diff --git a/rust/.lock b/rust/.lock new file mode 100644 index 0000000000..e69de29bb2 diff --git a/rust/crates.js b/rust/crates.js new file mode 100644 index 0000000000..3f49ff1260 --- /dev/null +++ b/rust/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["fuzz_mkvs_node","fuzz_mkvs_proof","fuzz_sgx_pcs_quote","oasis_contract_sdk","oasis_contract_sdk_storage","oasis_contract_sdk_types","oasis_core_runtime","oasis_runtime_sdk","oasis_runtime_sdk_contracts","oasis_runtime_sdk_macros","rofl_utils"]; \ No newline at end of file diff --git a/rust/fuzz_mkvs_node/all.html b/rust/fuzz_mkvs_node/all.html new file mode 100644 index 0000000000..4dd541ea44 --- /dev/null +++ b/rust/fuzz_mkvs_node/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/rust/fuzz_mkvs_node/fn.main.html b/rust/fuzz_mkvs_node/fn.main.html new file mode 100644 index 0000000000..4a744d41c2 --- /dev/null +++ b/rust/fuzz_mkvs_node/fn.main.html @@ -0,0 +1 @@ +main in fuzz_mkvs_node - Rust

Function fuzz_mkvs_node::main

source ·
pub(crate) fn main()
\ No newline at end of file diff --git a/rust/fuzz_mkvs_node/index.html b/rust/fuzz_mkvs_node/index.html new file mode 100644 index 0000000000..83daff164b --- /dev/null +++ b/rust/fuzz_mkvs_node/index.html @@ -0,0 +1 @@ +fuzz_mkvs_node - Rust

Crate fuzz_mkvs_node

source ·

Functions§

\ No newline at end of file diff --git a/rust/fuzz_mkvs_node/sidebar-items.js b/rust/fuzz_mkvs_node/sidebar-items.js new file mode 100644 index 0000000000..9b556a055c --- /dev/null +++ b/rust/fuzz_mkvs_node/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/rust/fuzz_mkvs_proof/all.html b/rust/fuzz_mkvs_proof/all.html new file mode 100644 index 0000000000..d29af80bf6 --- /dev/null +++ b/rust/fuzz_mkvs_proof/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/rust/fuzz_mkvs_proof/fn.main.html b/rust/fuzz_mkvs_proof/fn.main.html new file mode 100644 index 0000000000..177d114c83 --- /dev/null +++ b/rust/fuzz_mkvs_proof/fn.main.html @@ -0,0 +1 @@ +main in fuzz_mkvs_proof - Rust

Function fuzz_mkvs_proof::main

source ·
pub(crate) fn main()
\ No newline at end of file diff --git a/rust/fuzz_mkvs_proof/index.html b/rust/fuzz_mkvs_proof/index.html new file mode 100644 index 0000000000..7a3ed77ae7 --- /dev/null +++ b/rust/fuzz_mkvs_proof/index.html @@ -0,0 +1 @@ +fuzz_mkvs_proof - Rust

Crate fuzz_mkvs_proof

source ·

Functions§

\ No newline at end of file diff --git a/rust/fuzz_mkvs_proof/sidebar-items.js b/rust/fuzz_mkvs_proof/sidebar-items.js new file mode 100644 index 0000000000..9b556a055c --- /dev/null +++ b/rust/fuzz_mkvs_proof/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/rust/fuzz_sgx_pcs_quote/all.html b/rust/fuzz_sgx_pcs_quote/all.html new file mode 100644 index 0000000000..483573dafc --- /dev/null +++ b/rust/fuzz_sgx_pcs_quote/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/rust/fuzz_sgx_pcs_quote/fn.main.html b/rust/fuzz_sgx_pcs_quote/fn.main.html new file mode 100644 index 0000000000..3e790f0e4f --- /dev/null +++ b/rust/fuzz_sgx_pcs_quote/fn.main.html @@ -0,0 +1 @@ +main in fuzz_sgx_pcs_quote - Rust

Function fuzz_sgx_pcs_quote::main

source ·
pub(crate) fn main()
\ No newline at end of file diff --git a/rust/fuzz_sgx_pcs_quote/index.html b/rust/fuzz_sgx_pcs_quote/index.html new file mode 100644 index 0000000000..e63fd7082d --- /dev/null +++ b/rust/fuzz_sgx_pcs_quote/index.html @@ -0,0 +1 @@ +fuzz_sgx_pcs_quote - Rust

Crate fuzz_sgx_pcs_quote

source ·

Functions§

\ No newline at end of file diff --git a/rust/fuzz_sgx_pcs_quote/sidebar-items.js b/rust/fuzz_sgx_pcs_quote/sidebar-items.js new file mode 100644 index 0000000000..9b556a055c --- /dev/null +++ b/rust/fuzz_sgx_pcs_quote/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["main"]}; \ No newline at end of file diff --git a/rust/help.html b/rust/help.html new file mode 100644 index 0000000000..7cbe2591cf --- /dev/null +++ b/rust/help.html @@ -0,0 +1 @@ +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/all.html b/rust/oasis_contract_sdk/all.html new file mode 100644 index 0000000000..45b2c57515 --- /dev/null +++ b/rust/oasis_contract_sdk/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Derive Macros

Functions

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/context/index.html b/rust/oasis_contract_sdk/context/index.html new file mode 100644 index 0000000000..95c31940b2 --- /dev/null +++ b/rust/oasis_contract_sdk/context/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk::context - Rust

Module oasis_contract_sdk::context

source ·
Expand description

Contract execution context.

+

Traits§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/context/sidebar-items.js b/rust/oasis_contract_sdk/context/sidebar-items.js new file mode 100644 index 0000000000..be5e9b6434 --- /dev/null +++ b/rust/oasis_contract_sdk/context/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["Context"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/context/trait.Context.html b/rust/oasis_contract_sdk/context/trait.Context.html new file mode 100644 index 0000000000..38cb4f5271 --- /dev/null +++ b/rust/oasis_contract_sdk/context/trait.Context.html @@ -0,0 +1,33 @@ +Context in oasis_contract_sdk::context - Rust

Trait oasis_contract_sdk::context::Context

source ·
pub trait Context {
+    type PublicStore: PublicStore;
+    type ConfidentialStore: ConfidentialStore;
+    type Env: Env + Crypto;
+
+    // Required methods
+    fn instance_id(&self) -> InstanceId;
+    fn instance_address(&self) -> &Address;
+    fn caller_address(&self) -> &Address;
+    fn deposited_tokens(&self) -> &[BaseUnits];
+    fn is_read_only(&self) -> bool;
+    fn call_format(&self) -> CallFormat;
+    fn emit_message(&mut self, msg: Message);
+    fn emit_event<E: Event>(&mut self, event: E);
+    fn public_store(&mut self) -> &mut Self::PublicStore;
+    fn confidential_store(&mut self) -> &mut Self::ConfidentialStore;
+    fn env(&self) -> &Self::Env;
+}
Expand description

Execution context.

+

Required Associated Types§

source

type PublicStore: PublicStore

The public store.

+
source

type ConfidentialStore: ConfidentialStore

The confidential store.

+
source

type Env: Env + Crypto

The environment.

+

Required Methods§

source

fn instance_id(&self) -> InstanceId

Contract instance identifier.

+
source

fn instance_address(&self) -> &Address

Contract instance address.

+
source

fn caller_address(&self) -> &Address

Caller address.

+
source

fn deposited_tokens(&self) -> &[BaseUnits]

Tokens deposited by the caller.

+
source

fn is_read_only(&self) -> bool

Whether the call is read-only and must not make any storage modifications.

+
source

fn call_format(&self) -> CallFormat

Call format.

+
source

fn emit_message(&mut self, msg: Message)

Emits a message.

+
source

fn emit_event<E: Event>(&mut self, event: E)

Emits an event.

+
source

fn public_store(&mut self) -> &mut Self::PublicStore

Public contract store.

+
source

fn confidential_store(&mut self) -> &mut Self::ConfidentialStore

Confidential contract store.

+
source

fn env(&self) -> &Self::Env

Environment.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/contract/index.html b/rust/oasis_contract_sdk/contract/index.html new file mode 100644 index 0000000000..f5ef3b1f2c --- /dev/null +++ b/rust/oasis_contract_sdk/contract/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk::contract - Rust

Module oasis_contract_sdk::contract

source ·
Expand description

The contract trait.

+

Traits§

  • Trait that needs to be implemented by contract implementations.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/contract/sidebar-items.js b/rust/oasis_contract_sdk/contract/sidebar-items.js new file mode 100644 index 0000000000..6db4a84913 --- /dev/null +++ b/rust/oasis_contract_sdk/contract/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["Contract"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/contract/trait.Contract.html b/rust/oasis_contract_sdk/contract/trait.Contract.html new file mode 100644 index 0000000000..580c9d9d07 --- /dev/null +++ b/rust/oasis_contract_sdk/contract/trait.Contract.html @@ -0,0 +1,63 @@ +Contract in oasis_contract_sdk::contract - Rust

Trait oasis_contract_sdk::contract::Contract

source ·
pub trait Contract {
+    type Request: Decode;
+    type Response: Encode;
+    type Error: Error;
+
+    // Required methods
+    fn call<C: Context>(
+        ctx: &mut C,
+        request: Self::Request,
+    ) -> Result<Self::Response, Self::Error>;
+    fn query<C: Context>(
+        _ctx: &mut C,
+        _request: Self::Request,
+    ) -> Result<Self::Response, Self::Error>;
+
+    // Provided methods
+    fn instantiate<C: Context>(
+        _ctx: &mut C,
+        _request: Self::Request,
+    ) -> Result<(), Self::Error> { ... }
+    fn handle_reply<C: Context>(
+        _ctx: &mut C,
+        _reply: Reply,
+    ) -> Result<Option<Self::Response>, Self::Error> { ... }
+    fn pre_upgrade<C: Context>(
+        _ctx: &mut C,
+        _request: Self::Request,
+    ) -> Result<(), Self::Error> { ... }
+    fn post_upgrade<C: Context>(
+        _ctx: &mut C,
+        _request: Self::Request,
+    ) -> Result<(), Self::Error> { ... }
+}
Expand description

Trait that needs to be implemented by contract implementations.

+

Required Associated Types§

source

type Request: Decode

Type of all requests.

+
source

type Response: Encode

Type of all responses.

+
source

type Error: Error

Type of all errors.

+

Required Methods§

source

fn call<C: Context>( + ctx: &mut C, + request: Self::Request, +) -> Result<Self::Response, Self::Error>

Call the contract.

+
source

fn query<C: Context>( + _ctx: &mut C, + _request: Self::Request, +) -> Result<Self::Response, Self::Error>

Query the contract.

+

Provided Methods§

source

fn instantiate<C: Context>( + _ctx: &mut C, + _request: Self::Request, +) -> Result<(), Self::Error>

Instantiate the contract.

+
source

fn handle_reply<C: Context>( + _ctx: &mut C, + _reply: Reply, +) -> Result<Option<Self::Response>, Self::Error>

Handle replies from sent messages.

+
source

fn pre_upgrade<C: Context>( + _ctx: &mut C, + _request: Self::Request, +) -> Result<(), Self::Error>

Perform any pre-upgrade tasks. This method is called on the old contract code.

+

If this method reports an error the upgrade will be aborted.

+
source

fn post_upgrade<C: Context>( + _ctx: &mut C, + _request: Self::Request, +) -> Result<(), Self::Error>

Perform any post-upgrade tasks. This method is called on the new contract code.

+

If this method reports an error the upgrade will be aborted.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/derive.Error.html b/rust/oasis_contract_sdk/derive.Error.html new file mode 100644 index 0000000000..274de86fdb --- /dev/null +++ b/rust/oasis_contract_sdk/derive.Error.html @@ -0,0 +1,9 @@ +Error in oasis_contract_sdk - Rust

Derive Macro oasis_contract_sdk::Error

#[derive(Error)]
+{
+    // Attributes available to this derive:
+    #[sdk_error]
+    #[source]
+    #[from]
+}
+
Expand description

Derives the Error trait on an enum.

+
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/derive.Event.html b/rust/oasis_contract_sdk/derive.Event.html new file mode 100644 index 0000000000..e49885418c --- /dev/null +++ b/rust/oasis_contract_sdk/derive.Event.html @@ -0,0 +1,7 @@ +Event in oasis_contract_sdk - Rust

Derive Macro oasis_contract_sdk::Event

#[derive(Event)]
+{
+    // Attributes available to this derive:
+    #[sdk_event]
+}
+
Expand description

Derives the Event trait on an enum.

+
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/env/enum.CryptoError.html b/rust/oasis_contract_sdk/env/enum.CryptoError.html new file mode 100644 index 0000000000..01a326606d --- /dev/null +++ b/rust/oasis_contract_sdk/env/enum.CryptoError.html @@ -0,0 +1,24 @@ +CryptoError in oasis_contract_sdk::env - Rust

Enum oasis_contract_sdk::env::CryptoError

source ·
pub enum CryptoError {
+    DecryptionFailed,
+}
Expand description

Errors that can be returned from crypto functions.

+

Variants§

§

DecryptionFailed

Trait Implementations§

source§

impl Debug for CryptoError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CryptoError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for CryptoError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/env/index.html b/rust/oasis_contract_sdk/env/index.html new file mode 100644 index 0000000000..1cd433a7e8 --- /dev/null +++ b/rust/oasis_contract_sdk/env/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk::env - Rust

Module oasis_contract_sdk::env

source ·
Expand description

Smart contract environment query interface.

+

Enums§

  • Errors that can be returned from crypto functions.

Traits§

  • Crypto helpers trait.
  • Environment query trait.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/env/sidebar-items.js b/rust/oasis_contract_sdk/env/sidebar-items.js new file mode 100644 index 0000000000..4ffe2df144 --- /dev/null +++ b/rust/oasis_contract_sdk/env/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CryptoError"],"trait":["Crypto","Env"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/env/trait.Crypto.html b/rust/oasis_contract_sdk/env/trait.Crypto.html new file mode 100644 index 0000000000..c6a2b072f0 --- /dev/null +++ b/rust/oasis_contract_sdk/env/trait.Crypto.html @@ -0,0 +1,86 @@ +Crypto in oasis_contract_sdk::env - Rust

Trait oasis_contract_sdk::env::Crypto

source ·
pub trait Crypto {
+    // Required methods
+    fn ecdsa_recover(&self, input: &[u8]) -> [u8; 65];
+    fn signature_verify_ed25519(
+        &self,
+        key: &[u8],
+        message: &[u8],
+        signature: &[u8],
+    ) -> bool;
+    fn signature_verify_secp256k1(
+        &self,
+        key: &[u8],
+        message: &[u8],
+        signature: &[u8],
+    ) -> bool;
+    fn signature_verify_sr25519(
+        &self,
+        key: &[u8],
+        context: &[u8],
+        message: &[u8],
+        signature: &[u8],
+    ) -> bool;
+    fn x25519_derive_symmetric(
+        &self,
+        public_key: &[u8],
+        private_key: &[u8],
+    ) -> [u8; 32];
+    fn deoxysii_seal(
+        &self,
+        key: &[u8],
+        nonce: &[u8],
+        message: &[u8],
+        additional_data: &[u8],
+    ) -> Result<Vec<u8>, CryptoError>;
+    fn deoxysii_open(
+        &self,
+        key: &[u8],
+        nonce: &[u8],
+        message: &[u8],
+        additional_data: &[u8],
+    ) -> Result<Vec<u8>, CryptoError>;
+    fn random_bytes(&self, pers: &[u8], dst: &mut [u8]) -> usize;
+}
Expand description

Crypto helpers trait.

+

Required Methods§

source

fn ecdsa_recover(&self, input: &[u8]) -> [u8; 65]

ECDSA public key recovery function.

+
source

fn signature_verify_ed25519( + &self, + key: &[u8], + message: &[u8], + signature: &[u8], +) -> bool

Verify an ed25519 message signature.

+
source

fn signature_verify_secp256k1( + &self, + key: &[u8], + message: &[u8], + signature: &[u8], +) -> bool

Verify a secp256k1 message signature.

+
source

fn signature_verify_sr25519( + &self, + key: &[u8], + context: &[u8], + message: &[u8], + signature: &[u8], +) -> bool

Verify an sr25519 message signature.

+
source

fn x25519_derive_symmetric( + &self, + public_key: &[u8], + private_key: &[u8], +) -> [u8; 32]

Derive a symmetric key from a public/private key pair.

+
source

fn deoxysii_seal( + &self, + key: &[u8], + nonce: &[u8], + message: &[u8], + additional_data: &[u8], +) -> Result<Vec<u8>, CryptoError>

Encrypt and authenticate a message and authenticate additional data using DeoxysII.

+
source

fn deoxysii_open( + &self, + key: &[u8], + nonce: &[u8], + message: &[u8], + additional_data: &[u8], +) -> Result<Vec<u8>, CryptoError>

Decrypt and authenticate a message and authenticate additional data using DeoxysII.

+
source

fn random_bytes(&self, pers: &[u8], dst: &mut [u8]) -> usize

Fills dst with cryptographically secure random bytes. +Returns the number of bytes written. +If the optional personalization string (pers) is provided, it will be mixed into the RNG to provide additional domain separation.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/env/trait.Env.html b/rust/oasis_contract_sdk/env/trait.Env.html new file mode 100644 index 0000000000..ce34e9a207 --- /dev/null +++ b/rust/oasis_contract_sdk/env/trait.Env.html @@ -0,0 +1,10 @@ +Env in oasis_contract_sdk::env - Rust

Trait oasis_contract_sdk::env::Env

source ·
pub trait Env {
+    // Required methods
+    fn query<Q: Into<QueryRequest>>(&self, query: Q) -> QueryResponse;
+    fn address_for_instance(&self, instance_id: InstanceId) -> Address;
+    fn debug_print(&self, msg: &str);
+}
Expand description

Environment query trait.

+

Required Methods§

source

fn query<Q: Into<QueryRequest>>(&self, query: Q) -> QueryResponse

Perform an environment query.

+
source

fn address_for_instance(&self, instance_id: InstanceId) -> Address

Returns an address for the contract instance id.

+
source

fn debug_print(&self, msg: &str)

Prints a message to the console. Useful when debugging.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/error/index.html b/rust/oasis_contract_sdk/error/index.html new file mode 100644 index 0000000000..22a9343ac9 --- /dev/null +++ b/rust/oasis_contract_sdk/error/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk::error - Rust

Module oasis_contract_sdk::error

source ·
Expand description

Contract error trait.

+

Traits§

  • A contract error that gets propagated to the caller.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/error/sidebar-items.js b/rust/oasis_contract_sdk/error/sidebar-items.js new file mode 100644 index 0000000000..cd5ebcd90c --- /dev/null +++ b/rust/oasis_contract_sdk/error/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["Error"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/error/trait.Error.html b/rust/oasis_contract_sdk/error/trait.Error.html new file mode 100644 index 0000000000..254ba1d586 --- /dev/null +++ b/rust/oasis_contract_sdk/error/trait.Error.html @@ -0,0 +1,26 @@ +Error in oasis_contract_sdk::error - Rust

Trait oasis_contract_sdk::error::Error

source ·
pub trait Error: Error {
+    // Required methods
+    fn module_name(&self) -> &str;
+    fn code(&self) -> u32;
+
+    // Provided method
+    fn to_execution_result(&self) -> ExecutionResult { ... }
+}
Expand description

A contract error that gets propagated to the caller.

+

It extends std::error::Error with module name and error code so that errors can be easily +serialized and transferred between different processes.

+

This trait can be derived:

+ +
#[derive(Clone, Debug, Error, thiserror::Error)]
+#[sdk_error(autonumber)]
+enum Error {
+   #[error("invalid argument")]
+   InvalidArgument,          // autonumbered to 0
+
+   #[error("forbidden")]
+   #[sdk_error(code = 401)]  // manually numbered to 403 (`code` or autonumbering is required)
+   Forbidden,
+}
+

Required Methods§

source

fn module_name(&self) -> &str

Name of the module that emitted the error.

+
source

fn code(&self) -> u32

Error code uniquely identifying the error.

+

Provided Methods§

source

fn to_execution_result(&self) -> ExecutionResult

Converts the error into an execution result.

+

Implementations on Foreign Types§

source§

impl Error for Infallible

source§

fn module_name(&self) -> &str

source§

fn code(&self) -> u32

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/event/index.html b/rust/oasis_contract_sdk/event/index.html new file mode 100644 index 0000000000..dfaf15d8da --- /dev/null +++ b/rust/oasis_contract_sdk/event/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk::event - Rust

Module oasis_contract_sdk::event

source ·
Expand description

Contract event trait.

+

Traits§

  • An event emitted by the contract.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/event/sidebar-items.js b/rust/oasis_contract_sdk/event/sidebar-items.js new file mode 100644 index 0000000000..4fdb09315a --- /dev/null +++ b/rust/oasis_contract_sdk/event/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["Event"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/event/trait.Event.html b/rust/oasis_contract_sdk/event/trait.Event.html new file mode 100644 index 0000000000..b6d6e7f547 --- /dev/null +++ b/rust/oasis_contract_sdk/event/trait.Event.html @@ -0,0 +1,25 @@ +Event in oasis_contract_sdk::event - Rust

Trait oasis_contract_sdk::event::Event

source ·
pub trait Event: Sized + Encode {
+    // Required methods
+    fn module_name(&self) -> &str;
+    fn code(&self) -> u32;
+
+    // Provided method
+    fn into_raw(self) -> Event { ... }
+}
Expand description

An event emitted by the contract.

+

This trait can be derived:

+ +
#[derive(Clone, Debug, cbor::Encode, Event)]
+#[cbor(untagged)]
+#[sdk_event(autonumber)]
+enum MyEvent {
+   Greeting(String),      // autonumbered to 0
+   #[sdk_event(code = 2)] // manually numbered to 2 (`code` is required if not autonumbering)
+   DontPanic,
+   Salutation {           // autonumbered to 1
+       plural: bool,
+   }
+}
+

Required Methods§

source

fn module_name(&self) -> &str

Name of the module that emitted the event.

+
source

fn code(&self) -> u32

Code uniquely identifying the event.

+

Provided Methods§

source

fn into_raw(self) -> Event

Converts an event into the raw event type that can be emitted from the contract.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Event for Event

source§

fn module_name(&self) -> &str

source§

fn code(&self) -> u32

source§

fn into_raw(self) -> Event

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/index.html b/rust/oasis_contract_sdk/index.html new file mode 100644 index 0000000000..81300ca36d --- /dev/null +++ b/rust/oasis_contract_sdk/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk - Rust

Crate oasis_contract_sdk

source ·
Expand description

Oasis Contract SDK.

+

Re-exports§

Modules§

  • Contract execution context.
  • The contract trait.
  • Smart contract environment query interface.
  • Contract error trait.
  • Contract event trait.
  • Memory management.
  • Smart contract storage interface.
  • Utilities for testing smart contracts.

Macros§

Derive Macros§

  • Derives the Error trait on an enum.
  • Derives the Event trait on an enum.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/macro.create_contract!.html b/rust/oasis_contract_sdk/macro.create_contract!.html new file mode 100644 index 0000000000..c0817dde4f --- /dev/null +++ b/rust/oasis_contract_sdk/macro.create_contract!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.create_contract.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_contract_sdk/macro.create_contract.html b/rust/oasis_contract_sdk/macro.create_contract.html new file mode 100644 index 0000000000..900206a445 --- /dev/null +++ b/rust/oasis_contract_sdk/macro.create_contract.html @@ -0,0 +1 @@ +create_contract in oasis_contract_sdk - Rust

Macro oasis_contract_sdk::create_contract

create_contract!() { /* proc-macro */ }
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/memory/fn.allocate_host.html b/rust/oasis_contract_sdk/memory/fn.allocate_host.html new file mode 100644 index 0000000000..f747428e16 --- /dev/null +++ b/rust/oasis_contract_sdk/memory/fn.allocate_host.html @@ -0,0 +1,2 @@ +allocate_host in oasis_contract_sdk::memory - Rust

Function oasis_contract_sdk::memory::allocate_host

source ·
pub fn allocate_host(length: u32) -> u32
Expand description

Allocate memory on host’s behalf.

+
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/memory/fn.deallocate_host.html b/rust/oasis_contract_sdk/memory/fn.deallocate_host.html new file mode 100644 index 0000000000..dcbcefff5b --- /dev/null +++ b/rust/oasis_contract_sdk/memory/fn.deallocate_host.html @@ -0,0 +1,2 @@ +deallocate_host in oasis_contract_sdk::memory - Rust

Function oasis_contract_sdk::memory::deallocate_host

source ·
pub fn deallocate_host(offset: u32, length: u32)
Expand description

Deallocate memory on host’s behalf.

+
\ No newline at end of file diff --git a/rust/oasis_contract_sdk/memory/index.html b/rust/oasis_contract_sdk/memory/index.html new file mode 100644 index 0000000000..6fa71b538a --- /dev/null +++ b/rust/oasis_contract_sdk/memory/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk::memory - Rust

Module oasis_contract_sdk::memory

source ·
Expand description

Memory management.

+

Structs§

Functions§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/memory/sidebar-items.js b/rust/oasis_contract_sdk/memory/sidebar-items.js new file mode 100644 index 0000000000..d8425deb06 --- /dev/null +++ b/rust/oasis_contract_sdk/memory/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["allocate_host","deallocate_host"],"struct":["HostRegion","HostRegionRef"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/memory/struct.HostRegion.html b/rust/oasis_contract_sdk/memory/struct.HostRegion.html new file mode 100644 index 0000000000..71b3c43638 --- /dev/null +++ b/rust/oasis_contract_sdk/memory/struct.HostRegion.html @@ -0,0 +1,37 @@ +HostRegion in oasis_contract_sdk::memory - Rust

Struct oasis_contract_sdk::memory::HostRegion

source ·
#[repr(C)]
pub struct HostRegion { + pub offset: u32, + pub length: u32, +}
Expand description

A region of memory managed on behalf of the host.

+

The host is responsible for deallocating the region by calling deallocate.

+

Fields§

§offset: u32§length: u32

Implementations§

source§

impl HostRegion

source

pub fn from_arg((offset, length): (u32, u32)) -> Self

Creates a new host region from arguments.

+

This does not yet transfer memory ownership from the host.

+
source

pub fn from_args(offset: u32, length: u32) -> Self

Creates a new host region from arguments.

+

This does not yet transfer memory ownership from the host.

+
source

pub fn from_vec(data: Vec<u8>) -> Self

Transfers ownership of memory to the host by constructing a host region.

+
source

pub fn into_vec(self) -> Vec<u8>

Transfers ownership of memory from the host and returns the vector.

+
§Safety
+

This is safe as long as the region was constructed from valid arguments.

+
source

pub unsafe fn deref(arg: *const HostRegion) -> Self

Returns a new region by dereferencing a pointer to the region.

+

This does not yet transfer memory ownership from the host.

+
§Safety
+

This is safe as long as the pointer is a valid pointer to the region struct.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/memory/struct.HostRegionRef.html b/rust/oasis_contract_sdk/memory/struct.HostRegionRef.html new file mode 100644 index 0000000000..730c2368cc --- /dev/null +++ b/rust/oasis_contract_sdk/memory/struct.HostRegionRef.html @@ -0,0 +1,26 @@ +HostRegionRef in oasis_contract_sdk::memory - Rust

Struct oasis_contract_sdk::memory::HostRegionRef

source ·
pub struct HostRegionRef<'a> {
+    pub offset: u32,
+    pub length: u32,
+    /* private fields */
+}
Expand description

Reference to a host region.

+

Fields§

§offset: u32§length: u32

Implementations§

source§

impl<'a> HostRegionRef<'a>

source

pub fn from_slice(data: &'a [u8]) -> Self

Creates a new host region from the given byte slice.

+

Auto Trait Implementations§

§

impl<'a> Freeze for HostRegionRef<'a>

§

impl<'a> RefUnwindSafe for HostRegionRef<'a>

§

impl<'a> Send for HostRegionRef<'a>

§

impl<'a> Sync for HostRegionRef<'a>

§

impl<'a> Unpin for HostRegionRef<'a>

§

impl<'a> UnwindSafe for HostRegionRef<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/sidebar-items.js b/rust/oasis_contract_sdk/sidebar-items.js new file mode 100644 index 0000000000..d04fe3e616 --- /dev/null +++ b/rust/oasis_contract_sdk/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"derive":["Error","Event"],"macro":["create_contract"],"mod":["context","contract","env","error","event","memory","storage","testing"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/storage/index.html b/rust/oasis_contract_sdk/storage/index.html new file mode 100644 index 0000000000..663602cb4e --- /dev/null +++ b/rust/oasis_contract_sdk/storage/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk::storage - Rust

Module oasis_contract_sdk::storage

source ·
Expand description

Smart contract storage interface.

+

Traits§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/storage/sidebar-items.js b/rust/oasis_contract_sdk/storage/sidebar-items.js new file mode 100644 index 0000000000..9c8cd28095 --- /dev/null +++ b/rust/oasis_contract_sdk/storage/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["ConfidentialStore","PublicStore","Store"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/storage/trait.ConfidentialStore.html b/rust/oasis_contract_sdk/storage/trait.ConfidentialStore.html new file mode 100644 index 0000000000..3de343c732 --- /dev/null +++ b/rust/oasis_contract_sdk/storage/trait.ConfidentialStore.html @@ -0,0 +1,2 @@ +ConfidentialStore in oasis_contract_sdk::storage - Rust

Trait oasis_contract_sdk::storage::ConfidentialStore

source ·
pub trait ConfidentialStore: Store { }
Expand description

Marker trait for stores backed by confidential storage.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/storage/trait.PublicStore.html b/rust/oasis_contract_sdk/storage/trait.PublicStore.html new file mode 100644 index 0000000000..9f07ee1b69 --- /dev/null +++ b/rust/oasis_contract_sdk/storage/trait.PublicStore.html @@ -0,0 +1,2 @@ +PublicStore in oasis_contract_sdk::storage - Rust

Trait oasis_contract_sdk::storage::PublicStore

source ·
pub trait PublicStore: Store { }
Expand description

Marker trait for stores backed by public storage.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/storage/trait.Store.html b/rust/oasis_contract_sdk/storage/trait.Store.html new file mode 100644 index 0000000000..7c98ba8933 --- /dev/null +++ b/rust/oasis_contract_sdk/storage/trait.Store.html @@ -0,0 +1,10 @@ +Store in oasis_contract_sdk::storage - Rust

Trait oasis_contract_sdk::storage::Store

source ·
pub trait Store {
+    // Required methods
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;
+    fn insert(&mut self, key: &[u8], value: &[u8]);
+    fn remove(&mut self, key: &[u8]);
+}
Expand description

Key/value store trait.

+

Required Methods§

source

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch a given key from contract storage.

+
source

fn insert(&mut self, key: &[u8], value: &[u8])

Insert a given key/value pair into contract storage.

+
source

fn remove(&mut self, key: &[u8])

Remove a given key from contract storage.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/testing/index.html b/rust/oasis_contract_sdk/testing/index.html new file mode 100644 index 0000000000..b86cb140e4 --- /dev/null +++ b/rust/oasis_contract_sdk/testing/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk::testing - Rust

Module oasis_contract_sdk::testing

source ·
Expand description

Utilities for testing smart contracts.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/testing/sidebar-items.js b/rust/oasis_contract_sdk/testing/sidebar-items.js new file mode 100644 index 0000000000..0ea92f23af --- /dev/null +++ b/rust/oasis_contract_sdk/testing/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["MockContext","MockEnv","MockStore"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk/testing/struct.MockContext.html b/rust/oasis_contract_sdk/testing/struct.MockContext.html new file mode 100644 index 0000000000..793c1330c7 --- /dev/null +++ b/rust/oasis_contract_sdk/testing/struct.MockContext.html @@ -0,0 +1,34 @@ +MockContext in oasis_contract_sdk::testing - Rust

Struct oasis_contract_sdk::testing::MockContext

source ·
pub struct MockContext {
+    pub ec: ExecutionContext,
+    pub public_store: MockStore,
+    pub confidential_store: MockStore,
+    pub env: MockEnv,
+    pub messages: Vec<Message>,
+    pub events: Vec<Event>,
+}
Expand description

A mock contract context suitable for testing.

+

Fields§

§ec: ExecutionContext

Execution context.

+
§public_store: MockStore

Public store.

+
§confidential_store: MockStore

“Confidential” store.

+
§env: MockEnv

Environment.

+
§messages: Vec<Message>

Emitted messages.

+
§events: Vec<Event>

Emitted events.

+

Trait Implementations§

source§

impl Context for MockContext

§

type PublicStore = MockStore

The public store.
§

type ConfidentialStore = MockStore

The confidential store.
§

type Env = MockEnv

The environment.
source§

fn instance_id(&self) -> InstanceId

Contract instance identifier.
source§

fn instance_address(&self) -> &Address

Contract instance address.
source§

fn caller_address(&self) -> &Address

Caller address.
source§

fn deposited_tokens(&self) -> &[BaseUnits]

Tokens deposited by the caller.
source§

fn is_read_only(&self) -> bool

Whether the call is read-only and must not make any storage modifications.
source§

fn call_format(&self) -> CallFormat

Call format.
source§

fn emit_message(&mut self, msg: Message)

Emits a message.
source§

fn emit_event<E: Event>(&mut self, event: E)

Emits an event.
source§

fn public_store(&mut self) -> &mut Self::PublicStore

Public contract store.
source§

fn confidential_store(&mut self) -> &mut Self::ConfidentialStore

Confidential contract store.
source§

fn env(&self) -> &Self::Env

Environment.
source§

impl From<ExecutionContext> for MockContext

source§

fn from(ec: ExecutionContext) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/testing/struct.MockEnv.html b/rust/oasis_contract_sdk/testing/struct.MockEnv.html new file mode 100644 index 0000000000..f5b1b7bc32 --- /dev/null +++ b/rust/oasis_contract_sdk/testing/struct.MockEnv.html @@ -0,0 +1,58 @@ +MockEnv in oasis_contract_sdk::testing - Rust

Struct oasis_contract_sdk::testing::MockEnv

source ·
pub struct MockEnv { /* private fields */ }
Expand description

Mock environment.

+

Implementations§

source§

impl MockEnv

source

pub fn new() -> Self

Create a new mock environment.

+

Trait Implementations§

source§

impl Clone for MockEnv

source§

fn clone(&self) -> MockEnv

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Crypto for MockEnv

source§

fn ecdsa_recover(&self, input: &[u8]) -> [u8; 65]

ECDSA public key recovery function.
source§

fn signature_verify_ed25519( + &self, + key: &[u8], + message: &[u8], + signature: &[u8], +) -> bool

Verify an ed25519 message signature.
source§

fn signature_verify_secp256k1( + &self, + key: &[u8], + message: &[u8], + signature: &[u8], +) -> bool

Verify a secp256k1 message signature.
source§

fn signature_verify_sr25519( + &self, + key: &[u8], + context: &[u8], + message: &[u8], + signature: &[u8], +) -> bool

Verify an sr25519 message signature.
source§

fn x25519_derive_symmetric( + &self, + public_key: &[u8], + private_key: &[u8], +) -> [u8; 32]

Derive a symmetric key from a public/private key pair.
source§

fn deoxysii_seal( + &self, + key: &[u8], + nonce: &[u8], + message: &[u8], + additional_data: &[u8], +) -> Result<Vec<u8>, CryptoError>

Encrypt and authenticate a message and authenticate additional data using DeoxysII.
source§

fn deoxysii_open( + &self, + key: &[u8], + nonce: &[u8], + message: &[u8], + additional_data: &[u8], +) -> Result<Vec<u8>, CryptoError>

Decrypt and authenticate a message and authenticate additional data using DeoxysII.
source§

fn random_bytes(&self, _pers: &[u8], dst: &mut [u8]) -> usize

Fills dst with cryptographically secure random bytes. +Returns the number of bytes written. +If the optional personalization string (pers) is provided, it will be mixed into the RNG to provide additional domain separation.
source§

impl Default for MockEnv

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Env for MockEnv

source§

fn query<Q: Into<QueryRequest>>(&self, query: Q) -> QueryResponse

Perform an environment query.
source§

fn address_for_instance(&self, instance_id: InstanceId) -> Address

Returns an address for the contract instance id.
source§

fn debug_print(&self, msg: &str)

Prints a message to the console. Useful when debugging.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk/testing/struct.MockStore.html b/rust/oasis_contract_sdk/testing/struct.MockStore.html new file mode 100644 index 0000000000..6b98bc58a7 --- /dev/null +++ b/rust/oasis_contract_sdk/testing/struct.MockStore.html @@ -0,0 +1,24 @@ +MockStore in oasis_contract_sdk::testing - Rust

Struct oasis_contract_sdk::testing::MockStore

source ·
pub struct MockStore { /* private fields */ }
Expand description

Mock store.

+

Implementations§

source§

impl MockStore

source

pub fn new() -> Self

Create a new empty mock store.

+

Trait Implementations§

source§

impl Clone for MockStore

source§

fn clone(&self) -> MockStore

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for MockStore

source§

fn default() -> MockStore

Returns the “default value” for a type. Read more
source§

impl Store for MockStore

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch a given key from contract storage.
source§

fn insert(&mut self, key: &[u8], value: &[u8])

Insert a given key/value pair into contract storage.
source§

fn remove(&mut self, key: &[u8])

Remove a given key from contract storage.
source§

impl ConfidentialStore for MockStore

source§

impl PublicStore for MockStore

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/all.html b/rust/oasis_contract_sdk_storage/all.html new file mode 100644 index 0000000000..51bcb1285b --- /dev/null +++ b/rust/oasis_contract_sdk_storage/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Traits

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/cell/index.html b/rust/oasis_contract_sdk_storage/cell/index.html new file mode 100644 index 0000000000..79949ff42f --- /dev/null +++ b/rust/oasis_contract_sdk_storage/cell/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_storage::cell - Rust

Module oasis_contract_sdk_storage::cell

source ·
Expand description

Low-level storage primitive that holds one value.

+

Structs§

  • A storage cell identifies a storage key of a specific type.
  • A storage cell identifies a storage key of a specific type.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/cell/sidebar-items.js b/rust/oasis_contract_sdk_storage/cell/sidebar-items.js new file mode 100644 index 0000000000..c264cadceb --- /dev/null +++ b/rust/oasis_contract_sdk_storage/cell/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ConfidentialCell","PublicCell"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/cell/struct.ConfidentialCell.html b/rust/oasis_contract_sdk_storage/cell/struct.ConfidentialCell.html new file mode 100644 index 0000000000..c3adc5b96d --- /dev/null +++ b/rust/oasis_contract_sdk_storage/cell/struct.ConfidentialCell.html @@ -0,0 +1,34 @@ +ConfidentialCell in oasis_contract_sdk_storage::cell - Rust
pub struct ConfidentialCell<'key, T> { /* private fields */ }
Expand description

A storage cell identifies a storage key of a specific type.

+

Implementations§

source§

impl<'key, T> ConfidentialCell<'key, T>

source

pub const fn new(key: &'key [u8]) -> Self

Create a new storage cell with the specified key and type.

+
source

pub fn clear(&self, store: &mut dyn ConfidentialStore)

Clear the value in the storage cell.

+
source§

impl<'key, T> ConfidentialCell<'key, T>
where + T: Decode,

source

pub fn get(&self, store: &dyn ConfidentialStore) -> Option<T>

Return the current value of the storage cell.

+
§Panics
+

The method will panic in case the raw cell value cannot be deserialized.

+
source§

impl<'key, T> ConfidentialCell<'key, T>
where + T: Encode,

source

pub fn set(&self, store: &mut dyn ConfidentialStore, value: T)

Set the value of the storage cell.

+

Auto Trait Implementations§

§

impl<'key, T> Freeze for ConfidentialCell<'key, T>

§

impl<'key, T> RefUnwindSafe for ConfidentialCell<'key, T>
where + T: RefUnwindSafe,

§

impl<'key, T> Send for ConfidentialCell<'key, T>
where + T: Send,

§

impl<'key, T> Sync for ConfidentialCell<'key, T>
where + T: Sync,

§

impl<'key, T> Unpin for ConfidentialCell<'key, T>
where + T: Unpin,

§

impl<'key, T> UnwindSafe for ConfidentialCell<'key, T>
where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/cell/struct.PublicCell.html b/rust/oasis_contract_sdk_storage/cell/struct.PublicCell.html new file mode 100644 index 0000000000..b13dabf691 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/cell/struct.PublicCell.html @@ -0,0 +1,34 @@ +PublicCell in oasis_contract_sdk_storage::cell - Rust

Struct oasis_contract_sdk_storage::cell::PublicCell

source ·
pub struct PublicCell<'key, T> { /* private fields */ }
Expand description

A storage cell identifies a storage key of a specific type.

+

Implementations§

source§

impl<'key, T> PublicCell<'key, T>

source

pub const fn new(key: &'key [u8]) -> Self

Create a new storage cell with the specified key and type.

+
source

pub fn clear(&self, store: &mut dyn PublicStore)

Clear the value in the storage cell.

+
source§

impl<'key, T> PublicCell<'key, T>
where + T: Decode,

source

pub fn get(&self, store: &dyn PublicStore) -> Option<T>

Return the current value of the storage cell.

+
§Panics
+

The method will panic in case the raw cell value cannot be deserialized.

+
source§

impl<'key, T> PublicCell<'key, T>
where + T: Encode,

source

pub fn set(&self, store: &mut dyn PublicStore, value: T)

Set the value of the storage cell.

+

Auto Trait Implementations§

§

impl<'key, T> Freeze for PublicCell<'key, T>

§

impl<'key, T> RefUnwindSafe for PublicCell<'key, T>
where + T: RefUnwindSafe,

§

impl<'key, T> Send for PublicCell<'key, T>
where + T: Send,

§

impl<'key, T> Sync for PublicCell<'key, T>
where + T: Sync,

§

impl<'key, T> Unpin for PublicCell<'key, T>
where + T: Unpin,

§

impl<'key, T> UnwindSafe for PublicCell<'key, T>
where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/index.html b/rust/oasis_contract_sdk_storage/index.html new file mode 100644 index 0000000000..2e6d187e86 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_storage - Rust

Crate oasis_contract_sdk_storage

source ·
Expand description

High-level storage helpers for the Oasis Contract SDK.

+

Modules§

  • Low-level storage primitive that holds one value.
  • A map backed by contract storage.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/map/index.html b/rust/oasis_contract_sdk_storage/map/index.html new file mode 100644 index 0000000000..2bb2a5f9b9 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/map/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_storage::map - Rust

Module oasis_contract_sdk_storage::map

source ·
Expand description

A map backed by contract storage.

+

Structs§

Traits§

  • A trait representing an integer that can be encoded into big-endian bytes.
  • A trait for types which can be used as map keys.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/map/sidebar-items.js b/rust/oasis_contract_sdk_storage/map/sidebar-items.js new file mode 100644 index 0000000000..d649135ebb --- /dev/null +++ b/rust/oasis_contract_sdk_storage/map/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ConfidentialMap","Int","PublicMap"],"trait":["Integer","MapKey"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/map/struct.ConfidentialMap.html b/rust/oasis_contract_sdk_storage/map/struct.ConfidentialMap.html new file mode 100644 index 0000000000..4127b6cae7 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/map/struct.ConfidentialMap.html @@ -0,0 +1,37 @@ +ConfidentialMap in oasis_contract_sdk_storage::map - Rust

Struct oasis_contract_sdk_storage::map::ConfidentialMap

source ·
pub struct ConfidentialMap<'key, K, V> { /* private fields */ }
Expand description

A map backed by contract storage.

+

Implementations§

source§

impl<'key, K, V> ConfidentialMap<'key, K, V>

source

pub const fn new(key: &'key [u8]) -> Self

Create a new map instance.

+
source§

impl<'key, K, V> ConfidentialMap<'key, K, V>
where + K: MapKey, + V: Encode + Decode,

source

pub fn get(&self, store: &dyn ConfidentialStore, key: K) -> Option<V>

Lookup a given key.

+
source

pub fn insert(&self, store: &mut dyn ConfidentialStore, key: K, value: V)

Insert a given key/value pair.

+
source

pub fn remove(&self, store: &mut dyn ConfidentialStore, key: K)

Remove a given key.

+

Auto Trait Implementations§

§

impl<'key, K, V> Freeze for ConfidentialMap<'key, K, V>

§

impl<'key, K, V> RefUnwindSafe for ConfidentialMap<'key, K, V>
where + K: RefUnwindSafe, + V: RefUnwindSafe,

§

impl<'key, K, V> Send for ConfidentialMap<'key, K, V>
where + K: Send, + V: Send,

§

impl<'key, K, V> Sync for ConfidentialMap<'key, K, V>
where + K: Sync, + V: Sync,

§

impl<'key, K, V> Unpin for ConfidentialMap<'key, K, V>
where + K: Unpin, + V: Unpin,

§

impl<'key, K, V> UnwindSafe for ConfidentialMap<'key, K, V>
where + K: UnwindSafe, + V: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/map/struct.Int.html b/rust/oasis_contract_sdk_storage/map/struct.Int.html new file mode 100644 index 0000000000..dcf6dfff16 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/map/struct.Int.html @@ -0,0 +1,33 @@ +Int in oasis_contract_sdk_storage::map - Rust

Struct oasis_contract_sdk_storage::map::Int

source ·
pub struct Int<I: Integer> { /* private fields */ }
Expand description

An integer in big-endian representation.

+

Implementations§

source§

impl<I: Integer> Int<I>

source

pub fn new(v: I) -> Self

Create a new integer in big-endian representation.

+

Trait Implementations§

source§

impl<I: Integer> From<I> for Int<I>

source§

fn from(v: I) -> Self

Converts to this type from the input type.
source§

impl<I: Integer> MapKey for Int<I>

source§

fn key(&self) -> Vec<&[u8]>

Return the composite key.

Auto Trait Implementations§

§

impl<I> Freeze for Int<I>
where + <I as Integer>::Encoded: Freeze,

§

impl<I> RefUnwindSafe for Int<I>
where + <I as Integer>::Encoded: RefUnwindSafe, + I: RefUnwindSafe,

§

impl<I> Send for Int<I>
where + <I as Integer>::Encoded: Send, + I: Send,

§

impl<I> Sync for Int<I>
where + <I as Integer>::Encoded: Sync, + I: Sync,

§

impl<I> Unpin for Int<I>
where + <I as Integer>::Encoded: Unpin, + I: Unpin,

§

impl<I> UnwindSafe for Int<I>
where + <I as Integer>::Encoded: UnwindSafe, + I: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/map/struct.PublicMap.html b/rust/oasis_contract_sdk_storage/map/struct.PublicMap.html new file mode 100644 index 0000000000..8569865029 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/map/struct.PublicMap.html @@ -0,0 +1,37 @@ +PublicMap in oasis_contract_sdk_storage::map - Rust

Struct oasis_contract_sdk_storage::map::PublicMap

source ·
pub struct PublicMap<'key, K, V> { /* private fields */ }
Expand description

A map backed by contract storage.

+

Implementations§

source§

impl<'key, K, V> PublicMap<'key, K, V>

source

pub const fn new(key: &'key [u8]) -> Self

Create a new map instance.

+
source§

impl<'key, K, V> PublicMap<'key, K, V>
where + K: MapKey, + V: Encode + Decode,

source

pub fn get(&self, store: &dyn PublicStore, key: K) -> Option<V>

Lookup a given key.

+
source

pub fn insert(&self, store: &mut dyn PublicStore, key: K, value: V)

Insert a given key/value pair.

+
source

pub fn remove(&self, store: &mut dyn PublicStore, key: K)

Remove a given key.

+

Auto Trait Implementations§

§

impl<'key, K, V> Freeze for PublicMap<'key, K, V>

§

impl<'key, K, V> RefUnwindSafe for PublicMap<'key, K, V>
where + K: RefUnwindSafe, + V: RefUnwindSafe,

§

impl<'key, K, V> Send for PublicMap<'key, K, V>
where + K: Send, + V: Send,

§

impl<'key, K, V> Sync for PublicMap<'key, K, V>
where + K: Sync, + V: Sync,

§

impl<'key, K, V> Unpin for PublicMap<'key, K, V>
where + K: Unpin, + V: Unpin,

§

impl<'key, K, V> UnwindSafe for PublicMap<'key, K, V>
where + K: UnwindSafe, + V: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/map/trait.Integer.html b/rust/oasis_contract_sdk_storage/map/trait.Integer.html new file mode 100644 index 0000000000..d9e11faf99 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/map/trait.Integer.html @@ -0,0 +1,9 @@ +Integer in oasis_contract_sdk_storage::map - Rust

Trait oasis_contract_sdk_storage::map::Integer

source ·
pub trait Integer {
+    type Encoded: AsRef<[u8]>;
+
+    // Required method
+    fn to_be_bytes(self) -> Self::Encoded;
+}
Expand description

A trait representing an integer that can be encoded into big-endian bytes.

+

Required Associated Types§

source

type Encoded: AsRef<[u8]>

Type of the encoded representation.

+

Required Methods§

source

fn to_be_bytes(self) -> Self::Encoded

Return the memory representation of this integer as a byte array in big-endian byte order.

+

Implementations on Foreign Types§

source§

impl Integer for i8

§

type Encoded = [u8; 1]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for i16

§

type Encoded = [u8; 2]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for i32

§

type Encoded = [u8; 4]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for i64

§

type Encoded = [u8; 8]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for i128

§

type Encoded = [u8; 16]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for u8

§

type Encoded = [u8; 1]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for u16

§

type Encoded = [u8; 2]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for u32

§

type Encoded = [u8; 4]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for u64

§

type Encoded = [u8; 8]

source§

fn to_be_bytes(self) -> Self::Encoded

source§

impl Integer for u128

§

type Encoded = [u8; 16]

source§

fn to_be_bytes(self) -> Self::Encoded

Implementors§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/map/trait.MapKey.html b/rust/oasis_contract_sdk_storage/map/trait.MapKey.html new file mode 100644 index 0000000000..3b838133a3 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/map/trait.MapKey.html @@ -0,0 +1,11 @@ +MapKey in oasis_contract_sdk_storage::map - Rust

Trait oasis_contract_sdk_storage::map::MapKey

source ·
pub trait MapKey {
+    // Required method
+    fn key(&self) -> Vec<&[u8]>;
+}
Expand description

A trait for types which can be used as map keys.

+

Required Methods§

source

fn key(&self) -> Vec<&[u8]>

Return the composite key.

+

Implementations on Foreign Types§

source§

impl MapKey for &str

source§

fn key(&self) -> Vec<&[u8]>

source§

impl MapKey for &[u8]

source§

fn key(&self) -> Vec<&[u8]>

source§

impl MapKey for Address

source§

fn key(&self) -> Vec<&[u8]>

source§

impl MapKey for String

source§

fn key(&self) -> Vec<&[u8]>

source§

impl MapKey for Vec<u8>

source§

fn key(&self) -> Vec<&[u8]>

source§

impl<T, U> MapKey for (T, U)
where + T: MapKey, + U: MapKey,

source§

fn key(&self) -> Vec<&[u8]>

source§

impl<T, U, V> MapKey for (T, U, V)
where + T: MapKey, + U: MapKey, + V: MapKey,

source§

fn key(&self) -> Vec<&[u8]>

source§

impl<const N: usize> MapKey for [u8; N]

source§

fn key(&self) -> Vec<&[u8]>

Implementors§

source§

impl<I: Integer> MapKey for Int<I>

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_storage/sidebar-items.js b/rust/oasis_contract_sdk_storage/sidebar-items.js new file mode 100644 index 0000000000..06eeb24da3 --- /dev/null +++ b/rust/oasis_contract_sdk_storage/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["cell","map"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/address/enum.Error.html b/rust/oasis_contract_sdk_types/address/enum.Error.html new file mode 100644 index 0000000000..8453b7dd65 --- /dev/null +++ b/rust/oasis_contract_sdk_types/address/enum.Error.html @@ -0,0 +1,24 @@ +Error in oasis_contract_sdk_types::address - Rust

Enum oasis_contract_sdk_types::address::Error

source ·
pub enum Error {
+    MalformedAddress,
+}
Expand description

Error.

+

Variants§

§

MalformedAddress

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/address/index.html b/rust/oasis_contract_sdk_types/address/index.html new file mode 100644 index 0000000000..4248725ff4 --- /dev/null +++ b/rust/oasis_contract_sdk_types/address/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::address - Rust

Module oasis_contract_sdk_types::address

source ·
Expand description

A minimal representation of an Oasis Runtime SDK address.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/address/sidebar-items.js b/rust/oasis_contract_sdk_types/address/sidebar-items.js new file mode 100644 index 0000000000..c161534133 --- /dev/null +++ b/rust/oasis_contract_sdk_types/address/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["Address"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/address/struct.Address.html b/rust/oasis_contract_sdk_types/address/struct.Address.html new file mode 100644 index 0000000000..f593e72032 --- /dev/null +++ b/rust/oasis_contract_sdk_types/address/struct.Address.html @@ -0,0 +1,46 @@ +Address in oasis_contract_sdk_types::address - Rust

Struct oasis_contract_sdk_types::address::Address

source ·
pub struct Address(/* private fields */);
Expand description

An account address.

+

Implementations§

source§

impl Address

source

pub const SIZE: usize = 21usize

Size of an address in bytes.

+
source

pub fn from_bytes(data: &[u8]) -> Result<Self, Error>

Tries to create a new address from raw bytes.

+
source

pub fn from_bech32(data: &str) -> Result<Self, Error>

Tries to create a new address from Bech32-encoded string.

+
source

pub fn to_bech32(self) -> String

Converts an address to Bech32 representation.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Address

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Address

source§

fn clone(&self) -> Address

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Address

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Address

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Address

source§

fn default() -> Address

Returns the “default value” for a type. Read more
source§

impl Encode for Address

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<Address> for Address

source§

fn from(a: Address) -> Self

Converts to this type from the input type.
source§

impl From<Address> for Address

source§

fn from(a: Address) -> Self

Converts to this type from the input type.
source§

impl Ord for Address

source§

fn cmp(&self, other: &Address) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Address

source§

fn eq(&self, other: &Address) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Address

source§

fn partial_cmp(&self, other: &Address) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl TryFrom<&[u8]> for Address

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for Address

source§

impl Eq for Address

source§

impl StructuralPartialEq for Address

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/all.html b/rust/oasis_contract_sdk_types/all.html new file mode 100644 index 0000000000..081073dc5a --- /dev/null +++ b/rust/oasis_contract_sdk_types/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Functions

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/crypto/enum.SignatureKind.html b/rust/oasis_contract_sdk_types/crypto/enum.SignatureKind.html new file mode 100644 index 0000000000..8332edbabf --- /dev/null +++ b/rust/oasis_contract_sdk_types/crypto/enum.SignatureKind.html @@ -0,0 +1,28 @@ +SignatureKind in oasis_contract_sdk_types::crypto - Rust
#[repr(u32)]
pub enum SignatureKind { + Ed25519 = 0, + Secp256k1 = 1, + Sr25519 = 2, +}
Expand description

Signature kind.

+

Variants§

§

Ed25519 = 0

§

Secp256k1 = 1

§

Sr25519 = 2

Trait Implementations§

source§

impl Clone for SignatureKind

source§

fn clone(&self) -> SignatureKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl TryFrom<u32> for SignatureKind

§

type Error = u32

The type returned in the event of a conversion error.
source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for SignatureKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/crypto/index.html b/rust/oasis_contract_sdk_types/crypto/index.html new file mode 100644 index 0000000000..54c8ee1885 --- /dev/null +++ b/rust/oasis_contract_sdk_types/crypto/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::crypto - Rust

Module oasis_contract_sdk_types::crypto

source ·
Expand description

Cryptography-related types.

+

Enums§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/crypto/sidebar-items.js b/rust/oasis_contract_sdk_types/crypto/sidebar-items.js new file mode 100644 index 0000000000..ba67ae8b26 --- /dev/null +++ b/rust/oasis_contract_sdk_types/crypto/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["SignatureKind"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/enum.CallFormat.html b/rust/oasis_contract_sdk_types/enum.CallFormat.html new file mode 100644 index 0000000000..ef0074ccfb --- /dev/null +++ b/rust/oasis_contract_sdk_types/enum.CallFormat.html @@ -0,0 +1,35 @@ +CallFormat in oasis_contract_sdk_types - Rust

Enum oasis_contract_sdk_types::CallFormat

source ·
#[repr(u8)]
pub enum CallFormat { + Plain = 0, + EncryptedX25519DeoxysII = 1, +}
Expand description

Format used for encoding the call (and output) information.

+

Variants§

§

Plain = 0

Plain text call data.

+
§

EncryptedX25519DeoxysII = 1

Encrypted call data using X25519 for key exchange and Deoxys-II for symmetric encryption.

+

Trait Implementations§

source§

impl Clone for CallFormat

source§

fn clone(&self) -> CallFormat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CallFormat

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CallFormat

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for CallFormat

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<CallFormat> for CallFormat

source§

fn from(a: CallFormat) -> Self

Converts to this type from the input type.
source§

impl PartialEq for CallFormat

source§

fn eq(&self, other: &CallFormat) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for CallFormat

source§

impl Eq for CallFormat

source§

impl StructuralPartialEq for CallFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/enum.ExecutionResult.html b/rust/oasis_contract_sdk_types/enum.ExecutionResult.html new file mode 100644 index 0000000000..9de75e9a8f --- /dev/null +++ b/rust/oasis_contract_sdk_types/enum.ExecutionResult.html @@ -0,0 +1,35 @@ +ExecutionResult in oasis_contract_sdk_types - Rust

Enum oasis_contract_sdk_types::ExecutionResult

source ·
pub enum ExecutionResult {
+    Ok(ExecutionOk),
+    Failed {
+        module: String,
+        code: u32,
+        message: String,
+    },
+}
Expand description

Contract execution result.

+

Variants§

§

Ok(ExecutionOk)

§

Failed

Fields

§module: String
§code: u32
§message: String

Trait Implementations§

source§

impl Clone for ExecutionResult

source§

fn clone(&self) -> ExecutionResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutionResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecutionResult

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for ExecutionResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExecutionResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/env/enum.AccountsQuery.html b/rust/oasis_contract_sdk_types/env/enum.AccountsQuery.html new file mode 100644 index 0000000000..7da30fea86 --- /dev/null +++ b/rust/oasis_contract_sdk_types/env/enum.AccountsQuery.html @@ -0,0 +1,34 @@ +AccountsQuery in oasis_contract_sdk_types::env - Rust

Enum oasis_contract_sdk_types::env::AccountsQuery

source ·
#[non_exhaustive]
pub enum AccountsQuery { + Balance { + address: Address, + denomination: Denomination, + }, +}
Expand description

Accounts API queries.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Balance

Query an account’s balance.

+

Fields

§address: Address
§denomination: Denomination

Trait Implementations§

source§

impl Clone for AccountsQuery

source§

fn clone(&self) -> AccountsQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AccountsQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AccountsQuery

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for AccountsQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AccountsQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<AccountsQuery> for QueryRequest

source§

fn from(q: AccountsQuery) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/env/enum.AccountsResponse.html b/rust/oasis_contract_sdk_types/env/enum.AccountsResponse.html new file mode 100644 index 0000000000..5a8aa21916 --- /dev/null +++ b/rust/oasis_contract_sdk_types/env/enum.AccountsResponse.html @@ -0,0 +1,33 @@ +AccountsResponse in oasis_contract_sdk_types::env - Rust
#[non_exhaustive]
pub enum AccountsResponse { + Balance { + balance: u128, + }, +}
Expand description

Accounts API responses.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Balance

An account’s balance of the given denomination.

+

Fields

§balance: u128

Trait Implementations§

source§

impl Clone for AccountsResponse

source§

fn clone(&self) -> AccountsResponse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AccountsResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AccountsResponse

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for AccountsResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AccountsResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<AccountsResponse> for QueryResponse

source§

fn from(q: AccountsResponse) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/env/enum.QueryRequest.html b/rust/oasis_contract_sdk_types/env/enum.QueryRequest.html new file mode 100644 index 0000000000..031187b1ae --- /dev/null +++ b/rust/oasis_contract_sdk_types/env/enum.QueryRequest.html @@ -0,0 +1,31 @@ +QueryRequest in oasis_contract_sdk_types::env - Rust

Enum oasis_contract_sdk_types::env::QueryRequest

source ·
#[non_exhaustive]
pub enum QueryRequest { + BlockInfo, + Accounts(AccountsQuery), +}
Expand description

A query request.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BlockInfo

Information about the current runtime block.

+
§

Accounts(AccountsQuery)

Accounts queries.

+

Trait Implementations§

source§

impl Clone for QueryRequest

source§

fn clone(&self) -> QueryRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QueryRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for QueryRequest

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for QueryRequest

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<AccountsQuery> for QueryRequest

source§

fn from(q: AccountsQuery) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/env/enum.QueryResponse.html b/rust/oasis_contract_sdk_types/env/enum.QueryResponse.html new file mode 100644 index 0000000000..cf16e35006 --- /dev/null +++ b/rust/oasis_contract_sdk_types/env/enum.QueryResponse.html @@ -0,0 +1,43 @@ +QueryResponse in oasis_contract_sdk_types::env - Rust

Enum oasis_contract_sdk_types::env::QueryResponse

source ·
#[non_exhaustive]
pub enum QueryResponse { + Error { + module: String, + code: u32, + message: String, + }, + BlockInfo { + round: u64, + epoch: u64, + timestamp: u64, + }, + Accounts(AccountsResponse), +}
Expand description

A query response.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Error

Indication of a failing request.

+

Fields

§module: String
§code: u32
§message: String
§

BlockInfo

Information about the current runtime block.

+

Fields

§round: u64
§epoch: u64
§timestamp: u64
§

Accounts(AccountsResponse)

Accounts queries.

+

Trait Implementations§

source§

impl Clone for QueryResponse

source§

fn clone(&self) -> QueryResponse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QueryResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for QueryResponse

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for QueryResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for QueryResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<AccountsResponse> for QueryResponse

source§

fn from(q: AccountsResponse) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/env/index.html b/rust/oasis_contract_sdk_types/env/index.html new file mode 100644 index 0000000000..22791cd636 --- /dev/null +++ b/rust/oasis_contract_sdk_types/env/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::env - Rust

Module oasis_contract_sdk_types::env

source ·
Expand description

Environment query-related types.

+

Enums§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/env/sidebar-items.js b/rust/oasis_contract_sdk_types/env/sidebar-items.js new file mode 100644 index 0000000000..f35c3c8a9c --- /dev/null +++ b/rust/oasis_contract_sdk_types/env/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AccountsQuery","AccountsResponse","QueryRequest","QueryResponse"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/event/index.html b/rust/oasis_contract_sdk_types/event/index.html new file mode 100644 index 0000000000..a8c08ced18 --- /dev/null +++ b/rust/oasis_contract_sdk_types/event/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::event - Rust

Module oasis_contract_sdk_types::event

source ·
Expand description

Events.

+

Structs§

  • An event emitted from the contract.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/event/sidebar-items.js b/rust/oasis_contract_sdk_types/event/sidebar-items.js new file mode 100644 index 0000000000..275ab9b7f4 --- /dev/null +++ b/rust/oasis_contract_sdk_types/event/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Event"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/event/struct.Event.html b/rust/oasis_contract_sdk_types/event/struct.Event.html new file mode 100644 index 0000000000..94cf145bc3 --- /dev/null +++ b/rust/oasis_contract_sdk_types/event/struct.Event.html @@ -0,0 +1,35 @@ +Event in oasis_contract_sdk_types::event - Rust

Struct oasis_contract_sdk_types::event::Event

source ·
pub struct Event {
+    pub module: String,
+    pub code: u32,
+    pub data: Vec<u8>,
+}
Expand description

An event emitted from the contract.

+

Fields§

§module: String

Optional module name.

+
§code: u32

Unique code representing the event for the given module.

+
§data: Vec<u8>

Arbitrary data associated with the event.

+

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Event

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Event

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/index.html b/rust/oasis_contract_sdk_types/index.html new file mode 100644 index 0000000000..0c21a1c25c --- /dev/null +++ b/rust/oasis_contract_sdk_types/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types - Rust

Crate oasis_contract_sdk_types

source ·
Expand description

A collection of common types used by the Oasis Contract SDK.

+

Modules§

  • A minimal representation of an Oasis Runtime SDK address.
  • Cryptography-related types.
  • Environment query-related types.
  • Events.
  • Messages that can be emitted by contracts.
  • A collection of types for easier calling into existing SDK modules.
  • Storage-related types.
  • Testing helpers.
  • Token types.

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/message/enum.CallResult.html b/rust/oasis_contract_sdk_types/message/enum.CallResult.html new file mode 100644 index 0000000000..90b46e6415 --- /dev/null +++ b/rust/oasis_contract_sdk_types/message/enum.CallResult.html @@ -0,0 +1,35 @@ +CallResult in oasis_contract_sdk_types::message - Rust

Enum oasis_contract_sdk_types::message::CallResult

source ·
pub enum CallResult {
+    Ok(Value),
+    Failed {
+        module: String,
+        code: u32,
+    },
+}
Expand description

Call result.

+

Variants§

§

Ok(Value)

§

Failed

Fields

§module: String
§code: u32

Implementations§

source§

impl CallResult

source

pub fn is_success(&self) -> bool

Check whether the call result indicates a successful operation or not.

+

Trait Implementations§

source§

impl Clone for CallResult

source§

fn clone(&self) -> CallResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CallResult

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for CallResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CallResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<CallResult> for CallResult

source§

fn from(r: CallResult) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/message/enum.Message.html b/rust/oasis_contract_sdk_types/message/enum.Message.html new file mode 100644 index 0000000000..634b1f05dc --- /dev/null +++ b/rust/oasis_contract_sdk_types/message/enum.Message.html @@ -0,0 +1,41 @@ +Message in oasis_contract_sdk_types::message - Rust

Enum oasis_contract_sdk_types::message::Message

source ·
#[non_exhaustive]
pub enum Message { + Call { + id: u64, + reply: NotifyReply, + method: String, + body: Value, + max_gas: Option<u64>, + data: Option<Value>, + }, +}
Expand description

Messages can be emitted by contracts and are processed after the contract execution completes.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Call

Calls an arbitrary runtime method handler in a child context with an optional gas limit.

+

The call is executed in the context of the smart contract as the caller within the same +transaction.

+

This can be used to call other smart contracts.

+

Fields

§id: u64
§method: String
§body: Value
§max_gas: Option<u64>
§data: Option<Value>

Trait Implementations§

source§

impl Clone for Message

source§

fn clone(&self) -> Message

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Message

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Message

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Message

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Message

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/message/enum.NotifyReply.html b/rust/oasis_contract_sdk_types/message/enum.NotifyReply.html new file mode 100644 index 0000000000..f3dafb9a82 --- /dev/null +++ b/rust/oasis_contract_sdk_types/message/enum.NotifyReply.html @@ -0,0 +1,36 @@ +NotifyReply in oasis_contract_sdk_types::message - Rust

Enum oasis_contract_sdk_types::message::NotifyReply

source ·
#[repr(u8)]
pub enum NotifyReply { + Never = 0, + OnError = 1, + OnSuccess = 2, + Always = 3, +}
Expand description

Specifies when the caller (smart contract) wants to be notified of a reply.

+

Variants§

§

Never = 0

§

OnError = 1

§

OnSuccess = 2

§

Always = 3

Trait Implementations§

source§

impl Clone for NotifyReply

source§

fn clone(&self) -> NotifyReply

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NotifyReply

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for NotifyReply

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for NotifyReply

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for NotifyReply

source§

fn eq(&self, other: &NotifyReply) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for NotifyReply

source§

impl Eq for NotifyReply

source§

impl StructuralPartialEq for NotifyReply

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/message/enum.Reply.html b/rust/oasis_contract_sdk_types/message/enum.Reply.html new file mode 100644 index 0000000000..77a2b11fb2 --- /dev/null +++ b/rust/oasis_contract_sdk_types/message/enum.Reply.html @@ -0,0 +1,35 @@ +Reply in oasis_contract_sdk_types::message - Rust

Enum oasis_contract_sdk_types::message::Reply

source ·
#[non_exhaustive]
pub enum Reply { + Call { + id: u64, + result: CallResult, + data: Option<Value>, + }, +}
Expand description

Replies to delivered messages.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Call

Reply from a call message.

+

Fields

§id: u64
§result: CallResult
§data: Option<Value>

Trait Implementations§

source§

impl Clone for Reply

source§

fn clone(&self) -> Reply

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Reply

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Reply

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Reply

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Reply

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Reply

§

impl RefUnwindSafe for Reply

§

impl Send for Reply

§

impl Sync for Reply

§

impl Unpin for Reply

§

impl UnwindSafe for Reply

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/message/index.html b/rust/oasis_contract_sdk_types/message/index.html new file mode 100644 index 0000000000..51c9735bee --- /dev/null +++ b/rust/oasis_contract_sdk_types/message/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::message - Rust

Module oasis_contract_sdk_types::message

source ·
Expand description

Messages that can be emitted by contracts.

+

Enums§

  • Call result.
  • Messages can be emitted by contracts and are processed after the contract execution completes.
  • Specifies when the caller (smart contract) wants to be notified of a reply.
  • Replies to delivered messages.
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/message/sidebar-items.js b/rust/oasis_contract_sdk_types/message/sidebar-items.js new file mode 100644 index 0000000000..d99482dc49 --- /dev/null +++ b/rust/oasis_contract_sdk_types/message/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CallResult","Message","NotifyReply","Reply"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/modules/contracts/index.html b/rust/oasis_contract_sdk_types/modules/contracts/index.html new file mode 100644 index 0000000000..9155d8fe80 --- /dev/null +++ b/rust/oasis_contract_sdk_types/modules/contracts/index.html @@ -0,0 +1 @@ +oasis_contract_sdk_types::modules::contracts - Rust

Module oasis_contract_sdk_types::modules::contracts

source ·

Structs§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/modules/contracts/sidebar-items.js b/rust/oasis_contract_sdk_types/modules/contracts/sidebar-items.js new file mode 100644 index 0000000000..072d30952b --- /dev/null +++ b/rust/oasis_contract_sdk_types/modules/contracts/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["InstantiateResult"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/modules/contracts/struct.InstantiateResult.html b/rust/oasis_contract_sdk_types/modules/contracts/struct.InstantiateResult.html new file mode 100644 index 0000000000..4423dbbb7d --- /dev/null +++ b/rust/oasis_contract_sdk_types/modules/contracts/struct.InstantiateResult.html @@ -0,0 +1,30 @@ +InstantiateResult in oasis_contract_sdk_types::modules::contracts - Rust
pub struct InstantiateResult {
+    pub id: InstanceId,
+}
Expand description

Instantiate call result.

+

Fields§

§id: InstanceId

Assigned instance identifier.

+

Trait Implementations§

source§

impl Clone for InstantiateResult

source§

fn clone(&self) -> InstantiateResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstantiateResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for InstantiateResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for InstantiateResult

source§

fn default() -> InstantiateResult

Returns the “default value” for a type. Read more
source§

impl Encode for InstantiateResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for InstantiateResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/modules/index.html b/rust/oasis_contract_sdk_types/modules/index.html new file mode 100644 index 0000000000..204e636183 --- /dev/null +++ b/rust/oasis_contract_sdk_types/modules/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::modules - Rust

Module oasis_contract_sdk_types::modules

source ·
Expand description

A collection of types for easier calling into existing SDK modules.

+

Modules§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/modules/sidebar-items.js b/rust/oasis_contract_sdk_types/modules/sidebar-items.js new file mode 100644 index 0000000000..5af75a25bd --- /dev/null +++ b/rust/oasis_contract_sdk_types/modules/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["contracts"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/sidebar-items.js b/rust/oasis_contract_sdk_types/sidebar-items.js new file mode 100644 index 0000000000..c25b5514c3 --- /dev/null +++ b/rust/oasis_contract_sdk_types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CallFormat","ExecutionResult"],"mod":["address","crypto","env","event","message","modules","storage","testing","token"],"struct":["CodeId","ExecutionContext","ExecutionOk","InstanceId"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/storage/enum.StoreKind.html b/rust/oasis_contract_sdk_types/storage/enum.StoreKind.html new file mode 100644 index 0000000000..4147487041 --- /dev/null +++ b/rust/oasis_contract_sdk_types/storage/enum.StoreKind.html @@ -0,0 +1,28 @@ +StoreKind in oasis_contract_sdk_types::storage - Rust

Enum oasis_contract_sdk_types::storage::StoreKind

source ·
#[repr(u32)]
pub enum StoreKind { + Public = 0, + Confidential = 1, +}
Expand description

Kind of the store to use.

+

Variants§

§

Public = 0

§

Confidential = 1

Implementations§

source§

impl StoreKind

source

pub fn prefix(&self) -> &'static [u8]

Prefix that should be used for the underlying store.

+

Trait Implementations§

source§

impl Clone for StoreKind

source§

fn clone(&self) -> StoreKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl TryFrom<u32> for StoreKind

§

type Error = u32

The type returned in the event of a conversion error.
source§

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for StoreKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/storage/index.html b/rust/oasis_contract_sdk_types/storage/index.html new file mode 100644 index 0000000000..9a2831bfb5 --- /dev/null +++ b/rust/oasis_contract_sdk_types/storage/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::storage - Rust

Module oasis_contract_sdk_types::storage

source ·
Expand description

Storage-related types.

+

Enums§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/storage/sidebar-items.js b/rust/oasis_contract_sdk_types/storage/sidebar-items.js new file mode 100644 index 0000000000..baa3e3f6c2 --- /dev/null +++ b/rust/oasis_contract_sdk_types/storage/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["StoreKind"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/struct.CodeId.html b/rust/oasis_contract_sdk_types/struct.CodeId.html new file mode 100644 index 0000000000..927f842c55 --- /dev/null +++ b/rust/oasis_contract_sdk_types/struct.CodeId.html @@ -0,0 +1,33 @@ +CodeId in oasis_contract_sdk_types - Rust

Struct oasis_contract_sdk_types::CodeId

source ·
pub struct CodeId(/* private fields */);
Expand description

Unique stored code identifier.

+

Implementations§

source§

impl CodeId

source

pub fn as_u64(&self) -> u64

Convert identifier to u64.

+
source

pub fn increment(&self) -> Self

Return the next identifier in sequence.

+
source

pub fn to_storage_key(self) -> [u8; 8]

Convert identifier to storage key representation.

+

Trait Implementations§

source§

impl Clone for CodeId

source§

fn clone(&self) -> CodeId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CodeId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CodeId

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CodeId

source§

fn default() -> CodeId

Returns the “default value” for a type. Read more
source§

impl Encode for CodeId

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<u64> for CodeId

source§

fn from(v: u64) -> Self

Converts to this type from the input type.
source§

impl PartialEq for CodeId

source§

fn eq(&self, other: &CodeId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for CodeId

source§

impl Eq for CodeId

source§

impl StructuralPartialEq for CodeId

Auto Trait Implementations§

§

impl Freeze for CodeId

§

impl RefUnwindSafe for CodeId

§

impl Send for CodeId

§

impl Sync for CodeId

§

impl Unpin for CodeId

§

impl UnwindSafe for CodeId

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/struct.ExecutionContext.html b/rust/oasis_contract_sdk_types/struct.ExecutionContext.html new file mode 100644 index 0000000000..f5e0920dec --- /dev/null +++ b/rust/oasis_contract_sdk_types/struct.ExecutionContext.html @@ -0,0 +1,42 @@ +ExecutionContext in oasis_contract_sdk_types - Rust

Struct oasis_contract_sdk_types::ExecutionContext

source ·
pub struct ExecutionContext {
+    pub instance_id: InstanceId,
+    pub instance_address: Address,
+    pub caller_address: Address,
+    pub deposited_tokens: Vec<BaseUnits>,
+    pub read_only: bool,
+    pub call_format: CallFormat,
+}
Expand description

Execution context.

+

Contains information that is useful on most invocations as it is always +included without requiring any explicit queries.

+

Fields§

§instance_id: InstanceId

Contract instance identifier.

+
§instance_address: Address

Contract instance address.

+
§caller_address: Address

Caller address.

+
§deposited_tokens: Vec<BaseUnits>

Tokens deposited by the caller.

+
§read_only: bool

Read-only flag.

+

A read-only call cannot make any changes to runtime state. Any attempt at modifying state +will result in the call failing.

+
§call_format: CallFormat

Transaction’s call format.

+

Trait Implementations§

source§

impl Debug for ExecutionContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecutionContext

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecutionContext

source§

fn default() -> ExecutionContext

Returns the “default value” for a type. Read more
source§

impl Encode for ExecutionContext

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExecutionContext

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/struct.ExecutionOk.html b/rust/oasis_contract_sdk_types/struct.ExecutionOk.html new file mode 100644 index 0000000000..4019687bf8 --- /dev/null +++ b/rust/oasis_contract_sdk_types/struct.ExecutionOk.html @@ -0,0 +1,34 @@ +ExecutionOk in oasis_contract_sdk_types - Rust

Struct oasis_contract_sdk_types::ExecutionOk

source ·
pub struct ExecutionOk {
+    pub data: Vec<u8>,
+    pub messages: Vec<Message>,
+    pub events: Vec<Event>,
+}
Expand description

Result of a successful contract execution.

+

Fields§

§data: Vec<u8>

Raw data returned from the contract.

+
§messages: Vec<Message>

Messages emitted from the contract.

+
§events: Vec<Event>

Events emitted from the contract.

+

Trait Implementations§

source§

impl Clone for ExecutionOk

source§

fn clone(&self) -> ExecutionOk

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutionOk

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecutionOk

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecutionOk

source§

fn default() -> ExecutionOk

Returns the “default value” for a type. Read more
source§

impl Encode for ExecutionOk

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExecutionOk

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/struct.InstanceId.html b/rust/oasis_contract_sdk_types/struct.InstanceId.html new file mode 100644 index 0000000000..9caa0a90b8 --- /dev/null +++ b/rust/oasis_contract_sdk_types/struct.InstanceId.html @@ -0,0 +1,33 @@ +InstanceId in oasis_contract_sdk_types - Rust

Struct oasis_contract_sdk_types::InstanceId

source ·
pub struct InstanceId(/* private fields */);
Expand description

Unique deployed code instance identifier.

+

Implementations§

source§

impl InstanceId

source

pub fn as_u64(&self) -> u64

Convert identifier to u64.

+
source

pub fn increment(&self) -> Self

Return the next identifier in sequence.

+
source

pub fn to_storage_key(self) -> [u8; 8]

Convert identifier to storage key representation.

+

Trait Implementations§

source§

impl Clone for InstanceId

source§

fn clone(&self) -> InstanceId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for InstanceId

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for InstanceId

source§

fn default() -> InstanceId

Returns the “default value” for a type. Read more
source§

impl Encode for InstanceId

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<u64> for InstanceId

source§

fn from(v: u64) -> Self

Converts to this type from the input type.
source§

impl PartialEq for InstanceId

source§

fn eq(&self, other: &InstanceId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for InstanceId

source§

impl Eq for InstanceId

source§

impl StructuralPartialEq for InstanceId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/alice/fn.address.html b/rust/oasis_contract_sdk_types/testing/addresses/alice/fn.address.html new file mode 100644 index 0000000000..ea4768b827 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/alice/fn.address.html @@ -0,0 +1 @@ +address in oasis_contract_sdk_types::testing::addresses::alice - Rust

Function oasis_contract_sdk_types::testing::addresses::alice::address

source ·
pub fn address() -> Address
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/alice/index.html b/rust/oasis_contract_sdk_types/testing/addresses/alice/index.html new file mode 100644 index 0000000000..d106731762 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/alice/index.html @@ -0,0 +1 @@ +oasis_contract_sdk_types::testing::addresses::alice - Rust

Module oasis_contract_sdk_types::testing::addresses::alice

source ·

Functions§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/alice/sidebar-items.js b/rust/oasis_contract_sdk_types/testing/addresses/alice/sidebar-items.js new file mode 100644 index 0000000000..47e7468f20 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/alice/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/bob/fn.address.html b/rust/oasis_contract_sdk_types/testing/addresses/bob/fn.address.html new file mode 100644 index 0000000000..c477849de1 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/bob/fn.address.html @@ -0,0 +1 @@ +address in oasis_contract_sdk_types::testing::addresses::bob - Rust

Function oasis_contract_sdk_types::testing::addresses::bob::address

source ·
pub fn address() -> Address
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/bob/index.html b/rust/oasis_contract_sdk_types/testing/addresses/bob/index.html new file mode 100644 index 0000000000..0f22192037 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/bob/index.html @@ -0,0 +1 @@ +oasis_contract_sdk_types::testing::addresses::bob - Rust

Module oasis_contract_sdk_types::testing::addresses::bob

source ·

Functions§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/bob/sidebar-items.js b/rust/oasis_contract_sdk_types/testing/addresses/bob/sidebar-items.js new file mode 100644 index 0000000000..47e7468f20 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/bob/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/charlie/fn.address.html b/rust/oasis_contract_sdk_types/testing/addresses/charlie/fn.address.html new file mode 100644 index 0000000000..37259351bf --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/charlie/fn.address.html @@ -0,0 +1 @@ +address in oasis_contract_sdk_types::testing::addresses::charlie - Rust

Function oasis_contract_sdk_types::testing::addresses::charlie::address

source ·
pub fn address() -> Address
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/charlie/index.html b/rust/oasis_contract_sdk_types/testing/addresses/charlie/index.html new file mode 100644 index 0000000000..cbfdb912a1 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/charlie/index.html @@ -0,0 +1 @@ +oasis_contract_sdk_types::testing::addresses::charlie - Rust

Module oasis_contract_sdk_types::testing::addresses::charlie

source ·

Functions§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/charlie/sidebar-items.js b/rust/oasis_contract_sdk_types/testing/addresses/charlie/sidebar-items.js new file mode 100644 index 0000000000..47e7468f20 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/charlie/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/dave/fn.address.html b/rust/oasis_contract_sdk_types/testing/addresses/dave/fn.address.html new file mode 100644 index 0000000000..e2807109a7 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/dave/fn.address.html @@ -0,0 +1 @@ +address in oasis_contract_sdk_types::testing::addresses::dave - Rust

Function oasis_contract_sdk_types::testing::addresses::dave::address

source ·
pub fn address() -> Address
\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/dave/index.html b/rust/oasis_contract_sdk_types/testing/addresses/dave/index.html new file mode 100644 index 0000000000..f48b7ddf94 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/dave/index.html @@ -0,0 +1 @@ +oasis_contract_sdk_types::testing::addresses::dave - Rust

Module oasis_contract_sdk_types::testing::addresses::dave

source ·

Functions§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/dave/sidebar-items.js b/rust/oasis_contract_sdk_types/testing/addresses/dave/sidebar-items.js new file mode 100644 index 0000000000..47e7468f20 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/dave/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/index.html b/rust/oasis_contract_sdk_types/testing/addresses/index.html new file mode 100644 index 0000000000..ae63cb8cfc --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/index.html @@ -0,0 +1 @@ +oasis_contract_sdk_types::testing::addresses - Rust

Module oasis_contract_sdk_types::testing::addresses

source ·

Modules§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/addresses/sidebar-items.js b/rust/oasis_contract_sdk_types/testing/addresses/sidebar-items.js new file mode 100644 index 0000000000..3bba4f205c --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/addresses/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["alice","bob","charlie","dave"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/index.html b/rust/oasis_contract_sdk_types/testing/index.html new file mode 100644 index 0000000000..81d2a47e4b --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::testing - Rust

Module oasis_contract_sdk_types::testing

source ·
Expand description

Testing helpers.

+

Modules§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/testing/sidebar-items.js b/rust/oasis_contract_sdk_types/testing/sidebar-items.js new file mode 100644 index 0000000000..4cad679013 --- /dev/null +++ b/rust/oasis_contract_sdk_types/testing/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["addresses"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/token/enum.Error.html b/rust/oasis_contract_sdk_types/token/enum.Error.html new file mode 100644 index 0000000000..214c4e5056 --- /dev/null +++ b/rust/oasis_contract_sdk_types/token/enum.Error.html @@ -0,0 +1,25 @@ +Error in oasis_contract_sdk_types::token - Rust

Enum oasis_contract_sdk_types::token::Error

source ·
pub enum Error {
+    NameTooLong {
+        length: usize,
+    },
+}

Variants§

§

NameTooLong

Fields

§length: usize

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/token/index.html b/rust/oasis_contract_sdk_types/token/index.html new file mode 100644 index 0000000000..6098bb1521 --- /dev/null +++ b/rust/oasis_contract_sdk_types/token/index.html @@ -0,0 +1,2 @@ +oasis_contract_sdk_types::token - Rust

Module oasis_contract_sdk_types::token

source ·
Expand description

Token types.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/token/sidebar-items.js b/rust/oasis_contract_sdk_types/token/sidebar-items.js new file mode 100644 index 0000000000..f1022eb171 --- /dev/null +++ b/rust/oasis_contract_sdk_types/token/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["BaseUnits","Denomination"]}; \ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/token/struct.BaseUnits.html b/rust/oasis_contract_sdk_types/token/struct.BaseUnits.html new file mode 100644 index 0000000000..127344948f --- /dev/null +++ b/rust/oasis_contract_sdk_types/token/struct.BaseUnits.html @@ -0,0 +1,40 @@ +BaseUnits in oasis_contract_sdk_types::token - Rust

Struct oasis_contract_sdk_types::token::BaseUnits

source ·
pub struct BaseUnits(pub u128, pub Denomination);
Expand description

Token amount of given denomination in base units.

+

Tuple Fields§

§0: u128§1: Denomination

Implementations§

source§

impl BaseUnits

source

pub fn new(amount: u128, denomination: Denomination) -> Self

Creates a new token amount of the given denomination.

+
source

pub fn amount(&self) -> u128

Token amount in base units.

+
source

pub fn denomination(&self) -> &Denomination

Denomination of the token amount.

+

Trait Implementations§

source§

impl Clone for BaseUnits

source§

fn clone(&self) -> BaseUnits

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BaseUnits

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for BaseUnits

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for BaseUnits

source§

fn default() -> BaseUnits

Returns the “default value” for a type. Read more
source§

impl Display for BaseUnits

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for BaseUnits

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&BaseUnits> for BaseUnits

source§

fn from(a: &BaseUnits) -> Self

Converts to this type from the input type.
source§

impl From<BaseUnits> for BaseUnits

source§

fn from(a: BaseUnits) -> Self

Converts to this type from the input type.
source§

impl Ord for BaseUnits

source§

fn cmp(&self, other: &BaseUnits) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for BaseUnits

source§

fn eq(&self, other: &BaseUnits) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for BaseUnits

source§

fn partial_cmp(&self, other: &BaseUnits) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for BaseUnits

source§

impl StructuralPartialEq for BaseUnits

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_contract_sdk_types/token/struct.Denomination.html b/rust/oasis_contract_sdk_types/token/struct.Denomination.html new file mode 100644 index 0000000000..b35eba71e0 --- /dev/null +++ b/rust/oasis_contract_sdk_types/token/struct.Denomination.html @@ -0,0 +1,46 @@ +Denomination in oasis_contract_sdk_types::token - Rust

Struct oasis_contract_sdk_types::token::Denomination

source ·
pub struct Denomination(/* private fields */);
Expand description

Name/type of the token.

+

Implementations§

source§

impl Denomination

source

pub const MAX_LENGTH: usize = 32usize

Maximum length of a denomination.

+
source

pub const NATIVE: Denomination = _

Denomination in native token.

+
source

pub fn is_native(&self) -> bool

Whether the denomination represents the native token.

+
source

pub fn into_vec(self) -> Vec<u8>

Raw representation of a denomination.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Denomination

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Denomination

source§

fn clone(&self) -> Denomination

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Denomination

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Denomination

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Denomination

source§

fn default() -> Denomination

Returns the “default value” for a type. Read more
source§

impl Display for Denomination

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Denomination

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<Denomination> for Denomination

source§

fn from(d: Denomination) -> Self

Converts to this type from the input type.
source§

impl From<Denomination> for Denomination

source§

fn from(d: Denomination) -> Self

Converts to this type from the input type.
source§

impl FromStr for Denomination

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(v: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Ord for Denomination

source§

fn cmp(&self, other: &Denomination) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Denomination

source§

fn eq(&self, other: &Denomination) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Denomination

source§

fn partial_cmp(&self, other: &Denomination) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl TryFrom<&[u8]> for Denomination

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Denomination

source§

impl StructuralPartialEq for Denomination

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/all.html b/rust/oasis_core_runtime/all.html new file mode 100644 index 0000000000..dc753e5db9 --- /dev/null +++ b/rust/oasis_core_runtime/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

Constants

\ No newline at end of file diff --git a/rust/oasis_core_runtime/app/fn.new.html b/rust/oasis_core_runtime/app/fn.new.html new file mode 100644 index 0000000000..d6fe2054f7 --- /dev/null +++ b/rust/oasis_core_runtime/app/fn.new.html @@ -0,0 +1,2 @@ +new in oasis_core_runtime::app - Rust

Function oasis_core_runtime::app::new

source ·
pub fn new(app: Box<dyn App>) -> Box<dyn Initializer>
Expand description

Create a new runtime initializer for an application.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/app/index.html b/rust/oasis_core_runtime/app/index.html new file mode 100644 index 0000000000..074babd5ee --- /dev/null +++ b/rust/oasis_core_runtime/app/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::app - Rust

Module oasis_core_runtime::app

source ·
Expand description

Runtime apps.

+

Structs§

  • An application which doesn’t do anything.

Traits§

  • An Oasis runtime app.

Functions§

  • Create a new runtime initializer for an application.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/app/sidebar-items.js b/rust/oasis_core_runtime/app/sidebar-items.js new file mode 100644 index 0000000000..2e756274d6 --- /dev/null +++ b/rust/oasis_core_runtime/app/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["new"],"struct":["NoopApp"],"trait":["App"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/app/struct.NoopApp.html b/rust/oasis_core_runtime/app/struct.NoopApp.html new file mode 100644 index 0000000000..fb20e04eb6 --- /dev/null +++ b/rust/oasis_core_runtime/app/struct.NoopApp.html @@ -0,0 +1,46 @@ +NoopApp in oasis_core_runtime::app - Rust

Struct oasis_core_runtime::app::NoopApp

source ·
pub struct NoopApp;
Expand description

An application which doesn’t do anything.

+

Trait Implementations§

source§

impl App for NoopApp

source§

fn is_rofl(&self) -> bool

Whether this is a ROFL app.
source§

fn on_init(&mut self, host: Arc<dyn Host>) -> Result<()>

Called on application initialization.
source§

fn quote_policy<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<QuotePolicy>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Quote policy to use for verifying our own enclave identity.
source§

fn on_runtime_block<'life0, 'life1, 'async_trait>( + &'life0 self, + blk: &'life1 AnnotatedBlock, +) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Called on new runtime block being received.
source§

fn on_runtime_event<'life0, 'life1, 'life2, 'async_trait>( + &'life0 self, + blk: &'life1 AnnotatedBlock, + tags: &'life2 [Vec<u8>], +) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait, + 'life2: 'async_trait,

Called on new runtime event being detected.
source§

fn query<'life0, 'life1, 'async_trait>( + &'life0 self, + method: &'life1 str, + args: Vec<u8>, +) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Called for runtime queries.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/app/trait.App.html b/rust/oasis_core_runtime/app/trait.App.html new file mode 100644 index 0000000000..f775d59dec --- /dev/null +++ b/rust/oasis_core_runtime/app/trait.App.html @@ -0,0 +1,66 @@ +App in oasis_core_runtime::app - Rust

Trait oasis_core_runtime::app::App

source ·
pub trait App: Send + Sync {
+    // Provided methods
+    fn is_rofl(&self) -> bool { ... }
+    fn on_init(&mut self, host: Arc<dyn Host>) -> Result<()> { ... }
+    fn quote_policy<'life0, 'async_trait>(
+        &'life0 self,
+    ) -> Pin<Box<dyn Future<Output = Result<QuotePolicy>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait { ... }
+    fn on_runtime_block<'life0, 'life1, 'async_trait>(
+        &'life0 self,
+        blk: &'life1 AnnotatedBlock,
+    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait,
+             'life1: 'async_trait { ... }
+    fn on_runtime_event<'life0, 'life1, 'life2, 'async_trait>(
+        &'life0 self,
+        blk: &'life1 AnnotatedBlock,
+        tags: &'life2 [Vec<u8>],
+    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait,
+             'life1: 'async_trait,
+             'life2: 'async_trait { ... }
+    fn query<'life0, 'life1, 'async_trait>(
+        &'life0 self,
+        method: &'life1 str,
+        args: Vec<u8>,
+    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait,
+             'life1: 'async_trait { ... }
+}
Expand description

An Oasis runtime app.

+

Provided Methods§

source

fn is_rofl(&self) -> bool

Whether this is a ROFL app.

+
source

fn on_init(&mut self, host: Arc<dyn Host>) -> Result<()>

Called on application initialization.

+
source

fn quote_policy<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<QuotePolicy>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Quote policy to use for verifying our own enclave identity.

+
source

fn on_runtime_block<'life0, 'life1, 'async_trait>( + &'life0 self, + blk: &'life1 AnnotatedBlock, +) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Called on new runtime block being received.

+
source

fn on_runtime_event<'life0, 'life1, 'life2, 'async_trait>( + &'life0 self, + blk: &'life1 AnnotatedBlock, + tags: &'life2 [Vec<u8>], +) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait, + 'life2: 'async_trait,

Called on new runtime event being detected.

+
source

fn query<'life0, 'life1, 'async_trait>( + &'life0 self, + method: &'life1 str, + args: Vec<u8>, +) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Called for runtime queries.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/cache/index.html b/rust/oasis_core_runtime/cache/index.html new file mode 100644 index 0000000000..86c29be050 --- /dev/null +++ b/rust/oasis_core_runtime/cache/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::cache - Rust

Module oasis_core_runtime::cache

source ·
Expand description

In-memory cache of trees.

+

Structs§

  • Cached storage tree with an associated root.
  • A set of storage tree caches, one for each storage operation:
\ No newline at end of file diff --git a/rust/oasis_core_runtime/cache/sidebar-items.js b/rust/oasis_core_runtime/cache/sidebar-items.js new file mode 100644 index 0000000000..9bd11665df --- /dev/null +++ b/rust/oasis_core_runtime/cache/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Cache","CacheSet"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/cache/struct.Cache.html b/rust/oasis_core_runtime/cache/struct.Cache.html new file mode 100644 index 0000000000..f60aa33c87 --- /dev/null +++ b/rust/oasis_core_runtime/cache/struct.Cache.html @@ -0,0 +1,23 @@ +Cache in oasis_core_runtime::cache - Rust

Struct oasis_core_runtime::cache::Cache

source ·
pub struct Cache { /* private fields */ }
Expand description

Cached storage tree with an associated root.

+

Implementations§

source§

impl Cache

source

pub fn tree(&self) -> &Tree

Reference to the cached tree.

+
source

pub fn tree_mut(&mut self) -> &mut Tree

Mutable reference to the cached tree.

+
source

pub fn commit(&mut self, version: u64, hash: Hash)

Commits a specific version and root as being stored by the tree.

+

Auto Trait Implementations§

§

impl !Freeze for Cache

§

impl !RefUnwindSafe for Cache

§

impl Send for Cache

§

impl !Sync for Cache

§

impl Unpin for Cache

§

impl !UnwindSafe for Cache

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/cache/struct.CacheSet.html b/rust/oasis_core_runtime/cache/struct.CacheSet.html new file mode 100644 index 0000000000..635a109444 --- /dev/null +++ b/rust/oasis_core_runtime/cache/struct.CacheSet.html @@ -0,0 +1,36 @@ +CacheSet in oasis_core_runtime::cache - Rust

Struct oasis_core_runtime::cache::CacheSet

source ·
pub struct CacheSet { /* private fields */ }
Expand description

A set of storage tree caches, one for each storage operation:

+
    +
  • +

    Execution and checking of transactions each have their own cache guarded by a mutex +since the usual use case is that only one execution/check batch is running at any given time.

    +
  • +
  • +

    Queries have a thread-local cache as there can be multiple queries running at any given +time and having a global lock would kill concurrency.

    +
  • +
+

Implementations§

source§

impl CacheSet

source

pub fn new(protocol: Arc<Protocol>) -> Self

Create a new empty cache set.

+
source

pub fn execute(&self, root: Root) -> MutexGuard<'_, Cache>

Cache used for executing transactions.

+
source

pub fn check(&self, root: Root) -> MutexGuard<'_, Cache>

Cache used for checking transactions.

+
source

pub fn query(&self, root: Root) -> Rc<RefCell<Cache>>

Cache used for queries.

+

Trait Implementations§

source§

impl Clone for CacheSet

source§

fn clone(&self) -> CacheSet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/bytes/index.html b/rust/oasis_core_runtime/common/bytes/index.html new file mode 100644 index 0000000000..21f9d24bf3 --- /dev/null +++ b/rust/oasis_core_runtime/common/bytes/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::bytes - Rust

Module oasis_core_runtime::common::bytes

source ·
Expand description

Byte array type helpers.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/bytes/sidebar-items.js b/rust/oasis_core_runtime/common/bytes/sidebar-items.js new file mode 100644 index 0000000000..5244ce01cc --- /dev/null +++ b/rust/oasis_core_runtime/common/bytes/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/hash/index.html b/rust/oasis_core_runtime/common/crypto/hash/index.html new file mode 100644 index 0000000000..301d52f206 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/hash/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::crypto::hash - Rust

Module oasis_core_runtime::common::crypto::hash

source ·
Expand description

Hash type.

+

Structs§

  • A 32-byte SHA-512/256 hash.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/hash/sidebar-items.js b/rust/oasis_core_runtime/common/crypto/hash/sidebar-items.js new file mode 100644 index 0000000000..780b53725e --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/hash/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Hash"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/hash/struct.Hash.html b/rust/oasis_core_runtime/common/crypto/hash/struct.Hash.html new file mode 100644 index 0000000000..36cfc405d7 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/hash/struct.Hash.html @@ -0,0 +1,54 @@ +Hash in oasis_core_runtime::common::crypto::hash - Rust

Struct oasis_core_runtime::common::crypto::hash::Hash

source ·
pub struct Hash(pub [u8; 32]);
Expand description

A 32-byte SHA-512/256 hash.

+

Tuple Fields§

§0: [u8; 32]

Implementations§

source§

impl Hash

source

pub const fn len() -> usize

Size of this object in bytes.

+
source§

impl Hash

source

pub fn digest_bytes(data: &[u8]) -> Hash

Compute a digest of the passed slice of bytes.

+
source

pub fn digest_bytes_list(data: &[&[u8]]) -> Hash

Compute a digest of the passed slices of bytes.

+
source

pub fn is_empty(&self) -> bool

Returns true if the hash is of an empty string.

+
source

pub fn empty_hash() -> Hash

Hash of an empty string.

+
source

pub fn truncated(&self, n: usize) -> &[u8]

Hash truncated to the given number of bytes.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Hash

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Hash

source§

fn clone(&self) -> Hash

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Hash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Hash

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Hash

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for Hash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Hash

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&[u8]> for Hash

source§

fn from(b: &[u8]) -> Hash

Converts to this type from the input type.
source§

impl From<&'static str> for Hash

source§

fn from(s: &'static str) -> Hash

Converts to this type from the input type.
source§

impl From<Hash> for [u8; 32]

source§

fn from(b: Hash) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Hash

source§

fn from(v: Vec<u8>) -> Hash

Converts to this type from the input type.
source§

impl FromStr for Hash

§

type Err = FromHexError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Hash, FromHexError>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Hash

source§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl KeyFormatAtom for Hash

source§

fn size() -> usize

source§

fn encode_atom(self) -> Vec<u8>

source§

fn decode_atom(data: &[u8]) -> Self
where + Self: Sized,

source§

impl LowerHex for Hash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Hash

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Hash

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Hash

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Zeroize for Hash

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
source§

impl Copy for Hash

source§

impl Eq for Hash

Auto Trait Implementations§

§

impl Freeze for Hash

§

impl RefUnwindSafe for Hash

§

impl Send for Hash

§

impl Sync for Hash

§

impl Unpin for Hash

§

impl UnwindSafe for Hash

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/index.html b/rust/oasis_core_runtime/common/crypto/index.html new file mode 100644 index 0000000000..61b4e7b393 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::crypto - Rust

Module oasis_core_runtime::common::crypto

source ·
Expand description

Cryptographic primitives.

+

Modules§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.KEY_SIZE.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.KEY_SIZE.html new file mode 100644 index 0000000000..e735d7f5e0 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.KEY_SIZE.html @@ -0,0 +1,2 @@ +KEY_SIZE in oasis_core_runtime::common::crypto::mrae::deoxysii - Rust

Constant oasis_core_runtime::common::crypto::mrae::deoxysii::KEY_SIZE

pub const KEY_SIZE: usize = 32; // 32usize
Expand description

Size of the Deoxys-II-256-128 key in bytes.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.NONCE_SIZE.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.NONCE_SIZE.html new file mode 100644 index 0000000000..32ff657494 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.NONCE_SIZE.html @@ -0,0 +1,2 @@ +NONCE_SIZE in oasis_core_runtime::common::crypto::mrae::deoxysii - Rust

Constant oasis_core_runtime::common::crypto::mrae::deoxysii::NONCE_SIZE

pub const NONCE_SIZE: usize = 15; // 15usize
Expand description

Size of the nonce in bytes.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.TAG_SIZE.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.TAG_SIZE.html new file mode 100644 index 0000000000..43adc72744 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/constant.TAG_SIZE.html @@ -0,0 +1,2 @@ +TAG_SIZE in oasis_core_runtime::common::crypto::mrae::deoxysii - Rust

Constant oasis_core_runtime::common::crypto::mrae::deoxysii::TAG_SIZE

pub const TAG_SIZE: usize = 16; // 16usize
Expand description

Size of the authentication tag in bytes.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.box_open.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.box_open.html new file mode 100644 index 0000000000..0cf290896d --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.box_open.html @@ -0,0 +1,12 @@ +box_open in oasis_core_runtime::common::crypto::mrae::deoxysii - Rust

Function oasis_core_runtime::common::crypto::mrae::deoxysii::box_open

source ·
pub fn box_open(
+    nonce: &[u8; 15],
+    ciphertext: Vec<u8>,
+    additional_data: Vec<u8>,
+    peers_public_key: &PublicKey,
+    private_key: &StaticSecret,
+) -> Result<Vec<u8>>
Expand description

Unboxes (“opens”) the provided additional data and ciphertext via +Deoxys-II-256-128 using a symmetric key derived from the provided +X25519 public and private keys. +The nonce should be NONCE_SIZE bytes long and both it and the additional +data must match the value passed to box_seal.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.box_seal.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.box_seal.html new file mode 100644 index 0000000000..a6970d44a4 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.box_seal.html @@ -0,0 +1,12 @@ +box_seal in oasis_core_runtime::common::crypto::mrae::deoxysii - Rust

Function oasis_core_runtime::common::crypto::mrae::deoxysii::box_seal

source ·
pub fn box_seal(
+    nonce: &[u8; 15],
+    plaintext: Vec<u8>,
+    additional_data: Vec<u8>,
+    peers_public_key: &PublicKey,
+    private_key: &StaticSecret,
+) -> Result<Vec<u8>>
Expand description

Boxes (“seals”) the provided additional data and plaintext via +Deoxys-II-256-128 using a symmetric key derived from the provided +X25519 public and private keys. +The nonce should be NONCE_SIZE bytes long and unique for all time +for a given public and private key tuple.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.generate_key_pair.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.generate_key_pair.html new file mode 100644 index 0000000000..f7767c6563 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/fn.generate_key_pair.html @@ -0,0 +1,3 @@ +generate_key_pair in oasis_core_runtime::common::crypto::mrae::deoxysii - Rust
pub fn generate_key_pair() -> (PublicKey, StaticSecret)
Expand description

Generates a public/private key pair suitable for use with +derive_symmetric_key, box_seal, and box_open.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/index.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/index.html new file mode 100644 index 0000000000..181dd7a33a --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/index.html @@ -0,0 +1,11 @@ +oasis_core_runtime::common::crypto::mrae::deoxysii - Rust

Module oasis_core_runtime::common::crypto::mrae::deoxysii

source ·
Expand description

Deoxys-II-256-128 MRAE primitives implementation.

+

Structs§

Constants§

  • Size of the Deoxys-II-256-128 key in bytes.
  • Size of the nonce in bytes.
  • Size of the authentication tag in bytes.

Traits§

  • An abstract Deoxys-II-256-128 box opener.

Functions§

  • Unboxes (“opens”) the provided additional data and ciphertext via +Deoxys-II-256-128 using a symmetric key derived from the provided +X25519 public and private keys. +The nonce should be NONCE_SIZE bytes long and both it and the additional +data must match the value passed to box_seal.
  • Boxes (“seals”) the provided additional data and plaintext via +Deoxys-II-256-128 using a symmetric key derived from the provided +X25519 public and private keys. +The nonce should be NONCE_SIZE bytes long and unique for all time +for a given public and private key tuple.
  • Generates a public/private key pair suitable for use with +derive_symmetric_key, box_seal, and box_open.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/sidebar-items.js b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/sidebar-items.js new file mode 100644 index 0000000000..3638ccb277 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["KEY_SIZE","NONCE_SIZE","TAG_SIZE"],"fn":["box_open","box_seal","generate_key_pair"],"struct":["DeoxysII"],"trait":["Opener"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/struct.DeoxysII.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/struct.DeoxysII.html new file mode 100644 index 0000000000..5e6610483e --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/struct.DeoxysII.html @@ -0,0 +1,57 @@ +DeoxysII in oasis_core_runtime::common::crypto::mrae::deoxysii - Rust

Struct oasis_core_runtime::common::crypto::mrae::deoxysii::DeoxysII

#[repr(align(16))]
pub struct DeoxysII { /* private fields */ }
Expand description

Deoxys-II-256-128 state.

+

We don’t store the key itself, but only components derived from the key. +These components are automatically erased after the structure is dropped.

+

Implementations§

§

impl DeoxysII

pub fn new(key: &[u8; 32]) -> DeoxysII

Creates a new instance using the provided key.

+

pub fn seal( + &self, + nonce: &[u8; 15], + plaintext: impl AsRef<[u8]>, + additional_data: impl AsRef<[u8]>, +) -> Vec<u8>

Encrypts and authenticates plaintext, authenticates the additional +data and returns the result.

+

pub fn seal_into( + &self, + nonce: &[u8; 15], + plaintext: &[u8], + additional_data: &[u8], + ciphertext_with_tag: &mut [u8], +) -> Result<usize, EncryptionError>

Like DeoxysII::seal but seals into ciphertext_with_tag, +returning the number of bytes written.

+

pub fn open( + &self, + nonce: &[u8; 15], + ciphertext_with_tag: impl AsMut<[u8]>, + additional_data: impl AsRef<[u8]>, +) -> Result<Vec<u8>, DecryptionError>

Decrypts and authenticates ciphertext, authenticates the additional +data and, if successful, returns the resulting plaintext. +If the tag verification fails, an error is returned and the +intermediary plaintext is securely erased from memory.

+

pub fn open_into( + &self, + nonce: &[u8; 15], + ciphertext_with_tag: &mut [u8], + additional_data: &[u8], + plaintext: &mut [u8], +) -> Result<usize, DecryptionError>

Like DeoxysII::open but writes the plaintext into plaintext if successful, +returning the number of bytes written.

+

Trait Implementations§

§

impl Zeroize for DeoxysII

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/trait.Opener.html b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/trait.Opener.html new file mode 100644 index 0000000000..e7ca2fed3c --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/deoxysii/trait.Opener.html @@ -0,0 +1,18 @@ +Opener in oasis_core_runtime::common::crypto::mrae::deoxysii - Rust

Trait oasis_core_runtime::common::crypto::mrae::deoxysii::Opener

source ·
pub trait Opener: Send + Sync {
+    // Required method
+    fn box_open(
+        &self,
+        nonce: &[u8; 15],
+        ciphertext: Vec<u8>,
+        additional_data: Vec<u8>,
+        peers_public_key: &PublicKey,
+    ) -> Result<Vec<u8>>;
+}
Expand description

An abstract Deoxys-II-256-128 box opener.

+

Required Methods§

source

fn box_open( + &self, + nonce: &[u8; 15], + ciphertext: Vec<u8>, + additional_data: Vec<u8>, + peers_public_key: &PublicKey, +) -> Result<Vec<u8>>

Unboxes (“opens”) the provided additional data and ciphertext.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/index.html b/rust/oasis_core_runtime/common/crypto/mrae/index.html new file mode 100644 index 0000000000..d6bf9161af --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::crypto::mrae - Rust

Module oasis_core_runtime::common::crypto::mrae

source ·
Expand description

MRAE primitives.

+

Modules§

  • Deoxys-II-256-128 MRAE primitives implementation.
  • Nonce utility used to ensure nonces are safely incremented.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/nonce/constant.NONCE_SIZE.html b/rust/oasis_core_runtime/common/crypto/mrae/nonce/constant.NONCE_SIZE.html new file mode 100644 index 0000000000..021cf9e930 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/nonce/constant.NONCE_SIZE.html @@ -0,0 +1,3 @@ +NONCE_SIZE in oasis_core_runtime::common::crypto::mrae::nonce - Rust

Constant oasis_core_runtime::common::crypto::mrae::nonce::NONCE_SIZE

pub const NONCE_SIZE: usize = 15; // 15usize
Expand description

Size of the nonce in bytes. +Size of the nonce in bytes.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/nonce/constant.TAG_SIZE.html b/rust/oasis_core_runtime/common/crypto/mrae/nonce/constant.TAG_SIZE.html new file mode 100644 index 0000000000..2ae075e6a9 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/nonce/constant.TAG_SIZE.html @@ -0,0 +1,2 @@ +TAG_SIZE in oasis_core_runtime::common::crypto::mrae::nonce - Rust

Constant oasis_core_runtime::common::crypto::mrae::nonce::TAG_SIZE

source ·
pub const TAG_SIZE: usize = 11;
Expand description

Size of tag portion of the nonce in bytes. These bytes will never update.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/nonce/index.html b/rust/oasis_core_runtime/common/crypto/mrae/nonce/index.html new file mode 100644 index 0000000000..3b5163e1f4 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/nonce/index.html @@ -0,0 +1,7 @@ +oasis_core_runtime::common::crypto::mrae::nonce - Rust

Module oasis_core_runtime::common::crypto::mrae::nonce

source ·
Expand description

Nonce utility used to ensure nonces are safely incremented.

+

Structs§

  • 120 bit nonce with a 88 bit tag and 32 bit counter. If the counter exceeds +32 bits, then the nonce is no longer valid and must be refreshed with a new +random nonce. It is expected that all 128 bits are given randomly. However, +the last 32 counting bits may wrap around to ensure 2^32 counts may be used +per nonce.

Constants§

  • Size of the nonce in bytes. +Size of the nonce in bytes.
  • Size of tag portion of the nonce in bytes. These bytes will never update.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/nonce/sidebar-items.js b/rust/oasis_core_runtime/common/crypto/mrae/nonce/sidebar-items.js new file mode 100644 index 0000000000..5d158dfd8f --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/nonce/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["NONCE_SIZE","TAG_SIZE"],"struct":["Nonce"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/nonce/struct.Nonce.html b/rust/oasis_core_runtime/common/crypto/mrae/nonce/struct.Nonce.html new file mode 100644 index 0000000000..01f8ab0ee4 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/nonce/struct.Nonce.html @@ -0,0 +1,121 @@ +Nonce in oasis_core_runtime::common::crypto::mrae::nonce - Rust

Struct oasis_core_runtime::common::crypto::mrae::nonce::Nonce

source ·
pub struct Nonce { /* private fields */ }
Expand description

120 bit nonce with a 88 bit tag and 32 bit counter. If the counter exceeds +32 bits, then the nonce is no longer valid and must be refreshed with a new +random nonce. It is expected that all 128 bits are given randomly. However, +the last 32 counting bits may wrap around to ensure 2^32 counts may be used +per nonce.

+

Implementations§

source§

impl Nonce

source

pub fn new(start_value: [u8; 15]) -> Self

Create a new nonce.

+
source

pub fn generate() -> Self

Generate a random nonce.

+
source

pub fn increment(&mut self) -> Result<()>

Adds one to the nonce, affecting only the last 32 counting bits. +Returns an error iff we’ve exceeded our nonce’s counter capacity, i.e., +we’ve incremented 2^32 times. In this case, the Nonce remains unchanged, +and all subsequent calls to this method will return an Error.

+

Methods from Deref<Target = [u8; 15]>§

1.57.0 · source

pub fn as_slice(&self) -> &[T]

Returns a slice containing the entire array. Equivalent to &s[..].

+
1.77.0 · source

pub fn each_ref(&self) -> [&T; N]

Borrows each element and returns an array of references with the same +size as self.

+
§Example
+
let floats = [3.1, 2.7, -1.0];
+let float_refs: [&f64; 3] = floats.each_ref();
+assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
+

This method is particularly useful if combined with other methods, like +map. This way, you can avoid moving the original +array if its elements are not Copy.

+ +
let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
+let is_ascii = strings.each_ref().map(|s| s.is_ascii());
+assert_eq!(is_ascii, [true, false, true]);
+
+// We can still access the original array: it has not been moved.
+assert_eq!(strings.len(), 3);
+
source

pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one array reference into two at an index.

+

The first will contain all indices from [0, M) (excluding +the index M itself) and the second will contain all +indices from [M, N) (excluding the index N itself).

+
§Panics
+

Panics if M > N.

+
§Examples
+
#![feature(split_array)]
+
+let v = [1, 2, 3, 4, 5, 6];
+
+{
+   let (left, right) = v.split_array_ref::<0>();
+   assert_eq!(left, &[]);
+   assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_array_ref::<2>();
+    assert_eq!(left, &[1, 2]);
+    assert_eq!(right, &[3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_array_ref::<6>();
+    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, &[]);
+}
+
source

pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])

🔬This is a nightly-only experimental API. (split_array)

Divides one array reference into two at an index from the end.

+

The first will contain all indices from [0, N - M) (excluding +the index N - M itself) and the second will contain all +indices from [N - M, N) (excluding the index N itself).

+
§Panics
+

Panics if M > N.

+
§Examples
+
#![feature(split_array)]
+
+let v = [1, 2, 3, 4, 5, 6];
+
+{
+   let (left, right) = v.rsplit_array_ref::<0>();
+   assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
+   assert_eq!(right, &[]);
+}
+
+{
+    let (left, right) = v.rsplit_array_ref::<2>();
+    assert_eq!(left, &[1, 2, 3, 4]);
+    assert_eq!(right, &[5, 6]);
+}
+
+{
+    let (left, right) = v.rsplit_array_ref::<6>();
+    assert_eq!(left, &[]);
+    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
+}
+
source

pub fn as_ascii(&self) -> Option<&[AsciiChar; N]>

🔬This is a nightly-only experimental API. (ascii_char)

Converts this array of bytes into a array of ASCII characters, +or returns None if any of the characters is non-ASCII.

+
§Examples
+
#![feature(ascii_char)]
+#![feature(const_option)]
+
+const HEX_DIGITS: [std::ascii::Char; 16] =
+    *b"0123456789abcdef".as_ascii().unwrap();
+
+assert_eq!(HEX_DIGITS[1].as_str(), "1");
+assert_eq!(HEX_DIGITS[10].as_str(), "a");
+
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this array of bytes into a array of ASCII characters, +without checking whether they’re valid.

+
§Safety
+

Every byte in the array must be in 0..=127, or else this is UB.

+

Trait Implementations§

source§

impl Clone for Nonce

source§

fn clone(&self) -> Nonce

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Nonce

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Nonce

§

type Target = [u8; 15]

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl Freeze for Nonce

§

impl RefUnwindSafe for Nonce

§

impl Send for Nonce

§

impl Sync for Nonce

§

impl Unpin for Nonce

§

impl UnwindSafe for Nonce

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/mrae/sidebar-items.js b/rust/oasis_core_runtime/common/crypto/mrae/sidebar-items.js new file mode 100644 index 0000000000..83c7606ee7 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/mrae/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["deoxysii","nonce"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/sidebar-items.js b/rust/oasis_core_runtime/common/crypto/sidebar-items.js new file mode 100644 index 0000000000..078e9bc217 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["hash","mrae","signature","x25519"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/fn.signature_context_with_chain_separation.html b/rust/oasis_core_runtime/common/crypto/signature/fn.signature_context_with_chain_separation.html new file mode 100644 index 0000000000..aaca107a53 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/fn.signature_context_with_chain_separation.html @@ -0,0 +1,5 @@ +signature_context_with_chain_separation in oasis_core_runtime::common::crypto::signature - Rust
pub fn signature_context_with_chain_separation(
+    context: Vec<u8>,
+    chain_context: &String,
+) -> Vec<u8> 
Expand description

Extends signature context with additional domain separation based on the chain context.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/fn.signature_context_with_runtime_separation.html b/rust/oasis_core_runtime/common/crypto/signature/fn.signature_context_with_runtime_separation.html new file mode 100644 index 0000000000..acb0f79048 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/fn.signature_context_with_runtime_separation.html @@ -0,0 +1,5 @@ +signature_context_with_runtime_separation in oasis_core_runtime::common::crypto::signature - Rust
pub fn signature_context_with_runtime_separation(
+    context: Vec<u8>,
+    runtime_id: &Namespace,
+) -> Vec<u8> 
Expand description

Extends signature context with additional domain separation based on the runtime ID.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/index.html b/rust/oasis_core_runtime/common/crypto/signature/index.html new file mode 100644 index 0000000000..84748f1788 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::crypto::signature - Rust

Module oasis_core_runtime::common::crypto::signature

source ·
Expand description

Signature types.

+

Structs§

Traits§

Functions§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/sidebar-items.js b/rust/oasis_core_runtime/common/crypto/signature/sidebar-items.js new file mode 100644 index 0000000000..b0fca6fa57 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["signature_context_with_chain_separation","signature_context_with_runtime_separation"],"struct":["MultiSigned","PrivateKey","PublicKey","Signature","SignatureBundle","Signed"],"trait":["Signer"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/struct.MultiSigned.html b/rust/oasis_core_runtime/common/crypto/signature/struct.MultiSigned.html new file mode 100644 index 0000000000..758c7b8b5c --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/struct.MultiSigned.html @@ -0,0 +1,38 @@ +MultiSigned in oasis_core_runtime::common::crypto::signature - Rust

Struct oasis_core_runtime::common::crypto::signature::MultiSigned

source ·
pub struct MultiSigned {
+    pub blob: Vec<u8>,
+    pub signatures: Vec<SignatureBundle>,
+}
Expand description

Blob signed by multiple public keys.

+

Fields§

§blob: Vec<u8>

Signed blob.

+
§signatures: Vec<SignatureBundle>

Signatures over the blob.

+

Trait Implementations§

source§

impl Clone for MultiSigned

source§

fn clone(&self) -> MultiSigned

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MultiSigned

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MultiSigned

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for MultiSigned

source§

fn default() -> MultiSigned

Returns the “default value” for a type. Read more
source§

impl Encode for MultiSigned

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for MultiSigned

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for MultiSigned

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for MultiSigned

source§

fn eq(&self, other: &MultiSigned) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for MultiSigned

source§

impl StructuralPartialEq for MultiSigned

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/struct.PrivateKey.html b/rust/oasis_core_runtime/common/crypto/signature/struct.PrivateKey.html new file mode 100644 index 0000000000..6696393d3f --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/struct.PrivateKey.html @@ -0,0 +1,28 @@ +PrivateKey in oasis_core_runtime::common::crypto::signature - Rust

Struct oasis_core_runtime::common::crypto::signature::PrivateKey

source ·
pub struct PrivateKey(pub SigningKey);
Expand description

An Ed25519 private key.

+

Tuple Fields§

§0: SigningKey

Implementations§

source§

impl PrivateKey

source

pub fn generate() -> Self

Generates a new private key pair.

+
source

pub fn to_bytes(&self) -> Vec<u8>

Convert this private key into bytes.

+
source

pub fn from_bytes(bytes: Vec<u8>) -> PrivateKey

Construct a private key from bytes returned by to_bytes.

+
§Panics
+

This method will panic in case the passed bytes do not have the correct length.

+
source

pub fn from_test_seed(seed: String) -> Self

Generate a new private key from a test key seed.

+
source

pub fn public_key(&self) -> PublicKey

Returns the public key.

+

Trait Implementations§

source§

impl Signer for PrivateKey

source§

fn public(&self) -> PublicKey

Returns the public key corresponding to the signer.
source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature>

Generates a signature over the context and message.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/struct.PublicKey.html b/rust/oasis_core_runtime/common/crypto/signature/struct.PublicKey.html new file mode 100644 index 0000000000..7cd47f4d65 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/struct.PublicKey.html @@ -0,0 +1,48 @@ +PublicKey in oasis_core_runtime::common::crypto::signature - Rust

Struct oasis_core_runtime::common::crypto::signature::PublicKey

source ·
pub struct PublicKey(pub [u8; 32]);
Expand description

An Ed25519 public key.

+

Tuple Fields§

§0: [u8; 32]

Implementations§

source§

impl PublicKey

source

pub const fn len() -> usize

Size of this object in bytes.

+

Trait Implementations§

source§

impl AsRef<[u8]> for PublicKey

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKey

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for PublicKey

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for PublicKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&[u8]> for PublicKey

source§

fn from(b: &[u8]) -> PublicKey

Converts to this type from the input type.
source§

impl From<&'static str> for PublicKey

source§

fn from(s: &'static str) -> PublicKey

Converts to this type from the input type.
source§

impl From<PublicKey> for [u8; 32]

source§

fn from(b: PublicKey) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for PublicKey

source§

fn from(v: Vec<u8>) -> PublicKey

Converts to this type from the input type.
source§

impl FromStr for PublicKey

§

type Err = FromHexError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<PublicKey, FromHexError>

Parses a string s to return a value of this type. Read more
source§

impl Hash for PublicKey

source§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Zeroize for PublicKey

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
source§

impl Copy for PublicKey

source§

impl Eq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/struct.Signature.html b/rust/oasis_core_runtime/common/crypto/signature/struct.Signature.html new file mode 100644 index 0000000000..555cfb53ae --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/struct.Signature.html @@ -0,0 +1,55 @@ +Signature in oasis_core_runtime::common::crypto::signature - Rust

Struct oasis_core_runtime::common::crypto::signature::Signature

source ·
pub struct Signature(pub [u8; 64]);
Expand description

An Ed25519 signature.

+

Tuple Fields§

§0: [u8; 64]

Implementations§

source§

impl Signature

source

pub const fn len() -> usize

Size of this object in bytes.

+
source§

impl Signature

source

pub fn verify( + &self, + pk: &PublicKey, + context: &[u8], + message: &[u8], +) -> Result<()>

Verify signature.

+
source

pub fn verify_raw(&self, pk: &PublicKey, msg: &[u8]) -> Result<()>

Verify signature without applying domain separation.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Signature

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Signature

source§

fn clone(&self) -> Signature

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Signature

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Signature

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Signature

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for Signature

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Signature

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&[u8]> for Signature

source§

fn from(b: &[u8]) -> Signature

Converts to this type from the input type.
source§

impl From<&'static str> for Signature

source§

fn from(s: &'static str) -> Signature

Converts to this type from the input type.
source§

impl From<Signature> for [u8; 64]

source§

fn from(b: Signature) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Signature

source§

fn from(v: Vec<u8>) -> Signature

Converts to this type from the input type.
source§

impl FromStr for Signature

§

type Err = FromHexError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Signature, FromHexError>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Signature

source§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for Signature

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Signature

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Signature

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Signature

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Zeroize for Signature

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
source§

impl Copy for Signature

source§

impl Eq for Signature

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/struct.SignatureBundle.html b/rust/oasis_core_runtime/common/crypto/signature/struct.SignatureBundle.html new file mode 100644 index 0000000000..219e604aaa --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/struct.SignatureBundle.html @@ -0,0 +1,40 @@ +SignatureBundle in oasis_core_runtime::common::crypto::signature - Rust
pub struct SignatureBundle {
+    pub public_key: PublicKey,
+    pub signature: Signature,
+}
Expand description

A signature bundled with a public key.

+

Fields§

§public_key: PublicKey

Public key that produced the signature.

+
§signature: Signature

Actual signature.

+

Implementations§

source§

impl SignatureBundle

source

pub fn verify(&self, context: &[u8], message: &[u8]) -> bool

Verify returns true iff the signature is valid over the given context +and message.

+

Trait Implementations§

source§

impl Clone for SignatureBundle

source§

fn clone(&self) -> SignatureBundle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SignatureBundle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignatureBundle

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SignatureBundle

source§

fn default() -> SignatureBundle

Returns the “default value” for a type. Read more
source§

impl Encode for SignatureBundle

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SignatureBundle

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for SignatureBundle

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for SignatureBundle

source§

fn eq(&self, other: &SignatureBundle) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SignatureBundle

source§

impl StructuralPartialEq for SignatureBundle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/struct.Signed.html b/rust/oasis_core_runtime/common/crypto/signature/struct.Signed.html new file mode 100644 index 0000000000..0097384e73 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/struct.Signed.html @@ -0,0 +1,39 @@ +Signed in oasis_core_runtime::common::crypto::signature - Rust

Struct oasis_core_runtime::common::crypto::signature::Signed

source ·
pub struct Signed {
+    pub blob: Vec<u8>,
+    pub signature: SignatureBundle,
+}
Expand description

Blob signed with one public key.

+

Fields§

§blob: Vec<u8>

Signed blob.

+
§signature: SignatureBundle

Signature over the blob.

+

Implementations§

source§

impl Signed

source

pub fn verify(&self, chain_context: &String) -> bool

Returns true iff the signature is valid.

+

Trait Implementations§

source§

impl Clone for Signed

source§

fn clone(&self) -> Signed

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Signed

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Signed

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Signed

source§

fn default() -> Signed

Returns the “default value” for a type. Read more
source§

impl Encode for Signed

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Signed

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Signed

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Signed

source§

fn eq(&self, other: &Signed) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Signed

source§

impl StructuralPartialEq for Signed

Auto Trait Implementations§

§

impl Freeze for Signed

§

impl RefUnwindSafe for Signed

§

impl Send for Signed

§

impl Sync for Signed

§

impl Unpin for Signed

§

impl UnwindSafe for Signed

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/signature/trait.Signer.html b/rust/oasis_core_runtime/common/crypto/signature/trait.Signer.html new file mode 100644 index 0000000000..dbd6eb7810 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/signature/trait.Signer.html @@ -0,0 +1,8 @@ +Signer in oasis_core_runtime::common::crypto::signature - Rust

Trait oasis_core_runtime::common::crypto::signature::Signer

source ·
pub trait Signer: Send + Sync {
+    // Required methods
+    fn public(&self) -> PublicKey;
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature>;
+}
Expand description

A abstract signer.

+

Required Methods§

source

fn public(&self) -> PublicKey

Returns the public key corresponding to the signer.

+
source

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature>

Generates a signature over the context and message.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/x25519/constant.PRIVATE_KEY_LENGTH.html b/rust/oasis_core_runtime/common/crypto/x25519/constant.PRIVATE_KEY_LENGTH.html new file mode 100644 index 0000000000..04f2bdb42f --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/x25519/constant.PRIVATE_KEY_LENGTH.html @@ -0,0 +1,2 @@ +PRIVATE_KEY_LENGTH in oasis_core_runtime::common::crypto::x25519 - Rust

Constant oasis_core_runtime::common::crypto::x25519::PRIVATE_KEY_LENGTH

source ·
pub const PRIVATE_KEY_LENGTH: usize = 32;
Expand description

The length of an X25519 private key, in bytes.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/x25519/constant.PUBLIC_KEY_LENGTH.html b/rust/oasis_core_runtime/common/crypto/x25519/constant.PUBLIC_KEY_LENGTH.html new file mode 100644 index 0000000000..d9942a5364 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/x25519/constant.PUBLIC_KEY_LENGTH.html @@ -0,0 +1,2 @@ +PUBLIC_KEY_LENGTH in oasis_core_runtime::common::crypto::x25519 - Rust

Constant oasis_core_runtime::common::crypto::x25519::PUBLIC_KEY_LENGTH

source ·
pub const PUBLIC_KEY_LENGTH: usize = 32;
Expand description

The length of an X25519 public key, in bytes.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/x25519/index.html b/rust/oasis_core_runtime/common/crypto/x25519/index.html new file mode 100644 index 0000000000..02e87ad750 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/x25519/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::crypto::x25519 - Rust

Module oasis_core_runtime::common::crypto::x25519

source ·
Expand description

CBOR serializable X25519 types.

+

Structs§

  • A CBOR serializable Diffie-Hellman X25519 private key.
  • A CBOR serializable Diffie-Hellman X25519 public key.

Constants§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/x25519/sidebar-items.js b/rust/oasis_core_runtime/common/crypto/x25519/sidebar-items.js new file mode 100644 index 0000000000..58bb00c293 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/x25519/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["PRIVATE_KEY_LENGTH","PUBLIC_KEY_LENGTH"],"struct":["PrivateKey","PublicKey"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/x25519/struct.PrivateKey.html b/rust/oasis_core_runtime/common/crypto/x25519/struct.PrivateKey.html new file mode 100644 index 0000000000..1110b750e1 --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/x25519/struct.PrivateKey.html @@ -0,0 +1,36 @@ +PrivateKey in oasis_core_runtime::common::crypto::x25519 - Rust

Struct oasis_core_runtime::common::crypto::x25519::PrivateKey

source ·
pub struct PrivateKey(pub StaticSecret);
Expand description

A CBOR serializable Diffie-Hellman X25519 private key.

+

Tuple Fields§

§0: StaticSecret

Implementations§

source§

impl PrivateKey

source

pub fn generate() -> Self

Generate a new private key.

+
source

pub fn public_key(&self) -> PublicKey

Compute corresponding public key.

+
source

pub fn from_test_seed(seed: String) -> Self

Generate a new private key from a test key seed.

+

Trait Implementations§

source§

impl AsRef<[u8]> for PrivateKey

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for PrivateKey

source§

fn clone(&self) -> PrivateKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Decode for PrivateKey

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for PrivateKey

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Drop for PrivateKey

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Encode for PrivateKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&PrivateKey> for PublicKey

source§

fn from(sk: &PrivateKey) -> PublicKey

Given an X25519 private key, compute its corresponding public key.

+
source§

impl From<[u8; 32]> for PrivateKey

source§

fn from(bytes: [u8; 32]) -> PrivateKey

Load private key from a byte array.

+
source§

impl From<PrivateKey> for StaticSecret

source§

fn from(sk: PrivateKey) -> Self

Converts to this type from the input type.
source§

impl From<StaticSecret> for PrivateKey

source§

fn from(sk: StaticSecret) -> Self

Converts to this type from the input type.
source§

impl Zeroize for PrivateKey

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/crypto/x25519/struct.PublicKey.html b/rust/oasis_core_runtime/common/crypto/x25519/struct.PublicKey.html new file mode 100644 index 0000000000..a977748c5d --- /dev/null +++ b/rust/oasis_core_runtime/common/crypto/x25519/struct.PublicKey.html @@ -0,0 +1,39 @@ +PublicKey in oasis_core_runtime::common::crypto::x25519 - Rust

Struct oasis_core_runtime::common::crypto::x25519::PublicKey

source ·
pub struct PublicKey(pub PublicKey);
Expand description

A CBOR serializable Diffie-Hellman X25519 public key.

+

Tuple Fields§

§0: PublicKey

Trait Implementations§

source§

impl AsRef<[u8]> for PublicKey

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKey

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for PublicKey

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for PublicKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&PrivateKey> for PublicKey

source§

fn from(sk: &PrivateKey) -> PublicKey

Given an X25519 private key, compute its corresponding public key.

+
source§

impl From<[u8; 32]> for PublicKey

source§

fn from(bytes: [u8; 32]) -> PublicKey

Load public key from a byte array.

+
source§

impl From<PublicKey> for PublicKey

source§

fn from(pk: PublicKey) -> Self

Converts to this type from the input type.
source§

impl From<PublicKey> for PublicKey

source§

fn from(pk: PublicKey) -> Self

Converts to this type from the input type.
source§

impl Hash for PublicKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for PublicKey

source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/index.html b/rust/oasis_core_runtime/common/index.html new file mode 100644 index 0000000000..11cacc09ae --- /dev/null +++ b/rust/oasis_core_runtime/common/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common - Rust

Module oasis_core_runtime::common

source ·
Expand description

Common types.

+

Modules§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/key_format/index.html b/rust/oasis_core_runtime/common/key_format/index.html new file mode 100644 index 0000000000..0501fb7153 --- /dev/null +++ b/rust/oasis_core_runtime/common/key_format/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::key_format - Rust

Module oasis_core_runtime::common::key_format

source ·

Traits§

  • A key formatting helper trait to be used together with key-value +backends for constructing keys.
  • Part of the KeyFormat to be used with key-value backends for constructing keys.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/key_format/sidebar-items.js b/rust/oasis_core_runtime/common/key_format/sidebar-items.js new file mode 100644 index 0000000000..a86a6c58ce --- /dev/null +++ b/rust/oasis_core_runtime/common/key_format/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["KeyFormat","KeyFormatAtom"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/key_format/trait.KeyFormat.html b/rust/oasis_core_runtime/common/key_format/trait.KeyFormat.html new file mode 100644 index 0000000000..1ceef0b81d --- /dev/null +++ b/rust/oasis_core_runtime/common/key_format/trait.KeyFormat.html @@ -0,0 +1,35 @@ +KeyFormat in oasis_core_runtime::common::key_format - Rust

Trait oasis_core_runtime::common::key_format::KeyFormat

source ·
pub trait KeyFormat {
+    // Required methods
+    fn prefix() -> u8;
+    fn size() -> usize;
+    fn encode_atoms(self, atoms: &mut Vec<Vec<u8>>);
+    fn decode_atoms(data: &[u8]) -> Self
+       where Self: Sized;
+
+    // Provided methods
+    fn encode_partial(self, count: usize) -> Vec<u8> 
+       where Self: Sized { ... }
+    fn encode(self) -> Vec<u8> 
+       where Self: Sized { ... }
+    fn decode(data: &[u8]) -> Option<Self>
+       where Self: Sized { ... }
+}
Expand description

A key formatting helper trait to be used together with key-value +backends for constructing keys.

+

Required Methods§

source

fn prefix() -> u8

The prefix that identifies the key format.

+
source

fn size() -> usize

The minimum size of the encoded key.

+
source

fn encode_atoms(self, atoms: &mut Vec<Vec<u8>>)

Encode the given key format into a set of atoms.

+
source

fn decode_atoms(data: &[u8]) -> Self
where + Self: Sized,

Decode the given key format from data (without prefix).

+

The caller must ensure that the size of the passed data is at +least the minimum size returned by size.

+

Provided Methods§

source

fn encode_partial(self, count: usize) -> Vec<u8>
where + Self: Sized,

Encode the first few atoms in the key format.

+

This method can be used to construct key prefixes for iteration. +Specifying a zero count will only generate the prefix.

+
source

fn encode(self) -> Vec<u8>
where + Self: Sized,

Encode the given key format.

+
source

fn decode(data: &[u8]) -> Option<Self>
where + Self: Sized,

Decode the given key format from data.

+

The method may return None in case the key is of a different +type as indicated by the prefix byte.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/key_format/trait.KeyFormatAtom.html b/rust/oasis_core_runtime/common/key_format/trait.KeyFormatAtom.html new file mode 100644 index 0000000000..d8c69440a6 --- /dev/null +++ b/rust/oasis_core_runtime/common/key_format/trait.KeyFormatAtom.html @@ -0,0 +1,25 @@ +KeyFormatAtom in oasis_core_runtime::common::key_format - Rust
pub trait KeyFormatAtom {
+    // Required methods
+    fn size() -> usize;
+    fn encode_atom(self) -> Vec<u8> ;
+    fn decode_atom(data: &[u8]) -> Self
+       where Self: Sized;
+}
Expand description

Part of the KeyFormat to be used with key-value backends for constructing keys.

+

Required Methods§

source

fn size() -> usize

source

fn encode_atom(self) -> Vec<u8>

source

fn decode_atom(data: &[u8]) -> Self
where + Self: Sized,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl KeyFormatAtom for u8

source§

fn size() -> usize

source§

fn encode_atom(self) -> Vec<u8>

source§

fn decode_atom(data: &[u8]) -> Self
where + Self: Sized,

source§

impl KeyFormatAtom for u64

source§

fn size() -> usize

source§

fn encode_atom(self) -> Vec<u8>

source§

fn decode_atom(data: &[u8]) -> Self
where + Self: Sized,

source§

impl KeyFormatAtom for ()

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1)

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2)

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom, TupleElement3: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom, TupleElement3: KeyFormatAtom, TupleElement4: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom, TupleElement3: KeyFormatAtom, TupleElement4: KeyFormatAtom, TupleElement5: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom, TupleElement3: KeyFormatAtom, TupleElement4: KeyFormatAtom, TupleElement5: KeyFormatAtom, TupleElement6: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom, TupleElement3: KeyFormatAtom, TupleElement4: KeyFormatAtom, TupleElement5: KeyFormatAtom, TupleElement6: KeyFormatAtom, TupleElement7: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom, TupleElement3: KeyFormatAtom, TupleElement4: KeyFormatAtom, TupleElement5: KeyFormatAtom, TupleElement6: KeyFormatAtom, TupleElement7: KeyFormatAtom, TupleElement8: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom, TupleElement3: KeyFormatAtom, TupleElement4: KeyFormatAtom, TupleElement5: KeyFormatAtom, TupleElement6: KeyFormatAtom, TupleElement7: KeyFormatAtom, TupleElement8: KeyFormatAtom, TupleElement9: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/logger/fn.get_logger.html b/rust/oasis_core_runtime/common/logger/fn.get_logger.html new file mode 100644 index 0000000000..52a19efb0c --- /dev/null +++ b/rust/oasis_core_runtime/common/logger/fn.get_logger.html @@ -0,0 +1,2 @@ +get_logger in oasis_core_runtime::common::logger - Rust

Function oasis_core_runtime::common::logger::get_logger

source ·
pub fn get_logger(module: &'static str) -> Logger
Expand description

Get the logger.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/logger/fn.init_logger.html b/rust/oasis_core_runtime/common/logger/fn.init_logger.html new file mode 100644 index 0000000000..b2d7260365 --- /dev/null +++ b/rust/oasis_core_runtime/common/logger/fn.init_logger.html @@ -0,0 +1,2 @@ +init_logger in oasis_core_runtime::common::logger - Rust

Function oasis_core_runtime::common::logger::init_logger

source ·
pub fn init_logger(level: Level)
Expand description

Initialize the global slog_stdlog adapter to allow logging with the log crate (instead of slog).

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/logger/index.html b/rust/oasis_core_runtime/common/logger/index.html new file mode 100644 index 0000000000..6e57f774a8 --- /dev/null +++ b/rust/oasis_core_runtime/common/logger/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::logger - Rust

Module oasis_core_runtime::common::logger

source ·
Expand description

Logging subsystem for runtimes.

+

Functions§

  • Get the logger.
  • Initialize the global slog_stdlog adapter to allow logging with the log crate (instead of slog).
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/logger/sidebar-items.js b/rust/oasis_core_runtime/common/logger/sidebar-items.js new file mode 100644 index 0000000000..c102339aaf --- /dev/null +++ b/rust/oasis_core_runtime/common/logger/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["get_logger","init_logger"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/namespace/constant.NAMESPACE_SIZE.html b/rust/oasis_core_runtime/common/namespace/constant.NAMESPACE_SIZE.html new file mode 100644 index 0000000000..a2ca9c360a --- /dev/null +++ b/rust/oasis_core_runtime/common/namespace/constant.NAMESPACE_SIZE.html @@ -0,0 +1,2 @@ +NAMESPACE_SIZE in oasis_core_runtime::common::namespace - Rust

Constant oasis_core_runtime::common::namespace::NAMESPACE_SIZE

source ·
pub const NAMESPACE_SIZE: usize = 32;
Expand description

Size of the namespace in bytes.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/namespace/index.html b/rust/oasis_core_runtime/common/namespace/index.html new file mode 100644 index 0000000000..abcc3b2972 --- /dev/null +++ b/rust/oasis_core_runtime/common/namespace/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::namespace - Rust

Module oasis_core_runtime::common::namespace

source ·
Expand description

Chain namespace.

+

Structs§

Constants§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/namespace/sidebar-items.js b/rust/oasis_core_runtime/common/namespace/sidebar-items.js new file mode 100644 index 0000000000..6d8efcd3b6 --- /dev/null +++ b/rust/oasis_core_runtime/common/namespace/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["NAMESPACE_SIZE"],"struct":["Namespace"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/namespace/struct.Namespace.html b/rust/oasis_core_runtime/common/namespace/struct.Namespace.html new file mode 100644 index 0000000000..6d9026fe66 --- /dev/null +++ b/rust/oasis_core_runtime/common/namespace/struct.Namespace.html @@ -0,0 +1,48 @@ +Namespace in oasis_core_runtime::common::namespace - Rust

Struct oasis_core_runtime::common::namespace::Namespace

source ·
pub struct Namespace(pub [u8; 32]);
Expand description

Chain namespace.

+

Tuple Fields§

§0: [u8; 32]

Implementations§

source§

impl Namespace

source

pub const fn len() -> usize

Size of this object in bytes.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Namespace

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Namespace

source§

fn clone(&self) -> Namespace

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Namespace

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Namespace

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Namespace

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for Namespace

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Namespace

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&[u8]> for Namespace

source§

fn from(b: &[u8]) -> Namespace

Converts to this type from the input type.
source§

impl From<&'static str> for Namespace

source§

fn from(s: &'static str) -> Namespace

Converts to this type from the input type.
source§

impl From<Namespace> for [u8; 32]

source§

fn from(b: Namespace) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Namespace

source§

fn from(v: Vec<u8>) -> Namespace

Converts to this type from the input type.
source§

impl FromStr for Namespace

§

type Err = FromHexError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Namespace, FromHexError>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Namespace

source§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for Namespace

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Namespace

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Namespace

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Namespace

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Zeroize for Namespace

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
source§

impl Copy for Namespace

source§

impl Eq for Namespace

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/panic/index.html b/rust/oasis_core_runtime/common/panic/index.html new file mode 100644 index 0000000000..8ad936d5ec --- /dev/null +++ b/rust/oasis_core_runtime/common/panic/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::panic - Rust

Module oasis_core_runtime::common::panic

source ·
Expand description

Panic-related functions.

+

Structs§

  • A guard that will abort the process if dropped while panicking.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/panic/sidebar-items.js b/rust/oasis_core_runtime/common/panic/sidebar-items.js new file mode 100644 index 0000000000..d7269fb199 --- /dev/null +++ b/rust/oasis_core_runtime/common/panic/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["AbortOnPanic"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/panic/struct.AbortOnPanic.html b/rust/oasis_core_runtime/common/panic/struct.AbortOnPanic.html new file mode 100644 index 0000000000..49e1d2943c --- /dev/null +++ b/rust/oasis_core_runtime/common/panic/struct.AbortOnPanic.html @@ -0,0 +1,24 @@ +AbortOnPanic in oasis_core_runtime::common::panic - Rust

Struct oasis_core_runtime::common::panic::AbortOnPanic

source ·
pub struct AbortOnPanic;
Expand description

A guard that will abort the process if dropped while panicking.

+

This is to ensure that the runtime will terminate in case there is +a panic encountered during dispatch and the runtime is built with +a non-abort panic handler.

+

Trait Implementations§

source§

impl Drop for AbortOnPanic

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/process/fn.abort.html b/rust/oasis_core_runtime/common/process/fn.abort.html new file mode 100644 index 0000000000..8c390027ff --- /dev/null +++ b/rust/oasis_core_runtime/common/process/fn.abort.html @@ -0,0 +1,2 @@ +abort in oasis_core_runtime::common::process - Rust

Function oasis_core_runtime::common::process::abort

source ·
pub fn abort() -> !
Expand description

Aborts the process via std::process::abort, but also making sure that log buffers are flushed.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/process/index.html b/rust/oasis_core_runtime/common/process/index.html new file mode 100644 index 0000000000..12e2d0171f --- /dev/null +++ b/rust/oasis_core_runtime/common/process/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::process - Rust

Module oasis_core_runtime::common::process

source ·
Expand description

Process-related helpers.

+

Functions§

  • Aborts the process via std::process::abort, but also making sure that log buffers are flushed.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/process/sidebar-items.js b/rust/oasis_core_runtime/common/process/sidebar-items.js new file mode 100644 index 0000000000..19cca034a4 --- /dev/null +++ b/rust/oasis_core_runtime/common/process/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["abort"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/quantity/index.html b/rust/oasis_core_runtime/common/quantity/index.html new file mode 100644 index 0000000000..57f6c0f5c7 --- /dev/null +++ b/rust/oasis_core_runtime/common/quantity/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::quantity - Rust

Module oasis_core_runtime::common::quantity

source ·
Expand description

An arbitrary precision unsigned integer.

+

Structs§

  • An arbitrary precision unsigned integer.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/quantity/sidebar-items.js b/rust/oasis_core_runtime/common/quantity/sidebar-items.js new file mode 100644 index 0000000000..f7b920ff5a --- /dev/null +++ b/rust/oasis_core_runtime/common/quantity/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Quantity"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/quantity/struct.Quantity.html b/rust/oasis_core_runtime/common/quantity/struct.Quantity.html new file mode 100644 index 0000000000..d68ff2656b --- /dev/null +++ b/rust/oasis_core_runtime/common/quantity/struct.Quantity.html @@ -0,0 +1,42 @@ +Quantity in oasis_core_runtime::common::quantity - Rust

Struct oasis_core_runtime::common::quantity::Quantity

source ·
pub struct Quantity(/* private fields */);
Expand description

An arbitrary precision unsigned integer.

+

Implementations§

source§

impl Quantity

source

pub fn checked_sub(&self, other: &Quantity) -> Option<Quantity>

Subtracts two numbers, checking for underflow. If underflow happens, None is returned.

+
source

pub fn checked_div(&self, other: &Quantity) -> Option<Quantity>

Divides two numbers, checking for underflow, overflow and division by zero. If any of that +happens, None is returned.

+

Trait Implementations§

source§

impl<'a> Add<&'a Quantity> for Quantity

§

type Output = Quantity

The resulting type after applying the + operator.
source§

fn add(self, other: &Quantity) -> Quantity

Performs the + operation. Read more
source§

impl Add<u64> for Quantity

§

type Output = Quantity

The resulting type after applying the + operator.
source§

fn add(self, other: u64) -> Quantity

Performs the + operation. Read more
source§

impl Add for Quantity

§

type Output = Quantity

The resulting type after applying the + operator.
source§

fn add(self, other: Quantity) -> Quantity

Performs the + operation. Read more
source§

impl<'a> AddAssign<&'a Quantity> for Quantity

source§

fn add_assign(&mut self, other: &Quantity)

Performs the += operation. Read more
source§

impl AddAssign<u64> for Quantity

source§

fn add_assign(&mut self, other: u64)

Performs the += operation. Read more
source§

impl AddAssign for Quantity

source§

fn add_assign(&mut self, other: Quantity)

Performs the += operation. Read more
source§

impl Clone for Quantity

source§

fn clone(&self) -> Quantity

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Quantity

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Quantity

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Quantity

source§

fn default() -> Quantity

Returns the “default value” for a type. Read more
source§

impl Display for Quantity

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Quantity

source§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
source§

impl From<u128> for Quantity

source§

fn from(v: u128) -> Quantity

Converts to this type from the input type.
source§

impl From<u16> for Quantity

source§

fn from(v: u16) -> Quantity

Converts to this type from the input type.
source§

impl From<u32> for Quantity

source§

fn from(v: u32) -> Quantity

Converts to this type from the input type.
source§

impl From<u64> for Quantity

source§

fn from(v: u64) -> Quantity

Converts to this type from the input type.
source§

impl From<u8> for Quantity

source§

fn from(v: u8) -> Quantity

Converts to this type from the input type.
source§

impl Hash for Quantity

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a> Mul<&'a Quantity> for Quantity

§

type Output = Quantity

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Quantity) -> Quantity

Performs the * operation. Read more
source§

impl Mul<u64> for Quantity

§

type Output = Quantity

The resulting type after applying the * operator.
source§

fn mul(self, other: u64) -> Quantity

Performs the * operation. Read more
source§

impl Mul for Quantity

§

type Output = Quantity

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Quantity) -> Quantity

Performs the * operation. Read more
source§

impl<'a> MulAssign<&'a Quantity> for Quantity

source§

fn mul_assign(&mut self, rhs: &Quantity)

Performs the *= operation. Read more
source§

impl MulAssign<u64> for Quantity

source§

fn mul_assign(&mut self, other: u64)

Performs the *= operation. Read more
source§

impl MulAssign for Quantity

source§

fn mul_assign(&mut self, rhs: Quantity)

Performs the *= operation. Read more
source§

impl Ord for Quantity

source§

fn cmp(&self, other: &Quantity) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Quantity

source§

fn eq(&self, other: &Quantity) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Quantity

source§

fn partial_cmp(&self, other: &Quantity) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl TryFrom<&Quantity> for u128

§

type Error = IntErrorKind

The type returned in the event of a conversion error.
source§

fn try_from(value: &Quantity) -> Result<u128, Self::Error>

Performs the conversion.
source§

impl TryFrom<&Quantity> for u64

§

type Error = IntErrorKind

The type returned in the event of a conversion error.
source§

fn try_from(value: &Quantity) -> Result<u64, Self::Error>

Performs the conversion.
source§

impl TryFrom<Quantity> for u128

§

type Error = IntErrorKind

The type returned in the event of a conversion error.
source§

fn try_from(value: Quantity) -> Result<u128, Self::Error>

Performs the conversion.
source§

impl TryFrom<Quantity> for u64

§

type Error = IntErrorKind

The type returned in the event of a conversion error.
source§

fn try_from(value: Quantity) -> Result<u64, Self::Error>

Performs the conversion.
source§

impl Zero for Quantity

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl Eq for Quantity

source§

impl StructuralPartialEq for Quantity

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/constant.MAX_QUOTE_AGE.html b/rust/oasis_core_runtime/common/sgx/constant.MAX_QUOTE_AGE.html new file mode 100644 index 0000000000..d729d15218 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/constant.MAX_QUOTE_AGE.html @@ -0,0 +1,2 @@ +MAX_QUOTE_AGE in oasis_core_runtime::common::sgx - Rust

Constant oasis_core_runtime::common::sgx::MAX_QUOTE_AGE

source ·
pub const MAX_QUOTE_AGE: i64 = _; // 86_400i64
Expand description

Maximum age of a quote from the viewpoint of the enclave.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/egetkey/fn.egetkey.html b/rust/oasis_core_runtime/common/sgx/egetkey/fn.egetkey.html new file mode 100644 index 0000000000..292086b0ea --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/egetkey/fn.egetkey.html @@ -0,0 +1,6 @@ +egetkey in oasis_core_runtime::common::sgx::egetkey - Rust

Function oasis_core_runtime::common::sgx::egetkey::egetkey

source ·
pub fn egetkey(key_policy: Keypolicy, context: &[u8]) -> [u8; 32]
Expand description

egetkey returns a 256 bit key suitable for sealing secrets to the +enclave in cold storage, derived from the results of the EGETKEY +instruction. The context field is a domain separation tag.

+

Note: The key can also be used for other things (eg: as an X25519 +private key).

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/egetkey/index.html b/rust/oasis_core_runtime/common/sgx/egetkey/index.html new file mode 100644 index 0000000000..1177c5bda6 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/egetkey/index.html @@ -0,0 +1,4 @@ +oasis_core_runtime::common::sgx::egetkey - Rust

Module oasis_core_runtime::common::sgx::egetkey

source ·
Expand description

SGX per-CPU package sealing key accessor.

+

Functions§

  • egetkey returns a 256 bit key suitable for sealing secrets to the +enclave in cold storage, derived from the results of the EGETKEY +instruction. The context field is a domain separation tag.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/egetkey/sidebar-items.js b/rust/oasis_core_runtime/common/sgx/egetkey/sidebar-items.js new file mode 100644 index 0000000000..aeb534c1d5 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/egetkey/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["egetkey"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/enum.Quote.html b/rust/oasis_core_runtime/common/sgx/enum.Quote.html new file mode 100644 index 0000000000..b33336dd56 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/enum.Quote.html @@ -0,0 +1,37 @@ +Quote in oasis_core_runtime::common::sgx - Rust

Enum oasis_core_runtime::common::sgx::Quote

source ·
pub enum Quote {
+    Ias(AVR),
+    Pcs(QuoteBundle),
+}
Expand description

An unverified SGX remote attestation quote, depending on the attestation scheme.

+

Variants§

Implementations§

source§

impl Quote

source

pub fn verify(&self, policy: &QuotePolicy) -> Result<VerifiedQuote>

Verify the remote attestation quote.

+
source

pub fn is_fresh(&self, now: i64, ts: i64, policy: &QuotePolicy) -> bool

Whether the quote should be considered fresh.

+

Trait Implementations§

source§

impl Clone for Quote

source§

fn clone(&self) -> Quote

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Quote

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Quote

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Quote

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Quote

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Quote

source§

fn eq(&self, other: &Quote) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Quote

source§

impl StructuralPartialEq for Quote

Auto Trait Implementations§

§

impl Freeze for Quote

§

impl RefUnwindSafe for Quote

§

impl Send for Quote

§

impl Sync for Quote

§

impl Unpin for Quote

§

impl UnwindSafe for Quote

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/fn.report_for.html b/rust/oasis_core_runtime/common/sgx/fn.report_for.html new file mode 100644 index 0000000000..e5b1f83dcd --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/fn.report_for.html @@ -0,0 +1,2 @@ +report_for in oasis_core_runtime::common::sgx - Rust

Function oasis_core_runtime::common::sgx::report_for

source ·
pub fn report_for(_target_info: &Targetinfo, report_data: &[u8; 64]) -> Report
Expand description

Generate a report for the given target enclave.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/ias/constant.QUOTE_CONTEXT_LEN.html b/rust/oasis_core_runtime/common/sgx/ias/constant.QUOTE_CONTEXT_LEN.html new file mode 100644 index 0000000000..40a280090d --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/ias/constant.QUOTE_CONTEXT_LEN.html @@ -0,0 +1 @@ +QUOTE_CONTEXT_LEN in oasis_core_runtime::common::sgx::ias - Rust

Constant oasis_core_runtime::common::sgx::ias::QUOTE_CONTEXT_LEN

source ·
pub const QUOTE_CONTEXT_LEN: usize = 8;
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/ias/fn.verify.html b/rust/oasis_core_runtime/common/sgx/ias/fn.verify.html new file mode 100644 index 0000000000..84cf34fbaf --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/ias/fn.verify.html @@ -0,0 +1,2 @@ +verify in oasis_core_runtime::common::sgx::ias - Rust

Function oasis_core_runtime::common::sgx::ias::verify

source ·
pub fn verify(avr: &AVR, policy: &QuotePolicy) -> Result<VerifiedQuote>
Expand description

Verify attestation report.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/ias/index.html b/rust/oasis_core_runtime/common/sgx/ias/index.html new file mode 100644 index 0000000000..ca1ee55fa5 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/ias/index.html @@ -0,0 +1,3 @@ +oasis_core_runtime::common::sgx::ias - Rust

Module oasis_core_runtime::common::sgx::ias

source ·
Expand description

Intel Attestation Service (IAS) attestation verification report handling.

+

Structs§

Constants§

Functions§

  • Verify attestation report.

Type Aliases§

  • The purpose of QuoteContext is to prevent quotes from being used in +different contexts. The value is included as a prefix in report data.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/ias/sidebar-items.js b/rust/oasis_core_runtime/common/sgx/ias/sidebar-items.js new file mode 100644 index 0000000000..c2f53e6c95 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/ias/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["QUOTE_CONTEXT_LEN"],"fn":["verify"],"struct":["AVR","QuotePolicy"],"type":["QuoteContext"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/ias/struct.AVR.html b/rust/oasis_core_runtime/common/sgx/ias/struct.AVR.html new file mode 100644 index 0000000000..5e0902d2d9 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/ias/struct.AVR.html @@ -0,0 +1,35 @@ +AVR in oasis_core_runtime::common::sgx::ias - Rust

Struct oasis_core_runtime::common::sgx::ias::AVR

source ·
pub struct AVR {
+    pub body: Vec<u8>,
+    pub signature: Vec<u8>,
+    pub certificate_chain: Vec<u8>,
+}
Expand description

Attestation verification report.

+

Fields§

§body: Vec<u8>§signature: Vec<u8>§certificate_chain: Vec<u8>

Trait Implementations§

source§

impl Clone for AVR

source§

fn clone(&self) -> AVR

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AVR

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AVR

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AVR

source§

fn default() -> AVR

Returns the “default value” for a type. Read more
source§

impl Encode for AVR

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AVR

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for AVR

source§

fn eq(&self, other: &AVR) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for AVR

source§

impl StructuralPartialEq for AVR

Auto Trait Implementations§

§

impl Freeze for AVR

§

impl RefUnwindSafe for AVR

§

impl Send for AVR

§

impl Sync for AVR

§

impl Unpin for AVR

§

impl UnwindSafe for AVR

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/ias/struct.QuotePolicy.html b/rust/oasis_core_runtime/common/sgx/ias/struct.QuotePolicy.html new file mode 100644 index 0000000000..2e1104af6c --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/ias/struct.QuotePolicy.html @@ -0,0 +1,42 @@ +QuotePolicy in oasis_core_runtime::common::sgx::ias - Rust

Struct oasis_core_runtime::common::sgx::ias::QuotePolicy

source ·
pub struct QuotePolicy {
+    pub disabled: bool,
+    pub allowed_quote_statuses: Vec<i64>,
+    pub gid_blacklist: Vec<u32>,
+    pub min_tcb_evaluation_data_number: u32,
+}
Expand description

Quote validity policy.

+

Fields§

§disabled: bool

Whether IAS quotes are disabled and will always be rejected.

+
§allowed_quote_statuses: Vec<i64>

Allowed quote statuses.

+

Note: QuoteOK and QuoteSwHardeningNeeded are ALWAYS allowed, and do not need to be +specified.

+
§gid_blacklist: Vec<u32>

List of blocked platform EPID group IDs.

+
§min_tcb_evaluation_data_number: u32

The minimum TCB evaluation data number that should be accepted.

+

Trait Implementations§

source§

impl Clone for QuotePolicy

source§

fn clone(&self) -> QuotePolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QuotePolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for QuotePolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for QuotePolicy

source§

fn default() -> QuotePolicy

Returns the “default value” for a type. Read more
source§

impl Encode for QuotePolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for QuotePolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for QuotePolicy

source§

fn eq(&self, other: &QuotePolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for QuotePolicy

source§

impl StructuralPartialEq for QuotePolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/ias/type.QuoteContext.html b/rust/oasis_core_runtime/common/sgx/ias/type.QuoteContext.html new file mode 100644 index 0000000000..a64e8962ec --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/ias/type.QuoteContext.html @@ -0,0 +1,3 @@ +QuoteContext in oasis_core_runtime::common::sgx::ias - Rust

Type Alias oasis_core_runtime::common::sgx::ias::QuoteContext

source ·
pub type QuoteContext = [u8; 8];
Expand description

The purpose of QuoteContext is to prevent quotes from being used in +different contexts. The value is included as a prefix in report data.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/index.html b/rust/oasis_core_runtime/common/sgx/index.html new file mode 100644 index 0000000000..246f0c4899 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::sgx - Rust

Module oasis_core_runtime::common::sgx

source ·
Expand description

SGX-specific functionality.

+

Modules§

  • SGX per-CPU package sealing key accessor.
  • Intel Attestation Service (IAS) attestation verification report handling.
  • Intel Provisioning Certification Services (PCS) quote handling.
  • Wrappers for sealing secrets to the enclave in cold storage.

Structs§

Enums§

  • An unverified SGX remote attestation quote, depending on the attestation scheme.

Constants§

  • Maximum age of a quote from the viewpoint of the enclave.

Functions§

  • Generate a report for the given target enclave.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/enum.Error.html b/rust/oasis_core_runtime/common/sgx/pcs/enum.Error.html new file mode 100644 index 0000000000..341bdc3fd0 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/enum.Error.html @@ -0,0 +1,47 @@ +Error in oasis_core_runtime::common::sgx::pcs - Rust

Enum oasis_core_runtime::common::sgx::pcs::Error

source ·
pub enum Error {
+
Show 24 variants UnsupportedQEVendor, + UnsupportedAttestationKeyType, + UnsupportedTeeType, + QuoteParseError(String), + VerificationFailed(String), + UnexpectedCertificateChain, + UnexpectedCertificationData, + MalformedCertificationData, + MalformedPCK, + TCBParseError(Error), + TCBVerificationFailed, + TCBExpired, + TCBOutOfDate, + TCBMismatch, + TCBEvaluationDataNumberInvalid, + BlacklistedFMSPC, + MalformedQEReport, + MalformedReport, + DebugEnclave, + ProductionEnclave, + TeeTypeNotAllowed, + TdxModuleNotAllowed, + Disabled, + Other(Error), +
}
Expand description

Possible errors returned by this module.

+

Variants§

§

UnsupportedQEVendor

§

UnsupportedAttestationKeyType

§

UnsupportedTeeType

§

QuoteParseError(String)

§

VerificationFailed(String)

§

UnexpectedCertificateChain

§

UnexpectedCertificationData

§

MalformedCertificationData

§

MalformedPCK

§

TCBParseError(Error)

§

TCBVerificationFailed

§

TCBExpired

§

TCBOutOfDate

§

TCBMismatch

§

TCBEvaluationDataNumberInvalid

§

BlacklistedFMSPC

§

MalformedQEReport

§

MalformedReport

§

DebugEnclave

§

ProductionEnclave

§

TeeTypeNotAllowed

§

TdxModuleNotAllowed

§

Disabled

§

Other(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/fn.td_enclave_identity.html b/rust/oasis_core_runtime/common/sgx/pcs/fn.td_enclave_identity.html new file mode 100644 index 0000000000..add4375a8d --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/fn.td_enclave_identity.html @@ -0,0 +1,8 @@ +td_enclave_identity in oasis_core_runtime::common::sgx::pcs - Rust

Function oasis_core_runtime::common::sgx::pcs::td_enclave_identity

source ·
pub fn td_enclave_identity(
+    mr_td: &[u8; 48],
+    rtmr0: &[u8; 48],
+    rtmr1: &[u8; 48],
+    rtmr2: &[u8; 48],
+    rtmr3: &[u8; 48],
+) -> EnclaveIdentity
Expand description

Compute enclave identity from the given measurements.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/index.html b/rust/oasis_core_runtime/common/sgx/pcs/index.html new file mode 100644 index 0000000000..70703c1106 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::sgx::pcs - Rust

Module oasis_core_runtime::common::sgx::pcs

source ·
Expand description

Intel Provisioning Certification Services (PCS) quote handling.

+

Structs§

Enums§

  • Possible errors returned by this module.

Functions§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.QuotePolicy.html b/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.QuotePolicy.html new file mode 100644 index 0000000000..43b931e341 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.QuotePolicy.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/struct.QuotePolicy.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.TdxModulePolicy.html b/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.TdxModulePolicy.html new file mode 100644 index 0000000000..2dc7c76d80 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.TdxModulePolicy.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/struct.TdxModulePolicy.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.TdxQuotePolicy.html b/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.TdxQuotePolicy.html new file mode 100644 index 0000000000..6d68590e6a --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/policy/struct.TdxQuotePolicy.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/struct.TdxQuotePolicy.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/quote/struct.Quote.html b/rust/oasis_core_runtime/common/sgx/pcs/quote/struct.Quote.html new file mode 100644 index 0000000000..29cf618aa7 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/quote/struct.Quote.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/struct.Quote.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/quote/struct.QuoteBundle.html b/rust/oasis_core_runtime/common/sgx/pcs/quote/struct.QuoteBundle.html new file mode 100644 index 0000000000..3e47f81a57 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/quote/struct.QuoteBundle.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/struct.QuoteBundle.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/report/fn.td_enclave_identity.html b/rust/oasis_core_runtime/common/sgx/pcs/report/fn.td_enclave_identity.html new file mode 100644 index 0000000000..7b347380fb --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/report/fn.td_enclave_identity.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/fn.td_enclave_identity.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/report/struct.TdAttributes.html b/rust/oasis_core_runtime/common/sgx/pcs/report/struct.TdAttributes.html new file mode 100644 index 0000000000..3d7363dcda --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/report/struct.TdAttributes.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/struct.TdAttributes.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/report/struct.TdReport.html b/rust/oasis_core_runtime/common/sgx/pcs/report/struct.TdReport.html new file mode 100644 index 0000000000..a1b44a55de --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/report/struct.TdReport.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/struct.TdReport.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/sidebar-items.js b/rust/oasis_core_runtime/common/sgx/pcs/sidebar-items.js new file mode 100644 index 0000000000..c1804c65c7 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"fn":["td_enclave_identity"],"struct":["Quote","QuoteBundle","QuotePolicy","TCBBundle","TdAttributes","TdReport","TdxModulePolicy","TdxQuotePolicy"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/struct.Quote.html b/rust/oasis_core_runtime/common/sgx/pcs/struct.Quote.html new file mode 100644 index 0000000000..8e564ccc86 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/struct.Quote.html @@ -0,0 +1,28 @@ +Quote in oasis_core_runtime::common::sgx::pcs - Rust

Struct oasis_core_runtime::common::sgx::pcs::Quote

source ·
pub struct Quote<'a> { /* private fields */ }
Expand description

An enclave quote.

+

Implementations§

source§

impl<'a> Quote<'a>

source

pub fn parse<T: Into<Cow<'a, [u8]>>>(quote: T) -> Result<Quote<'a>, Error>

source

pub fn header(&self) -> &Header<'a>

Quote header.

+
source

pub fn report_body(&self) -> &ReportBody

Report body.

+
source

pub fn verify( + &self, + tcb_info: TCBInfo, + qe_identity: QEIdentity, +) -> Result<TCBLevel, Error>

Verify quote.

+

Trait Implementations§

source§

impl<'a> Debug for Quote<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Quote<'a>

§

impl<'a> RefUnwindSafe for Quote<'a>

§

impl<'a> Send for Quote<'a>

§

impl<'a> Sync for Quote<'a>

§

impl<'a> Unpin for Quote<'a>

§

impl<'a> UnwindSafe for Quote<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/struct.QuoteBundle.html b/rust/oasis_core_runtime/common/sgx/pcs/struct.QuoteBundle.html new file mode 100644 index 0000000000..5d7c9afc89 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/struct.QuoteBundle.html @@ -0,0 +1,39 @@ +QuoteBundle in oasis_core_runtime::common::sgx::pcs - Rust

Struct oasis_core_runtime::common::sgx::pcs::QuoteBundle

source ·
pub struct QuoteBundle {
+    pub quote: Vec<u8>,
+    pub tcb: TCBBundle,
+}
Expand description

An attestation quote together with the TCB bundle required for its verification.

+

Fields§

§quote: Vec<u8>§tcb: TCBBundle

Implementations§

source§

impl QuoteBundle

source

pub fn verify( + &self, + policy: &QuotePolicy, + ts: DateTime<Utc>, +) -> Result<VerifiedQuote, Error>

Verify the quote bundle.

+

Trait Implementations§

source§

impl Clone for QuoteBundle

source§

fn clone(&self) -> QuoteBundle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QuoteBundle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for QuoteBundle

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for QuoteBundle

source§

fn default() -> QuoteBundle

Returns the “default value” for a type. Read more
source§

impl Encode for QuoteBundle

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for QuoteBundle

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for QuoteBundle

source§

fn eq(&self, other: &QuoteBundle) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for QuoteBundle

source§

impl StructuralPartialEq for QuoteBundle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/struct.QuotePolicy.html b/rust/oasis_core_runtime/common/sgx/pcs/struct.QuotePolicy.html new file mode 100644 index 0000000000..8d843cb72c --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/struct.QuotePolicy.html @@ -0,0 +1,45 @@ +QuotePolicy in oasis_core_runtime::common::sgx::pcs - Rust

Struct oasis_core_runtime::common::sgx::pcs::QuotePolicy

source ·
pub struct QuotePolicy {
+    pub disabled: bool,
+    pub tcb_validity_period: u16,
+    pub min_tcb_evaluation_data_number: u32,
+    pub fmspc_blacklist: Vec<String>,
+    pub tdx: Option<TdxQuotePolicy>,
+}
Expand description

Quote validity policy.

+

Fields§

§disabled: bool

Whether PCS quotes are disabled and will always be rejected.

+
§tcb_validity_period: u16

Validity (in days) of the TCB collateral.

+
§min_tcb_evaluation_data_number: u32

Minimum TCB evaluation data number that is considered to be valid. TCB bundles containing +smaller values will be invalid.

+
§fmspc_blacklist: Vec<String>

A list of hexadecimal encoded FMSPCs specifying which processor packages and platform +instances are blocked.

+
§tdx: Option<TdxQuotePolicy>

Optional TDX-specific policy. In case this is None, TDX quotes are disallowed.

+

Implementations§

source§

impl QuotePolicy

source

pub fn is_expired(&self, now: i64, ts: i64) -> bool

Whether the quote with timestamp ts is expired.

+

Trait Implementations§

source§

impl Clone for QuotePolicy

source§

fn clone(&self) -> QuotePolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QuotePolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for QuotePolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for QuotePolicy

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for QuotePolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for QuotePolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for QuotePolicy

source§

fn eq(&self, other: &QuotePolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for QuotePolicy

source§

impl StructuralPartialEq for QuotePolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/struct.TCBBundle.html b/rust/oasis_core_runtime/common/sgx/pcs/struct.TCBBundle.html new file mode 100644 index 0000000000..c99f6aee36 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/struct.TCBBundle.html @@ -0,0 +1,35 @@ +TCBBundle in oasis_core_runtime::common::sgx::pcs - Rust

Struct oasis_core_runtime::common::sgx::pcs::TCBBundle

source ·
pub struct TCBBundle {
+    pub tcb_info: SignedTCBInfo,
+    pub qe_identity: SignedQEIdentity,
+    pub certificates: Vec<u8>,
+}
Expand description

The TCB bundle contains all the required components to verify a quote’s TCB.

+

Fields§

§tcb_info: SignedTCBInfo§qe_identity: SignedQEIdentity§certificates: Vec<u8>

Trait Implementations§

source§

impl Clone for TCBBundle

source§

fn clone(&self) -> TCBBundle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TCBBundle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TCBBundle

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TCBBundle

source§

fn default() -> TCBBundle

Returns the “default value” for a type. Read more
source§

impl Encode for TCBBundle

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TCBBundle

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for TCBBundle

source§

fn eq(&self, other: &TCBBundle) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TCBBundle

source§

impl StructuralPartialEq for TCBBundle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/struct.TdAttributes.html b/rust/oasis_core_runtime/common/sgx/pcs/struct.TdAttributes.html new file mode 100644 index 0000000000..054cd86066 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/struct.TdAttributes.html @@ -0,0 +1,89 @@ +TdAttributes in oasis_core_runtime::common::sgx::pcs - Rust

Struct oasis_core_runtime::common::sgx::pcs::TdAttributes

source ·
pub struct TdAttributes(/* private fields */);
Expand description

TDX TD attributes.

+

Implementations§

source§

impl TdAttributes

source

pub const DEBUG: Self = _

TUD.DEBUG (TD runs in debug mode).

+
source

pub const SEPT_VE_DISABLE: Self = _

SEC.SEPT_VE_DISABLE (Disable EPT violation conversion to #VE on TD access of PENDING pages).

+
source

pub const PKS: Self = _

SEC.PKS (TD is allowed to use Supervisor Protection Keys).

+
source

pub const KL: Self = _

SEC.KL (TD is allowed to use Key Locker).

+
source

pub const PERFMON: Self = _

OTHER.PERFMON (TD is allowed to use Perfmon and PERF_METRICS capabilities).

+
source§

impl TdAttributes

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> u64

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: u64) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: u64) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: u64) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl TdAttributes

source

pub const fn iter(&self) -> Iter<TdAttributes>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<TdAttributes>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+
source§

impl TdAttributes

source

pub fn parse(data: &[u8]) -> Result<Self, Error>

Parse raw TDX attributes.

+

Trait Implementations§

source§

impl Binary for TdAttributes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl BitAnd for TdAttributes

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = TdAttributes

The resulting type after applying the & operator.
source§

impl BitAndAssign for TdAttributes

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for TdAttributes

source§

fn bitor(self, other: TdAttributes) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = TdAttributes

The resulting type after applying the | operator.
source§

impl BitOrAssign for TdAttributes

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for TdAttributes

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = TdAttributes

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for TdAttributes

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Clone for TdAttributes

source§

fn clone(&self) -> TdAttributes

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TdAttributes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<TdAttributes> for TdAttributes

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Flags for TdAttributes

source§

const FLAGS: &'static [Flag<TdAttributes>] = _

The set of defined flags.
§

type Bits = u64

The underlying bits type.
source§

fn bits(&self) -> u64

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: u64) -> TdAttributes

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> bool
where + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> bool
where + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)
where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)
where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)
where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)
where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl FromIterator<TdAttributes> for TdAttributes

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for TdAttributes

§

type Item = TdAttributes

The type of the elements being iterated over.
§

type IntoIter = Iter<TdAttributes>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl LowerHex for TdAttributes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Not for TdAttributes

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = TdAttributes

The resulting type after applying the ! operator.
source§

impl Octal for TdAttributes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for TdAttributes

source§

fn eq(&self, other: &TdAttributes) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PublicFlags for TdAttributes

§

type Primitive = u64

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for TdAttributes

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = TdAttributes

The resulting type after applying the - operator.
source§

impl SubAssign for TdAttributes

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for TdAttributes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for TdAttributes

source§

impl Eq for TdAttributes

source§

impl StructuralPartialEq for TdAttributes

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/struct.TdReport.html b/rust/oasis_core_runtime/common/sgx/pcs/struct.TdReport.html new file mode 100644 index 0000000000..a2449cfdee --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/struct.TdReport.html @@ -0,0 +1,62 @@ +TdReport in oasis_core_runtime::common::sgx::pcs - Rust

Struct oasis_core_runtime::common::sgx::pcs::TdReport

source ·
pub struct TdReport {
Show 15 fields + pub tee_tcb_svn: [u8; 16], + pub mr_seam: [u8; 48], + pub mr_signer_seam: [u8; 48], + pub seam_attributes: [u8; 8], + pub td_attributes: TdAttributes, + pub xfam: [u8; 8], + pub mr_td: [u8; 48], + pub mr_config_id: [u8; 48], + pub mr_owner: [u8; 48], + pub mr_owner_config: [u8; 48], + pub rtmr0: [u8; 48], + pub rtmr1: [u8; 48], + pub rtmr2: [u8; 48], + pub rtmr3: [u8; 48], + pub report_data: [u8; 64], +
}
Expand description

TDX TD report.

+

Fields§

§tee_tcb_svn: [u8; 16]

Describes the TCB of TDX.

+
§mr_seam: [u8; 48]

Measurement of the TDX Module.

+
§mr_signer_seam: [u8; 48]

Signer of the TDX Module (zero for Intel).

+
§seam_attributes: [u8; 8]

TDX Module attributes (must be zero for TDX 1.0).

+
§td_attributes: TdAttributes

TD attributes.

+
§xfam: [u8; 8]

XFAM (eXtended Features Available Mask).

+
§mr_td: [u8; 48]

Measurement of the initial contents of the TD.

+
§mr_config_id: [u8; 48]

Software-defined ID for non-owner-defined configuration of the TD, e.g., runtime or OS +configuration.

+
§mr_owner: [u8; 48]

Software-defined ID for the TD’s owner.

+
§mr_owner_config: [u8; 48]

Software-defined ID for owner-defined configuration of the TD, e.g., specific to the +workload rather than the runtime or OS.

+
§rtmr0: [u8; 48]

Runtime extendable measurement register 0.

+
§rtmr1: [u8; 48]

Runtime extendable measurement register 1.

+
§rtmr2: [u8; 48]

Runtime extendable measurement register 2.

+
§rtmr3: [u8; 48]

Runtime extendable measurement register 3.

+
§report_data: [u8; 64]

Custom report data.

+

Implementations§

source§

impl TdReport

source

pub fn parse(data: &[u8]) -> Result<Self, Error>

Parse a TDX report.

+
source

pub fn as_enclave_identity(&self) -> EnclaveIdentity

Converts this report into an enclave identity.

+

Trait Implementations§

source§

impl Clone for TdReport

source§

fn clone(&self) -> TdReport

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TdReport

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for TdReport

source§

fn eq(&self, other: &TdReport) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TdReport

source§

impl StructuralPartialEq for TdReport

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/struct.TdxModulePolicy.html b/rust/oasis_core_runtime/common/sgx/pcs/struct.TdxModulePolicy.html new file mode 100644 index 0000000000..6ff0a6b755 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/struct.TdxModulePolicy.html @@ -0,0 +1,39 @@ +TdxModulePolicy in oasis_core_runtime::common::sgx::pcs - Rust

Struct oasis_core_runtime::common::sgx::pcs::TdxModulePolicy

source ·
pub struct TdxModulePolicy {
+    pub mr_seam: Option<[u8; 48]>,
+    pub mr_signer_seam: [u8; 48],
+}
Expand description

TDX module policy.

+

Fields§

§mr_seam: Option<[u8; 48]>

Optional allowed measurement of the TDX Module. In case it is None, ANY measurement is +allowed and only the signer is checked.

+
§mr_signer_seam: [u8; 48]

Allowed signer of the TDX Module (zero for Intel).

+

Implementations§

source§

impl TdxModulePolicy

source

pub fn matches(&self, report: &TdReport) -> bool

Returns true iff the TDX module in the given report matches this module policy.

+

Trait Implementations§

source§

impl Clone for TdxModulePolicy

source§

fn clone(&self) -> TdxModulePolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TdxModulePolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TdxModulePolicy

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for TdxModulePolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TdxModulePolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for TdxModulePolicy

source§

fn eq(&self, other: &TdxModulePolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TdxModulePolicy

source§

impl StructuralPartialEq for TdxModulePolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/struct.TdxQuotePolicy.html b/rust/oasis_core_runtime/common/sgx/pcs/struct.TdxQuotePolicy.html new file mode 100644 index 0000000000..0a51ef26cd --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/struct.TdxQuotePolicy.html @@ -0,0 +1,35 @@ +TdxQuotePolicy in oasis_core_runtime::common::sgx::pcs - Rust

Struct oasis_core_runtime::common::sgx::pcs::TdxQuotePolicy

source ·
pub struct TdxQuotePolicy {
+    pub allowed_tdx_modules: Vec<TdxModulePolicy>,
+}
Expand description

TDX-specific quote policy.

+

Fields§

§allowed_tdx_modules: Vec<TdxModulePolicy>

Allowed TDX modules. Empty to allow ANY Intel-signed module.

+

Implementations§

source§

impl TdxQuotePolicy

source

pub fn verify(&self, report: &TdReport) -> Result<(), Error>

Verify whether the TDX policy is satisfied for the given report.

+

Trait Implementations§

source§

impl Clone for TdxQuotePolicy

source§

fn clone(&self) -> TdxQuotePolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TdxQuotePolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TdxQuotePolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TdxQuotePolicy

source§

fn default() -> TdxQuotePolicy

Returns the “default value” for a type. Read more
source§

impl Encode for TdxQuotePolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TdxQuotePolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for TdxQuotePolicy

source§

fn eq(&self, other: &TdxQuotePolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TdxQuotePolicy

source§

impl StructuralPartialEq for TdxQuotePolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/pcs/tcb/struct.TCBBundle.html b/rust/oasis_core_runtime/common/sgx/pcs/tcb/struct.TCBBundle.html new file mode 100644 index 0000000000..dee276f0aa --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/pcs/tcb/struct.TCBBundle.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/common/sgx/pcs/struct.TCBBundle.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/seal/fn.new_deoxysii.html b/rust/oasis_core_runtime/common/sgx/seal/fn.new_deoxysii.html new file mode 100644 index 0000000000..12c2be25c6 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/seal/fn.new_deoxysii.html @@ -0,0 +1,4 @@ +new_deoxysii in oasis_core_runtime::common::sgx::seal - Rust

Function oasis_core_runtime::common::sgx::seal::new_deoxysii

source ·
pub fn new_deoxysii(key_policy: Keypolicy, context: &[u8]) -> DeoxysII
Expand description

Creates a new Deoxys-II instance initialized with an SGX sealing key derived +from the results of the EGETKEYinstruction.

+

The context field is a domain separation tag.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/seal/fn.seal.html b/rust/oasis_core_runtime/common/sgx/seal/fn.seal.html new file mode 100644 index 0000000000..7a610d5000 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/seal/fn.seal.html @@ -0,0 +1,3 @@ +seal in oasis_core_runtime::common::sgx::seal - Rust

Function oasis_core_runtime::common::sgx::seal::seal

source ·
pub fn seal(key_policy: Keypolicy, context: &[u8], data: &[u8]) -> Vec<u8> 
Expand description

Seal a secret to the enclave.

+

The context field is a domain separation tag.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/seal/fn.unseal.html b/rust/oasis_core_runtime/common/sgx/seal/fn.unseal.html new file mode 100644 index 0000000000..b0347bfdb3 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/seal/fn.unseal.html @@ -0,0 +1,7 @@ +unseal in oasis_core_runtime::common::sgx::seal - Rust

Function oasis_core_runtime::common::sgx::seal::unseal

source ·
pub fn unseal(
+    key_policy: Keypolicy,
+    context: &[u8],
+    ciphertext: &[u8],
+) -> Result<Option<Vec<u8>>, Error>
Expand description

Unseal a previously sealed secret to the enclave.

+

The context field is a domain separation tag.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/seal/index.html b/rust/oasis_core_runtime/common/sgx/seal/index.html new file mode 100644 index 0000000000..7ebcbcd6d3 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/seal/index.html @@ -0,0 +1,3 @@ +oasis_core_runtime::common::sgx::seal - Rust

Module oasis_core_runtime::common::sgx::seal

source ·
Expand description

Wrappers for sealing secrets to the enclave in cold storage.

+

Functions§

  • Creates a new Deoxys-II instance initialized with an SGX sealing key derived +from the results of the EGETKEYinstruction.
  • Seal a secret to the enclave.
  • Unseal a previously sealed secret to the enclave.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/seal/sidebar-items.js b/rust/oasis_core_runtime/common/sgx/seal/sidebar-items.js new file mode 100644 index 0000000000..1d231d4d34 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/seal/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["new_deoxysii","seal","unseal"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/sidebar-items.js b/rust/oasis_core_runtime/common/sgx/sidebar-items.js new file mode 100644 index 0000000000..b111d04fb7 --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["MAX_QUOTE_AGE"],"enum":["Quote"],"fn":["report_for"],"mod":["egetkey","ias","pcs","seal"],"struct":["EnclaveIdentity","MrEnclave","MrSigner","QuotePolicy","VerifiedQuote"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/struct.EnclaveIdentity.html b/rust/oasis_core_runtime/common/sgx/struct.EnclaveIdentity.html new file mode 100644 index 0000000000..fe8b4e83ab --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/struct.EnclaveIdentity.html @@ -0,0 +1,38 @@ +EnclaveIdentity in oasis_core_runtime::common::sgx - Rust

Struct oasis_core_runtime::common::sgx::EnclaveIdentity

source ·
pub struct EnclaveIdentity {
+    pub mr_enclave: MrEnclave,
+    pub mr_signer: MrSigner,
+}
Expand description

Enclave identity.

+

Fields§

§mr_enclave: MrEnclave§mr_signer: MrSigner

Implementations§

source§

impl EnclaveIdentity

source

pub fn current() -> Option<Self>

Enclave identity for the current enclave (when available).

+
source

pub fn fortanix_test(mr_enclave: MrEnclave) -> Self

Enclave identity using a test MRSIGNER from Fortanix with a well-known private key.

+

Trait Implementations§

source§

impl Clone for EnclaveIdentity

source§

fn clone(&self) -> EnclaveIdentity

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EnclaveIdentity

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EnclaveIdentity

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EnclaveIdentity

source§

fn default() -> EnclaveIdentity

Returns the “default value” for a type. Read more
source§

impl Encode for EnclaveIdentity

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EnclaveIdentity

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EnclaveIdentity

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EnclaveIdentity

source§

fn eq(&self, other: &EnclaveIdentity) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EnclaveIdentity

source§

impl StructuralPartialEq for EnclaveIdentity

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/struct.MrEnclave.html b/rust/oasis_core_runtime/common/sgx/struct.MrEnclave.html new file mode 100644 index 0000000000..3d43b7aa5f --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/struct.MrEnclave.html @@ -0,0 +1,48 @@ +MrEnclave in oasis_core_runtime::common::sgx - Rust

Struct oasis_core_runtime::common::sgx::MrEnclave

source ·
pub struct MrEnclave(pub [u8; 32]);
Expand description

Enclave hash (MRENCLAVE).

+

Tuple Fields§

§0: [u8; 32]

Implementations§

source§

impl MrEnclave

source

pub const fn len() -> usize

Size of this object in bytes.

+

Trait Implementations§

source§

impl AsRef<[u8]> for MrEnclave

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for MrEnclave

source§

fn clone(&self) -> MrEnclave

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MrEnclave

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MrEnclave

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for MrEnclave

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for MrEnclave

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for MrEnclave

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&[u8]> for MrEnclave

source§

fn from(b: &[u8]) -> MrEnclave

Converts to this type from the input type.
source§

impl From<&'static str> for MrEnclave

source§

fn from(s: &'static str) -> MrEnclave

Converts to this type from the input type.
source§

impl From<MrEnclave> for [u8; 32]

source§

fn from(b: MrEnclave) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for MrEnclave

source§

fn from(v: Vec<u8>) -> MrEnclave

Converts to this type from the input type.
source§

impl FromStr for MrEnclave

§

type Err = FromHexError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<MrEnclave, FromHexError>

Parses a string s to return a value of this type. Read more
source§

impl Hash for MrEnclave

source§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for MrEnclave

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for MrEnclave

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MrEnclave

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MrEnclave

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Zeroize for MrEnclave

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
source§

impl Copy for MrEnclave

source§

impl Eq for MrEnclave

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/struct.MrSigner.html b/rust/oasis_core_runtime/common/sgx/struct.MrSigner.html new file mode 100644 index 0000000000..370eff9afe --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/struct.MrSigner.html @@ -0,0 +1,48 @@ +MrSigner in oasis_core_runtime::common::sgx - Rust

Struct oasis_core_runtime::common::sgx::MrSigner

source ·
pub struct MrSigner(pub [u8; 32]);
Expand description

Enclave signer hash (MRSIGNER).

+

Tuple Fields§

§0: [u8; 32]

Implementations§

source§

impl MrSigner

source

pub const fn len() -> usize

Size of this object in bytes.

+

Trait Implementations§

source§

impl AsRef<[u8]> for MrSigner

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for MrSigner

source§

fn clone(&self) -> MrSigner

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MrSigner

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MrSigner

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for MrSigner

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for MrSigner

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for MrSigner

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&[u8]> for MrSigner

source§

fn from(b: &[u8]) -> MrSigner

Converts to this type from the input type.
source§

impl From<&'static str> for MrSigner

source§

fn from(s: &'static str) -> MrSigner

Converts to this type from the input type.
source§

impl From<MrSigner> for [u8; 32]

source§

fn from(b: MrSigner) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for MrSigner

source§

fn from(v: Vec<u8>) -> MrSigner

Converts to this type from the input type.
source§

impl FromStr for MrSigner

§

type Err = FromHexError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<MrSigner, FromHexError>

Parses a string s to return a value of this type. Read more
source§

impl Hash for MrSigner

source§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for MrSigner

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for MrSigner

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MrSigner

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MrSigner

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Zeroize for MrSigner

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
source§

impl Copy for MrSigner

source§

impl Eq for MrSigner

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/struct.QuotePolicy.html b/rust/oasis_core_runtime/common/sgx/struct.QuotePolicy.html new file mode 100644 index 0000000000..8da8f183ae --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/struct.QuotePolicy.html @@ -0,0 +1,34 @@ +QuotePolicy in oasis_core_runtime::common::sgx - Rust

Struct oasis_core_runtime::common::sgx::QuotePolicy

source ·
pub struct QuotePolicy {
+    pub ias: Option<QuotePolicy>,
+    pub pcs: Option<QuotePolicy>,
+}
Expand description

Quote validity policy.

+

Fields§

§ias: Option<QuotePolicy>§pcs: Option<QuotePolicy>

Trait Implementations§

source§

impl Clone for QuotePolicy

source§

fn clone(&self) -> QuotePolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QuotePolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for QuotePolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for QuotePolicy

source§

fn default() -> QuotePolicy

Returns the “default value” for a type. Read more
source§

impl Encode for QuotePolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for QuotePolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for QuotePolicy

source§

fn eq(&self, other: &QuotePolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for QuotePolicy

source§

impl StructuralPartialEq for QuotePolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sgx/struct.VerifiedQuote.html b/rust/oasis_core_runtime/common/sgx/struct.VerifiedQuote.html new file mode 100644 index 0000000000..e7908c0cac --- /dev/null +++ b/rust/oasis_core_runtime/common/sgx/struct.VerifiedQuote.html @@ -0,0 +1,27 @@ +VerifiedQuote in oasis_core_runtime::common::sgx - Rust

Struct oasis_core_runtime::common::sgx::VerifiedQuote

source ·
pub struct VerifiedQuote {
+    pub report_data: Vec<u8>,
+    pub identity: EnclaveIdentity,
+    pub timestamp: i64,
+}
Expand description

A remote attestation quote that has undergone verification.

+

Fields§

§report_data: Vec<u8>§identity: EnclaveIdentity§timestamp: i64

Trait Implementations§

source§

impl Clone for VerifiedQuote

source§

fn clone(&self) -> VerifiedQuote

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VerifiedQuote

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for VerifiedQuote

source§

fn default() -> VerifiedQuote

Returns the “default value” for a type. Read more
source§

impl From<VerifiedQuote> for VerifiedAttestation

source§

fn from(quote: VerifiedQuote) -> Self

Converts to this type from the input type.
source§

impl From<VerifiedQuote> for VerifiedEndorsedCapabilityTEE

source§

fn from(verified_quote: VerifiedQuote) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/sidebar-items.js b/rust/oasis_core_runtime/common/sidebar-items.js new file mode 100644 index 0000000000..7d102151cb --- /dev/null +++ b/rust/oasis_core_runtime/common/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["bytes","crypto","key_format","logger","namespace","panic","process","quantity","sgx","time","version","versioned"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/time/fn.insecure_posix_system_time.html b/rust/oasis_core_runtime/common/time/fn.insecure_posix_system_time.html new file mode 100644 index 0000000000..33b03e34c4 --- /dev/null +++ b/rust/oasis_core_runtime/common/time/fn.insecure_posix_system_time.html @@ -0,0 +1 @@ +insecure_posix_system_time in oasis_core_runtime::common::time - Rust
pub fn insecure_posix_system_time() -> SystemTime
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/time/fn.insecure_posix_time.html b/rust/oasis_core_runtime/common/time/fn.insecure_posix_time.html new file mode 100644 index 0000000000..b097f87844 --- /dev/null +++ b/rust/oasis_core_runtime/common/time/fn.insecure_posix_time.html @@ -0,0 +1,6 @@ +insecure_posix_time in oasis_core_runtime::common::time - Rust

Function oasis_core_runtime::common::time::insecure_posix_time

source ·
pub fn insecure_posix_time() -> i64
Expand description

Returns the number of seconds since the UNIX epoch. The time returned +is guaranteed to never decrease within each enclave instance (though it +may decrease iff the enclave is re-launched).

+

The returned timestamp MUST NOT be trusted on in any way, as the underlying +time source is reliant on the host operating system.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/time/index.html b/rust/oasis_core_runtime/common/time/index.html new file mode 100644 index 0000000000..10a2236055 --- /dev/null +++ b/rust/oasis_core_runtime/common/time/index.html @@ -0,0 +1,4 @@ +oasis_core_runtime::common::time - Rust

Module oasis_core_runtime::common::time

source ·
Expand description

Runtime time source.

+

Functions§

  • Returns the number of seconds since the UNIX epoch. The time returned +is guaranteed to never decrease within each enclave instance (though it +may decrease iff the enclave is re-launched).
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/time/sidebar-items.js b/rust/oasis_core_runtime/common/time/sidebar-items.js new file mode 100644 index 0000000000..79c1f25dcf --- /dev/null +++ b/rust/oasis_core_runtime/common/time/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["insecure_posix_system_time","insecure_posix_time"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/version/constant.PROTOCOL_VERSION.html b/rust/oasis_core_runtime/common/version/constant.PROTOCOL_VERSION.html new file mode 100644 index 0000000000..038f279a50 --- /dev/null +++ b/rust/oasis_core_runtime/common/version/constant.PROTOCOL_VERSION.html @@ -0,0 +1 @@ +PROTOCOL_VERSION in oasis_core_runtime::common::version - Rust

Constant oasis_core_runtime::common::version::PROTOCOL_VERSION

source ·
pub const PROTOCOL_VERSION: Version;
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/version/index.html b/rust/oasis_core_runtime/common/version/index.html new file mode 100644 index 0000000000..fe4b180fd5 --- /dev/null +++ b/rust/oasis_core_runtime/common/version/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::common::version - Rust

Module oasis_core_runtime::common::version

source ·
Expand description

Protocol and runtime versioning.

+

Structs§

Constants§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/version/sidebar-items.js b/rust/oasis_core_runtime/common/version/sidebar-items.js new file mode 100644 index 0000000000..38c48af42d --- /dev/null +++ b/rust/oasis_core_runtime/common/version/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["PROTOCOL_VERSION"],"struct":["ProtocolVersions","Version"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/version/struct.ProtocolVersions.html b/rust/oasis_core_runtime/common/version/struct.ProtocolVersions.html new file mode 100644 index 0000000000..feaefc73c0 --- /dev/null +++ b/rust/oasis_core_runtime/common/version/struct.ProtocolVersions.html @@ -0,0 +1,37 @@ +ProtocolVersions in oasis_core_runtime::common::version - Rust

Struct oasis_core_runtime::common::version::ProtocolVersions

source ·
pub struct ProtocolVersions {
+    pub consensus_protocol: Version,
+    pub runtime_host_protocol: Version,
+    pub runtime_committee_protocol: Version,
+}
Expand description

Protocol versions.

+

Fields§

§consensus_protocol: Version§runtime_host_protocol: Version§runtime_committee_protocol: Version

Trait Implementations§

source§

impl Clone for ProtocolVersions

source§

fn clone(&self) -> ProtocolVersions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProtocolVersions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ProtocolVersions

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ProtocolVersions

source§

fn default() -> ProtocolVersions

Returns the “default value” for a type. Read more
source§

impl Encode for ProtocolVersions

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ProtocolVersions

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ProtocolVersions

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ProtocolVersions

source§

fn eq(&self, other: &ProtocolVersions) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ProtocolVersions

source§

impl StructuralPartialEq for ProtocolVersions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/version/struct.Version.html b/rust/oasis_core_runtime/common/version/struct.Version.html new file mode 100644 index 0000000000..c6fa814211 --- /dev/null +++ b/rust/oasis_core_runtime/common/version/struct.Version.html @@ -0,0 +1,40 @@ +Version in oasis_core_runtime::common::version - Rust

Struct oasis_core_runtime::common::version::Version

source ·
pub struct Version {
+    pub major: u16,
+    pub minor: u16,
+    pub patch: u16,
+}
Expand description

A protocol or runtime version.

+

Fields§

§major: u16§minor: u16§patch: u16

Implementations§

source§

impl Version

source

pub const fn new(major: u16, minor: u16, patch: u16) -> Version

Creates a new version with given major, minor, and patch segments.

+
source

pub fn is_compatible_with(&self, other: &Version) -> bool

Checks if two versions are compatible.

+

Trait Implementations§

source§

impl Clone for Version

source§

fn clone(&self) -> Version

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Version

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Version

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Version

source§

fn default() -> Version

Returns the “default value” for a type. Read more
source§

impl Encode for Version

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Version

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<Version> for u64

source§

fn from(val: Version) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Version

source§

fn from(v: u64) -> Version

Converts to this type from the input type.
source§

impl Hash for Version

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Version

source§

fn eq(&self, other: &Version) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Version

source§

impl Eq for Version

source§

impl StructuralPartialEq for Version

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/versioned/constant.VERSION_KEY.html b/rust/oasis_core_runtime/common/versioned/constant.VERSION_KEY.html new file mode 100644 index 0000000000..6eb6e4e5f9 --- /dev/null +++ b/rust/oasis_core_runtime/common/versioned/constant.VERSION_KEY.html @@ -0,0 +1,2 @@ +VERSION_KEY in oasis_core_runtime::common::versioned - Rust

Constant oasis_core_runtime::common::versioned::VERSION_KEY

source ·
pub const VERSION_KEY: &str = "v";
Expand description

Version key used in serialized form.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/versioned/index.html b/rust/oasis_core_runtime/common/versioned/index.html new file mode 100644 index 0000000000..f1afec2bab --- /dev/null +++ b/rust/oasis_core_runtime/common/versioned/index.html @@ -0,0 +1 @@ +oasis_core_runtime::common::versioned - Rust

Module oasis_core_runtime::common::versioned

source ·

Structs§

  • A generic versioned serializable data structure.

Constants§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/common/versioned/sidebar-items.js b/rust/oasis_core_runtime/common/versioned/sidebar-items.js new file mode 100644 index 0000000000..c330519e13 --- /dev/null +++ b/rust/oasis_core_runtime/common/versioned/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["VERSION_KEY"],"struct":["Versioned"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/common/versioned/struct.Versioned.html b/rust/oasis_core_runtime/common/versioned/struct.Versioned.html new file mode 100644 index 0000000000..455cccd915 --- /dev/null +++ b/rust/oasis_core_runtime/common/versioned/struct.Versioned.html @@ -0,0 +1,42 @@ +Versioned in oasis_core_runtime::common::versioned - Rust

Struct oasis_core_runtime::common::versioned::Versioned

source ·
pub struct Versioned<T> {
+    pub version: u16,
+    pub inner: T,
+}
Expand description

A generic versioned serializable data structure.

+

Fields§

§version: u16§inner: T

Implementations§

source§

impl<T> Versioned<T>

source

pub fn new(version: u16, inner: T) -> Self

Create a new versioned structure.

+

Trait Implementations§

source§

impl<T: Clone> Clone for Versioned<T>

source§

fn clone(&self) -> Versioned<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Versioned<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Decode> Decode for Versioned<T>

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl<T: EncodeAsMap> Encode for Versioned<T>

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl<T: Hash> Hash for Versioned<T>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: PartialEq> PartialEq for Versioned<T>

source§

fn eq(&self, other: &Versioned<T>) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<T: Eq> Eq for Versioned<T>

source§

impl<T> StructuralPartialEq for Versioned<T>

Auto Trait Implementations§

§

impl<T> Freeze for Versioned<T>
where + T: Freeze,

§

impl<T> RefUnwindSafe for Versioned<T>
where + T: RefUnwindSafe,

§

impl<T> Send for Versioned<T>
where + T: Send,

§

impl<T> Sync for Versioned<T>
where + T: Sync,

§

impl<T> Unpin for Versioned<T>
where + T: Unpin,

§

impl<T> UnwindSafe for Versioned<T>
where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/config/index.html b/rust/oasis_core_runtime/config/index.html new file mode 100644 index 0000000000..612be64778 --- /dev/null +++ b/rust/oasis_core_runtime/config/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::config - Rust

Module oasis_core_runtime::config

source ·
Expand description

Runtime configuration.

+

Structs§

  • Global runtime configuration.
  • Storage-related configuration.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/config/sidebar-items.js b/rust/oasis_core_runtime/config/sidebar-items.js new file mode 100644 index 0000000000..410149582a --- /dev/null +++ b/rust/oasis_core_runtime/config/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Config","Storage"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/config/struct.Config.html b/rust/oasis_core_runtime/config/struct.Config.html new file mode 100644 index 0000000000..5c0a7cbb79 --- /dev/null +++ b/rust/oasis_core_runtime/config/struct.Config.html @@ -0,0 +1,35 @@ +Config in oasis_core_runtime::config - Rust

Struct oasis_core_runtime::config::Config

source ·
pub struct Config {
+    pub version: Version,
+    pub trust_root: Option<TrustRoot>,
+    pub storage: Storage,
+    pub features: Features,
+    pub persist_check_tx_state: bool,
+}
Expand description

Global runtime configuration.

+

Fields§

§version: Version

Semantic runtime version.

+
§trust_root: Option<TrustRoot>

Optional trust root for consensus layer integrity verification.

+
§storage: Storage

Storage configuration.

+
§features: Features

Advertised runtime features.

+
§persist_check_tx_state: bool

Whether storage state should be persisted between transaction check invocations. The state +is invalidated on the next round.

+

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Config

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/config/struct.Storage.html b/rust/oasis_core_runtime/config/struct.Storage.html new file mode 100644 index 0000000000..c9690505d4 --- /dev/null +++ b/rust/oasis_core_runtime/config/struct.Storage.html @@ -0,0 +1,30 @@ +Storage in oasis_core_runtime::config - Rust

Struct oasis_core_runtime::config::Storage

source ·
pub struct Storage {
+    pub cache_node_capacity: usize,
+    pub cache_value_capacity: usize,
+}
Expand description

Storage-related configuration.

+

Fields§

§cache_node_capacity: usize

The maximum number of tree nodes held by the cache before eviction. +A zero value denotes unlimited capacity.

+
§cache_value_capacity: usize

The total size, in bytes, of values held by the cache before eviction. +A zero value denotes unlimited capacity.

+

Trait Implementations§

source§

impl Clone for Storage

source§

fn clone(&self) -> Storage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Storage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Storage

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/address/index.html b/rust/oasis_core_runtime/consensus/address/index.html new file mode 100644 index 0000000000..f642c7b5d0 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/address/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::address - Rust

Module oasis_core_runtime::consensus::address

source ·
Expand description

Consensus account address structures.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/address/sidebar-items.js b/rust/oasis_core_runtime/consensus/address/sidebar-items.js new file mode 100644 index 0000000000..658627b2ef --- /dev/null +++ b/rust/oasis_core_runtime/consensus/address/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Address","COMMON_POOL_ADDRESS","FEE_ACC_ADDRESS","GOVERNANCE_DEPOSITS_ADDRESS"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/address/struct.Address.html b/rust/oasis_core_runtime/consensus/address/struct.Address.html new file mode 100644 index 0000000000..cc3065d124 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/address/struct.Address.html @@ -0,0 +1,49 @@ +Address in oasis_core_runtime::consensus::address - Rust

Struct oasis_core_runtime::consensus::address::Address

source ·
pub struct Address(/* private fields */);
Expand description

A staking account address.

+

Implementations§

source§

impl Address

source

pub fn new(ctx: &'static [u8], version: u8, data: &[u8]) -> Self

Creates a new address from a context, version and data.

+
source

pub fn from_pk(pk: &PublicKey) -> Self

Creates a new address from a public key.

+
source

pub fn from_runtime_id(id: &Namespace) -> Self

Creates a new runtime address.

+
source

pub fn from_bech32(data: &str) -> Result<Self>

Tries to create a new address from Bech32-encoded string.

+
source

pub fn to_bech32(&self) -> String

Converts an address to Bech32 representation.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Address

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Address

source§

fn clone(&self) -> Address

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Address

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Address

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Address

source§

fn default() -> Address

Returns the “default value” for a type. Read more
source§

impl Encode for Address

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&[u8; 21]> for Address

source§

fn from(b: &[u8; 21]) -> Address

Converts to this type from the input type.
source§

impl<'a> From<&'a str> for Address

source§

fn from(s: &'a str) -> Address

Converts to this type from the input type.
source§

impl From<Address> for [u8; 21]

source§

fn from(val: Address) -> Self

Converts to this type from the input type.
source§

impl Hash for Address

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl KeyFormatAtom for Address

source§

fn size() -> usize

source§

fn encode_atom(self) -> Vec<u8>

source§

fn decode_atom(data: &[u8]) -> Self
where + Self: Sized,

source§

impl LowerHex for Address

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Address

source§

fn cmp(&self, other: &Address) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Address

source§

fn eq(&self, other: &Address) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Address

source§

fn partial_cmp(&self, other: &Address) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for Address

source§

impl StructuralPartialEq for Address

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/address/struct.COMMON_POOL_ADDRESS.html b/rust/oasis_core_runtime/consensus/address/struct.COMMON_POOL_ADDRESS.html new file mode 100644 index 0000000000..88e643b1f8 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/address/struct.COMMON_POOL_ADDRESS.html @@ -0,0 +1,22 @@ +COMMON_POOL_ADDRESS in oasis_core_runtime::consensus::address - Rust
pub struct COMMON_POOL_ADDRESS { /* private fields */ }
Expand description

Common pool reserved address.

+

Methods from Deref<Target = Address>§

source

pub fn to_bech32(&self) -> String

Converts an address to Bech32 representation.

+

Trait Implementations§

source§

impl Deref for COMMON_POOL_ADDRESS

§

type Target = Address

The resulting type after dereferencing.
source§

fn deref(&self) -> &Address

Dereferences the value.
source§

impl LazyStatic for COMMON_POOL_ADDRESS

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/address/struct.FEE_ACC_ADDRESS.html b/rust/oasis_core_runtime/consensus/address/struct.FEE_ACC_ADDRESS.html new file mode 100644 index 0000000000..480ed192f3 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/address/struct.FEE_ACC_ADDRESS.html @@ -0,0 +1,22 @@ +FEE_ACC_ADDRESS in oasis_core_runtime::consensus::address - Rust
pub struct FEE_ACC_ADDRESS { /* private fields */ }
Expand description

Per-block fee accumulator reserved address.

+

Methods from Deref<Target = Address>§

source

pub fn to_bech32(&self) -> String

Converts an address to Bech32 representation.

+

Trait Implementations§

source§

impl Deref for FEE_ACC_ADDRESS

§

type Target = Address

The resulting type after dereferencing.
source§

fn deref(&self) -> &Address

Dereferences the value.
source§

impl LazyStatic for FEE_ACC_ADDRESS

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/address/struct.GOVERNANCE_DEPOSITS_ADDRESS.html b/rust/oasis_core_runtime/consensus/address/struct.GOVERNANCE_DEPOSITS_ADDRESS.html new file mode 100644 index 0000000000..fb6708bae8 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/address/struct.GOVERNANCE_DEPOSITS_ADDRESS.html @@ -0,0 +1,22 @@ +GOVERNANCE_DEPOSITS_ADDRESS in oasis_core_runtime::consensus::address - Rust
pub struct GOVERNANCE_DEPOSITS_ADDRESS { /* private fields */ }
Expand description

Governance deposits reserved address.

+

Methods from Deref<Target = Address>§

source

pub fn to_bech32(&self) -> String

Converts an address to Bech32 representation.

+

Trait Implementations§

source§

impl Deref for GOVERNANCE_DEPOSITS_ADDRESS

§

type Target = Address

The resulting type after dereferencing.
source§

fn deref(&self) -> &Address

Dereferences the value.
source§

impl LazyStatic for GOVERNANCE_DEPOSITS_ADDRESS

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/beacon/constant.EPOCH_INVALID.html b/rust/oasis_core_runtime/consensus/beacon/constant.EPOCH_INVALID.html new file mode 100644 index 0000000000..a60012fa61 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/beacon/constant.EPOCH_INVALID.html @@ -0,0 +1,2 @@ +EPOCH_INVALID in oasis_core_runtime::consensus::beacon - Rust

Constant oasis_core_runtime::consensus::beacon::EPOCH_INVALID

source ·
pub const EPOCH_INVALID: EpochTime = 0xffffffffffffffff;
Expand description

An invalid epoch time.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/beacon/index.html b/rust/oasis_core_runtime/consensus/beacon/index.html new file mode 100644 index 0000000000..88132b8523 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/beacon/index.html @@ -0,0 +1 @@ +oasis_core_runtime::consensus::beacon - Rust

Module oasis_core_runtime::consensus::beacon

source ·

Structs§

Constants§

Type Aliases§

  • The number of intervals (epochs) since a fixed instant in time/block height (epoch date/height).
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/beacon/sidebar-items.js b/rust/oasis_core_runtime/consensus/beacon/sidebar-items.js new file mode 100644 index 0000000000..eb0c7b5acf --- /dev/null +++ b/rust/oasis_core_runtime/consensus/beacon/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["EPOCH_INVALID"],"struct":["EpochTimeState"],"type":["EpochTime"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/beacon/struct.EpochTimeState.html b/rust/oasis_core_runtime/consensus/beacon/struct.EpochTimeState.html new file mode 100644 index 0000000000..71f1221d2f --- /dev/null +++ b/rust/oasis_core_runtime/consensus/beacon/struct.EpochTimeState.html @@ -0,0 +1,36 @@ +EpochTimeState in oasis_core_runtime::consensus::beacon - Rust

Struct oasis_core_runtime::consensus::beacon::EpochTimeState

source ·
pub struct EpochTimeState {
+    pub epoch: EpochTime,
+    pub height: i64,
+}
Expand description

The epoch state.

+

Fields§

§epoch: EpochTime§height: i64

Trait Implementations§

source§

impl Clone for EpochTimeState

source§

fn clone(&self) -> EpochTimeState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EpochTimeState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EpochTimeState

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EpochTimeState

source§

fn default() -> EpochTimeState

Returns the “default value” for a type. Read more
source§

impl Encode for EpochTimeState

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EpochTimeState

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EpochTimeState

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EpochTimeState

source§

fn eq(&self, other: &EpochTimeState) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EpochTimeState

source§

impl StructuralPartialEq for EpochTimeState

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/beacon/type.EpochTime.html b/rust/oasis_core_runtime/consensus/beacon/type.EpochTime.html new file mode 100644 index 0000000000..ba7fe8d6e4 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/beacon/type.EpochTime.html @@ -0,0 +1,2 @@ +EpochTime in oasis_core_runtime::consensus::beacon - Rust

Type Alias oasis_core_runtime::consensus::beacon::EpochTime

source ·
pub type EpochTime = u64;
Expand description

The number of intervals (epochs) since a fixed instant in time/block height (epoch date/height).

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/constant.HEIGHT_LATEST.html b/rust/oasis_core_runtime/consensus/constant.HEIGHT_LATEST.html new file mode 100644 index 0000000000..aabcd866b4 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/constant.HEIGHT_LATEST.html @@ -0,0 +1,2 @@ +HEIGHT_LATEST in oasis_core_runtime::consensus - Rust

Constant oasis_core_runtime::consensus::HEIGHT_LATEST

source ·
pub const HEIGHT_LATEST: u64 = 0;
Expand description

The height that represents the most recent block height.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/constant.METHOD_META.html b/rust/oasis_core_runtime/consensus/constant.METHOD_META.html new file mode 100644 index 0000000000..ebbbe6a35d --- /dev/null +++ b/rust/oasis_core_runtime/consensus/constant.METHOD_META.html @@ -0,0 +1 @@ +METHOD_META in oasis_core_runtime::consensus - Rust

Constant oasis_core_runtime::consensus::METHOD_META

source ·
pub const METHOD_META: &str = "consensus.Meta";
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/constant.MODULE_NAME.html b/rust/oasis_core_runtime/consensus/constant.MODULE_NAME.html new file mode 100644 index 0000000000..18e3860dbd --- /dev/null +++ b/rust/oasis_core_runtime/consensus/constant.MODULE_NAME.html @@ -0,0 +1,2 @@ +MODULE_NAME in oasis_core_runtime::consensus - Rust

Constant oasis_core_runtime::consensus::MODULE_NAME

source ·
pub const MODULE_NAME: &str = "consensus";
Expand description

A unique module name for the consensus module.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/enum.Event.html b/rust/oasis_core_runtime/consensus/enum.Event.html new file mode 100644 index 0000000000..f65a6d4af4 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/enum.Event.html @@ -0,0 +1,30 @@ +Event in oasis_core_runtime::consensus - Rust

Enum oasis_core_runtime::consensus::Event

source ·
pub enum Event {
+    Staking(Event),
+}
Expand description

An event emitted by the consensus layer.

+

Variants§

§

Staking(Event)

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Event

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Event

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/enum.Vote.html b/rust/oasis_core_runtime/consensus/governance/enum.Vote.html new file mode 100644 index 0000000000..4c698556a1 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/enum.Vote.html @@ -0,0 +1,48 @@ +Vote in oasis_core_runtime::consensus::governance - Rust

Enum oasis_core_runtime::consensus::governance::Vote

source ·
#[repr(u8)]
pub enum Vote { + Invalid = 0, + Yes = 1, + No = 2, + Abstain = 3, +}
Expand description

A governance vote.

+

Variants§

§

Invalid = 0

Invalid vote that should never be explicitly set.

+
§

Yes = 1

Yes Vote.

+
§

No = 2

No vote.

+
§

Abstain = 3

Abstained.

+

Trait Implementations§

source§

impl Clone for Vote

source§

fn clone(&self) -> Vote

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Vote

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Vote

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Vote

source§

fn default() -> Vote

Returns the “default value” for a type. Read more
source§

impl Encode for Vote

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for Vote

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Vote

source§

fn cmp(&self, other: &Vote) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Vote

source§

fn eq(&self, other: &Vote) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Vote

source§

fn partial_cmp(&self, other: &Vote) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for Vote

source§

impl StructuralPartialEq for Vote

Auto Trait Implementations§

§

impl Freeze for Vote

§

impl RefUnwindSafe for Vote

§

impl Send for Vote

§

impl Sync for Vote

§

impl Unpin for Vote

§

impl UnwindSafe for Vote

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/index.html b/rust/oasis_core_runtime/consensus/governance/index.html new file mode 100644 index 0000000000..e7662c2906 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/index.html @@ -0,0 +1,4 @@ +oasis_core_runtime::consensus::governance - Rust

Module oasis_core_runtime::consensus::governance

source ·
Expand description

Governance structures.

+

§Note

+

This MUST be kept in sync with go/governance/api.

+

Structs§

Enums§

  • A governance vote.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/sidebar-items.js b/rust/oasis_core_runtime/consensus/governance/sidebar-items.js new file mode 100644 index 0000000000..51423da269 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Vote"],"struct":["CancelUpgradeProposal","ChangeParametersProposal","ConsensusParameterChanges","ProposalContent","ProposalVote","UpgradeProposal"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/struct.CancelUpgradeProposal.html b/rust/oasis_core_runtime/consensus/governance/struct.CancelUpgradeProposal.html new file mode 100644 index 0000000000..6d9e3b9e69 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/struct.CancelUpgradeProposal.html @@ -0,0 +1,35 @@ +CancelUpgradeProposal in oasis_core_runtime::consensus::governance - Rust
pub struct CancelUpgradeProposal {
+    pub proposal_id: u64,
+}
Expand description

Cancel proposal content.

+

Fields§

§proposal_id: u64

Trait Implementations§

source§

impl Clone for CancelUpgradeProposal

source§

fn clone(&self) -> CancelUpgradeProposal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CancelUpgradeProposal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CancelUpgradeProposal

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CancelUpgradeProposal

source§

fn default() -> CancelUpgradeProposal

Returns the “default value” for a type. Read more
source§

impl Encode for CancelUpgradeProposal

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CancelUpgradeProposal

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for CancelUpgradeProposal

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for CancelUpgradeProposal

source§

fn eq(&self, other: &CancelUpgradeProposal) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CancelUpgradeProposal

source§

impl StructuralPartialEq for CancelUpgradeProposal

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/struct.ChangeParametersProposal.html b/rust/oasis_core_runtime/consensus/governance/struct.ChangeParametersProposal.html new file mode 100644 index 0000000000..d248242021 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/struct.ChangeParametersProposal.html @@ -0,0 +1,34 @@ +ChangeParametersProposal in oasis_core_runtime::consensus::governance - Rust
pub struct ChangeParametersProposal {
+    pub module: String,
+    pub changes: Option<Value>,
+}
Expand description

Change parameters proposal content.

+

Fields§

§module: String§changes: Option<Value>

Trait Implementations§

source§

impl Clone for ChangeParametersProposal

source§

fn clone(&self) -> ChangeParametersProposal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChangeParametersProposal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ChangeParametersProposal

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ChangeParametersProposal

source§

fn default() -> ChangeParametersProposal

Returns the “default value” for a type. Read more
source§

impl Encode for ChangeParametersProposal

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ChangeParametersProposal

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for ChangeParametersProposal

source§

fn eq(&self, other: &ChangeParametersProposal) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ChangeParametersProposal

source§

impl StructuralPartialEq for ChangeParametersProposal

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/struct.ConsensusParameterChanges.html b/rust/oasis_core_runtime/consensus/governance/struct.ConsensusParameterChanges.html new file mode 100644 index 0000000000..3a83e6bbf9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/struct.ConsensusParameterChanges.html @@ -0,0 +1,40 @@ +ConsensusParameterChanges in oasis_core_runtime::consensus::governance - Rust
pub struct ConsensusParameterChanges {
+    pub gas_costs: BTreeMap<String, u64>,
+    pub min_proposal_deposit: Option<Quantity>,
+    pub voting_period: Option<EpochTime>,
+    pub stake_threshold: Option<u8>,
+    pub upgrade_min_epoch_diff: Option<EpochTime>,
+    pub upgrade_cancel_min_epoch_diff: Option<EpochTime>,
+    pub enable_change_parameters_proposal: Option<bool>,
+}

Fields§

§gas_costs: BTreeMap<String, u64>§min_proposal_deposit: Option<Quantity>§voting_period: Option<EpochTime>§stake_threshold: Option<u8>§upgrade_min_epoch_diff: Option<EpochTime>§upgrade_cancel_min_epoch_diff: Option<EpochTime>§enable_change_parameters_proposal: Option<bool>

Trait Implementations§

source§

impl Clone for ConsensusParameterChanges

source§

fn clone(&self) -> ConsensusParameterChanges

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusParameterChanges

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusParameterChanges

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusParameterChanges

source§

fn default() -> ConsensusParameterChanges

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusParameterChanges

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusParameterChanges

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ConsensusParameterChanges

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ConsensusParameterChanges

source§

fn eq(&self, other: &ConsensusParameterChanges) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ConsensusParameterChanges

source§

impl StructuralPartialEq for ConsensusParameterChanges

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/struct.ProposalContent.html b/rust/oasis_core_runtime/consensus/governance/struct.ProposalContent.html new file mode 100644 index 0000000000..77c6bff02c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/struct.ProposalContent.html @@ -0,0 +1,35 @@ +ProposalContent in oasis_core_runtime::consensus::governance - Rust
pub struct ProposalContent {
+    pub upgrade: Option<UpgradeProposal>,
+    pub cancel_upgrade: Option<CancelUpgradeProposal>,
+    pub change_parameters: Option<ChangeParametersProposal>,
+}
Expand description

Consensus layer governance proposal content.

+

Fields§

§upgrade: Option<UpgradeProposal>§cancel_upgrade: Option<CancelUpgradeProposal>§change_parameters: Option<ChangeParametersProposal>

Trait Implementations§

source§

impl Clone for ProposalContent

source§

fn clone(&self) -> ProposalContent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProposalContent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ProposalContent

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ProposalContent

source§

fn default() -> ProposalContent

Returns the “default value” for a type. Read more
source§

impl Encode for ProposalContent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ProposalContent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for ProposalContent

source§

fn eq(&self, other: &ProposalContent) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ProposalContent

source§

impl StructuralPartialEq for ProposalContent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/struct.ProposalVote.html b/rust/oasis_core_runtime/consensus/governance/struct.ProposalVote.html new file mode 100644 index 0000000000..c99996eeb1 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/struct.ProposalVote.html @@ -0,0 +1,38 @@ +ProposalVote in oasis_core_runtime::consensus::governance - Rust
pub struct ProposalVote {
+    pub id: u64,
+    pub vote: Vote,
+}
Expand description

Vote for a proposal.

+

Fields§

§id: u64

Unique identifier of a proposal.

+
§vote: Vote

Proposal vote.

+

Trait Implementations§

source§

impl Clone for ProposalVote

source§

fn clone(&self) -> ProposalVote

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProposalVote

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ProposalVote

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ProposalVote

source§

fn default() -> ProposalVote

Returns the “default value” for a type. Read more
source§

impl Encode for ProposalVote

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ProposalVote

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ProposalVote

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ProposalVote

source§

fn eq(&self, other: &ProposalVote) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ProposalVote

source§

impl StructuralPartialEq for ProposalVote

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/governance/struct.UpgradeProposal.html b/rust/oasis_core_runtime/consensus/governance/struct.UpgradeProposal.html new file mode 100644 index 0000000000..283fe68277 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/governance/struct.UpgradeProposal.html @@ -0,0 +1,38 @@ +UpgradeProposal in oasis_core_runtime::consensus::governance - Rust
pub struct UpgradeProposal {
+    pub v: u16,
+    pub handler: String,
+    pub target: ProtocolVersions,
+    pub epoch: EpochTime,
+}
Expand description

Upgrade proposal content.

+

Fields§

§v: u16§handler: String§target: ProtocolVersions§epoch: EpochTime

Trait Implementations§

source§

impl Clone for UpgradeProposal

source§

fn clone(&self) -> UpgradeProposal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UpgradeProposal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for UpgradeProposal

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for UpgradeProposal

source§

fn default() -> UpgradeProposal

Returns the “default value” for a type. Read more
source§

impl Encode for UpgradeProposal

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for UpgradeProposal

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for UpgradeProposal

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for UpgradeProposal

source§

fn eq(&self, other: &UpgradeProposal) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for UpgradeProposal

source§

impl StructuralPartialEq for UpgradeProposal

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/index.html b/rust/oasis_core_runtime/consensus/index.html new file mode 100644 index 0000000000..61c8dab460 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus - Rust

Module oasis_core_runtime::consensus

source ·
Expand description

Consensus service interfaces.

+

Modules§

Structs§

  • BlockMetadata contains additional metadata related to the executing block.
  • Light consensus block.

Enums§

  • An event emitted by the consensus layer.

Constants§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/churp/enum.Error.html b/rust/oasis_core_runtime/consensus/keymanager/churp/enum.Error.html new file mode 100644 index 0000000000..9318c075bb --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/churp/enum.Error.html @@ -0,0 +1,24 @@ +Error in oasis_core_runtime::consensus::keymanager::churp - Rust

Enum oasis_core_runtime::consensus::keymanager::churp::Error

source ·
pub enum Error {
+    InvalidSignature,
+}
Expand description

Errors emitted by the CHURP module.

+

Variants§

§

InvalidSignature

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/churp/enum.SuiteId.html b/rust/oasis_core_runtime/consensus/keymanager/churp/enum.SuiteId.html new file mode 100644 index 0000000000..45834d45ec --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/churp/enum.SuiteId.html @@ -0,0 +1,35 @@ +SuiteId in oasis_core_runtime::consensus::keymanager::churp - Rust
#[repr(u8)]
pub enum SuiteId { + NistP384Sha3_384 = 0, +}
Expand description

Cipher suite identifier.

+

Variants§

§

NistP384Sha3_384 = 0

The NIST P-384 elliptic curve group with the SHA3-384 hash function +used to encode arbitrary-length byte strings to elements of the +underlying prime field or elliptic curve points.

+

Trait Implementations§

source§

impl Clone for SuiteId

source§

fn clone(&self) -> SuiteId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SuiteId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SuiteId

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SuiteId

source§

fn default() -> SuiteId

Returns the “default value” for a type. Read more
source§

impl Encode for SuiteId

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for SuiteId

source§

fn eq(&self, other: &SuiteId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SuiteId

source§

impl StructuralPartialEq for SuiteId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/churp/index.html b/rust/oasis_core_runtime/consensus/keymanager/churp/index.html new file mode 100644 index 0000000000..12a6ca71d9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/churp/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::keymanager::churp - Rust

Module oasis_core_runtime::consensus::keymanager::churp

source ·
Expand description

Key manager state in the consensus layer.

+

Structs§

  • Application represents a node’s application to form a new committee.
  • Key manager access control policy.
  • Signed key manager access control policy.
  • Status represents the current state of a CHURP instance.

Enums§

  • Errors emitted by the CHURP module.
  • Cipher suite identifier.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/churp/sidebar-items.js b/rust/oasis_core_runtime/consensus/keymanager/churp/sidebar-items.js new file mode 100644 index 0000000000..fd2afad483 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/churp/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","SuiteId"],"struct":["Application","PolicySGX","SignedPolicySGX","Status"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/churp/struct.Application.html b/rust/oasis_core_runtime/consensus/keymanager/churp/struct.Application.html new file mode 100644 index 0000000000..4cf4e5fee6 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/churp/struct.Application.html @@ -0,0 +1,39 @@ +Application in oasis_core_runtime::consensus::keymanager::churp - Rust
pub struct Application {
+    pub checksum: Hash,
+    pub reconstructed: bool,
+}
Expand description

Application represents a node’s application to form a new committee.

+

Fields§

§checksum: Hash

The hash of the random verification matrix.

+

In all handoffs, except in the dealer phase, the verification matrix +needs to be zero-hole.

+
§reconstructed: bool

Reconstructed is true if and only if the node verified all matrices +and successfully reconstructed its share during the handoff.

+

Trait Implementations§

source§

impl Clone for Application

source§

fn clone(&self) -> Application

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Application

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Application

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Application

source§

fn default() -> Application

Returns the “default value” for a type. Read more
source§

impl Encode for Application

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Application

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Application

source§

fn eq(&self, other: &Application) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Application

source§

impl StructuralPartialEq for Application

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/churp/struct.PolicySGX.html b/rust/oasis_core_runtime/consensus/keymanager/churp/struct.PolicySGX.html new file mode 100644 index 0000000000..9879f5e318 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/churp/struct.PolicySGX.html @@ -0,0 +1,47 @@ +PolicySGX in oasis_core_runtime::consensus::keymanager::churp - Rust

Struct oasis_core_runtime::consensus::keymanager::churp::PolicySGX

source ·
pub struct PolicySGX {
+    pub id: u8,
+    pub runtime_id: Namespace,
+    pub serial: u32,
+    pub may_share: Vec<EnclaveIdentity>,
+    pub may_join: Vec<EnclaveIdentity>,
+    pub may_query: HashMap<Namespace, Vec<EnclaveIdentity>>,
+}
Expand description

Key manager access control policy.

+

Fields§

§id: u8

A unique identifier within the key manager runtime.

+
§runtime_id: Namespace

The identifier of the key manager runtime.

+
§serial: u32

A monotonically increasing policy serial number.

+
§may_share: Vec<EnclaveIdentity>

A vector of enclave identities from which a share can be obtained +during handoffs.

+
§may_join: Vec<EnclaveIdentity>

A vector of enclave identities that may form the new committee +in the next handoffs.

+
§may_query: HashMap<Namespace, Vec<EnclaveIdentity>>

A map of runtime identities to the vector of enclave identities +that may query key shares.

+

Trait Implementations§

source§

impl Clone for PolicySGX

source§

fn clone(&self) -> PolicySGX

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PolicySGX

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PolicySGX

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for PolicySGX

source§

fn default() -> PolicySGX

Returns the “default value” for a type. Read more
source§

impl Encode for PolicySGX

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for PolicySGX

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for PolicySGX

source§

fn eq(&self, other: &PolicySGX) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for PolicySGX

source§

impl StructuralPartialEq for PolicySGX

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/churp/struct.SignedPolicySGX.html b/rust/oasis_core_runtime/consensus/keymanager/churp/struct.SignedPolicySGX.html new file mode 100644 index 0000000000..188cdfbb04 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/churp/struct.SignedPolicySGX.html @@ -0,0 +1,37 @@ +SignedPolicySGX in oasis_core_runtime::consensus::keymanager::churp - Rust
pub struct SignedPolicySGX {
+    pub policy: PolicySGX,
+    pub signatures: Vec<SignatureBundle>,
+}
Expand description

Signed key manager access control policy.

+

Fields§

§policy: PolicySGX

An SGX access control policy.

+
§signatures: Vec<SignatureBundle>

A vector of signatures.

+

Implementations§

source§

impl SignedPolicySGX

source

pub fn verify(&self) -> Result<&PolicySGX>

Verify the signatures.

+

Trait Implementations§

source§

impl Clone for SignedPolicySGX

source§

fn clone(&self) -> SignedPolicySGX

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SignedPolicySGX

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignedPolicySGX

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SignedPolicySGX

source§

fn default() -> SignedPolicySGX

Returns the “default value” for a type. Read more
source§

impl Encode for SignedPolicySGX

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SignedPolicySGX

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for SignedPolicySGX

source§

fn eq(&self, other: &SignedPolicySGX) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SignedPolicySGX

source§

impl StructuralPartialEq for SignedPolicySGX

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/churp/struct.Status.html b/rust/oasis_core_runtime/consensus/keymanager/churp/struct.Status.html new file mode 100644 index 0000000000..ce64dcbbf7 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/churp/struct.Status.html @@ -0,0 +1,85 @@ +Status in oasis_core_runtime::consensus::keymanager::churp - Rust

Struct oasis_core_runtime::consensus::keymanager::churp::Status

source ·
pub struct Status {
Show 13 fields + pub id: u8, + pub runtime_id: Namespace, + pub suite_id: SuiteId, + pub threshold: u8, + pub extra_shares: u8, + pub handoff_interval: EpochTime, + pub policy: SignedPolicySGX, + pub handoff: EpochTime, + pub checksum: Option<Hash>, + pub committee: Vec<PublicKey>, + pub next_handoff: EpochTime, + pub next_checksum: Option<Hash>, + pub applications: HashMap<PublicKey, Application>, +
}
Expand description

Status represents the current state of a CHURP instance.

+

Fields§

§id: u8

A unique identifier within the key manager runtime.

+
§runtime_id: Namespace

The identifier of the key manager runtime.

+
§suite_id: SuiteId

The identifier of a cipher suite used for verifiable secret sharing +and key derivation.

+
§threshold: u8

The degree of the secret-sharing polynomial.

+

In a (t,n) secret-sharing scheme, where t represents the threshold, +any combination of t+1 or more shares can reconstruct the secret, +while losing n-t or fewer shares still allows the secret to be +recovered.

+
§extra_shares: u8

The minimum number of shares that can be lost to render the secret +unrecoverable.

+

If t and e represent the threshold and extra shares, respectively, +then the minimum size of the committee is t+e+1.

+
§handoff_interval: EpochTime

The time interval in epochs between handoffs.

+

A zero value disables handoffs.

+
§policy: SignedPolicySGX

A signed SGX access control policy.

+
§handoff: EpochTime

The epoch of the last successfully completed handoff.

+

The zero value indicates that no handoffs have been completed so far. +Note that the first handoff is special and is called the dealer phase, +in which nodes do not reshare or randomize shares but instead construct +the secret and shares.

+
§checksum: Option<Hash>

The hash of the verification matrix from the last successfully completed +handoff.

+
§committee: Vec<PublicKey>

A vector of nodes holding a share of the secret in the active handoff.

+

A client needs to obtain more than a threshold number of key shares +from the nodes in this vector to construct the key.

+
§next_handoff: EpochTime

The epoch in which the next handoff will occur.

+

If an insufficient number of applications is received, the next handoff +will be delayed by one epoch.

+
§next_checksum: Option<Hash>

The hash of the verification matrix from the current handoff.

+

The first candidate to confirm share reconstruction is the source +of truth for the checksum. All other candidates need to confirm +with the same checksum; otherwise, the applications will be annulled, +and the nodes will need to apply for the new committee again.

+
§applications: HashMap<PublicKey, Application>

A map of nodes that wish to form the new committee.

+

Candidates are expected to generate a random bivariate polynomial, +construct a verification matrix, compute its checksum, and submit +an application one epoch in advance of the next scheduled handoff. +Subsequently, upon the arrival of the handoff epoch, nodes must execute +the handoff protocol and confirm the reconstruction of its share.

+

Trait Implementations§

source§

impl Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Status

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Status

source§

fn default() -> Status

Returns the “default value” for a type. Read more
source§

impl Encode for Status

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Status

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Status

source§

fn eq(&self, other: &Status) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Status

source§

impl StructuralPartialEq for Status

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/enum.Error.html b/rust/oasis_core_runtime/consensus/keymanager/enum.Error.html new file mode 100644 index 0000000000..1b5c0ae4fb --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/enum.Error.html @@ -0,0 +1,24 @@ +Error in oasis_core_runtime::consensus::keymanager - Rust

Enum oasis_core_runtime::consensus::keymanager::Error

source ·
pub enum Error {
+    InvalidSignature,
+}
Expand description

Errors emitted by the key manager module.

+

Variants§

§

InvalidSignature

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/index.html b/rust/oasis_core_runtime/consensus/keymanager/index.html new file mode 100644 index 0000000000..7555c942cf --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/index.html @@ -0,0 +1 @@ +oasis_core_runtime::consensus::keymanager - Rust

Module oasis_core_runtime::consensus::keymanager

source ·

Modules§

  • Key manager state in the consensus layer.

Structs§

Enums§

  • Errors emitted by the key manager module.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/sidebar-items.js b/rust/oasis_core_runtime/consensus/keymanager/sidebar-items.js new file mode 100644 index 0000000000..4229097906 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"mod":["churp"],"struct":["EnclavePolicySGX","EncryptedEphemeralSecret","EncryptedMasterSecret","EncryptedSecret","PolicySGX","SignedEncryptedEphemeralSecret","SignedEncryptedMasterSecret","SignedPolicySGX"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/struct.EnclavePolicySGX.html b/rust/oasis_core_runtime/consensus/keymanager/struct.EnclavePolicySGX.html new file mode 100644 index 0000000000..3290681e99 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/struct.EnclavePolicySGX.html @@ -0,0 +1,39 @@ +EnclavePolicySGX in oasis_core_runtime::consensus::keymanager - Rust
pub struct EnclavePolicySGX {
+    pub may_query: HashMap<Namespace, Vec<EnclaveIdentity>>,
+    pub may_replicate: Vec<EnclaveIdentity>,
+}
Expand description

Per enclave key manager access control policy.

+

Fields§

§may_query: HashMap<Namespace, Vec<EnclaveIdentity>>

A map of runtime IDs to the vector of enclave IDs that may query +private key material.

+
§may_replicate: Vec<EnclaveIdentity>

A vector of enclave IDs that may retrieve the master secret.

+

NOTE: Each enclave ID may always implicitly replicate from other +instances of itself.

+

Trait Implementations§

source§

impl Clone for EnclavePolicySGX

source§

fn clone(&self) -> EnclavePolicySGX

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EnclavePolicySGX

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EnclavePolicySGX

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EnclavePolicySGX

source§

fn default() -> EnclavePolicySGX

Returns the “default value” for a type. Read more
source§

impl Encode for EnclavePolicySGX

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EnclavePolicySGX

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for EnclavePolicySGX

source§

fn eq(&self, other: &EnclavePolicySGX) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EnclavePolicySGX

source§

impl StructuralPartialEq for EnclavePolicySGX

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedEphemeralSecret.html b/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedEphemeralSecret.html new file mode 100644 index 0000000000..50d82d02cf --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedEphemeralSecret.html @@ -0,0 +1,38 @@ +EncryptedEphemeralSecret in oasis_core_runtime::consensus::keymanager - Rust
pub struct EncryptedEphemeralSecret {
+    pub runtime_id: Namespace,
+    pub epoch: EpochTime,
+    pub secret: EncryptedSecret,
+}
Expand description

Encrypted ephemeral secret.

+

Fields§

§runtime_id: Namespace

Runtime ID of the key manager.

+
§epoch: EpochTime

Epoch time to which the ephemeral secret belongs.

+
§secret: EncryptedSecret

Encrypted secret.

+

Trait Implementations§

source§

impl Clone for EncryptedEphemeralSecret

source§

fn clone(&self) -> EncryptedEphemeralSecret

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EncryptedEphemeralSecret

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EncryptedEphemeralSecret

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EncryptedEphemeralSecret

source§

fn default() -> EncryptedEphemeralSecret

Returns the “default value” for a type. Read more
source§

impl Encode for EncryptedEphemeralSecret

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EncryptedEphemeralSecret

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for EncryptedEphemeralSecret

source§

fn eq(&self, other: &EncryptedEphemeralSecret) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EncryptedEphemeralSecret

source§

impl StructuralPartialEq for EncryptedEphemeralSecret

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedMasterSecret.html b/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedMasterSecret.html new file mode 100644 index 0000000000..a490e539ff --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedMasterSecret.html @@ -0,0 +1,40 @@ +EncryptedMasterSecret in oasis_core_runtime::consensus::keymanager - Rust
pub struct EncryptedMasterSecret {
+    pub runtime_id: Namespace,
+    pub generation: u64,
+    pub epoch: EpochTime,
+    pub secret: EncryptedSecret,
+}
Expand description

Encrypted master secret.

+

Fields§

§runtime_id: Namespace

Runtime ID of the key manager.

+
§generation: u64

Generation of the secret.

+
§epoch: EpochTime

Epoch time in which the secret was created.

+
§secret: EncryptedSecret

Encrypted secret.

+

Trait Implementations§

source§

impl Clone for EncryptedMasterSecret

source§

fn clone(&self) -> EncryptedMasterSecret

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EncryptedMasterSecret

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EncryptedMasterSecret

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EncryptedMasterSecret

source§

fn default() -> EncryptedMasterSecret

Returns the “default value” for a type. Read more
source§

impl Encode for EncryptedMasterSecret

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EncryptedMasterSecret

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for EncryptedMasterSecret

source§

fn eq(&self, other: &EncryptedMasterSecret) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EncryptedMasterSecret

source§

impl StructuralPartialEq for EncryptedMasterSecret

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedSecret.html b/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedSecret.html new file mode 100644 index 0000000000..690092813b --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/struct.EncryptedSecret.html @@ -0,0 +1,38 @@ +EncryptedSecret in oasis_core_runtime::consensus::keymanager - Rust
pub struct EncryptedSecret {
+    pub checksum: Vec<u8>,
+    pub pub_key: PublicKey,
+    pub ciphertexts: HashMap<PublicKey, Vec<u8>>,
+}
Expand description

A secret encrypted with Deoxys-II MRAE algorithm.

+

Fields§

§checksum: Vec<u8>

Checksum for validating decrypted secret.

+
§pub_key: PublicKey

Public key to derive the symmetric key for decryption.

+
§ciphertexts: HashMap<PublicKey, Vec<u8>>

A map of REK encrypted secrets.

+

Trait Implementations§

source§

impl Clone for EncryptedSecret

source§

fn clone(&self) -> EncryptedSecret

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EncryptedSecret

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EncryptedSecret

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EncryptedSecret

source§

fn default() -> EncryptedSecret

Returns the “default value” for a type. Read more
source§

impl Encode for EncryptedSecret

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EncryptedSecret

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for EncryptedSecret

source§

fn eq(&self, other: &EncryptedSecret) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EncryptedSecret

source§

impl StructuralPartialEq for EncryptedSecret

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/struct.PolicySGX.html b/rust/oasis_core_runtime/consensus/keymanager/struct.PolicySGX.html new file mode 100644 index 0000000000..f8d415c4fa --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/struct.PolicySGX.html @@ -0,0 +1,37 @@ +PolicySGX in oasis_core_runtime::consensus::keymanager - Rust

Struct oasis_core_runtime::consensus::keymanager::PolicySGX

source ·
pub struct PolicySGX {
+    pub serial: u32,
+    pub id: Namespace,
+    pub enclaves: HashMap<EnclaveIdentity, EnclavePolicySGX>,
+    pub master_secret_rotation_interval: EpochTime,
+    pub max_ephemeral_secret_age: EpochTime,
+}
Expand description

Key manager access control policy.

+

Fields§

§serial: u32§id: Namespace§enclaves: HashMap<EnclaveIdentity, EnclavePolicySGX>§master_secret_rotation_interval: EpochTime§max_ephemeral_secret_age: EpochTime

Trait Implementations§

source§

impl Clone for PolicySGX

source§

fn clone(&self) -> PolicySGX

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PolicySGX

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PolicySGX

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for PolicySGX

source§

fn default() -> PolicySGX

Returns the “default value” for a type. Read more
source§

impl Encode for PolicySGX

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for PolicySGX

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for PolicySGX

source§

fn eq(&self, other: &PolicySGX) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for PolicySGX

source§

impl StructuralPartialEq for PolicySGX

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/struct.SignedEncryptedEphemeralSecret.html b/rust/oasis_core_runtime/consensus/keymanager/struct.SignedEncryptedEphemeralSecret.html new file mode 100644 index 0000000000..3cbc881f31 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/struct.SignedEncryptedEphemeralSecret.html @@ -0,0 +1,39 @@ +SignedEncryptedEphemeralSecret in oasis_core_runtime::consensus::keymanager - Rust
pub struct SignedEncryptedEphemeralSecret {
+    pub secret: EncryptedEphemeralSecret,
+    pub signature: Signature,
+}
Expand description

Signed encrypted ephemeral secret (RAK).

+

Fields§

§secret: EncryptedEphemeralSecret

Encrypted ephemeral secret.

+
§signature: Signature

Signature of the encrypted ephemeral secret.

+

Implementations§

Trait Implementations§

source§

impl Clone for SignedEncryptedEphemeralSecret

source§

fn clone(&self) -> SignedEncryptedEphemeralSecret

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SignedEncryptedEphemeralSecret

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignedEncryptedEphemeralSecret

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SignedEncryptedEphemeralSecret

source§

fn default() -> SignedEncryptedEphemeralSecret

Returns the “default value” for a type. Read more
source§

impl Encode for SignedEncryptedEphemeralSecret

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SignedEncryptedEphemeralSecret

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for SignedEncryptedEphemeralSecret

source§

fn eq(&self, other: &SignedEncryptedEphemeralSecret) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SignedEncryptedEphemeralSecret

source§

impl StructuralPartialEq for SignedEncryptedEphemeralSecret

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/struct.SignedEncryptedMasterSecret.html b/rust/oasis_core_runtime/consensus/keymanager/struct.SignedEncryptedMasterSecret.html new file mode 100644 index 0000000000..e86a5e39a0 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/struct.SignedEncryptedMasterSecret.html @@ -0,0 +1,39 @@ +SignedEncryptedMasterSecret in oasis_core_runtime::consensus::keymanager - Rust
pub struct SignedEncryptedMasterSecret {
+    pub secret: EncryptedMasterSecret,
+    pub signature: Signature,
+}
Expand description

Signed encrypted master secret (RAK).

+

Fields§

§secret: EncryptedMasterSecret

Encrypted master secret.

+
§signature: Signature

Signature of the encrypted master secret.

+

Implementations§

source§

impl SignedEncryptedMasterSecret

source

pub fn new( + secret: EncryptedMasterSecret, + signer: &Arc<dyn Signer>, +) -> Result<Self>

Trait Implementations§

source§

impl Clone for SignedEncryptedMasterSecret

source§

fn clone(&self) -> SignedEncryptedMasterSecret

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SignedEncryptedMasterSecret

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignedEncryptedMasterSecret

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SignedEncryptedMasterSecret

source§

fn default() -> SignedEncryptedMasterSecret

Returns the “default value” for a type. Read more
source§

impl Encode for SignedEncryptedMasterSecret

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SignedEncryptedMasterSecret

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for SignedEncryptedMasterSecret

source§

fn eq(&self, other: &SignedEncryptedMasterSecret) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SignedEncryptedMasterSecret

source§

impl StructuralPartialEq for SignedEncryptedMasterSecret

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/keymanager/struct.SignedPolicySGX.html b/rust/oasis_core_runtime/consensus/keymanager/struct.SignedPolicySGX.html new file mode 100644 index 0000000000..178d7a60f8 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/keymanager/struct.SignedPolicySGX.html @@ -0,0 +1,35 @@ +SignedPolicySGX in oasis_core_runtime::consensus::keymanager - Rust
pub struct SignedPolicySGX {
+    pub policy: PolicySGX,
+    pub signatures: Vec<SignatureBundle>,
+}
Expand description

Signed key manager access control policy.

+

Fields§

§policy: PolicySGX§signatures: Vec<SignatureBundle>

Implementations§

source§

impl SignedPolicySGX

source

pub fn verify(&self) -> Result<&PolicySGX>

Verify the signatures.

+

Trait Implementations§

source§

impl Clone for SignedPolicySGX

source§

fn clone(&self) -> SignedPolicySGX

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SignedPolicySGX

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignedPolicySGX

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SignedPolicySGX

source§

fn default() -> SignedPolicySGX

Returns the “default value” for a type. Read more
source§

impl Encode for SignedPolicySGX

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SignedPolicySGX

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for SignedPolicySGX

source§

fn eq(&self, other: &SignedPolicySGX) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SignedPolicySGX

source§

impl StructuralPartialEq for SignedPolicySGX

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/constant.ATTESTATION_SIGNATURE_CONTEXT.html b/rust/oasis_core_runtime/consensus/registry/constant.ATTESTATION_SIGNATURE_CONTEXT.html new file mode 100644 index 0000000000..afe6c20f4e --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/constant.ATTESTATION_SIGNATURE_CONTEXT.html @@ -0,0 +1,2 @@ +ATTESTATION_SIGNATURE_CONTEXT in oasis_core_runtime::consensus::registry - Rust
pub const ATTESTATION_SIGNATURE_CONTEXT: &[u8] = b"oasis-core/node: TEE attestation signature";
Expand description

Attestation signature context.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/constant.ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT.html b/rust/oasis_core_runtime/consensus/registry/constant.ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT.html new file mode 100644 index 0000000000..ed1f617b4e --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/constant.ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT.html @@ -0,0 +1,2 @@ +ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT in oasis_core_runtime::consensus::registry - Rust
pub const ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT: &[u8] = b"oasis-core/node: endorse TEE capability";
Expand description

TEE capability endorsement signature context.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/constant.LATEST_RUNTIME_DESCRIPTOR_VERSION.html b/rust/oasis_core_runtime/consensus/registry/constant.LATEST_RUNTIME_DESCRIPTOR_VERSION.html new file mode 100644 index 0000000000..dfc5e6ecaf --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/constant.LATEST_RUNTIME_DESCRIPTOR_VERSION.html @@ -0,0 +1,3 @@ +LATEST_RUNTIME_DESCRIPTOR_VERSION in oasis_core_runtime::consensus::registry - Rust
pub const LATEST_RUNTIME_DESCRIPTOR_VERSION: u16 = 3;
Expand description

The latest entity descriptor version that should be used for all new descriptors. Using earlier +versions may be rejected.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/constant.METHOD_PROVE_FRESHNESS.html b/rust/oasis_core_runtime/consensus/registry/constant.METHOD_PROVE_FRESHNESS.html new file mode 100644 index 0000000000..3cd39d84da --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/constant.METHOD_PROVE_FRESHNESS.html @@ -0,0 +1,2 @@ +METHOD_PROVE_FRESHNESS in oasis_core_runtime::consensus::registry - Rust
pub const METHOD_PROVE_FRESHNESS: &str = "registry.ProveFreshness";
Expand description

The method name for freshness proofs.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/constant.MODULE_NAME.html b/rust/oasis_core_runtime/consensus/registry/constant.MODULE_NAME.html new file mode 100644 index 0000000000..859adc4ad6 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/constant.MODULE_NAME.html @@ -0,0 +1,2 @@ +MODULE_NAME in oasis_core_runtime::consensus::registry - Rust

Constant oasis_core_runtime::consensus::registry::MODULE_NAME

source ·
pub const MODULE_NAME: &str = "registry";
Expand description

A unique module name for the registry module.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/enum.RuntimeGovernanceModel.html b/rust/oasis_core_runtime/consensus/registry/enum.RuntimeGovernanceModel.html new file mode 100644 index 0000000000..d67e94cb1c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/enum.RuntimeGovernanceModel.html @@ -0,0 +1,41 @@ +RuntimeGovernanceModel in oasis_core_runtime::consensus::registry - Rust
#[repr(u8)]
pub enum RuntimeGovernanceModel { + GovernanceInvalid = 0, + GovernanceEntity = 1, + GovernanceRuntime = 2, + GovernanceConsensus = 3, +}
Expand description

Runtime governance model.

+

Variants§

§

GovernanceInvalid = 0

Invalid model that should never be explicitly set.

+
§

GovernanceEntity = 1

Entity governance model.

+
§

GovernanceRuntime = 2

Runtime governance model.

+
§

GovernanceConsensus = 3

Consensus governance model.

+

Trait Implementations§

source§

impl Clone for RuntimeGovernanceModel

source§

fn clone(&self) -> RuntimeGovernanceModel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeGovernanceModel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeGovernanceModel

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RuntimeGovernanceModel

source§

fn default() -> RuntimeGovernanceModel

Returns the “default value” for a type. Read more
source§

impl Encode for RuntimeGovernanceModel

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for RuntimeGovernanceModel

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RuntimeGovernanceModel

source§

fn eq(&self, other: &RuntimeGovernanceModel) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RuntimeGovernanceModel

source§

impl StructuralPartialEq for RuntimeGovernanceModel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/enum.RuntimeKind.html b/rust/oasis_core_runtime/consensus/registry/enum.RuntimeKind.html new file mode 100644 index 0000000000..65ca4e4778 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/enum.RuntimeKind.html @@ -0,0 +1,39 @@ +RuntimeKind in oasis_core_runtime::consensus::registry - Rust
#[repr(u32)]
pub enum RuntimeKind { + KindInvalid = 0, + KindCompute = 1, + KindKeyManager = 2, +}
Expand description

Runtime kind.

+

Variants§

§

KindInvalid = 0

Invalid runtime that should never be explicitly set.

+
§

KindCompute = 1

Generic compute runtime.

+
§

KindKeyManager = 2

Key manager runtime.

+

Trait Implementations§

source§

impl Clone for RuntimeKind

source§

fn clone(&self) -> RuntimeKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RuntimeKind

source§

fn default() -> RuntimeKind

Returns the “default value” for a type. Read more
source§

impl Encode for RuntimeKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for RuntimeKind

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RuntimeKind

source§

fn eq(&self, other: &RuntimeKind) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RuntimeKind

source§

impl StructuralPartialEq for RuntimeKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/enum.SGXAttestation.html b/rust/oasis_core_runtime/consensus/registry/enum.SGXAttestation.html new file mode 100644 index 0000000000..3fedc099a6 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/enum.SGXAttestation.html @@ -0,0 +1,54 @@ +SGXAttestation in oasis_core_runtime::consensus::registry - Rust
pub enum SGXAttestation {
+    V0(AVR),
+    V1 {
+        quote: Quote,
+        height: u64,
+        signature: Signature,
+    },
+}
Expand description

Intel SGX remote attestation.

+

Variants§

§

V0(AVR)

Old V0 format that only supported IAS quotes.

+
§

V1

New V1 format that supports both IAS and PCS policies.

+

Fields

§quote: Quote

An Intel SGX quote.

+
§height: u64

The runtime’s view of the consensus layer height at the time of attestation.

+
§signature: Signature

The signature of the attestation by the enclave (RAK).

+

Implementations§

source§

impl SGXAttestation

source

pub fn quote(&self) -> Quote

SGX attestation quote.

+
source

pub fn hash( + report_data: &[u8], + node_id: &PublicKey, + height: u64, + rek: &PublicKey, +) -> [u8; 32]

Hashes the required data that needs to be signed by RAK producing the attestation signature.

+
source

pub fn verify( + &self, + policy: &QuotePolicy, + node_id: &PublicKey, + rak: &PublicKey, + rek: &PublicKey, +) -> Result<VerifiedAttestation>

Verifies the SGX attestation.

+

Trait Implementations§

source§

impl Clone for SGXAttestation

source§

fn clone(&self) -> SGXAttestation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SGXAttestation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SGXAttestation

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for SGXAttestation

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SGXAttestation

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/enum.SGXConstraints.html b/rust/oasis_core_runtime/consensus/registry/enum.SGXConstraints.html new file mode 100644 index 0000000000..6f92890f92 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/enum.SGXConstraints.html @@ -0,0 +1,48 @@ +SGXConstraints in oasis_core_runtime::consensus::registry - Rust
pub enum SGXConstraints {
+    V0 {
+        enclaves: Vec<EnclaveIdentity>,
+        allowed_quote_statuses: Vec<i64>,
+    },
+    V1 {
+        enclaves: Vec<EnclaveIdentity>,
+        policy: QuotePolicy,
+        max_attestation_age: u64,
+    },
+}
Expand description

Intel SGX TEE constraints.

+

Variants§

§

V0

Old V0 format that only supported IAS policies.

+

Fields

§enclaves: Vec<EnclaveIdentity>

The allowed MRENCLAVE/MRSIGNER pairs.

+
§allowed_quote_statuses: Vec<i64>

A set of allowed quote statuses.

+
§

V1

New V1 format that supports both IAS and PCS policies.

+

Fields

§enclaves: Vec<EnclaveIdentity>

The allowed MRENCLAVE/MRSIGNER pairs.

+
§policy: QuotePolicy

The quote policy.

+
§max_attestation_age: u64

The maximum attestation age (in blocks).

+

Implementations§

source§

impl SGXConstraints

source

pub fn enclaves(&self) -> &Vec<EnclaveIdentity>

Identities of allowed enclaves.

+
source

pub fn contains_enclave(&self, eid: &EnclaveIdentity) -> bool

Checks whether the given enclave identity is whitelisted.

+
source

pub fn policy(&self) -> QuotePolicy

SGX quote policy.

+

Trait Implementations§

source§

impl Clone for SGXConstraints

source§

fn clone(&self) -> SGXConstraints

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SGXConstraints

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SGXConstraints

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for SGXConstraints

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SGXConstraints

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/enum.TEEHardware.html b/rust/oasis_core_runtime/consensus/registry/enum.TEEHardware.html new file mode 100644 index 0000000000..ddd7d601a6 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/enum.TEEHardware.html @@ -0,0 +1,37 @@ +TEEHardware in oasis_core_runtime::consensus::registry - Rust
#[repr(u8)]
pub enum TEEHardware { + TEEHardwareInvalid = 0, + TEEHardwareIntelSGX = 1, +}
Expand description

TEE hardware implementation.

+

Variants§

§

TEEHardwareInvalid = 0

Non-TEE implementation.

+
§

TEEHardwareIntelSGX = 1

Intel SGX TEE implementation.

+

Trait Implementations§

source§

impl Clone for TEEHardware

source§

fn clone(&self) -> TEEHardware

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TEEHardware

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TEEHardware

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TEEHardware

source§

fn default() -> TEEHardware

Returns the “default value” for a type. Read more
source§

impl Encode for TEEHardware

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for TEEHardware

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for TEEHardware

source§

fn eq(&self, other: &TEEHardware) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TEEHardware

source§

impl StructuralPartialEq for TEEHardware

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/index.html b/rust/oasis_core_runtime/consensus/registry/index.html new file mode 100644 index 0000000000..d23f5b17c6 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/index.html @@ -0,0 +1,6 @@ +oasis_core_runtime::consensus::registry - Rust

Module oasis_core_runtime::consensus::registry

source ·
Expand description

Registry structures.

+

§Note

+

This MUST be kept in sync with go/registry/api.

+

Structs§

Enums§

Constants§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/sidebar-items.js b/rust/oasis_core_runtime/consensus/registry/sidebar-items.js new file mode 100644 index 0000000000..49ee441309 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["ATTESTATION_SIGNATURE_CONTEXT","ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT","LATEST_RUNTIME_DESCRIPTOR_VERSION","METHOD_PROVE_FRESHNESS","MODULE_NAME"],"enum":["RuntimeGovernanceModel","RuntimeKind","SGXAttestation","SGXConstraints","TEEHardware"],"struct":["AnyNodeRuntimeAdmissionPolicy","Capabilities","CapabilityTEE","ConsensusAddress","ConsensusInfo","EndorsedCapabilityTEE","EntityWhitelistConfig","EntityWhitelistRoleAdmissionPolicy","EntityWhitelistRoleConfig","EntityWhitelistRuntimeAdmissionPolicy","ExecutorParameters","MaxNodesConstraint","MinPoolSizeConstraint","Node","NodeRuntime","P2PInfo","PerRoleAdmissionPolicy","RolesMask","Runtime","RuntimeAdmissionPolicy","RuntimeGenesis","RuntimeStakingParameters","SchedulingConstraints","StorageParameters","TCPAddress","TLSAddress","TLSInfo","TxnSchedulerParameters","VRFInfo","ValidatorSetConstraint","VerifiedAttestation","VerifiedEndorsedCapabilityTEE","VersionInfo"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.AnyNodeRuntimeAdmissionPolicy.html b/rust/oasis_core_runtime/consensus/registry/struct.AnyNodeRuntimeAdmissionPolicy.html new file mode 100644 index 0000000000..ede5ec056c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.AnyNodeRuntimeAdmissionPolicy.html @@ -0,0 +1,33 @@ +AnyNodeRuntimeAdmissionPolicy in oasis_core_runtime::consensus::registry - Rust
pub struct AnyNodeRuntimeAdmissionPolicy {}
Expand description

Admission policy that allows any node to register.

+

Trait Implementations§

source§

impl Clone for AnyNodeRuntimeAdmissionPolicy

source§

fn clone(&self) -> AnyNodeRuntimeAdmissionPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AnyNodeRuntimeAdmissionPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AnyNodeRuntimeAdmissionPolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AnyNodeRuntimeAdmissionPolicy

source§

fn default() -> AnyNodeRuntimeAdmissionPolicy

Returns the “default value” for a type. Read more
source§

impl Encode for AnyNodeRuntimeAdmissionPolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AnyNodeRuntimeAdmissionPolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for AnyNodeRuntimeAdmissionPolicy

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for AnyNodeRuntimeAdmissionPolicy

source§

fn eq(&self, other: &AnyNodeRuntimeAdmissionPolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for AnyNodeRuntimeAdmissionPolicy

source§

impl StructuralPartialEq for AnyNodeRuntimeAdmissionPolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.Capabilities.html b/rust/oasis_core_runtime/consensus/registry/struct.Capabilities.html new file mode 100644 index 0000000000..9ce16acad5 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.Capabilities.html @@ -0,0 +1,36 @@ +Capabilities in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::Capabilities

source ·
pub struct Capabilities {
+    pub tee: Option<CapabilityTEE>,
+}
Expand description

Represents a node’s capabilities.

+

Fields§

§tee: Option<CapabilityTEE>

Is the capability of a node executing batches in a TEE.

+

Trait Implementations§

source§

impl Clone for Capabilities

source§

fn clone(&self) -> Capabilities

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Capabilities

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Capabilities

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Capabilities

source§

fn default() -> Capabilities

Returns the “default value” for a type. Read more
source§

impl Encode for Capabilities

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Capabilities

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Capabilities

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Capabilities

source§

fn eq(&self, other: &Capabilities) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Capabilities

source§

impl StructuralPartialEq for Capabilities

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.CapabilityTEE.html b/rust/oasis_core_runtime/consensus/registry/struct.CapabilityTEE.html new file mode 100644 index 0000000000..8cf4fc146e --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.CapabilityTEE.html @@ -0,0 +1,50 @@ +CapabilityTEE in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::CapabilityTEE

source ·
pub struct CapabilityTEE {
+    pub hardware: TEEHardware,
+    pub rak: PublicKey,
+    pub rek: Option<PublicKey>,
+    pub attestation: Vec<u8>,
+}
Expand description

Represents the node’s TEE capability.

+

Fields§

§hardware: TEEHardware

Hardware type.

+
§rak: PublicKey

Runtime attestation key.

+
§rek: Option<PublicKey>

Runtime encryption key.

+
§attestation: Vec<u8>

Attestation.

+

Implementations§

source§

impl CapabilityTEE

source

pub fn try_decode_attestation<T>(&self) -> Result<T, DecodeError>
where + T: Decode,

Tries to decode the TEE-specific attestation.

+
source

pub fn matches(&self, identity: &Identity) -> bool

Checks whether the TEE capability matches the given TEE identity.

+
source

pub fn verify( + &self, + policy: &QuotePolicy, + node_id: &PublicKey, +) -> Result<VerifiedAttestation>

Verifies the TEE capability.

+

Trait Implementations§

source§

impl Clone for CapabilityTEE

source§

fn clone(&self) -> CapabilityTEE

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CapabilityTEE

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CapabilityTEE

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CapabilityTEE

source§

fn default() -> CapabilityTEE

Returns the “default value” for a type. Read more
source§

impl Encode for CapabilityTEE

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CapabilityTEE

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for CapabilityTEE

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for CapabilityTEE

source§

fn eq(&self, other: &CapabilityTEE) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CapabilityTEE

source§

impl StructuralPartialEq for CapabilityTEE

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.ConsensusAddress.html b/rust/oasis_core_runtime/consensus/registry/struct.ConsensusAddress.html new file mode 100644 index 0000000000..35c5f83586 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.ConsensusAddress.html @@ -0,0 +1,40 @@ +ConsensusAddress in oasis_core_runtime::consensus::registry - Rust
pub struct ConsensusAddress {
+    pub id: PublicKey,
+    pub address: TCPAddress,
+}
Expand description

Represents a consensus address that includes an ID and a TCP address.

+

NOTE: The consensus address ID could be different from the consensus ID +to allow using a sentry node’s ID and address instead of the validator’s.

+

Fields§

§id: PublicKey

Public key identifying the node.

+
§address: TCPAddress

Address at which the node can be reached.

+

Trait Implementations§

source§

impl Clone for ConsensusAddress

source§

fn clone(&self) -> ConsensusAddress

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusAddress

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusAddress

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusAddress

source§

fn default() -> ConsensusAddress

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusAddress

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusAddress

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ConsensusAddress

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ConsensusAddress

source§

fn eq(&self, other: &ConsensusAddress) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ConsensusAddress

source§

impl StructuralPartialEq for ConsensusAddress

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.ConsensusInfo.html b/rust/oasis_core_runtime/consensus/registry/struct.ConsensusInfo.html new file mode 100644 index 0000000000..1734f8d7e9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.ConsensusInfo.html @@ -0,0 +1,38 @@ +ConsensusInfo in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::ConsensusInfo

source ·
pub struct ConsensusInfo {
+    pub id: PublicKey,
+    pub addresses: Option<Vec<ConsensusAddress>>,
+}
Expand description

Node’s consensus member information.

+

Fields§

§id: PublicKey

Unique identifier of the node as a consensus member.

+
§addresses: Option<Vec<ConsensusAddress>>

List of addresses at which the node can be reached.

+

Trait Implementations§

source§

impl Clone for ConsensusInfo

source§

fn clone(&self) -> ConsensusInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusInfo

source§

fn default() -> ConsensusInfo

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ConsensusInfo

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ConsensusInfo

source§

fn eq(&self, other: &ConsensusInfo) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ConsensusInfo

source§

impl StructuralPartialEq for ConsensusInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.EndorsedCapabilityTEE.html b/rust/oasis_core_runtime/consensus/registry/struct.EndorsedCapabilityTEE.html new file mode 100644 index 0000000000..2aee9cf9e6 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.EndorsedCapabilityTEE.html @@ -0,0 +1,47 @@ +EndorsedCapabilityTEE in oasis_core_runtime::consensus::registry - Rust
pub struct EndorsedCapabilityTEE {
+    pub capability_tee: CapabilityTEE,
+    pub node_endorsement: SignatureBundle,
+}
Expand description

An endorsed CapabilityTEE structure.

+

Endorsement is needed for off-chain runtime components where their RAK is not published in the +consensus layer and verification is part of the runtime itself. Via endorsement one can enforce +policies like “only components executed by the current compute committee are authorized”.

+

Fields§

§capability_tee: CapabilityTEE

TEE capability structure to be endorsed.

+
§node_endorsement: SignatureBundle

Node endorsement signature.

+

Implementations§

source§

impl EndorsedCapabilityTEE

source

pub fn verify_endorsement(&self) -> Result<()>

Verify the endorsement signature is valid.

+

This does not verify the TEE capability itself, use verify for that.

+
source

pub fn verify( + &self, + policy: &QuotePolicy, +) -> Result<VerifiedEndorsedCapabilityTEE>

Verify endorsed TEE capability is valid.

+

Trait Implementations§

source§

impl Clone for EndorsedCapabilityTEE

source§

fn clone(&self) -> EndorsedCapabilityTEE

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EndorsedCapabilityTEE

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EndorsedCapabilityTEE

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EndorsedCapabilityTEE

source§

fn default() -> EndorsedCapabilityTEE

Returns the “default value” for a type. Read more
source§

impl Encode for EndorsedCapabilityTEE

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EndorsedCapabilityTEE

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EndorsedCapabilityTEE

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EndorsedCapabilityTEE

source§

fn eq(&self, other: &EndorsedCapabilityTEE) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EndorsedCapabilityTEE

source§

impl StructuralPartialEq for EndorsedCapabilityTEE

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistConfig.html b/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistConfig.html new file mode 100644 index 0000000000..fa2f97d8c2 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistConfig.html @@ -0,0 +1,40 @@ +EntityWhitelistConfig in oasis_core_runtime::consensus::registry - Rust
pub struct EntityWhitelistConfig {
+    pub max_nodes: BTreeMap<RolesMask, u16>,
+}
Expand description

Entity whitelist configuration.

+

Fields§

§max_nodes: BTreeMap<RolesMask, u16>

Maximum number of nodes that an entity can register under the given +runtime for a specific role. If the map is empty or absent, the number +of nodes is unlimited. If the map is present and non-empty, the number +of nodes is restricted to the specified maximum (where zero +means no nodes allowed), any missing roles imply zero nodes.

+

Trait Implementations§

source§

impl Clone for EntityWhitelistConfig

source§

fn clone(&self) -> EntityWhitelistConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EntityWhitelistConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EntityWhitelistConfig

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EntityWhitelistConfig

source§

fn default() -> EntityWhitelistConfig

Returns the “default value” for a type. Read more
source§

impl Encode for EntityWhitelistConfig

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EntityWhitelistConfig

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EntityWhitelistConfig

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EntityWhitelistConfig

source§

fn eq(&self, other: &EntityWhitelistConfig) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EntityWhitelistConfig

source§

impl StructuralPartialEq for EntityWhitelistConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRoleAdmissionPolicy.html b/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRoleAdmissionPolicy.html new file mode 100644 index 0000000000..9d7466ab1a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRoleAdmissionPolicy.html @@ -0,0 +1,35 @@ +EntityWhitelistRoleAdmissionPolicy in oasis_core_runtime::consensus::registry - Rust
pub struct EntityWhitelistRoleAdmissionPolicy {
+    pub entities: BTreeMap<PublicKey, EntityWhitelistRoleConfig>,
+}
Expand description

A per-role entity whitelist policy.

+

Fields§

§entities: BTreeMap<PublicKey, EntityWhitelistRoleConfig>

Trait Implementations§

source§

impl Clone for EntityWhitelistRoleAdmissionPolicy

source§

fn clone(&self) -> EntityWhitelistRoleAdmissionPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EntityWhitelistRoleAdmissionPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EntityWhitelistRoleAdmissionPolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EntityWhitelistRoleAdmissionPolicy

source§

fn default() -> EntityWhitelistRoleAdmissionPolicy

Returns the “default value” for a type. Read more
source§

impl Encode for EntityWhitelistRoleAdmissionPolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EntityWhitelistRoleAdmissionPolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EntityWhitelistRoleAdmissionPolicy

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EntityWhitelistRoleAdmissionPolicy

source§

fn eq(&self, other: &EntityWhitelistRoleAdmissionPolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EntityWhitelistRoleAdmissionPolicy

source§

impl StructuralPartialEq for EntityWhitelistRoleAdmissionPolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRoleConfig.html b/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRoleConfig.html new file mode 100644 index 0000000000..528dc54c42 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRoleConfig.html @@ -0,0 +1,35 @@ +EntityWhitelistRoleConfig in oasis_core_runtime::consensus::registry - Rust
pub struct EntityWhitelistRoleConfig {
+    pub max_nodes: u16,
+}
Expand description

A per-entity whitelist configuration for a given role.

+

Fields§

§max_nodes: u16

Trait Implementations§

source§

impl Clone for EntityWhitelistRoleConfig

source§

fn clone(&self) -> EntityWhitelistRoleConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EntityWhitelistRoleConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EntityWhitelistRoleConfig

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EntityWhitelistRoleConfig

source§

fn default() -> EntityWhitelistRoleConfig

Returns the “default value” for a type. Read more
source§

impl Encode for EntityWhitelistRoleConfig

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EntityWhitelistRoleConfig

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EntityWhitelistRoleConfig

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EntityWhitelistRoleConfig

source§

fn eq(&self, other: &EntityWhitelistRoleConfig) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EntityWhitelistRoleConfig

source§

impl StructuralPartialEq for EntityWhitelistRoleConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRuntimeAdmissionPolicy.html b/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRuntimeAdmissionPolicy.html new file mode 100644 index 0000000000..70e56dad07 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.EntityWhitelistRuntimeAdmissionPolicy.html @@ -0,0 +1,36 @@ +EntityWhitelistRuntimeAdmissionPolicy in oasis_core_runtime::consensus::registry - Rust
pub struct EntityWhitelistRuntimeAdmissionPolicy {
+    pub entities: BTreeMap<PublicKey, EntityWhitelistConfig>,
+}
Expand description

Policy that allows only whitelisted entities’ nodes to register.

+

Fields§

§entities: BTreeMap<PublicKey, EntityWhitelistConfig>

Entity whitelist configuration for each whitelisted entity.

+

Trait Implementations§

source§

impl Clone for EntityWhitelistRuntimeAdmissionPolicy

source§

fn clone(&self) -> EntityWhitelistRuntimeAdmissionPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EntityWhitelistRuntimeAdmissionPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EntityWhitelistRuntimeAdmissionPolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EntityWhitelistRuntimeAdmissionPolicy

source§

fn default() -> EntityWhitelistRuntimeAdmissionPolicy

Returns the “default value” for a type. Read more
source§

impl Encode for EntityWhitelistRuntimeAdmissionPolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EntityWhitelistRuntimeAdmissionPolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EntityWhitelistRuntimeAdmissionPolicy

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EntityWhitelistRuntimeAdmissionPolicy

source§

fn eq(&self, other: &EntityWhitelistRuntimeAdmissionPolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EntityWhitelistRuntimeAdmissionPolicy

source§

impl StructuralPartialEq for EntityWhitelistRuntimeAdmissionPolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.ExecutorParameters.html b/rust/oasis_core_runtime/consensus/registry/struct.ExecutorParameters.html new file mode 100644 index 0000000000..105ffa26e4 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.ExecutorParameters.html @@ -0,0 +1,58 @@ +ExecutorParameters in oasis_core_runtime::consensus::registry - Rust
pub struct ExecutorParameters {
+    pub group_size: u16,
+    pub group_backup_size: u16,
+    pub allowed_stragglers: u16,
+    pub round_timeout: i64,
+    pub max_messages: u32,
+    pub min_live_rounds_percent: u8,
+    pub max_missed_proposals_percent: u8,
+    pub min_live_rounds_eval: u64,
+    pub max_liveness_fails: u8,
+}
Expand description

Parameters for the executor committee.

+

Fields§

§group_size: u16

Size of the committee.

+
§group_backup_size: u16

Size of the discrepancy resolution group.

+
§allowed_stragglers: u16

Number of allowed stragglers.

+
§round_timeout: i64

Round timeout in consensus blocks.

+
§max_messages: u32

Maximum number of messages that can be emitted by the runtime +in a single round.

+
§min_live_rounds_percent: u8

Minimum percentage of rounds in an epoch that a node must participate in positively in order +to be considered live. Nodes not satisfying this may be penalized.

+
§max_missed_proposals_percent: u8

Maximum percentage of proposed rounds in an epoch that can fail for a node +to be considered live. Nodes not satisfying this may be penalized. Zero means +that all proposed rounds can fail.

+
§min_live_rounds_eval: u64

Minimum number of live rounds in an epoch for the liveness calculations to be considered for +evaluation.

+
§max_liveness_fails: u8

Maximum number of liveness failures that are tolerated before suspending and/or slashing the +node. Zero means unlimited.

+

Trait Implementations§

source§

impl Clone for ExecutorParameters

source§

fn clone(&self) -> ExecutorParameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutorParameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecutorParameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecutorParameters

source§

fn default() -> ExecutorParameters

Returns the “default value” for a type. Read more
source§

impl Encode for ExecutorParameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExecutorParameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ExecutorParameters

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ExecutorParameters

source§

fn eq(&self, other: &ExecutorParameters) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ExecutorParameters

source§

impl StructuralPartialEq for ExecutorParameters

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.MaxNodesConstraint.html b/rust/oasis_core_runtime/consensus/registry/struct.MaxNodesConstraint.html new file mode 100644 index 0000000000..718e573779 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.MaxNodesConstraint.html @@ -0,0 +1,35 @@ +MaxNodesConstraint in oasis_core_runtime::consensus::registry - Rust
pub struct MaxNodesConstraint {
+    pub limit: u16,
+}
Expand description

A constraint which specifies that only the given number of nodes may be eligible per entity.

+

Fields§

§limit: u16

Trait Implementations§

source§

impl Clone for MaxNodesConstraint

source§

fn clone(&self) -> MaxNodesConstraint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MaxNodesConstraint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MaxNodesConstraint

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for MaxNodesConstraint

source§

fn default() -> MaxNodesConstraint

Returns the “default value” for a type. Read more
source§

impl Encode for MaxNodesConstraint

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for MaxNodesConstraint

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for MaxNodesConstraint

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for MaxNodesConstraint

source§

fn eq(&self, other: &MaxNodesConstraint) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for MaxNodesConstraint

source§

impl StructuralPartialEq for MaxNodesConstraint

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.MinPoolSizeConstraint.html b/rust/oasis_core_runtime/consensus/registry/struct.MinPoolSizeConstraint.html new file mode 100644 index 0000000000..2aea5bb622 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.MinPoolSizeConstraint.html @@ -0,0 +1,35 @@ +MinPoolSizeConstraint in oasis_core_runtime::consensus::registry - Rust
pub struct MinPoolSizeConstraint {
+    pub limit: u16,
+}
Expand description

A constraint which specifies the minimum required candidate pool size.

+

Fields§

§limit: u16

Trait Implementations§

source§

impl Clone for MinPoolSizeConstraint

source§

fn clone(&self) -> MinPoolSizeConstraint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MinPoolSizeConstraint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MinPoolSizeConstraint

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for MinPoolSizeConstraint

source§

fn default() -> MinPoolSizeConstraint

Returns the “default value” for a type. Read more
source§

impl Encode for MinPoolSizeConstraint

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for MinPoolSizeConstraint

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for MinPoolSizeConstraint

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for MinPoolSizeConstraint

source§

fn eq(&self, other: &MinPoolSizeConstraint) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for MinPoolSizeConstraint

source§

impl StructuralPartialEq for MinPoolSizeConstraint

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.Node.html b/rust/oasis_core_runtime/consensus/registry/struct.Node.html new file mode 100644 index 0000000000..f8c5dc2963 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.Node.html @@ -0,0 +1,67 @@ +Node in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::Node

source ·
pub struct Node {
+    pub v: u16,
+    pub id: PublicKey,
+    pub entity_id: PublicKey,
+    pub expiration: u64,
+    pub tls: TLSInfo,
+    pub p2p: P2PInfo,
+    pub consensus: ConsensusInfo,
+    pub vrf: VRFInfo,
+    pub runtimes: Option<Vec<NodeRuntime>>,
+    pub roles: RolesMask,
+    pub software_version: Option<String>,
+}
Expand description

Node registry descriptor.

+

Fields§

§v: u16

Structure version.

+
§id: PublicKey

Public key identifying the node.

+
§entity_id: PublicKey

Public key identifying the Entity controlling the node.

+
§expiration: u64

Epoch in which the node’s commitment expires.

+
§tls: TLSInfo

Information for connecting to this node via TLS.

+
§p2p: P2PInfo

Information for connecting to this node via P2P.

+
§consensus: ConsensusInfo

Information for connecting to this node as a consensus member.

+
§vrf: VRFInfo

Information for this node’s participation in VRF based elections.

+
§runtimes: Option<Vec<NodeRuntime>>

Node’s runtimes.

+
§roles: RolesMask

Bitmask representing the node roles.

+
§software_version: Option<String>

Node’s oasis-node software version.

+

Implementations§

source§

impl Node

source

pub fn has_roles(&self, roles: RolesMask) -> bool

Checks whether the node has any of the specified roles.

+
source

pub fn has_tee( + &self, + identity: &Identity, + runtime_id: &Namespace, + version: &Version, +) -> bool

Checks whether the node has the provided TEE identity configured.

+
source

pub fn get_runtime( + &self, + runtime_id: &Namespace, + version: &Version, +) -> Option<NodeRuntime>

Searches for an existing supported runtime descriptor +in runtimes with the specified version and returns it.

+

Trait Implementations§

source§

impl Clone for Node

source§

fn clone(&self) -> Node

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Node

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Node

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Node

source§

fn default() -> Node

Returns the “default value” for a type. Read more
source§

impl Encode for Node

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Node

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Node

source§

fn eq(&self, other: &Node) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Node

source§

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.NodeRuntime.html b/rust/oasis_core_runtime/consensus/registry/struct.NodeRuntime.html new file mode 100644 index 0000000000..73260336f7 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.NodeRuntime.html @@ -0,0 +1,42 @@ +NodeRuntime in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::NodeRuntime

source ·
pub struct NodeRuntime {
+    pub id: Namespace,
+    pub version: Version,
+    pub capabilities: Capabilities,
+    pub extra_info: Option<Vec<u8>>,
+}
Expand description

Represents the runtimes supported by a given Oasis node.

+

Fields§

§id: Namespace

Public key identifying the runtime.

+
§version: Version

Version of the runtime.

+
§capabilities: Capabilities

Node’s capabilities for a given runtime.

+
§extra_info: Option<Vec<u8>>

Extra per node + per runtime opaque data associated with the current instance.

+

Trait Implementations§

source§

impl Clone for NodeRuntime

source§

fn clone(&self) -> NodeRuntime

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeRuntime

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for NodeRuntime

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for NodeRuntime

source§

fn default() -> NodeRuntime

Returns the “default value” for a type. Read more
source§

impl Encode for NodeRuntime

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for NodeRuntime

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for NodeRuntime

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for NodeRuntime

source§

fn eq(&self, other: &NodeRuntime) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for NodeRuntime

source§

impl StructuralPartialEq for NodeRuntime

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.P2PInfo.html b/rust/oasis_core_runtime/consensus/registry/struct.P2PInfo.html new file mode 100644 index 0000000000..1affcdd4f9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.P2PInfo.html @@ -0,0 +1,38 @@ +P2PInfo in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::P2PInfo

source ·
pub struct P2PInfo {
+    pub id: PublicKey,
+    pub addresses: Option<Vec<TCPAddress>>,
+}
Expand description

Node’s P2P information.

+

Fields§

§id: PublicKey

Unique identifier of the node on the P2P transport.

+
§addresses: Option<Vec<TCPAddress>>

List of addresses at which the node can be reached.

+

Trait Implementations§

source§

impl Clone for P2PInfo

source§

fn clone(&self) -> P2PInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for P2PInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for P2PInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for P2PInfo

source§

fn default() -> P2PInfo

Returns the “default value” for a type. Read more
source§

impl Encode for P2PInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for P2PInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for P2PInfo

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for P2PInfo

source§

fn eq(&self, other: &P2PInfo) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for P2PInfo

source§

impl StructuralPartialEq for P2PInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.PerRoleAdmissionPolicy.html b/rust/oasis_core_runtime/consensus/registry/struct.PerRoleAdmissionPolicy.html new file mode 100644 index 0000000000..8501b387b8 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.PerRoleAdmissionPolicy.html @@ -0,0 +1,35 @@ +PerRoleAdmissionPolicy in oasis_core_runtime::consensus::registry - Rust
pub struct PerRoleAdmissionPolicy {
+    pub entity_whitelist: Option<EntityWhitelistRoleAdmissionPolicy>,
+}
Expand description

A per-role admission policy.

+

Fields§

§entity_whitelist: Option<EntityWhitelistRoleAdmissionPolicy>

Trait Implementations§

source§

impl Clone for PerRoleAdmissionPolicy

source§

fn clone(&self) -> PerRoleAdmissionPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PerRoleAdmissionPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PerRoleAdmissionPolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for PerRoleAdmissionPolicy

source§

fn default() -> PerRoleAdmissionPolicy

Returns the “default value” for a type. Read more
source§

impl Encode for PerRoleAdmissionPolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for PerRoleAdmissionPolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for PerRoleAdmissionPolicy

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for PerRoleAdmissionPolicy

source§

fn eq(&self, other: &PerRoleAdmissionPolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for PerRoleAdmissionPolicy

source§

impl StructuralPartialEq for PerRoleAdmissionPolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.RolesMask.html b/rust/oasis_core_runtime/consensus/registry/struct.RolesMask.html new file mode 100644 index 0000000000..265393d68f --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.RolesMask.html @@ -0,0 +1,48 @@ +RolesMask in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::RolesMask

source ·
pub struct RolesMask(pub u32);
Expand description

Oasis node roles bitmask.

+

Tuple Fields§

§0: u32

Implementations§

source§

impl RolesMask

source

pub const ROLE_EMPTY: RolesMask = _

Empty roles mask.

+
source

pub const ROLE_COMPUTE_WORKER: RolesMask = _

Compute worker role.

+
source

pub const ROLE_OBSERVER: RolesMask = _

Observer role.

+
source

pub const ROLE_KEY_MANAGER: RolesMask = _

Key manager role.

+
source

pub const ROLE_VALIDATOR: RolesMask = _

Validator role.

+
source

pub const ROLE_RESERVED_3: RolesMask = _

Public consensus RPC services worker role.

+
source

pub const ROLE_STORAGE_RPC: RolesMask = _

Public storage RPC services worker role.

+
source

pub const ROLES_RESERVED: RolesMask = _

source

pub fn contains(&self, role: RolesMask) -> bool

Whether the roles mask contains any of the specified roles.

+
source

pub fn is_single_role(&self) -> bool

Whether the roles mask encodes a single valid role.

+

Trait Implementations§

source§

impl BitAnd for RolesMask

§

type Output = RolesMask

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl BitOr for RolesMask

§

type Output = RolesMask

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl Clone for RolesMask

source§

fn clone(&self) -> RolesMask

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RolesMask

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RolesMask

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RolesMask

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for RolesMask

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for RolesMask

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for RolesMask

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for RolesMask

source§

fn eq(&self, other: &RolesMask) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for RolesMask

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Copy for RolesMask

source§

impl Eq for RolesMask

source§

impl StructuralPartialEq for RolesMask

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.Runtime.html b/rust/oasis_core_runtime/consensus/registry/struct.Runtime.html new file mode 100644 index 0000000000..13b5c49b94 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.Runtime.html @@ -0,0 +1,66 @@ +Runtime in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::Runtime

source ·
pub struct Runtime {
Show 15 fields + pub v: u16, + pub id: Namespace, + pub entity_id: PublicKey, + pub genesis: RuntimeGenesis, + pub kind: RuntimeKind, + pub tee_hardware: TEEHardware, + pub deployments: Vec<VersionInfo>, + pub key_manager: Option<Namespace>, + pub executor: ExecutorParameters, + pub txn_scheduler: TxnSchedulerParameters, + pub storage: StorageParameters, + pub admission_policy: RuntimeAdmissionPolicy, + pub constraints: BTreeMap<CommitteeKind, BTreeMap<Role, SchedulingConstraints>>, + pub staking: RuntimeStakingParameters, + pub governance_model: RuntimeGovernanceModel, +
}
Expand description

Runtime.

+

Fields§

§v: u16

Structure version.

+
§id: Namespace

Globally unique long term identifier of the runtime.

+
§entity_id: PublicKey

Public key identifying the Entity controlling the runtime.

+
§genesis: RuntimeGenesis

Runtime genesis information.

+
§kind: RuntimeKind

Type of runtime.

+
§tee_hardware: TEEHardware

Runtime’s TEE hardware requirements.

+
§deployments: Vec<VersionInfo>

Runtime deployment information.

+
§key_manager: Option<Namespace>

Key manager runtime ID for this runtime.

+
§executor: ExecutorParameters

Parameters of the executor committee.

+
§txn_scheduler: TxnSchedulerParameters

Transaction scheduling parameters of the executor committee.

+
§storage: StorageParameters

Parameters of the storage committee.

+
§admission_policy: RuntimeAdmissionPolicy

Which nodes are allowed to register for this runtime.

+
§constraints: BTreeMap<CommitteeKind, BTreeMap<Role, SchedulingConstraints>>

Node scheduling constraints.

+
§staking: RuntimeStakingParameters

Runtime’s staking-related parameters.

+
§governance_model: RuntimeGovernanceModel

Runtime governance model.

+

Implementations§

source§

impl Runtime

source

pub fn active_deployment(&self, now: EpochTime) -> Option<VersionInfo>

The currently active deployment for the specified epoch if it exists.

+
source

pub fn deployment_for_version(&self, version: Version) -> Option<VersionInfo>

Deployment corresponding to the specified version if it exists.

+

Trait Implementations§

source§

impl Clone for Runtime

source§

fn clone(&self) -> Runtime

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Runtime

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Runtime

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Runtime

source§

fn default() -> Runtime

Returns the “default value” for a type. Read more
source§

impl Encode for Runtime

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Runtime

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Runtime

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Runtime

source§

fn eq(&self, other: &Runtime) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Runtime

source§

impl StructuralPartialEq for Runtime

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.RuntimeAdmissionPolicy.html b/rust/oasis_core_runtime/consensus/registry/struct.RuntimeAdmissionPolicy.html new file mode 100644 index 0000000000..505b5f7a3c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.RuntimeAdmissionPolicy.html @@ -0,0 +1,41 @@ +RuntimeAdmissionPolicy in oasis_core_runtime::consensus::registry - Rust
pub struct RuntimeAdmissionPolicy {
+    pub any_node: Option<AnyNodeRuntimeAdmissionPolicy>,
+    pub entity_whitelist: Option<EntityWhitelistRuntimeAdmissionPolicy>,
+    pub per_role: BTreeMap<RolesMask, PerRoleAdmissionPolicy>,
+}
Expand description

Specification of which nodes are allowed to register for a runtime.

+

Fields§

§any_node: Option<AnyNodeRuntimeAdmissionPolicy>

Allow any node to register.

+
§entity_whitelist: Option<EntityWhitelistRuntimeAdmissionPolicy>

Allow only the whitelisted entities’ nodes to register.

+
§per_role: BTreeMap<RolesMask, PerRoleAdmissionPolicy>

A per-role admission policy that must be satisfied in addition to the global admission +policy for a specific role.

+

Trait Implementations§

source§

impl Clone for RuntimeAdmissionPolicy

source§

fn clone(&self) -> RuntimeAdmissionPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeAdmissionPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeAdmissionPolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RuntimeAdmissionPolicy

source§

fn default() -> RuntimeAdmissionPolicy

Returns the “default value” for a type. Read more
source§

impl Encode for RuntimeAdmissionPolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RuntimeAdmissionPolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for RuntimeAdmissionPolicy

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RuntimeAdmissionPolicy

source§

fn eq(&self, other: &RuntimeAdmissionPolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RuntimeAdmissionPolicy

source§

impl StructuralPartialEq for RuntimeAdmissionPolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.RuntimeGenesis.html b/rust/oasis_core_runtime/consensus/registry/struct.RuntimeGenesis.html new file mode 100644 index 0000000000..9c3cc2988a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.RuntimeGenesis.html @@ -0,0 +1,39 @@ +RuntimeGenesis in oasis_core_runtime::consensus::registry - Rust
pub struct RuntimeGenesis {
+    pub state_root: Hash,
+    pub round: u64,
+}
Expand description

Runtime genesis information that is used to initialize runtime state in the first block.

+

Fields§

§state_root: Hash

State root that should be used at genesis time. If the runtime should start with empty state, +this must be set to the empty hash.

+
§round: u64

Runtime round in the genesis.

+

Trait Implementations§

source§

impl Clone for RuntimeGenesis

source§

fn clone(&self) -> RuntimeGenesis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeGenesis

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeGenesis

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RuntimeGenesis

source§

fn default() -> RuntimeGenesis

Returns the “default value” for a type. Read more
source§

impl Encode for RuntimeGenesis

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RuntimeGenesis

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for RuntimeGenesis

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RuntimeGenesis

source§

fn eq(&self, other: &RuntimeGenesis) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RuntimeGenesis

source§

impl StructuralPartialEq for RuntimeGenesis

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.RuntimeStakingParameters.html b/rust/oasis_core_runtime/consensus/registry/struct.RuntimeStakingParameters.html new file mode 100644 index 0000000000..d86dbd1c44 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.RuntimeStakingParameters.html @@ -0,0 +1,50 @@ +RuntimeStakingParameters in oasis_core_runtime::consensus::registry - Rust
pub struct RuntimeStakingParameters {
+    pub thresholds: BTreeMap<ThresholdKind, Quantity>,
+    pub slashing: BTreeMap<SlashReason, Slash>,
+    pub reward_equivocation: u8,
+    pub reward_bad_results: u8,
+    pub min_in_message_fee: Quantity,
+}
Expand description

Stake-related parameters for a runtime.

+

Fields§

§thresholds: BTreeMap<ThresholdKind, Quantity>

Minimum stake thresholds for a runtime. These per-runtime thresholds are +in addition to the global thresholds. May be left unspecified.

+

In case a node is registered for multiple runtimes, it will need to +satisfy the maximum threshold of all the runtimes.

+
§slashing: BTreeMap<SlashReason, Slash>

Per-runtime misbehavior slashing parameters.

+
§reward_equivocation: u8

The percentage of the reward obtained when slashing for equivocation that is transferred to +the runtime’s account.

+
§reward_bad_results: u8

The percentage of the reward obtained when slashing for incorrect results that is +transferred to the runtime’s account.

+
§min_in_message_fee: Quantity

Specifies the minimum fee that the incoming message must include for the +message to be queued.

+

Trait Implementations§

source§

impl Clone for RuntimeStakingParameters

source§

fn clone(&self) -> RuntimeStakingParameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeStakingParameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeStakingParameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RuntimeStakingParameters

source§

fn default() -> RuntimeStakingParameters

Returns the “default value” for a type. Read more
source§

impl Encode for RuntimeStakingParameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RuntimeStakingParameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for RuntimeStakingParameters

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RuntimeStakingParameters

source§

fn eq(&self, other: &RuntimeStakingParameters) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RuntimeStakingParameters

source§

impl StructuralPartialEq for RuntimeStakingParameters

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.SchedulingConstraints.html b/rust/oasis_core_runtime/consensus/registry/struct.SchedulingConstraints.html new file mode 100644 index 0000000000..9a2788c06e --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.SchedulingConstraints.html @@ -0,0 +1,38 @@ +SchedulingConstraints in oasis_core_runtime::consensus::registry - Rust
pub struct SchedulingConstraints {
+    pub validator_set: Option<ValidatorSetConstraint>,
+    pub max_nodes: Option<MaxNodesConstraint>,
+    pub min_pool_size: Option<MinPoolSizeConstraint>,
+}
Expand description

The node scheduling constraints.

+

Multiple fields may be set in which case the ALL the constraints must be satisfied.

+

Fields§

§validator_set: Option<ValidatorSetConstraint>§max_nodes: Option<MaxNodesConstraint>§min_pool_size: Option<MinPoolSizeConstraint>

Trait Implementations§

source§

impl Clone for SchedulingConstraints

source§

fn clone(&self) -> SchedulingConstraints

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SchedulingConstraints

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SchedulingConstraints

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SchedulingConstraints

source§

fn default() -> SchedulingConstraints

Returns the “default value” for a type. Read more
source§

impl Encode for SchedulingConstraints

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SchedulingConstraints

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for SchedulingConstraints

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for SchedulingConstraints

source§

fn eq(&self, other: &SchedulingConstraints) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SchedulingConstraints

source§

impl StructuralPartialEq for SchedulingConstraints

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.StorageParameters.html b/rust/oasis_core_runtime/consensus/registry/struct.StorageParameters.html new file mode 100644 index 0000000000..1d303eb11c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.StorageParameters.html @@ -0,0 +1,40 @@ +StorageParameters in oasis_core_runtime::consensus::registry - Rust
pub struct StorageParameters {
+    pub checkpoint_interval: u64,
+    pub checkpoint_num_kept: u64,
+    pub checkpoint_chunk_size: u64,
+}
Expand description

Storage parameters.

+

Fields§

§checkpoint_interval: u64

Expected runtime state checkpoint interval (in rounds).

+
§checkpoint_num_kept: u64

Expected minimum number of checkpoints to keep.

+
§checkpoint_chunk_size: u64

Chunk size parameter for checkpoint creation.

+

Trait Implementations§

source§

impl Clone for StorageParameters

source§

fn clone(&self) -> StorageParameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StorageParameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StorageParameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for StorageParameters

source§

fn default() -> StorageParameters

Returns the “default value” for a type. Read more
source§

impl Encode for StorageParameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for StorageParameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for StorageParameters

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for StorageParameters

source§

fn eq(&self, other: &StorageParameters) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for StorageParameters

source§

impl StructuralPartialEq for StorageParameters

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.TCPAddress.html b/rust/oasis_core_runtime/consensus/registry/struct.TCPAddress.html new file mode 100644 index 0000000000..23ea00db51 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.TCPAddress.html @@ -0,0 +1,37 @@ +TCPAddress in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::TCPAddress

source ·
pub struct TCPAddress {
+    pub ip: Vec<u8>,
+    pub port: i64,
+    pub zone: String,
+}
Expand description

Represents the address of a TCP endpoint.

+

Fields§

§ip: Vec<u8>§port: i64§zone: String

Trait Implementations§

source§

impl Clone for TCPAddress

source§

fn clone(&self) -> TCPAddress

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TCPAddress

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TCPAddress

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TCPAddress

source§

fn default() -> TCPAddress

Returns the “default value” for a type. Read more
source§

impl Encode for TCPAddress

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TCPAddress

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for TCPAddress

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for TCPAddress

source§

fn eq(&self, other: &TCPAddress) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TCPAddress

source§

impl StructuralPartialEq for TCPAddress

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.TLSAddress.html b/rust/oasis_core_runtime/consensus/registry/struct.TLSAddress.html new file mode 100644 index 0000000000..a09f871074 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.TLSAddress.html @@ -0,0 +1,40 @@ +TLSAddress in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::TLSAddress

source ·
pub struct TLSAddress {
+    pub pub_key: PublicKey,
+    pub address: TCPAddress,
+}
Expand description

Represents an Oasis committee address that includes a TLS public key and a TCP address.

+

NOTE: The address TLS public key can be different from the actual node TLS public key to allow +using a sentry node’s addresses.

+

Fields§

§pub_key: PublicKey

Public key used for establishing TLS connections.

+
§address: TCPAddress

Address at which the node can be reached.

+

Trait Implementations§

source§

impl Clone for TLSAddress

source§

fn clone(&self) -> TLSAddress

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TLSAddress

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TLSAddress

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TLSAddress

source§

fn default() -> TLSAddress

Returns the “default value” for a type. Read more
source§

impl Encode for TLSAddress

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TLSAddress

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for TLSAddress

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for TLSAddress

source§

fn eq(&self, other: &TLSAddress) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TLSAddress

source§

impl StructuralPartialEq for TLSAddress

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.TLSInfo.html b/rust/oasis_core_runtime/consensus/registry/struct.TLSInfo.html new file mode 100644 index 0000000000..7a2c32535a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.TLSInfo.html @@ -0,0 +1,38 @@ +TLSInfo in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::TLSInfo

source ·
pub struct TLSInfo {
+    pub pub_key: PublicKey,
+    pub _deprecated_next_pub_key: Option<PublicKey>,
+    pub _deprecated_addresses: Option<Vec<TLSAddress>>,
+}
Expand description

Node’s TLS information.

+

Fields§

§pub_key: PublicKey

Public key used for establishing TLS connections.

+
§_deprecated_next_pub_key: Option<PublicKey>§_deprecated_addresses: Option<Vec<TLSAddress>>

Trait Implementations§

source§

impl Clone for TLSInfo

source§

fn clone(&self) -> TLSInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TLSInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TLSInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TLSInfo

source§

fn default() -> TLSInfo

Returns the “default value” for a type. Read more
source§

impl Encode for TLSInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TLSInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for TLSInfo

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for TLSInfo

source§

fn eq(&self, other: &TLSInfo) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TLSInfo

source§

impl StructuralPartialEq for TLSInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.TxnSchedulerParameters.html b/rust/oasis_core_runtime/consensus/registry/struct.TxnSchedulerParameters.html new file mode 100644 index 0000000000..7dc55b3acf --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.TxnSchedulerParameters.html @@ -0,0 +1,45 @@ +TxnSchedulerParameters in oasis_core_runtime::consensus::registry - Rust
pub struct TxnSchedulerParameters {
+    pub batch_flush_timeout: i64,
+    pub max_batch_size: u64,
+    pub max_batch_size_bytes: u64,
+    pub max_in_messages: u32,
+    pub propose_batch_timeout: i64,
+}
Expand description

Parameters for the runtime transaction scheduler.

+

Fields§

§batch_flush_timeout: i64

How long to wait for a scheduled batch in nanoseconds (when using the +“simple” scheduling algorithm).

+
§max_batch_size: u64

Maximum size of a scheduled batch.

+
§max_batch_size_bytes: u64

Maximum size of a scheduled batch in bytes.

+
§max_in_messages: u32

Maximum size of the incoming message queue.

+
§propose_batch_timeout: i64

How long to wait before accepting proposal from the next backup scheduler in nanoseconds.

+

Trait Implementations§

source§

impl Clone for TxnSchedulerParameters

source§

fn clone(&self) -> TxnSchedulerParameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TxnSchedulerParameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TxnSchedulerParameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TxnSchedulerParameters

source§

fn default() -> TxnSchedulerParameters

Returns the “default value” for a type. Read more
source§

impl Encode for TxnSchedulerParameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TxnSchedulerParameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for TxnSchedulerParameters

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for TxnSchedulerParameters

source§

fn eq(&self, other: &TxnSchedulerParameters) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TxnSchedulerParameters

source§

impl StructuralPartialEq for TxnSchedulerParameters

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.VRFInfo.html b/rust/oasis_core_runtime/consensus/registry/struct.VRFInfo.html new file mode 100644 index 0000000000..402391f931 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.VRFInfo.html @@ -0,0 +1,36 @@ +VRFInfo in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::VRFInfo

source ·
pub struct VRFInfo {
+    pub id: PublicKey,
+}
Expand description

Contains information for this node’s participation in VRF based elections.

+

Fields§

§id: PublicKey

Unique identifier of the node used to generate VRF proofs.

+

Trait Implementations§

source§

impl Clone for VRFInfo

source§

fn clone(&self) -> VRFInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VRFInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for VRFInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for VRFInfo

source§

fn default() -> VRFInfo

Returns the “default value” for a type. Read more
source§

impl Encode for VRFInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for VRFInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for VRFInfo

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for VRFInfo

source§

fn eq(&self, other: &VRFInfo) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for VRFInfo

source§

impl StructuralPartialEq for VRFInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.ValidatorSetConstraint.html b/rust/oasis_core_runtime/consensus/registry/struct.ValidatorSetConstraint.html new file mode 100644 index 0000000000..26fac3ecb6 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.ValidatorSetConstraint.html @@ -0,0 +1,34 @@ +ValidatorSetConstraint in oasis_core_runtime::consensus::registry - Rust
pub struct ValidatorSetConstraint {}
Expand description

A constraint which specifies that the entity must have a node that is part of the validator set. +No other options can currently be specified.

+

Trait Implementations§

source§

impl Clone for ValidatorSetConstraint

source§

fn clone(&self) -> ValidatorSetConstraint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ValidatorSetConstraint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ValidatorSetConstraint

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ValidatorSetConstraint

source§

fn default() -> ValidatorSetConstraint

Returns the “default value” for a type. Read more
source§

impl Encode for ValidatorSetConstraint

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ValidatorSetConstraint

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ValidatorSetConstraint

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ValidatorSetConstraint

source§

fn eq(&self, other: &ValidatorSetConstraint) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ValidatorSetConstraint

source§

impl StructuralPartialEq for ValidatorSetConstraint

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.VerifiedAttestation.html b/rust/oasis_core_runtime/consensus/registry/struct.VerifiedAttestation.html new file mode 100644 index 0000000000..cc3d0258d5 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.VerifiedAttestation.html @@ -0,0 +1,28 @@ +VerifiedAttestation in oasis_core_runtime::consensus::registry - Rust
pub struct VerifiedAttestation {
+    pub quote: VerifiedQuote,
+    pub height: Option<u64>,
+}
Expand description

Verified remote attestation.

+

Fields§

§quote: VerifiedQuote

Verified enclave quote.

+
§height: Option<u64>

Enclave’s view of the consensus layer height at the time of attestation.

+

Trait Implementations§

source§

impl Clone for VerifiedAttestation

source§

fn clone(&self) -> VerifiedAttestation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VerifiedAttestation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for VerifiedAttestation

source§

fn default() -> VerifiedAttestation

Returns the “default value” for a type. Read more
source§

impl From<VerifiedAttestation> for VerifiedEndorsedCapabilityTEE

source§

fn from(verified_attestation: VerifiedAttestation) -> Self

Converts to this type from the input type.
source§

impl From<VerifiedQuote> for VerifiedAttestation

source§

fn from(quote: VerifiedQuote) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.VerifiedEndorsedCapabilityTEE.html b/rust/oasis_core_runtime/consensus/registry/struct.VerifiedEndorsedCapabilityTEE.html new file mode 100644 index 0000000000..adad4a865c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.VerifiedEndorsedCapabilityTEE.html @@ -0,0 +1,28 @@ +VerifiedEndorsedCapabilityTEE in oasis_core_runtime::consensus::registry - Rust
pub struct VerifiedEndorsedCapabilityTEE {
+    pub verified_attestation: VerifiedAttestation,
+    pub node_id: Option<PublicKey>,
+}
Expand description

A verified endorsed CapabilityTEE structure.

+

Fields§

§verified_attestation: VerifiedAttestation

Verified TEE remote attestation.

+
§node_id: Option<PublicKey>

Optional identifier of the node that endorsed the TEE capability.

+

Trait Implementations§

source§

impl Clone for VerifiedEndorsedCapabilityTEE

source§

fn clone(&self) -> VerifiedEndorsedCapabilityTEE

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VerifiedEndorsedCapabilityTEE

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for VerifiedEndorsedCapabilityTEE

source§

fn default() -> VerifiedEndorsedCapabilityTEE

Returns the “default value” for a type. Read more
source§

impl From<VerifiedAttestation> for VerifiedEndorsedCapabilityTEE

source§

fn from(verified_attestation: VerifiedAttestation) -> Self

Converts to this type from the input type.
source§

impl From<VerifiedQuote> for VerifiedEndorsedCapabilityTEE

source§

fn from(verified_quote: VerifiedQuote) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/registry/struct.VersionInfo.html b/rust/oasis_core_runtime/consensus/registry/struct.VersionInfo.html new file mode 100644 index 0000000000..87319f8f4a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/registry/struct.VersionInfo.html @@ -0,0 +1,44 @@ +VersionInfo in oasis_core_runtime::consensus::registry - Rust

Struct oasis_core_runtime::consensus::registry::VersionInfo

source ·
pub struct VersionInfo {
+    pub version: Version,
+    pub valid_from: EpochTime,
+    pub tee: Vec<u8>,
+    pub bundle_checksum: Vec<u8>,
+}
Expand description

Per-runtime version information.

+

Fields§

§version: Version

Version of the runtime.

+
§valid_from: EpochTime

The epoch at which this version is valid.

+
§tee: Vec<u8>

Enclave version information, in an enclave provided specific format (if any).

+
§bundle_checksum: Vec<u8>

The SHA256 hash of the runtime bundle (optional).

+

Implementations§

source§

impl VersionInfo

source

pub fn try_decode_tee<T>(&self) -> Result<T, DecodeError>
where + T: Decode,

Tries to decode the TEE-specific version information.

+

Trait Implementations§

source§

impl Clone for VersionInfo

source§

fn clone(&self) -> VersionInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VersionInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for VersionInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for VersionInfo

source§

fn default() -> VersionInfo

Returns the “default value” for a type. Read more
source§

impl Encode for VersionInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for VersionInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for VersionInfo

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for VersionInfo

source§

fn eq(&self, other: &VersionInfo) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for VersionInfo

source§

impl StructuralPartialEq for VersionInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/block/enum.HeaderType.html b/rust/oasis_core_runtime/consensus/roothash/block/enum.HeaderType.html new file mode 100644 index 0000000000..657498c3fa --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/block/enum.HeaderType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/enum.HeaderType.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/block/struct.Block.html b/rust/oasis_core_runtime/consensus/roothash/block/struct.Block.html new file mode 100644 index 0000000000..cfc70f0b2d --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/block/struct.Block.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/struct.Block.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/block/struct.Header.html b/rust/oasis_core_runtime/consensus/roothash/block/struct.Header.html new file mode 100644 index 0000000000..8ede2ed4a9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/block/struct.Header.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/struct.Header.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/executor/constant.COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT.html b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/constant.COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT.html new file mode 100644 index 0000000000..c88d2a34bb --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/constant.COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/constant.COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/executor/constant.EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT.html b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/constant.EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT.html new file mode 100644 index 0000000000..878d9314c5 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/constant.EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/constant.EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/executor/enum.ExecutorCommitmentFailure.html b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/enum.ExecutorCommitmentFailure.html new file mode 100644 index 0000000000..19de9d8a00 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/enum.ExecutorCommitmentFailure.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/enum.ExecutorCommitmentFailure.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ComputeResultsHeader.html b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ComputeResultsHeader.html new file mode 100644 index 0000000000..e606b821f3 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ComputeResultsHeader.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/struct.ComputeResultsHeader.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ExecutorCommitment.html b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ExecutorCommitment.html new file mode 100644 index 0000000000..3527316416 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ExecutorCommitment.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/struct.ExecutorCommitment.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ExecutorCommitmentHeader.html b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ExecutorCommitmentHeader.html new file mode 100644 index 0000000000..47eb1cf63a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/executor/struct.ExecutorCommitmentHeader.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/struct.ExecutorCommitmentHeader.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/pool/struct.Pool.html b/rust/oasis_core_runtime/consensus/roothash/commitment/pool/struct.Pool.html new file mode 100644 index 0000000000..2449fd259d --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/pool/struct.Pool.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/struct.Pool.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/pool/trait.MessageValidator.html b/rust/oasis_core_runtime/consensus/roothash/commitment/pool/trait.MessageValidator.html new file mode 100644 index 0000000000..824330f537 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/pool/trait.MessageValidator.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/trait.MessageValidator.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/pool/trait.NodeLookup.html b/rust/oasis_core_runtime/consensus/roothash/commitment/pool/trait.NodeLookup.html new file mode 100644 index 0000000000..c09efc22e1 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/pool/trait.NodeLookup.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/roothash/trait.NodeLookup.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/commitment/trait.OpenCommitment.html b/rust/oasis_core_runtime/consensus/roothash/commitment/trait.OpenCommitment.html new file mode 100644 index 0000000000..bf4d238cb2 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/commitment/trait.OpenCommitment.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/trait.OpenCommitment.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/constant.COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT.html b/rust/oasis_core_runtime/consensus/roothash/constant.COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT.html new file mode 100644 index 0000000000..ed3c66d601 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/constant.COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT.html @@ -0,0 +1,2 @@ +COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT in oasis_core_runtime::consensus::roothash - Rust
pub const COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT: &[u8] = b"oasis-core/roothash: compute results header";
Expand description

The signature context used to sign compute results headers with RAK.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/constant.EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT.html b/rust/oasis_core_runtime/consensus/roothash/constant.EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT.html new file mode 100644 index 0000000000..aa6c92692a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/constant.EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT.html @@ -0,0 +1,2 @@ +EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT in oasis_core_runtime::consensus::roothash - Rust
pub const EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT: &[u8] = b"oasis-core/roothash: executor commitment";
Expand description

The signature context used to sign executor worker commitments.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/enum.Error.html b/rust/oasis_core_runtime/consensus/roothash/enum.Error.html new file mode 100644 index 0000000000..b256438095 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/enum.Error.html @@ -0,0 +1,40 @@ +Error in oasis_core_runtime::consensus::roothash - Rust

Enum oasis_core_runtime::consensus::roothash::Error

source ·
pub enum Error {
+
Show 17 variants InvalidRuntime(Namespace), + State(StateError), + NoRuntime, + NoCommittee, + InvalidCommitteeKind, + RakSigInvalid, + NotInCommittee, + AlreadyCommitted, + NotBasedOnCorrectBlock, + DiscrepancyDetected, + StillWaiting, + InsufficientVotes, + BadExecutorCommitment, + InvalidMessages, + InvalidRound, + NoProposerCommitment, + BadProposerCommitment, +
}
Expand description

Errors emitted by the roothash module.

+

Variants§

§

InvalidRuntime(Namespace)

§

State(StateError)

§

NoRuntime

§

NoCommittee

§

InvalidCommitteeKind

§

RakSigInvalid

§

NotInCommittee

§

AlreadyCommitted

§

NotBasedOnCorrectBlock

§

DiscrepancyDetected

§

StillWaiting

§

InsufficientVotes

§

BadExecutorCommitment

§

InvalidMessages

§

InvalidRound

§

NoProposerCommitment

§

BadProposerCommitment

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<StateError> for Error

source§

fn from(source: StateError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/enum.ExecutorCommitmentFailure.html b/rust/oasis_core_runtime/consensus/roothash/enum.ExecutorCommitmentFailure.html new file mode 100644 index 0000000000..1fc48c48d4 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/enum.ExecutorCommitmentFailure.html @@ -0,0 +1,38 @@ +ExecutorCommitmentFailure in oasis_core_runtime::consensus::roothash - Rust
#[repr(u8)]
pub enum ExecutorCommitmentFailure { + FailureNone = 0, + FailureUnknown = 1, + FailureStateUnavailable = 2, +}
Expand description

The executor commitment failure reason.

+

Variants§

§

FailureNone = 0

Indicates that no failure has occurred.

+
§

FailureUnknown = 1

Indicates a generic failure.

+
§

FailureStateUnavailable = 2

Indicates that batch processing failed due to the state being +unavailable.

+

Trait Implementations§

source§

impl Clone for ExecutorCommitmentFailure

source§

fn clone(&self) -> ExecutorCommitmentFailure

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutorCommitmentFailure

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecutorCommitmentFailure

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecutorCommitmentFailure

source§

fn default() -> ExecutorCommitmentFailure

Returns the “default value” for a type. Read more
source§

impl Encode for ExecutorCommitmentFailure

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for ExecutorCommitmentFailure

source§

fn eq(&self, other: &ExecutorCommitmentFailure) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ExecutorCommitmentFailure

source§

impl StructuralPartialEq for ExecutorCommitmentFailure

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/enum.GovernanceMessage.html b/rust/oasis_core_runtime/consensus/roothash/enum.GovernanceMessage.html new file mode 100644 index 0000000000..9861e9e1c8 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/enum.GovernanceMessage.html @@ -0,0 +1,35 @@ +GovernanceMessage in oasis_core_runtime::consensus::roothash - Rust
pub enum GovernanceMessage {
+    CastVote(ProposalVote),
+    SubmitProposal(ProposalContent),
+}

Variants§

§

CastVote(ProposalVote)

§

SubmitProposal(ProposalContent)

Implementations§

source§

impl GovernanceMessage

source

pub fn validate_basic(&self) -> Result<()>

Performs basic validation of the governance message.

+

Trait Implementations§

source§

impl Clone for GovernanceMessage

source§

fn clone(&self) -> GovernanceMessage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GovernanceMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GovernanceMessage

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for GovernanceMessage

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GovernanceMessage

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for GovernanceMessage

source§

fn eq(&self, other: &GovernanceMessage) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for GovernanceMessage

source§

impl StructuralPartialEq for GovernanceMessage

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/enum.HeaderType.html b/rust/oasis_core_runtime/consensus/roothash/enum.HeaderType.html new file mode 100644 index 0000000000..227d557cec --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/enum.HeaderType.html @@ -0,0 +1,40 @@ +HeaderType in oasis_core_runtime::consensus::roothash - Rust

Enum oasis_core_runtime::consensus::roothash::HeaderType

source ·
#[repr(u8)]
pub enum HeaderType { + Invalid = 0, + Normal = 1, + RoundFailed = 2, + EpochTransition = 3, + Suspended = 4, +}
Expand description

Header type.

+

§Note

+

This should be kept in sync with go/roothash/api/block/header.go.

+

Variants§

§

Invalid = 0

§

Normal = 1

§

RoundFailed = 2

§

EpochTransition = 3

§

Suspended = 4

Trait Implementations§

source§

impl Clone for HeaderType

source§

fn clone(&self) -> HeaderType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HeaderType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for HeaderType

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for HeaderType

source§

fn default() -> HeaderType

Returns the “default value” for a type. Read more
source§

impl Encode for HeaderType

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for HeaderType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for HeaderType

source§

fn eq(&self, other: &HeaderType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for HeaderType

source§

impl StructuralPartialEq for HeaderType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/enum.Message.html b/rust/oasis_core_runtime/consensus/roothash/enum.Message.html new file mode 100644 index 0000000000..0edcbfa6c4 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/enum.Message.html @@ -0,0 +1,39 @@ +Message in oasis_core_runtime::consensus::roothash - Rust

Enum oasis_core_runtime::consensus::roothash::Message

source ·
pub enum Message {
+    Staking(Versioned<StakingMessage>),
+    Registry(Versioned<RegistryMessage>),
+    Governance(Versioned<GovernanceMessage>),
+}
Expand description

A message that can be emitted by the runtime to be processed by the consensus layer.

+

Variants§

Implementations§

source§

impl Message

source

pub fn messages_hash(msgs: &[Message]) -> Hash

Returns a hash of provided runtime messages.

+
source

pub fn in_messages_hash(msgs: &[IncomingMessage]) -> Hash

Returns a hash of provided incoming runtime messages.

+
source

pub fn validate_basic(&self) -> Result<()>

Performs basic validation of the runtime message.

+

Trait Implementations§

source§

impl Clone for Message

source§

fn clone(&self) -> Message

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Message

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Message

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Message

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Message

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Message

source§

fn eq(&self, other: &Message) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Message

source§

impl StructuralPartialEq for Message

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/enum.RegistryMessage.html b/rust/oasis_core_runtime/consensus/roothash/enum.RegistryMessage.html new file mode 100644 index 0000000000..06b67ad98b --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/enum.RegistryMessage.html @@ -0,0 +1,36 @@ +RegistryMessage in oasis_core_runtime::consensus::roothash - Rust
pub enum RegistryMessage {
+    UpdateRuntime(Runtime),
+}

Variants§

§

UpdateRuntime(Runtime)

Implementations§

source§

impl RegistryMessage

source

pub fn validate_basic(&self) -> Result<()>

Performs basic validation of the registry message.

+

Trait Implementations§

source§

impl Clone for RegistryMessage

source§

fn clone(&self) -> RegistryMessage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RegistryMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RegistryMessage

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for RegistryMessage

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RegistryMessage

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for RegistryMessage

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RegistryMessage

source§

fn eq(&self, other: &RegistryMessage) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RegistryMessage

source§

impl StructuralPartialEq for RegistryMessage

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/enum.StakingMessage.html b/rust/oasis_core_runtime/consensus/roothash/enum.StakingMessage.html new file mode 100644 index 0000000000..2d2f6da65f --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/enum.StakingMessage.html @@ -0,0 +1,39 @@ +StakingMessage in oasis_core_runtime::consensus::roothash - Rust
pub enum StakingMessage {
+    Transfer(Transfer),
+    Withdraw(Withdraw),
+    AddEscrow(Escrow),
+    ReclaimEscrow(ReclaimEscrow),
+}

Variants§

§

Transfer(Transfer)

§

Withdraw(Withdraw)

§

AddEscrow(Escrow)

§

ReclaimEscrow(ReclaimEscrow)

Implementations§

source§

impl StakingMessage

source

pub fn validate_basic(&self) -> Result<()>

Performs basic validation of the staking message.

+

Trait Implementations§

source§

impl Clone for StakingMessage

source§

fn clone(&self) -> StakingMessage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StakingMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StakingMessage

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for StakingMessage

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for StakingMessage

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for StakingMessage

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for StakingMessage

source§

fn eq(&self, other: &StakingMessage) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for StakingMessage

source§

impl StructuralPartialEq for StakingMessage

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/index.html b/rust/oasis_core_runtime/consensus/roothash/index.html new file mode 100644 index 0000000000..9c68597a58 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/index.html @@ -0,0 +1,7 @@ +oasis_core_runtime::consensus::roothash - Rust

Module oasis_core_runtime::consensus::roothash

source ·
Expand description

Consensus roothash structures.

+

§Note

+

This MUST be kept in sync with go/roothash/api.

+

Structs§

  • Runtime block annotated with consensus information.
  • Runtime block.
  • The header of a computed batch output by a runtime. This header is a +compressed representation (e.g., hashes instead of full content) of +the actual results.
  • A commitment to results of processing a proposed runtime block.
  • The header of an executor commitment.
  • Block header.
  • An incoming message emitted by the consensus layer to be processed by the runtime.
  • Result of a message being processed by the consensus layer.
  • A pool of commitments that can be used to perform +discrepancy detection.
  • Information about how a particular round was executed by the consensus layer.
  • Per-round state and I/O roots that are stored in consensus state.

Enums§

Constants§

Traits§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/message/enum.GovernanceMessage.html b/rust/oasis_core_runtime/consensus/roothash/message/enum.GovernanceMessage.html new file mode 100644 index 0000000000..d1cb1d61ae --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/message/enum.GovernanceMessage.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/enum.GovernanceMessage.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/message/enum.Message.html b/rust/oasis_core_runtime/consensus/roothash/message/enum.Message.html new file mode 100644 index 0000000000..5c639c4192 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/message/enum.Message.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/enum.Message.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/message/enum.RegistryMessage.html b/rust/oasis_core_runtime/consensus/roothash/message/enum.RegistryMessage.html new file mode 100644 index 0000000000..a8a5f06b6a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/message/enum.RegistryMessage.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/enum.RegistryMessage.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/message/enum.StakingMessage.html b/rust/oasis_core_runtime/consensus/roothash/message/enum.StakingMessage.html new file mode 100644 index 0000000000..7ac803a89d --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/message/enum.StakingMessage.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/enum.StakingMessage.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/message/struct.IncomingMessage.html b/rust/oasis_core_runtime/consensus/roothash/message/struct.IncomingMessage.html new file mode 100644 index 0000000000..b6fb77003a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/message/struct.IncomingMessage.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/consensus/roothash/struct.IncomingMessage.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/sidebar-items.js b/rust/oasis_core_runtime/consensus/roothash/sidebar-items.js new file mode 100644 index 0000000000..f728757bdf --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT","EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT"],"enum":["Error","ExecutorCommitmentFailure","GovernanceMessage","HeaderType","Message","RegistryMessage","StakingMessage"],"struct":["AnnotatedBlock","Block","ComputeResultsHeader","ExecutorCommitment","ExecutorCommitmentHeader","Header","IncomingMessage","MessageEvent","Pool","RoundResults","RoundRoots"],"trait":["MessageValidator","NodeLookup","OpenCommitment"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.AnnotatedBlock.html b/rust/oasis_core_runtime/consensus/roothash/struct.AnnotatedBlock.html new file mode 100644 index 0000000000..a8da8f87c9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.AnnotatedBlock.html @@ -0,0 +1,38 @@ +AnnotatedBlock in oasis_core_runtime::consensus::roothash - Rust
pub struct AnnotatedBlock {
+    pub consensus_height: i64,
+    pub block: Block,
+}
Expand description

Runtime block annotated with consensus information.

+

Fields§

§consensus_height: i64

Consensus height at which this runtime block was produced.

+
§block: Block

Runtime block.

+

Trait Implementations§

source§

impl Clone for AnnotatedBlock

source§

fn clone(&self) -> AnnotatedBlock

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AnnotatedBlock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AnnotatedBlock

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AnnotatedBlock

source§

fn default() -> AnnotatedBlock

Returns the “default value” for a type. Read more
source§

impl Encode for AnnotatedBlock

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AnnotatedBlock

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for AnnotatedBlock

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for AnnotatedBlock

source§

fn eq(&self, other: &AnnotatedBlock) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for AnnotatedBlock

source§

impl StructuralPartialEq for AnnotatedBlock

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.Block.html b/rust/oasis_core_runtime/consensus/roothash/struct.Block.html new file mode 100644 index 0000000000..773cca4c2f --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.Block.html @@ -0,0 +1,44 @@ +Block in oasis_core_runtime::consensus::roothash - Rust

Struct oasis_core_runtime::consensus::roothash::Block

source ·
pub struct Block {
+    pub header: Header,
+}
Expand description

Runtime block.

+

§Note

+

This should be kept in sync with go/roothash/api/block/block.go.

+

Fields§

§header: Header

Header.

+

Implementations§

source§

impl Block

source

pub fn new_genesis_block(id: Namespace, timestamp: u64) -> Block

Creates a new empty genesis block given a runtime id and POSIX timestamp.

+
source

pub fn new_empty_block( + child: &Block, + timestamp: u64, + header_type: HeaderType, +) -> Block

Creates a new empty block with a specific type.

+

Trait Implementations§

source§

impl Clone for Block

source§

fn clone(&self) -> Block

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Block

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Block

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Block

source§

fn default() -> Block

Returns the “default value” for a type. Read more
source§

impl Encode for Block

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Block

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Block

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Block

source§

fn eq(&self, other: &Block) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Block

source§

impl StructuralPartialEq for Block

Auto Trait Implementations§

§

impl Freeze for Block

§

impl RefUnwindSafe for Block

§

impl Send for Block

§

impl Sync for Block

§

impl Unpin for Block

§

impl UnwindSafe for Block

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.ComputeResultsHeader.html b/rust/oasis_core_runtime/consensus/roothash/struct.ComputeResultsHeader.html new file mode 100644 index 0000000000..d35bb4e1cf --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.ComputeResultsHeader.html @@ -0,0 +1,54 @@ +ComputeResultsHeader in oasis_core_runtime::consensus::roothash - Rust
pub struct ComputeResultsHeader {
+    pub round: u64,
+    pub previous_hash: Hash,
+    pub io_root: Option<Hash>,
+    pub state_root: Option<Hash>,
+    pub messages_hash: Option<Hash>,
+    pub in_msgs_hash: Option<Hash>,
+    pub in_msgs_count: u32,
+}
Expand description

The header of a computed batch output by a runtime. This header is a +compressed representation (e.g., hashes instead of full content) of +the actual results.

+

§Note

+

This should be kept in sync with go/roothash/api/commitment/executor.go.

+

Fields§

§round: u64

Round number.

+
§previous_hash: Hash

Hash of the previous block header this batch was computed against.

+
§io_root: Option<Hash>

The I/O merkle root.

+
§state_root: Option<Hash>

The root hash of the state after computing this batch.

+
§messages_hash: Option<Hash>

Hash of messages sent from this batch.

+
§in_msgs_hash: Option<Hash>

The hash of processed incoming messages.

+
§in_msgs_count: u32

The number of processed incoming messages.

+

Implementations§

source§

impl ComputeResultsHeader

source

pub fn encoded_hash(&self) -> Hash

Returns a hash of an encoded header.

+
source

pub fn is_parent_of(&self, child: &Header) -> bool

Returns true iff the header is the parent of a child header.

+

Trait Implementations§

source§

impl Clone for ComputeResultsHeader

source§

fn clone(&self) -> ComputeResultsHeader

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ComputeResultsHeader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ComputeResultsHeader

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ComputeResultsHeader

source§

fn default() -> ComputeResultsHeader

Returns the “default value” for a type. Read more
source§

impl Encode for ComputeResultsHeader

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ComputeResultsHeader

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ComputeResultsHeader

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ComputeResultsHeader

source§

fn eq(&self, other: &ComputeResultsHeader) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ComputeResultsHeader

source§

impl StructuralPartialEq for ComputeResultsHeader

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.ExecutorCommitment.html b/rust/oasis_core_runtime/consensus/roothash/struct.ExecutorCommitment.html new file mode 100644 index 0000000000..5003593fce --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.ExecutorCommitment.html @@ -0,0 +1,50 @@ +ExecutorCommitment in oasis_core_runtime::consensus::roothash - Rust
pub struct ExecutorCommitment {
+    pub node_id: PublicKey,
+    pub header: ExecutorCommitmentHeader,
+    pub signature: Signature,
+    pub messages: Vec<Message>,
+}
Expand description

A commitment to results of processing a proposed runtime block.

+

Fields§

§node_id: PublicKey§header: ExecutorCommitmentHeader§signature: Signature§messages: Vec<Message>

Implementations§

source§

impl ExecutorCommitment

source

pub fn sign( + &mut self, + signer: &impl Signer, + runtime_id: &Namespace, + chain_context: &String, +) -> Result<()>

Signs the executor commitment header and sets the signature on the commitment.

+
source

pub fn verify( + &self, + runtime_id: &Namespace, + chain_context: &String, +) -> Result<()>

Verifies that the header signature is valid.

+
source

pub fn validate_basic(&self) -> Result<()>

Trait Implementations§

source§

impl Clone for ExecutorCommitment

source§

fn clone(&self) -> ExecutorCommitment

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutorCommitment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecutorCommitment

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecutorCommitment

source§

fn default() -> ExecutorCommitment

Returns the “default value” for a type. Read more
source§

impl Encode for ExecutorCommitment

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExecutorCommitment

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl OpenCommitment for ExecutorCommitment

source§

fn mostly_equal(&self, other: &Self) -> bool

Returns true if the commitment is mostly equal to another +specified commitment as per discrepancy detection criteria. Read more
source§

fn is_indicating_failure(&self) -> bool

Returns true if this commitment indicates a failure.
source§

fn to_vote(&self) -> Hash

Returns a hash that represents a vote for this commitment as +per discrepancy resolution criteria.
source§

fn to_dd_result(&self) -> &dyn Any

Returns a commitment-specific result after discrepancy +detection.
source§

impl PartialEq for ExecutorCommitment

source§

fn eq(&self, other: &ExecutorCommitment) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ExecutorCommitment

source§

impl StructuralPartialEq for ExecutorCommitment

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.ExecutorCommitmentHeader.html b/rust/oasis_core_runtime/consensus/roothash/struct.ExecutorCommitmentHeader.html new file mode 100644 index 0000000000..917df2bc06 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.ExecutorCommitmentHeader.html @@ -0,0 +1,44 @@ +ExecutorCommitmentHeader in oasis_core_runtime::consensus::roothash - Rust
pub struct ExecutorCommitmentHeader {
+    pub header: ComputeResultsHeader,
+    pub failure: ExecutorCommitmentFailure,
+    pub rak_signature: Option<Signature>,
+}
Expand description

The header of an executor commitment.

+

Fields§

§header: ComputeResultsHeader

The compute results header.

+
§failure: ExecutorCommitmentFailure

The executor commitment failure reason.

+
§rak_signature: Option<Signature>

Implementations§

source§

impl ExecutorCommitmentHeader

source

pub fn sign( + &self, + signer: &impl Signer, + runtime_id: &Namespace, + chain_context: &String, +) -> Result<Signature>

Signs the executor commitment header.

+
source

pub fn verify_rak(&self, rak: PublicKey) -> Result<()>

Verifies the RAK signature.

+

Trait Implementations§

source§

impl Clone for ExecutorCommitmentHeader

source§

fn clone(&self) -> ExecutorCommitmentHeader

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutorCommitmentHeader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecutorCommitmentHeader

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecutorCommitmentHeader

source§

fn default() -> ExecutorCommitmentHeader

Returns the “default value” for a type. Read more
source§

impl Encode for ExecutorCommitmentHeader

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExecutorCommitmentHeader

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for ExecutorCommitmentHeader

source§

fn eq(&self, other: &ExecutorCommitmentHeader) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ExecutorCommitmentHeader

source§

impl StructuralPartialEq for ExecutorCommitmentHeader

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.Header.html b/rust/oasis_core_runtime/consensus/roothash/struct.Header.html new file mode 100644 index 0000000000..2227e70fe5 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.Header.html @@ -0,0 +1,57 @@ +Header in oasis_core_runtime::consensus::roothash - Rust

Struct oasis_core_runtime::consensus::roothash::Header

source ·
pub struct Header {
+    pub version: u16,
+    pub namespace: Namespace,
+    pub round: u64,
+    pub timestamp: u64,
+    pub header_type: HeaderType,
+    pub previous_hash: Hash,
+    pub io_root: Hash,
+    pub state_root: Hash,
+    pub messages_hash: Hash,
+    pub in_msgs_hash: Hash,
+}
Expand description

Block header.

+

§Note

+

This should be kept in sync with go/roothash/api/block/header.go.

+

Fields§

§version: u16

Protocol version number.

+
§namespace: Namespace

Chain namespace.

+
§round: u64

Round number.

+
§timestamp: u64

Timestamp (POSIX time).

+
§header_type: HeaderType

Header type.

+
§previous_hash: Hash

Previous block hash.

+
§io_root: Hash

I/O merkle root.

+
§state_root: Hash

State merkle root.

+
§messages_hash: Hash

Messages hash.

+
§in_msgs_hash: Hash

Hash of processed incoming messages.

+

Implementations§

source§

impl Header

source

pub fn encoded_hash(&self) -> Hash

Returns a hash of an encoded header.

+

Trait Implementations§

source§

impl Clone for Header

source§

fn clone(&self) -> Header

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Header

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Header

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Header

source§

fn default() -> Header

Returns the “default value” for a type. Read more
source§

impl Encode for Header

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Header

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Header

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Header

source§

fn eq(&self, other: &Header) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Header

source§

impl StructuralPartialEq for Header

Auto Trait Implementations§

§

impl Freeze for Header

§

impl RefUnwindSafe for Header

§

impl Send for Header

§

impl Sync for Header

§

impl Unpin for Header

§

impl UnwindSafe for Header

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.IncomingMessage.html b/rust/oasis_core_runtime/consensus/roothash/struct.IncomingMessage.html new file mode 100644 index 0000000000..d04f66b915 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.IncomingMessage.html @@ -0,0 +1,50 @@ +IncomingMessage in oasis_core_runtime::consensus::roothash - Rust
pub struct IncomingMessage {
+    pub id: u64,
+    pub caller: Address,
+    pub tag: u64,
+    pub fee: Quantity,
+    pub tokens: Quantity,
+    pub data: Vec<u8>,
+}
Expand description

An incoming message emitted by the consensus layer to be processed by the runtime.

+

Fields§

§id: u64

Unique identifier of the message.

+
§caller: Address

Address of the caller authenticated by the consensus layer.

+
§tag: u64

An optional tag provided by the caller which is ignored and can be used to match processed +incoming message events later.

+
§fee: Quantity

Fee sent into the runtime as part of the message being sent. The fee is transferred before +the message is processed by the runtime.

+
§tokens: Quantity

Tokens sent into the runtime as part of the message being sent. The tokens are transferred +before the message is processed by the runtime.

+
§data: Vec<u8>

Arbitrary runtime-dependent data.

+

Implementations§

source§

impl IncomingMessage

source

pub fn in_messages_hash(msgs: &[IncomingMessage]) -> Hash

Returns a hash of provided runtime messages.

+

Trait Implementations§

source§

impl Clone for IncomingMessage

source§

fn clone(&self) -> IncomingMessage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for IncomingMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for IncomingMessage

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for IncomingMessage

source§

fn default() -> IncomingMessage

Returns the “default value” for a type. Read more
source§

impl Encode for IncomingMessage

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for IncomingMessage

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for IncomingMessage

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for IncomingMessage

source§

fn eq(&self, other: &IncomingMessage) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for IncomingMessage

source§

impl StructuralPartialEq for IncomingMessage

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.MessageEvent.html b/rust/oasis_core_runtime/consensus/roothash/struct.MessageEvent.html new file mode 100644 index 0000000000..657937a6aa --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.MessageEvent.html @@ -0,0 +1,37 @@ +MessageEvent in oasis_core_runtime::consensus::roothash - Rust

Struct oasis_core_runtime::consensus::roothash::MessageEvent

source ·
pub struct MessageEvent {
+    pub module: String,
+    pub code: u32,
+    pub index: u32,
+    pub result: Option<Value>,
+}
Expand description

Result of a message being processed by the consensus layer.

+

Fields§

§module: String§code: u32§index: u32§result: Option<Value>

Implementations§

source§

impl MessageEvent

source

pub fn is_success(&self) -> bool

Returns true if the event indicates that the message was successfully processed.

+

Trait Implementations§

source§

impl Clone for MessageEvent

source§

fn clone(&self) -> MessageEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MessageEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MessageEvent

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for MessageEvent

source§

fn default() -> MessageEvent

Returns the “default value” for a type. Read more
source§

impl Encode for MessageEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for MessageEvent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for MessageEvent

source§

fn eq(&self, other: &MessageEvent) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for MessageEvent

source§

impl StructuralPartialEq for MessageEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.Pool.html b/rust/oasis_core_runtime/consensus/roothash/struct.Pool.html new file mode 100644 index 0000000000..f3de01680f --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.Pool.html @@ -0,0 +1,37 @@ +Pool in oasis_core_runtime::consensus::roothash - Rust

Struct oasis_core_runtime::consensus::roothash::Pool

source ·
pub struct Pool { /* private fields */ }
Expand description

A pool of commitments that can be used to perform +discrepancy detection.

+

The pool is not safe for concurrent use.

+

Implementations§

source§

impl Pool

source

pub fn new(runtime: Runtime, committee: Committee, round: u64) -> Self

Creates a new pool.

+
source

pub fn add_executor_commitment( + &mut self, + blk: &Block, + nl: &impl NodeLookup, + commit: ExecutorCommitment, + msg_validator: &impl MessageValidator, + chain_context: &String, +) -> Result<()>

Verifies and adds a new executor commitment to the pool.

+
source

pub fn process_commitments( + &mut self, + did_timeout: bool, +) -> Result<&dyn OpenCommitment>

Performs a single round of commitment checks. If there are enough commitments +in the pool, it performs discrepancy detection or resolution.

+

Auto Trait Implementations§

§

impl Freeze for Pool

§

impl RefUnwindSafe for Pool

§

impl Send for Pool

§

impl Sync for Pool

§

impl Unpin for Pool

§

impl UnwindSafe for Pool

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.RoundResults.html b/rust/oasis_core_runtime/consensus/roothash/struct.RoundResults.html new file mode 100644 index 0000000000..40fc1fe19f --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.RoundResults.html @@ -0,0 +1,40 @@ +RoundResults in oasis_core_runtime::consensus::roothash - Rust

Struct oasis_core_runtime::consensus::roothash::RoundResults

source ·
pub struct RoundResults {
+    pub messages: Vec<MessageEvent>,
+    pub good_compute_entities: Vec<PublicKey>,
+    pub bad_compute_entities: Vec<PublicKey>,
+}
Expand description

Information about how a particular round was executed by the consensus layer.

+

Fields§

§messages: Vec<MessageEvent>

Results of executing emitted runtime messages.

+
§good_compute_entities: Vec<PublicKey>

Public keys of compute nodes’ controlling entities that positively contributed to the round +by replicating the computation correctly.

+
§bad_compute_entities: Vec<PublicKey>

Public keys of compute nodes’ controlling entities that negatively contributed to the round +by causing discrepancies.

+

Trait Implementations§

source§

impl Clone for RoundResults

source§

fn clone(&self) -> RoundResults

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RoundResults

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RoundResults

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RoundResults

source§

fn default() -> RoundResults

Returns the “default value” for a type. Read more
source§

impl Encode for RoundResults

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RoundResults

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for RoundResults

source§

fn eq(&self, other: &RoundResults) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RoundResults

source§

impl StructuralPartialEq for RoundResults

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/struct.RoundRoots.html b/rust/oasis_core_runtime/consensus/roothash/struct.RoundRoots.html new file mode 100644 index 0000000000..35790d8e00 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/struct.RoundRoots.html @@ -0,0 +1,34 @@ +RoundRoots in oasis_core_runtime::consensus::roothash - Rust

Struct oasis_core_runtime::consensus::roothash::RoundRoots

source ·
pub struct RoundRoots {
+    pub state_root: Hash,
+    pub io_root: Hash,
+}
Expand description

Per-round state and I/O roots that are stored in consensus state.

+

Fields§

§state_root: Hash§io_root: Hash

Trait Implementations§

source§

impl Clone for RoundRoots

source§

fn clone(&self) -> RoundRoots

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RoundRoots

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RoundRoots

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RoundRoots

source§

fn default() -> RoundRoots

Returns the “default value” for a type. Read more
source§

impl Encode for RoundRoots

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for RoundRoots

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RoundRoots

source§

fn eq(&self, other: &RoundRoots) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RoundRoots

source§

impl StructuralPartialEq for RoundRoots

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/trait.MessageValidator.html b/rust/oasis_core_runtime/consensus/roothash/trait.MessageValidator.html new file mode 100644 index 0000000000..4c1848c702 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/trait.MessageValidator.html @@ -0,0 +1,6 @@ +MessageValidator in oasis_core_runtime::consensus::roothash - Rust
pub trait MessageValidator {
+    // Required method
+    fn validate(&self, msgs: &[Message]) -> Result<()>;
+}
Expand description

A trait that validates messages for validity. It can be used for gas accounting.

+

Required Methods§

source

fn validate(&self, msgs: &[Message]) -> Result<()>

Implementors§

source§

impl<F> MessageValidator for F
where + F: Fn(&[Message]) -> Result<()>,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/trait.NodeLookup.html b/rust/oasis_core_runtime/consensus/roothash/trait.NodeLookup.html new file mode 100644 index 0000000000..6bd8a78cce --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/trait.NodeLookup.html @@ -0,0 +1,5 @@ +NodeLookup in oasis_core_runtime::consensus::roothash - Rust

Trait oasis_core_runtime::consensus::roothash::NodeLookup

source ·
pub trait NodeLookup {
+    // Required method
+    fn node(&self, id: PublicKey) -> Result<Node, Error>;
+}
Expand description

A trait for looking up registry node descriptors.

+

Required Methods§

source

fn node(&self, id: PublicKey) -> Result<Node, Error>

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/roothash/trait.OpenCommitment.html b/rust/oasis_core_runtime/consensus/roothash/trait.OpenCommitment.html new file mode 100644 index 0000000000..6a5ac62127 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/roothash/trait.OpenCommitment.html @@ -0,0 +1,19 @@ +OpenCommitment in oasis_core_runtime::consensus::roothash - Rust
pub trait OpenCommitment {
+    // Required methods
+    fn mostly_equal(&self, other: &Self) -> bool
+       where Self: Sized;
+    fn is_indicating_failure(&self) -> bool;
+    fn to_vote(&self) -> Hash;
+    fn to_dd_result(&self) -> &dyn Any;
+}
Expand description

Verified roothash commitment.

+

Required Methods§

source

fn mostly_equal(&self, other: &Self) -> bool
where + Self: Sized,

Returns true if the commitment is mostly equal to another +specified commitment as per discrepancy detection criteria.

+

The caller MUST guarantee that the passed commitment is of the same +type.

+
source

fn is_indicating_failure(&self) -> bool

Returns true if this commitment indicates a failure.

+
source

fn to_vote(&self) -> Hash

Returns a hash that represents a vote for this commitment as +per discrepancy resolution criteria.

+
source

fn to_dd_result(&self) -> &dyn Any

Returns a commitment-specific result after discrepancy +detection.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/scheduler/enum.CommitteeKind.html b/rust/oasis_core_runtime/consensus/scheduler/enum.CommitteeKind.html new file mode 100644 index 0000000000..5557ef0140 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/scheduler/enum.CommitteeKind.html @@ -0,0 +1,44 @@ +CommitteeKind in oasis_core_runtime::consensus::scheduler - Rust
#[repr(u8)]
pub enum CommitteeKind { + Invalid = 0, + ComputeExecutor = 1, +}
Expand description

The functionality a committee exists to provide.

+

Variants§

§

Invalid = 0

An invalid committee (should never appear on the wire).

+
§

ComputeExecutor = 1

A compute executor committee.

+

Trait Implementations§

source§

impl Clone for CommitteeKind

source§

fn clone(&self) -> CommitteeKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CommitteeKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CommitteeKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CommitteeKind

source§

fn default() -> CommitteeKind

Returns the “default value” for a type. Read more
source§

impl Encode for CommitteeKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for CommitteeKind

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for CommitteeKind

source§

fn cmp(&self, other: &CommitteeKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for CommitteeKind

source§

fn eq(&self, other: &CommitteeKind) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for CommitteeKind

source§

fn partial_cmp(&self, other: &CommitteeKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for CommitteeKind

source§

impl StructuralPartialEq for CommitteeKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/scheduler/enum.Role.html b/rust/oasis_core_runtime/consensus/scheduler/enum.Role.html new file mode 100644 index 0000000000..491d472f59 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/scheduler/enum.Role.html @@ -0,0 +1,46 @@ +Role in oasis_core_runtime::consensus::scheduler - Rust

Enum oasis_core_runtime::consensus::scheduler::Role

source ·
#[repr(u8)]
pub enum Role { + Invalid = 0, + Worker = 1, + BackupWorker = 2, +}
Expand description

The role a given node plays in a committee.

+

Variants§

§

Invalid = 0

An invalid role (should never appear on the wire).

+
§

Worker = 1

Indicates the node is a worker.

+
§

BackupWorker = 2

Indicates the node is a backup worker.

+

Trait Implementations§

source§

impl Clone for Role

source§

fn clone(&self) -> Role

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Role

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Role

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Role

source§

fn default() -> Role

Returns the “default value” for a type. Read more
source§

impl Encode for Role

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for Role

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Role

source§

fn cmp(&self, other: &Role) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Role

source§

fn eq(&self, other: &Role) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Role

source§

fn partial_cmp(&self, other: &Role) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for Role

source§

impl StructuralPartialEq for Role

Auto Trait Implementations§

§

impl Freeze for Role

§

impl RefUnwindSafe for Role

§

impl Send for Role

§

impl Sync for Role

§

impl Unpin for Role

§

impl UnwindSafe for Role

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/scheduler/index.html b/rust/oasis_core_runtime/consensus/scheduler/index.html new file mode 100644 index 0000000000..6317f14c78 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/scheduler/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::scheduler - Rust

Module oasis_core_runtime::consensus::scheduler

source ·
Expand description

Scheduler structures.

+

Structs§

Enums§

  • The functionality a committee exists to provide.
  • The role a given node plays in a committee.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/scheduler/sidebar-items.js b/rust/oasis_core_runtime/consensus/scheduler/sidebar-items.js new file mode 100644 index 0000000000..f61d97ff4c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/scheduler/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["CommitteeKind","Role"],"struct":["Committee","CommitteeNode"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/scheduler/struct.Committee.html b/rust/oasis_core_runtime/consensus/scheduler/struct.Committee.html new file mode 100644 index 0000000000..82bb69bb2f --- /dev/null +++ b/rust/oasis_core_runtime/consensus/scheduler/struct.Committee.html @@ -0,0 +1,32 @@ +Committee in oasis_core_runtime::consensus::scheduler - Rust

Struct oasis_core_runtime::consensus::scheduler::Committee

source ·
pub struct Committee {
+    pub kind: CommitteeKind,
+    pub members: Vec<CommitteeNode>,
+    pub runtime_id: Namespace,
+    pub valid_for: EpochTime,
+}
Expand description

A per-runtime (instance) committee.

+

Fields§

§kind: CommitteeKind

The functionality a committee exists to provide.

+
§members: Vec<CommitteeNode>

The committee members.

+
§runtime_id: Namespace

The runtime ID that this committee is for.

+
§valid_for: EpochTime

The epoch for which the committee is valid.

+

Implementations§

source§

impl Committee

source

pub fn workers(&self) -> Vec<&CommitteeNode>

Returns committee nodes with Worker role.

+
source

pub fn transaction_scheduler(&self, round: u64) -> Result<&CommitteeNode>

Returns the transaction scheduler of the provided committee based on the provided round.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/scheduler/struct.CommitteeNode.html b/rust/oasis_core_runtime/consensus/scheduler/struct.CommitteeNode.html new file mode 100644 index 0000000000..cfc74e08ea --- /dev/null +++ b/rust/oasis_core_runtime/consensus/scheduler/struct.CommitteeNode.html @@ -0,0 +1,26 @@ +CommitteeNode in oasis_core_runtime::consensus::scheduler - Rust
pub struct CommitteeNode {
+    pub role: Role,
+    pub public_key: PublicKey,
+}
Expand description

A node participating in a committee.

+

Fields§

§role: Role

The node’s role in a committee.

+
§public_key: PublicKey

The node’s public key.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/sidebar-items.js b/rust/oasis_core_runtime/consensus/sidebar-items.js new file mode 100644 index 0000000000..aea1d5034c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["HEIGHT_LATEST","METHOD_META","MODULE_NAME"],"enum":["Event"],"mod":["address","beacon","governance","keymanager","registry","roothash","scheduler","staking","state","tendermint","transaction","verifier"],"struct":["BlockMetadata","LightBlock"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/enum.EscrowEvent.html b/rust/oasis_core_runtime/consensus/staking/enum.EscrowEvent.html new file mode 100644 index 0000000000..a98a812b52 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/enum.EscrowEvent.html @@ -0,0 +1,68 @@ +EscrowEvent in oasis_core_runtime::consensus::staking - Rust

Enum oasis_core_runtime::consensus::staking::EscrowEvent

source ·
pub enum EscrowEvent {
+    Add {
+        owner: Address,
+        escrow: Address,
+        amount: Quantity,
+        new_shares: Quantity,
+    },
+    Take {
+        owner: Address,
+        amount: Quantity,
+        debonding_amount: Quantity,
+    },
+    DebondingStart {
+        owner: Address,
+        escrow: Address,
+        amount: Quantity,
+        active_shares: Quantity,
+        debonding_shares: Quantity,
+        debond_end_time: EpochTime,
+    },
+    Reclaim {
+        owner: Address,
+        escrow: Address,
+        amount: Quantity,
+        shares: Quantity,
+    },
+}
Expand description

Escrow-related events.

+

Variants§

§

Add

Event emitted when stake is transferred into an escrow account.

+

Fields

§owner: Address
§escrow: Address
§amount: Quantity
§new_shares: Quantity
§

Take

Event emitted when stake is taken from an escrow account (i.e. stake is slashed).

+

Fields

§owner: Address
§amount: Quantity
§debonding_amount: Quantity
§

DebondingStart

Event emitted when the debonding process has started and the given number of active shares +have been moved into the debonding pool and started debonding.

+

Note that the given amount is valid at the time of debonding start and may not correspond to +the final debonded amount in case any escrowed stake is subject to slashing.

+

Fields

§owner: Address
§escrow: Address
§amount: Quantity
§active_shares: Quantity
§debonding_shares: Quantity
§debond_end_time: EpochTime
§

Reclaim

Event emitted when stake is reclaimed from an escrow account back into owner’s general +account.

+

Fields

§owner: Address
§escrow: Address
§amount: Quantity
§shares: Quantity

Trait Implementations§

source§

impl Clone for EscrowEvent

source§

fn clone(&self) -> EscrowEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EscrowEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EscrowEvent

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for EscrowEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EscrowEvent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EscrowEvent

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EscrowEvent

source§

fn eq(&self, other: &EscrowEvent) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EscrowEvent

source§

impl StructuralPartialEq for EscrowEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/enum.SlashReason.html b/rust/oasis_core_runtime/consensus/staking/enum.SlashReason.html new file mode 100644 index 0000000000..3760d530be --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/enum.SlashReason.html @@ -0,0 +1,47 @@ +SlashReason in oasis_core_runtime::consensus::staking - Rust

Enum oasis_core_runtime::consensus::staking::SlashReason

source ·
#[repr(u8)]
pub enum SlashReason { + RuntimeIncorrectResults = 128, + RuntimeEquivocation = 129, + RuntimeLiveness = 130, +}
Expand description

Reason for slashing an entity.

+

Variants§

§

RuntimeIncorrectResults = 128

Slashing due to submission of incorrect results in runtime executor commitments.

+
§

RuntimeEquivocation = 129

Slashing due to signing two different executor commits or proposed batches for the same +round.

+
§

RuntimeLiveness = 130

Slashing due to not doing the required work.

+

Trait Implementations§

source§

impl Clone for SlashReason

source§

fn clone(&self) -> SlashReason

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SlashReason

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SlashReason

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for SlashReason

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for SlashReason

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for SlashReason

source§

fn cmp(&self, other: &SlashReason) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for SlashReason

source§

fn eq(&self, other: &SlashReason) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for SlashReason

source§

fn partial_cmp(&self, other: &SlashReason) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for SlashReason

source§

impl StructuralPartialEq for SlashReason

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/enum.ThresholdKind.html b/rust/oasis_core_runtime/consensus/staking/enum.ThresholdKind.html new file mode 100644 index 0000000000..bbe1290358 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/enum.ThresholdKind.html @@ -0,0 +1,52 @@ +ThresholdKind in oasis_core_runtime::consensus::staking - Rust
#[repr(i32)]
pub enum ThresholdKind { + KindEntity = 0, + KindNodeValidator = 1, + KindNodeCompute = 2, + KindNodeKeyManager = 4, + KindRuntimeCompute = 5, + KindRuntimeKeyManager = 6, +}
Expand description

Kind of staking threshold.

+

Variants§

§

KindEntity = 0

Entity staking threshold.

+
§

KindNodeValidator = 1

Validator node staking threshold.

+
§

KindNodeCompute = 2

Compute node staking threshold.

+
§

KindNodeKeyManager = 4

Keymanager node staking threshold.

+
§

KindRuntimeCompute = 5

Compute runtime staking threshold.

+
§

KindRuntimeKeyManager = 6

Keymanager runtime staking threshold.

+

Trait Implementations§

source§

impl Clone for ThresholdKind

source§

fn clone(&self) -> ThresholdKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ThresholdKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ThresholdKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for ThresholdKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for ThresholdKind

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for ThresholdKind

source§

fn cmp(&self, other: &ThresholdKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for ThresholdKind

source§

fn eq(&self, other: &ThresholdKind) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ThresholdKind

source§

fn partial_cmp(&self, other: &ThresholdKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for ThresholdKind

source§

impl StructuralPartialEq for ThresholdKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/index.html b/rust/oasis_core_runtime/consensus/staking/index.html new file mode 100644 index 0000000000..69b0ad53df --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/index.html @@ -0,0 +1,4 @@ +oasis_core_runtime::consensus::staking - Rust

Module oasis_core_runtime::consensus::staking

source ·
Expand description

Consensus staking structures.

+

§Note

+

This MUST be kept in sync with go/staking/api.

+

Structs§

Enums§

Type Aliases§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/sidebar-items.js b/rust/oasis_core_runtime/consensus/staking/sidebar-items.js new file mode 100644 index 0000000000..c8120899f3 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["EscrowEvent","SlashReason","ThresholdKind"],"struct":["Account","AddEscrowResult","AllowanceChangeEvent","BurnEvent","CommissionRateBoundStep","CommissionRateStep","CommissionSchedule","DebondingDelegation","Delegation","Escrow","EscrowAccount","Event","GeneralAccount","ReclaimEscrow","ReclaimEscrowResult","SharePool","Slash","StakeAccumulator","StakeThreshold","Transfer","TransferEvent","TransferResult","Withdraw","WithdrawResult"],"type":["StakeClaim"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.Account.html b/rust/oasis_core_runtime/consensus/staking/struct.Account.html new file mode 100644 index 0000000000..1e9289efe3 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.Account.html @@ -0,0 +1,36 @@ +Account in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::Account

source ·
pub struct Account {
+    pub general: GeneralAccount,
+    pub escrow: EscrowAccount,
+}
Expand description

Entry in the staking ledger.

+

Fields§

§general: GeneralAccount§escrow: EscrowAccount

Trait Implementations§

source§

impl Clone for Account

source§

fn clone(&self) -> Account

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Account

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Account

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Account

source§

fn default() -> Account

Returns the “default value” for a type. Read more
source§

impl Encode for Account

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Account

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Account

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Account

source§

fn eq(&self, other: &Account) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Account

source§

impl StructuralPartialEq for Account

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.AddEscrowResult.html b/rust/oasis_core_runtime/consensus/staking/struct.AddEscrowResult.html new file mode 100644 index 0000000000..47be9dd89d --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.AddEscrowResult.html @@ -0,0 +1,38 @@ +AddEscrowResult in oasis_core_runtime::consensus::staking - Rust
pub struct AddEscrowResult {
+    pub owner: Address,
+    pub escrow: Address,
+    pub amount: Quantity,
+    pub new_shares: Quantity,
+}
Expand description

Add escrow result.

+

Fields§

§owner: Address§escrow: Address§amount: Quantity§new_shares: Quantity

Trait Implementations§

source§

impl Clone for AddEscrowResult

source§

fn clone(&self) -> AddEscrowResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddEscrowResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AddEscrowResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AddEscrowResult

source§

fn default() -> AddEscrowResult

Returns the “default value” for a type. Read more
source§

impl Encode for AddEscrowResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AddEscrowResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for AddEscrowResult

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for AddEscrowResult

source§

fn eq(&self, other: &AddEscrowResult) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for AddEscrowResult

source§

impl StructuralPartialEq for AddEscrowResult

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.AllowanceChangeEvent.html b/rust/oasis_core_runtime/consensus/staking/struct.AllowanceChangeEvent.html new file mode 100644 index 0000000000..7c1c5ee5d5 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.AllowanceChangeEvent.html @@ -0,0 +1,39 @@ +AllowanceChangeEvent in oasis_core_runtime::consensus::staking - Rust
pub struct AllowanceChangeEvent {
+    pub owner: Address,
+    pub beneficiary: Address,
+    pub allowance: Quantity,
+    pub negative: bool,
+    pub amount_change: Quantity,
+}
Expand description

Event emitted when allowance is changed for a beneficiary.

+

Fields§

§owner: Address§beneficiary: Address§allowance: Quantity§negative: bool§amount_change: Quantity

Trait Implementations§

source§

impl Clone for AllowanceChangeEvent

source§

fn clone(&self) -> AllowanceChangeEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AllowanceChangeEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AllowanceChangeEvent

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AllowanceChangeEvent

source§

fn default() -> AllowanceChangeEvent

Returns the “default value” for a type. Read more
source§

impl Encode for AllowanceChangeEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AllowanceChangeEvent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for AllowanceChangeEvent

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for AllowanceChangeEvent

source§

fn eq(&self, other: &AllowanceChangeEvent) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for AllowanceChangeEvent

source§

impl StructuralPartialEq for AllowanceChangeEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.BurnEvent.html b/rust/oasis_core_runtime/consensus/staking/struct.BurnEvent.html new file mode 100644 index 0000000000..cf15e7d590 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.BurnEvent.html @@ -0,0 +1,36 @@ +BurnEvent in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::BurnEvent

source ·
pub struct BurnEvent {
+    pub owner: Address,
+    pub amount: Quantity,
+}
Expand description

Event emitted when stake is destroyed via a call to Burn.

+

Fields§

§owner: Address§amount: Quantity

Trait Implementations§

source§

impl Clone for BurnEvent

source§

fn clone(&self) -> BurnEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BurnEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for BurnEvent

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for BurnEvent

source§

fn default() -> BurnEvent

Returns the “default value” for a type. Read more
source§

impl Encode for BurnEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for BurnEvent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for BurnEvent

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for BurnEvent

source§

fn eq(&self, other: &BurnEvent) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for BurnEvent

source§

impl StructuralPartialEq for BurnEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.CommissionRateBoundStep.html b/rust/oasis_core_runtime/consensus/staking/struct.CommissionRateBoundStep.html new file mode 100644 index 0000000000..83a109ef20 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.CommissionRateBoundStep.html @@ -0,0 +1,37 @@ +CommissionRateBoundStep in oasis_core_runtime::consensus::staking - Rust
pub struct CommissionRateBoundStep {
+    pub start: EpochTime,
+    pub rate_min: Quantity,
+    pub rate_max: Quantity,
+}
Expand description

Commission rate bound and its starting time.

+

Fields§

§start: EpochTime§rate_min: Quantity§rate_max: Quantity

Trait Implementations§

source§

impl Clone for CommissionRateBoundStep

source§

fn clone(&self) -> CommissionRateBoundStep

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CommissionRateBoundStep

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CommissionRateBoundStep

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CommissionRateBoundStep

source§

fn default() -> CommissionRateBoundStep

Returns the “default value” for a type. Read more
source§

impl Encode for CommissionRateBoundStep

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CommissionRateBoundStep

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for CommissionRateBoundStep

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for CommissionRateBoundStep

source§

fn eq(&self, other: &CommissionRateBoundStep) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CommissionRateBoundStep

source§

impl StructuralPartialEq for CommissionRateBoundStep

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.CommissionRateStep.html b/rust/oasis_core_runtime/consensus/staking/struct.CommissionRateStep.html new file mode 100644 index 0000000000..ec8d8fe40d --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.CommissionRateStep.html @@ -0,0 +1,36 @@ +CommissionRateStep in oasis_core_runtime::consensus::staking - Rust
pub struct CommissionRateStep {
+    pub start: EpochTime,
+    pub rate: Quantity,
+}
Expand description

Commission rate and its starting time.

+

Fields§

§start: EpochTime§rate: Quantity

Trait Implementations§

source§

impl Clone for CommissionRateStep

source§

fn clone(&self) -> CommissionRateStep

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CommissionRateStep

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CommissionRateStep

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CommissionRateStep

source§

fn default() -> CommissionRateStep

Returns the “default value” for a type. Read more
source§

impl Encode for CommissionRateStep

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CommissionRateStep

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for CommissionRateStep

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for CommissionRateStep

source§

fn eq(&self, other: &CommissionRateStep) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CommissionRateStep

source§

impl StructuralPartialEq for CommissionRateStep

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.CommissionSchedule.html b/rust/oasis_core_runtime/consensus/staking/struct.CommissionSchedule.html new file mode 100644 index 0000000000..d0522bfb3c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.CommissionSchedule.html @@ -0,0 +1,36 @@ +CommissionSchedule in oasis_core_runtime::consensus::staking - Rust
pub struct CommissionSchedule {
+    pub rates: Vec<CommissionRateStep>,
+    pub bounds: Vec<CommissionRateBoundStep>,
+}
Expand description

Defines a list of commission rates and commission rate bounds with their starting times.

+

Fields§

§rates: Vec<CommissionRateStep>§bounds: Vec<CommissionRateBoundStep>

Trait Implementations§

source§

impl Clone for CommissionSchedule

source§

fn clone(&self) -> CommissionSchedule

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CommissionSchedule

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CommissionSchedule

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CommissionSchedule

source§

fn default() -> CommissionSchedule

Returns the “default value” for a type. Read more
source§

impl Encode for CommissionSchedule

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CommissionSchedule

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for CommissionSchedule

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for CommissionSchedule

source§

fn eq(&self, other: &CommissionSchedule) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CommissionSchedule

source§

impl StructuralPartialEq for CommissionSchedule

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.DebondingDelegation.html b/rust/oasis_core_runtime/consensus/staking/struct.DebondingDelegation.html new file mode 100644 index 0000000000..a0e988be09 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.DebondingDelegation.html @@ -0,0 +1,36 @@ +DebondingDelegation in oasis_core_runtime::consensus::staking - Rust
pub struct DebondingDelegation {
+    pub shares: Quantity,
+    pub debond_end_time: EpochTime,
+}
Expand description

Debonding delegation descriptor.

+

Fields§

§shares: Quantity§debond_end_time: EpochTime

Trait Implementations§

source§

impl Clone for DebondingDelegation

source§

fn clone(&self) -> DebondingDelegation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DebondingDelegation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for DebondingDelegation

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for DebondingDelegation

source§

fn default() -> DebondingDelegation

Returns the “default value” for a type. Read more
source§

impl Encode for DebondingDelegation

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for DebondingDelegation

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for DebondingDelegation

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for DebondingDelegation

source§

fn eq(&self, other: &DebondingDelegation) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for DebondingDelegation

source§

impl StructuralPartialEq for DebondingDelegation

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.Delegation.html b/rust/oasis_core_runtime/consensus/staking/struct.Delegation.html new file mode 100644 index 0000000000..fcf955adc3 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.Delegation.html @@ -0,0 +1,35 @@ +Delegation in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::Delegation

source ·
pub struct Delegation {
+    pub shares: Quantity,
+}
Expand description

Delegation descriptor.

+

Fields§

§shares: Quantity

Trait Implementations§

source§

impl Clone for Delegation

source§

fn clone(&self) -> Delegation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Delegation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Delegation

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Delegation

source§

fn default() -> Delegation

Returns the “default value” for a type. Read more
source§

impl Encode for Delegation

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Delegation

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Delegation

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Delegation

source§

fn eq(&self, other: &Delegation) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Delegation

source§

impl StructuralPartialEq for Delegation

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.Escrow.html b/rust/oasis_core_runtime/consensus/staking/struct.Escrow.html new file mode 100644 index 0000000000..c0ae058c52 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.Escrow.html @@ -0,0 +1,36 @@ +Escrow in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::Escrow

source ·
pub struct Escrow {
+    pub account: Address,
+    pub amount: Quantity,
+}
Expand description

A stake escrow.

+

Fields§

§account: Address§amount: Quantity

Trait Implementations§

source§

impl Clone for Escrow

source§

fn clone(&self) -> Escrow

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Escrow

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Escrow

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Escrow

source§

fn default() -> Escrow

Returns the “default value” for a type. Read more
source§

impl Encode for Escrow

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Escrow

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Escrow

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Escrow

source§

fn eq(&self, other: &Escrow) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Escrow

source§

impl StructuralPartialEq for Escrow

Auto Trait Implementations§

§

impl Freeze for Escrow

§

impl RefUnwindSafe for Escrow

§

impl Send for Escrow

§

impl Sync for Escrow

§

impl Unpin for Escrow

§

impl UnwindSafe for Escrow

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.EscrowAccount.html b/rust/oasis_core_runtime/consensus/staking/struct.EscrowAccount.html new file mode 100644 index 0000000000..1534d03b36 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.EscrowAccount.html @@ -0,0 +1,38 @@ +EscrowAccount in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::EscrowAccount

source ·
pub struct EscrowAccount {
+    pub active: SharePool,
+    pub debonding: SharePool,
+    pub commission_schedule: CommissionSchedule,
+    pub stake_accumulator: StakeAccumulator,
+}
Expand description

Escrow account.

+

Fields§

§active: SharePool§debonding: SharePool§commission_schedule: CommissionSchedule§stake_accumulator: StakeAccumulator

Trait Implementations§

source§

impl Clone for EscrowAccount

source§

fn clone(&self) -> EscrowAccount

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EscrowAccount

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EscrowAccount

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EscrowAccount

source§

fn default() -> EscrowAccount

Returns the “default value” for a type. Read more
source§

impl Encode for EscrowAccount

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EscrowAccount

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for EscrowAccount

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for EscrowAccount

source§

fn eq(&self, other: &EscrowAccount) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for EscrowAccount

source§

impl StructuralPartialEq for EscrowAccount

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.Event.html b/rust/oasis_core_runtime/consensus/staking/struct.Event.html new file mode 100644 index 0000000000..172d70dcea --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.Event.html @@ -0,0 +1,40 @@ +Event in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::Event

source ·
pub struct Event {
+    pub height: i64,
+    pub tx_hash: Hash,
+    pub transfer: Option<TransferEvent>,
+    pub burn: Option<BurnEvent>,
+    pub escrow: Option<EscrowEvent>,
+    pub allowance_change: Option<AllowanceChangeEvent>,
+}
Expand description

A staking-related event.

+

Fields§

§height: i64§tx_hash: Hash§transfer: Option<TransferEvent>§burn: Option<BurnEvent>§escrow: Option<EscrowEvent>§allowance_change: Option<AllowanceChangeEvent>

Trait Implementations§

source§

impl Clone for Event

source§

fn clone(&self) -> Event

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Event

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Event

source§

fn default() -> Event

Returns the “default value” for a type. Read more
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Event

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Event

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Event

source§

fn eq(&self, other: &Event) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Event

source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.GeneralAccount.html b/rust/oasis_core_runtime/consensus/staking/struct.GeneralAccount.html new file mode 100644 index 0000000000..6ab5969963 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.GeneralAccount.html @@ -0,0 +1,37 @@ +GeneralAccount in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::GeneralAccount

source ·
pub struct GeneralAccount {
+    pub balance: Quantity,
+    pub nonce: u64,
+    pub allowances: BTreeMap<Address, Quantity>,
+}
Expand description

General purpose account.

+

Fields§

§balance: Quantity§nonce: u64§allowances: BTreeMap<Address, Quantity>

Trait Implementations§

source§

impl Clone for GeneralAccount

source§

fn clone(&self) -> GeneralAccount

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GeneralAccount

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GeneralAccount

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for GeneralAccount

source§

fn default() -> GeneralAccount

Returns the “default value” for a type. Read more
source§

impl Encode for GeneralAccount

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GeneralAccount

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for GeneralAccount

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for GeneralAccount

source§

fn eq(&self, other: &GeneralAccount) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for GeneralAccount

source§

impl StructuralPartialEq for GeneralAccount

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.ReclaimEscrow.html b/rust/oasis_core_runtime/consensus/staking/struct.ReclaimEscrow.html new file mode 100644 index 0000000000..792bc59f88 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.ReclaimEscrow.html @@ -0,0 +1,36 @@ +ReclaimEscrow in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::ReclaimEscrow

source ·
pub struct ReclaimEscrow {
+    pub account: Address,
+    pub shares: Quantity,
+}
Expand description

A reclaim escrow.

+

Fields§

§account: Address§shares: Quantity

Trait Implementations§

source§

impl Clone for ReclaimEscrow

source§

fn clone(&self) -> ReclaimEscrow

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ReclaimEscrow

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ReclaimEscrow

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ReclaimEscrow

source§

fn default() -> ReclaimEscrow

Returns the “default value” for a type. Read more
source§

impl Encode for ReclaimEscrow

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ReclaimEscrow

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ReclaimEscrow

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ReclaimEscrow

source§

fn eq(&self, other: &ReclaimEscrow) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ReclaimEscrow

source§

impl StructuralPartialEq for ReclaimEscrow

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.ReclaimEscrowResult.html b/rust/oasis_core_runtime/consensus/staking/struct.ReclaimEscrowResult.html new file mode 100644 index 0000000000..2656449bdc --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.ReclaimEscrowResult.html @@ -0,0 +1,40 @@ +ReclaimEscrowResult in oasis_core_runtime::consensus::staking - Rust
pub struct ReclaimEscrowResult {
+    pub owner: Address,
+    pub escrow: Address,
+    pub amount: Quantity,
+    pub remaining_shares: Quantity,
+    pub debonding_shares: Quantity,
+    pub debond_end_time: EpochTime,
+}
Expand description

Reclaim escrow result.

+

Fields§

§owner: Address§escrow: Address§amount: Quantity§remaining_shares: Quantity§debonding_shares: Quantity§debond_end_time: EpochTime

Trait Implementations§

source§

impl Clone for ReclaimEscrowResult

source§

fn clone(&self) -> ReclaimEscrowResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ReclaimEscrowResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ReclaimEscrowResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ReclaimEscrowResult

source§

fn default() -> ReclaimEscrowResult

Returns the “default value” for a type. Read more
source§

impl Encode for ReclaimEscrowResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ReclaimEscrowResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for ReclaimEscrowResult

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ReclaimEscrowResult

source§

fn eq(&self, other: &ReclaimEscrowResult) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ReclaimEscrowResult

source§

impl StructuralPartialEq for ReclaimEscrowResult

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.SharePool.html b/rust/oasis_core_runtime/consensus/staking/struct.SharePool.html new file mode 100644 index 0000000000..c118997e5b --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.SharePool.html @@ -0,0 +1,36 @@ +SharePool in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::SharePool

source ·
pub struct SharePool {
+    pub balance: Quantity,
+    pub total_shares: Quantity,
+}
Expand description

Combined balance of serval entries, the relative sizes of which are tracked through shares.

+

Fields§

§balance: Quantity§total_shares: Quantity

Trait Implementations§

source§

impl Clone for SharePool

source§

fn clone(&self) -> SharePool

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SharePool

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SharePool

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SharePool

source§

fn default() -> SharePool

Returns the “default value” for a type. Read more
source§

impl Encode for SharePool

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SharePool

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for SharePool

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for SharePool

source§

fn eq(&self, other: &SharePool) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SharePool

source§

impl StructuralPartialEq for SharePool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.Slash.html b/rust/oasis_core_runtime/consensus/staking/struct.Slash.html new file mode 100644 index 0000000000..44a07d401e --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.Slash.html @@ -0,0 +1,36 @@ +Slash in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::Slash

source ·
pub struct Slash {
+    pub amount: Quantity,
+    pub freeze_interval: EpochTime,
+}
Expand description

Per-reason slashing configuration.

+

Fields§

§amount: Quantity§freeze_interval: EpochTime

Trait Implementations§

source§

impl Clone for Slash

source§

fn clone(&self) -> Slash

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Slash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Slash

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Slash

source§

fn default() -> Slash

Returns the “default value” for a type. Read more
source§

impl Encode for Slash

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Slash

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Slash

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Slash

source§

fn eq(&self, other: &Slash) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Slash

source§

impl StructuralPartialEq for Slash

Auto Trait Implementations§

§

impl Freeze for Slash

§

impl RefUnwindSafe for Slash

§

impl Send for Slash

§

impl Sync for Slash

§

impl Unpin for Slash

§

impl UnwindSafe for Slash

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.StakeAccumulator.html b/rust/oasis_core_runtime/consensus/staking/struct.StakeAccumulator.html new file mode 100644 index 0000000000..6c8d6add4c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.StakeAccumulator.html @@ -0,0 +1,35 @@ +StakeAccumulator in oasis_core_runtime::consensus::staking - Rust
pub struct StakeAccumulator {
+    pub claims: BTreeMap<StakeClaim, Vec<StakeThreshold>>,
+}
Expand description

Per escrow account stake accumulator.

+

Fields§

§claims: BTreeMap<StakeClaim, Vec<StakeThreshold>>

Trait Implementations§

source§

impl Clone for StakeAccumulator

source§

fn clone(&self) -> StakeAccumulator

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StakeAccumulator

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StakeAccumulator

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for StakeAccumulator

source§

fn default() -> StakeAccumulator

Returns the “default value” for a type. Read more
source§

impl Encode for StakeAccumulator

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for StakeAccumulator

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for StakeAccumulator

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for StakeAccumulator

source§

fn eq(&self, other: &StakeAccumulator) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for StakeAccumulator

source§

impl StructuralPartialEq for StakeAccumulator

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.StakeThreshold.html b/rust/oasis_core_runtime/consensus/staking/struct.StakeThreshold.html new file mode 100644 index 0000000000..7644d5cb3a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.StakeThreshold.html @@ -0,0 +1,36 @@ +StakeThreshold in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::StakeThreshold

source ·
pub struct StakeThreshold {
+    pub global: Option<ThresholdKind>,
+    pub constant: Option<Quantity>,
+}
Expand description

Stake threshold used in the stake accumulator.

+

Fields§

§global: Option<ThresholdKind>§constant: Option<Quantity>

Trait Implementations§

source§

impl Clone for StakeThreshold

source§

fn clone(&self) -> StakeThreshold

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StakeThreshold

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StakeThreshold

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for StakeThreshold

source§

fn default() -> StakeThreshold

Returns the “default value” for a type. Read more
source§

impl Encode for StakeThreshold

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for StakeThreshold

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for StakeThreshold

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for StakeThreshold

source§

fn eq(&self, other: &StakeThreshold) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for StakeThreshold

source§

impl StructuralPartialEq for StakeThreshold

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.Transfer.html b/rust/oasis_core_runtime/consensus/staking/struct.Transfer.html new file mode 100644 index 0000000000..92c52159a0 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.Transfer.html @@ -0,0 +1,36 @@ +Transfer in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::Transfer

source ·
pub struct Transfer {
+    pub to: Address,
+    pub amount: Quantity,
+}
Expand description

A stake transfer.

+

Fields§

§to: Address§amount: Quantity

Trait Implementations§

source§

impl Clone for Transfer

source§

fn clone(&self) -> Transfer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Transfer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Transfer

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Transfer

source§

fn default() -> Transfer

Returns the “default value” for a type. Read more
source§

impl Encode for Transfer

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Transfer

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Transfer

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Transfer

source§

fn eq(&self, other: &Transfer) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Transfer

source§

impl StructuralPartialEq for Transfer

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.TransferEvent.html b/rust/oasis_core_runtime/consensus/staking/struct.TransferEvent.html new file mode 100644 index 0000000000..682e7cc759 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.TransferEvent.html @@ -0,0 +1,37 @@ +TransferEvent in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::TransferEvent

source ·
pub struct TransferEvent {
+    pub from: Address,
+    pub to: Address,
+    pub amount: Quantity,
+}
Expand description

Event emitted when stake is transferred, either by a call to Transfer or Withdraw.

+

Fields§

§from: Address§to: Address§amount: Quantity

Trait Implementations§

source§

impl Clone for TransferEvent

source§

fn clone(&self) -> TransferEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TransferEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TransferEvent

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TransferEvent

source§

fn default() -> TransferEvent

Returns the “default value” for a type. Read more
source§

impl Encode for TransferEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TransferEvent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for TransferEvent

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for TransferEvent

source§

fn eq(&self, other: &TransferEvent) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TransferEvent

source§

impl StructuralPartialEq for TransferEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.TransferResult.html b/rust/oasis_core_runtime/consensus/staking/struct.TransferResult.html new file mode 100644 index 0000000000..be348abd0f --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.TransferResult.html @@ -0,0 +1,37 @@ +TransferResult in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::TransferResult

source ·
pub struct TransferResult {
+    pub from: Address,
+    pub to: Address,
+    pub amount: Quantity,
+}
Expand description

Transfer result.

+

Fields§

§from: Address§to: Address§amount: Quantity

Trait Implementations§

source§

impl Clone for TransferResult

source§

fn clone(&self) -> TransferResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TransferResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TransferResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TransferResult

source§

fn default() -> TransferResult

Returns the “default value” for a type. Read more
source§

impl Encode for TransferResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TransferResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for TransferResult

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for TransferResult

source§

fn eq(&self, other: &TransferResult) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TransferResult

source§

impl StructuralPartialEq for TransferResult

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.Withdraw.html b/rust/oasis_core_runtime/consensus/staking/struct.Withdraw.html new file mode 100644 index 0000000000..700d236ff3 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.Withdraw.html @@ -0,0 +1,36 @@ +Withdraw in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::Withdraw

source ·
pub struct Withdraw {
+    pub from: Address,
+    pub amount: Quantity,
+}
Expand description

A withdrawal from an account.

+

Fields§

§from: Address§amount: Quantity

Trait Implementations§

source§

impl Clone for Withdraw

source§

fn clone(&self) -> Withdraw

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Withdraw

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Withdraw

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Withdraw

source§

fn default() -> Withdraw

Returns the “default value” for a type. Read more
source§

impl Encode for Withdraw

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Withdraw

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for Withdraw

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Withdraw

source§

fn eq(&self, other: &Withdraw) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Withdraw

source§

impl StructuralPartialEq for Withdraw

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/struct.WithdrawResult.html b/rust/oasis_core_runtime/consensus/staking/struct.WithdrawResult.html new file mode 100644 index 0000000000..f64952752e --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/struct.WithdrawResult.html @@ -0,0 +1,38 @@ +WithdrawResult in oasis_core_runtime::consensus::staking - Rust

Struct oasis_core_runtime::consensus::staking::WithdrawResult

source ·
pub struct WithdrawResult {
+    pub owner: Address,
+    pub beneficiary: Address,
+    pub allowance: Quantity,
+    pub amount_change: Quantity,
+}
Expand description

Withdraw result.

+

Fields§

§owner: Address§beneficiary: Address§allowance: Quantity§amount_change: Quantity

Trait Implementations§

source§

impl Clone for WithdrawResult

source§

fn clone(&self) -> WithdrawResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WithdrawResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for WithdrawResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for WithdrawResult

source§

fn default() -> WithdrawResult

Returns the “default value” for a type. Read more
source§

impl Encode for WithdrawResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for WithdrawResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Hash for WithdrawResult

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for WithdrawResult

source§

fn eq(&self, other: &WithdrawResult) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for WithdrawResult

source§

impl StructuralPartialEq for WithdrawResult

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/staking/type.StakeClaim.html b/rust/oasis_core_runtime/consensus/staking/type.StakeClaim.html new file mode 100644 index 0000000000..eefb86dfb3 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/staking/type.StakeClaim.html @@ -0,0 +1,2 @@ +StakeClaim in oasis_core_runtime::consensus::staking - Rust

Type Alias oasis_core_runtime::consensus::staking::StakeClaim

source ·
pub type StakeClaim = String;
Expand description

Unique stake claim identifier.

+

Aliased Type§

struct StakeClaim { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/beacon/index.html b/rust/oasis_core_runtime/consensus/state/beacon/index.html new file mode 100644 index 0000000000..4d76ee584d --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/beacon/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::state::beacon - Rust

Module oasis_core_runtime::consensus::state::beacon

source ·
Expand description

Beacon state in the consensus layer.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/beacon/sidebar-items.js b/rust/oasis_core_runtime/consensus/state/beacon/sidebar-items.js new file mode 100644 index 0000000000..54ecbd7b02 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/beacon/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ImmutableState","MutableState"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/beacon/struct.ImmutableState.html b/rust/oasis_core_runtime/consensus/state/beacon/struct.ImmutableState.html new file mode 100644 index 0000000000..16bed7b84e --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/beacon/struct.ImmutableState.html @@ -0,0 +1,30 @@ +ImmutableState in oasis_core_runtime::consensus::state::beacon - Rust
pub struct ImmutableState<'a, T: ImmutableMKVS> { /* private fields */ }
Expand description

Consensus beacon state wrapper.

+

Implementations§

source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn new(mkvs: &'a T) -> ImmutableState<'a, T>

Constructs a new ImmutableMKVS.

+
source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn epoch(&self) -> Result<EpochTime, StateError>

Returns the current epoch number.

+
source

pub fn epoch_state(&self) -> Result<EpochTimeState, StateError>

Returns the current epoch state.

+
source

pub fn future_epoch(&self) -> Result<EpochTime, StateError>

Returns the future epoch number.

+
source

pub fn future_epoch_state(&self) -> Result<EpochTimeState, StateError>

Returns the future epoch state.

+

Auto Trait Implementations§

§

impl<'a, T> Freeze for ImmutableState<'a, T>

§

impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

§

impl<'a, T> Send for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Sync for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Unpin for ImmutableState<'a, T>

§

impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/beacon/struct.MutableState.html b/rust/oasis_core_runtime/consensus/state/beacon/struct.MutableState.html new file mode 100644 index 0000000000..633140b3b1 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/beacon/struct.MutableState.html @@ -0,0 +1,29 @@ +MutableState in oasis_core_runtime::consensus::state::beacon - Rust

Struct oasis_core_runtime::consensus::state::beacon::MutableState

source ·
pub struct MutableState;
Expand description

Mutable consensus beacon state wrapper.

+

Implementations§

source§

impl MutableState

source

pub fn set_epoch_state<S: FallibleMKVS>( + mkvs: &mut S, + epoch_state: EpochTimeState, +) -> Result<(), StateError>

Set current epoch state.

+
source

pub fn set_future_epoch_state<S: FallibleMKVS>( + mkvs: &mut S, + epoch_state: EpochTimeState, +) -> Result<(), StateError>

Set future epoch state.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/enum.StateError.html b/rust/oasis_core_runtime/consensus/state/enum.StateError.html new file mode 100644 index 0000000000..52c10f86ef --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/enum.StateError.html @@ -0,0 +1,23 @@ +StateError in oasis_core_runtime::consensus::state - Rust

Enum oasis_core_runtime::consensus::state::StateError

source ·
pub enum StateError {
+    Unavailable(Error),
+}

Variants§

§

Unavailable(Error)

Trait Implementations§

source§

impl Debug for StateError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for StateError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for StateError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for StateError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<StateError> for Error

source§

fn from(source: StateError) -> Self

Converts to this type from the input type.
source§

impl From<StateError> for Error

source§

fn from(e: StateError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/index.html b/rust/oasis_core_runtime/consensus/state/index.html new file mode 100644 index 0000000000..c778c65611 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::state - Rust

Module oasis_core_runtime::consensus::state

source ·
Expand description

Consensus state wrappers.

+

Modules§

  • Beacon state in the consensus layer.
  • Key manager state in the consensus layer.
  • Registry state in the consensus layer.
  • Roothash state in the consensus layer.
  • Staking state in the consensus layer.

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/keymanager/churp/index.html b/rust/oasis_core_runtime/consensus/state/keymanager/churp/index.html new file mode 100644 index 0000000000..a5371fff3c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/keymanager/churp/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::state::keymanager::churp - Rust

Module oasis_core_runtime::consensus::state::keymanager::churp

source ·
Expand description

Key manager state in the consensus layer.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/keymanager/churp/sidebar-items.js b/rust/oasis_core_runtime/consensus/state/keymanager/churp/sidebar-items.js new file mode 100644 index 0000000000..a067d02129 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/keymanager/churp/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ImmutableState"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/keymanager/churp/struct.ImmutableState.html b/rust/oasis_core_runtime/consensus/state/keymanager/churp/struct.ImmutableState.html new file mode 100644 index 0000000000..c2fc0ff007 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/keymanager/churp/struct.ImmutableState.html @@ -0,0 +1,31 @@ +ImmutableState in oasis_core_runtime::consensus::state::keymanager::churp - Rust
pub struct ImmutableState<'a, T: ImmutableMKVS> { /* private fields */ }
Expand description

Consensus CHURP state wrapper.

+

Implementations§

source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn new(mkvs: &'a T) -> ImmutableState<'a, T>

Constructs a new ImmutableMKVS.

+
source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn status( + &self, + runtime_id: Namespace, + churp_id: u8, +) -> Result<Option<Status>, StateError>

Looks up a specific key manager status by its namespace identifier.

+

Auto Trait Implementations§

§

impl<'a, T> Freeze for ImmutableState<'a, T>

§

impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

§

impl<'a, T> Send for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Sync for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Unpin for ImmutableState<'a, T>

§

impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/keymanager/index.html b/rust/oasis_core_runtime/consensus/state/keymanager/index.html new file mode 100644 index 0000000000..ecf6e6a977 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/keymanager/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::state::keymanager - Rust

Module oasis_core_runtime::consensus::state::keymanager

source ·
Expand description

Key manager state in the consensus layer.

+

Modules§

  • Key manager state in the consensus layer.

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/keymanager/sidebar-items.js b/rust/oasis_core_runtime/consensus/state/keymanager/sidebar-items.js new file mode 100644 index 0000000000..5d3c4b41d5 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/keymanager/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["churp"],"struct":["ImmutableState","Status"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/keymanager/struct.ImmutableState.html b/rust/oasis_core_runtime/consensus/state/keymanager/struct.ImmutableState.html new file mode 100644 index 0000000000..f877059a20 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/keymanager/struct.ImmutableState.html @@ -0,0 +1,36 @@ +ImmutableState in oasis_core_runtime::consensus::state::keymanager - Rust
pub struct ImmutableState<'a, T: ImmutableMKVS> { /* private fields */ }
Expand description

Consensus key manager state wrapper.

+

Implementations§

source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn new(mkvs: &'a T) -> ImmutableState<'a, T>

Constructs a new ImmutableMKVS.

+
source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn status(&self, id: Namespace) -> Result<Option<Status>, StateError>

Looks up a specific key manager status by its namespace identifier.

+
source

pub fn statuses(&self) -> Result<Vec<Status>, StateError>

Returns the list of all key manager statuses.

+
source

pub fn master_secret( + &self, + id: Namespace, +) -> Result<Option<SignedEncryptedMasterSecret>, StateError>

Looks up a specific key manager master secret by its namespace identifier.

+
source

pub fn ephemeral_secret( + &self, + id: Namespace, +) -> Result<Option<SignedEncryptedEphemeralSecret>, StateError>

Looks up a specific key manager ephemeral secret by its namespace identifier and epoch.

+

Auto Trait Implementations§

§

impl<'a, T> Freeze for ImmutableState<'a, T>

§

impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

§

impl<'a, T> Send for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Sync for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Unpin for ImmutableState<'a, T>

§

impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/keymanager/struct.Status.html b/rust/oasis_core_runtime/consensus/state/keymanager/struct.Status.html new file mode 100644 index 0000000000..a2401056b3 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/keymanager/struct.Status.html @@ -0,0 +1,50 @@ +Status in oasis_core_runtime::consensus::state::keymanager - Rust

Struct oasis_core_runtime::consensus::state::keymanager::Status

source ·
pub struct Status {
+    pub id: Namespace,
+    pub is_initialized: bool,
+    pub is_secure: bool,
+    pub generation: u64,
+    pub rotation_epoch: EpochTime,
+    pub checksum: Vec<u8>,
+    pub nodes: Vec<PublicKey>,
+    pub policy: Option<SignedPolicySGX>,
+    pub rsk: Option<PublicKey>,
+}
Expand description

Current key manager status.

+

Fields§

§id: Namespace

Runtime ID of the key manager.

+
§is_initialized: bool

True iff the key manager is done initializing.

+
§is_secure: bool

True iff the key manager is secure.

+
§generation: u64

Generation of the latest master secret.

+
§rotation_epoch: EpochTime

Epoch of the last master secret rotation.

+
§checksum: Vec<u8>

Key manager master secret verification checksum.

+
§nodes: Vec<PublicKey>

List of currently active key manager node IDs.

+
§policy: Option<SignedPolicySGX>

Key manager policy.

+
§rsk: Option<PublicKey>

Runtime signing key of the key manager.

+

Trait Implementations§

source§

impl Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Status

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Status

source§

fn default() -> Status

Returns the “default value” for a type. Read more
source§

impl Encode for Status

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Status

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Status

source§

fn eq(&self, other: &Status) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Status

source§

impl StructuralPartialEq for Status

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/registry/index.html b/rust/oasis_core_runtime/consensus/state/registry/index.html new file mode 100644 index 0000000000..371739b9e2 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/registry/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::state::registry - Rust

Module oasis_core_runtime::consensus::state::registry

source ·
Expand description

Registry state in the consensus layer.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/registry/sidebar-items.js b/rust/oasis_core_runtime/consensus/state/registry/sidebar-items.js new file mode 100644 index 0000000000..a067d02129 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/registry/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ImmutableState"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/registry/struct.ImmutableState.html b/rust/oasis_core_runtime/consensus/state/registry/struct.ImmutableState.html new file mode 100644 index 0000000000..77939f37e4 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/registry/struct.ImmutableState.html @@ -0,0 +1,31 @@ +ImmutableState in oasis_core_runtime::consensus::state::registry - Rust
pub struct ImmutableState<'a, T: ImmutableMKVS> { /* private fields */ }
Expand description

Consensus registry state wrapper.

+

Implementations§

source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn new(mkvs: &'a T) -> ImmutableState<'a, T>

Constructs a new ImmutableMKVS.

+
source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn node(&self, id: &PublicKey) -> Result<Option<Node>, StateError>

Looks up a specific node by its identifier.

+
source

pub fn nodes(&self) -> Result<Vec<Node>, StateError>

Returns the list of all registered nodes.

+
source

pub fn runtime(&self, id: &Namespace) -> Result<Option<Runtime>, StateError>

Looks up a specific runtime by its identifier.

+
§Note
+

This includes both non-suspended and suspended runtimes.

+

Auto Trait Implementations§

§

impl<'a, T> Freeze for ImmutableState<'a, T>

§

impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

§

impl<'a, T> Send for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Sync for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Unpin for ImmutableState<'a, T>

§

impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/roothash/index.html b/rust/oasis_core_runtime/consensus/state/roothash/index.html new file mode 100644 index 0000000000..55943008f9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/roothash/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::state::roothash - Rust

Module oasis_core_runtime::consensus::state::roothash

source ·
Expand description

Roothash state in the consensus layer.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/roothash/sidebar-items.js b/rust/oasis_core_runtime/consensus/state/roothash/sidebar-items.js new file mode 100644 index 0000000000..a067d02129 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/roothash/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ImmutableState"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/roothash/struct.ImmutableState.html b/rust/oasis_core_runtime/consensus/state/roothash/struct.ImmutableState.html new file mode 100644 index 0000000000..501b3a639c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/roothash/struct.ImmutableState.html @@ -0,0 +1,35 @@ +ImmutableState in oasis_core_runtime::consensus::state::roothash - Rust
pub struct ImmutableState<'a, T: ImmutableMKVS> { /* private fields */ }
Expand description

Consensus roothash state wrapper.

+

Implementations§

source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn new(mkvs: &'a T) -> ImmutableState<'a, T>

Constructs a new ImmutableMKVS.

+
source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn state_root(&self, id: Namespace) -> Result<Hash, Error>

Returns the state root for a specific runtime.

+
source

pub fn last_round_results(&self, id: Namespace) -> Result<RoundResults, Error>

Returns the last round results for a specific runtime.

+
source

pub fn round_roots( + &self, + id: Namespace, + round: u64, +) -> Result<Option<RoundRoots>, StateError>

source

pub fn past_round_roots( + &self, + id: Namespace, +) -> Result<BTreeMap<u64, RoundRoots>, StateError>

Auto Trait Implementations§

§

impl<'a, T> Freeze for ImmutableState<'a, T>

§

impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

§

impl<'a, T> Send for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Sync for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Unpin for ImmutableState<'a, T>

§

impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/sidebar-items.js b/rust/oasis_core_runtime/consensus/state/sidebar-items.js new file mode 100644 index 0000000000..ac5fbe3a6c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["StateError"],"mod":["beacon","keymanager","registry","roothash","staking"],"struct":["ConsensusState"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/staking/index.html b/rust/oasis_core_runtime/consensus/state/staking/index.html new file mode 100644 index 0000000000..3a584507c7 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/staking/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::state::staking - Rust

Module oasis_core_runtime::consensus::state::staking

source ·
Expand description

Staking state in the consensus layer.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/staking/sidebar-items.js b/rust/oasis_core_runtime/consensus/state/staking/sidebar-items.js new file mode 100644 index 0000000000..a067d02129 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/staking/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ImmutableState"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/staking/struct.ImmutableState.html b/rust/oasis_core_runtime/consensus/state/staking/struct.ImmutableState.html new file mode 100644 index 0000000000..8c90482fae --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/staking/struct.ImmutableState.html @@ -0,0 +1,49 @@ +ImmutableState in oasis_core_runtime::consensus::state::staking - Rust
pub struct ImmutableState<'a, T: ImmutableMKVS> { /* private fields */ }
Expand description

Consensus staking state wrapper.

+

Implementations§

source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn new(mkvs: &'a T) -> ImmutableState<'a, T>

Constructs a new ImmutableMKVS.

+
source§

impl<'a, T: ImmutableMKVS> ImmutableState<'a, T>

source

pub fn account(&self, address: Address) -> Result<Account, StateError>

Returns the staking account for the given account address.

+
source

pub fn total_supply(&self) -> Result<Quantity, StateError>

Returns the total supply.

+
source

pub fn common_pool(&self) -> Result<Quantity, StateError>

Returns the balance of the global common pool.

+
source

pub fn last_block_fees(&self) -> Result<Quantity, StateError>

Returns the last block fees balance.

+
source

pub fn governance_deposits(&self) -> Result<Quantity, StateError>

Returns the governance deposits balance.

+
source

pub fn addresses(&self) -> Result<Vec<Address>, StateError>

Returns the non-empty addresses from the staking ledger.

+
source

pub fn delegation( + &self, + delegator_addr: Address, + escrow_addr: Address, +) -> Result<Delegation, StateError>

Returns the delegation.

+
source

pub fn delegations( + &self, +) -> Result<BTreeMap<Address, BTreeMap<Address, Delegation>>, StateError>

Returns all active delegations.

+
source

pub fn debonding_delegation( + &self, + delegator_addr: Address, + escrow_addr: Address, + epoch: EpochTime, +) -> Result<DebondingDelegation, StateError>

Returns the debonding delegation.

+
source

pub fn debonding_delegations( + &self, +) -> Result<BTreeMap<Address, BTreeMap<Address, Vec<DebondingDelegation>>>, StateError>

Returns all debonding delegations.

+

Auto Trait Implementations§

§

impl<'a, T> Freeze for ImmutableState<'a, T>

§

impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

§

impl<'a, T> Send for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Sync for ImmutableState<'a, T>
where + T: Sync,

§

impl<'a, T> Unpin for ImmutableState<'a, T>

§

impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where + T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/state/struct.ConsensusState.html b/rust/oasis_core_runtime/consensus/state/struct.ConsensusState.html new file mode 100644 index 0000000000..67f3c278b5 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/state/struct.ConsensusState.html @@ -0,0 +1,23 @@ +ConsensusState in oasis_core_runtime::consensus::state - Rust

Struct oasis_core_runtime::consensus::state::ConsensusState

source ·
pub struct ConsensusState { /* private fields */ }
Expand description

Provides consensus state tree from the host.

+

Implementations§

source§

impl ConsensusState

source

pub fn new(height: u64, tree: Tree) -> Self

Creates a consensus state wrapping the provided tree.

+
source

pub fn from_protocol(protocol: Arc<Protocol>, height: u64, root: Root) -> Self

Creates consensus state using host protocol.

+
source

pub fn height(&self) -> u64

Consensus layer height that this data is for.

+

Trait Implementations§

source§

impl ImmutableMKVS for &ConsensusState

source§

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Fetch entry with given key.
source§

fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>

Fetch proof for entry with given key.
source§

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>

Populate the in-memory tree with nodes for keys starting with given prefixes.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

impl ImmutableMKVS for ConsensusState

source§

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Fetch entry with given key.
source§

fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>

Fetch proof for entry with given key.
source§

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>

Populate the in-memory tree with nodes for keys starting with given prefixes.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/struct.BlockMetadata.html b/rust/oasis_core_runtime/consensus/struct.BlockMetadata.html new file mode 100644 index 0000000000..921b2ecad0 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/struct.BlockMetadata.html @@ -0,0 +1,37 @@ +BlockMetadata in oasis_core_runtime::consensus - Rust

Struct oasis_core_runtime::consensus::BlockMetadata

source ·
pub struct BlockMetadata {
+    pub state_root: Hash,
+    pub events_root: Vec<u8>,
+}
Expand description

BlockMetadata contains additional metadata related to the executing block.

+

The metadata is included in the form of a special transaction where this structure is the +transaction body.

+

Fields§

§state_root: Hash

State root after executing all logic in the block.

+
§events_root: Vec<u8>

Trait Implementations§

source§

impl Clone for BlockMetadata

source§

fn clone(&self) -> BlockMetadata

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BlockMetadata

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for BlockMetadata

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for BlockMetadata

source§

fn default() -> BlockMetadata

Returns the “default value” for a type. Read more
source§

impl Encode for BlockMetadata

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for BlockMetadata

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for BlockMetadata

source§

fn eq(&self, other: &BlockMetadata) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for BlockMetadata

source§

impl StructuralPartialEq for BlockMetadata

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/struct.LightBlock.html b/rust/oasis_core_runtime/consensus/struct.LightBlock.html new file mode 100644 index 0000000000..a482b70276 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/struct.LightBlock.html @@ -0,0 +1,30 @@ +LightBlock in oasis_core_runtime::consensus - Rust

Struct oasis_core_runtime::consensus::LightBlock

source ·
pub struct LightBlock {
+    pub height: u64,
+    pub meta: Vec<u8>,
+}
Expand description

Light consensus block.

+

Fields§

§height: u64§meta: Vec<u8>

Trait Implementations§

source§

impl Clone for LightBlock

source§

fn clone(&self) -> LightBlock

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LightBlock

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for LightBlock

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for LightBlock

source§

fn default() -> LightBlock

Returns the “default value” for a type. Read more
source§

impl Encode for LightBlock

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for LightBlock

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/constant.BACKEND_NAME.html b/rust/oasis_core_runtime/consensus/tendermint/constant.BACKEND_NAME.html new file mode 100644 index 0000000000..b6cc1f50d8 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/constant.BACKEND_NAME.html @@ -0,0 +1,3 @@ +BACKEND_NAME in oasis_core_runtime::consensus::tendermint - Rust

Constant oasis_core_runtime::consensus::tendermint::BACKEND_NAME

source ·
pub const BACKEND_NAME: &str = "tendermint";
Expand description

Tendermint consensus backend name. +Keep synced with go/consensus/cometbft/api/api.go.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/constant.TENDERMINT_CONTEXT.html b/rust/oasis_core_runtime/consensus/tendermint/constant.TENDERMINT_CONTEXT.html new file mode 100644 index 0000000000..25a6984c8c --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/constant.TENDERMINT_CONTEXT.html @@ -0,0 +1,3 @@ +TENDERMINT_CONTEXT in oasis_core_runtime::consensus::tendermint - Rust
pub const TENDERMINT_CONTEXT: &[u8] = b"oasis-core/tendermint";
Expand description

The domain separation context used by Oasis Core for Tendermint cryptography. +Keep synced with go/consensus/cometbft/crypto/signature.go.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/fn.chain_id.html b/rust/oasis_core_runtime/consensus/tendermint/fn.chain_id.html new file mode 100644 index 0000000000..fe4492f743 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/fn.chain_id.html @@ -0,0 +1,2 @@ +chain_id in oasis_core_runtime::consensus::tendermint - Rust

Function oasis_core_runtime::consensus::tendermint::chain_id

source ·
pub fn chain_id(chain_context: &str) -> Id
Expand description

Convert an Oasis Core chain context into a Tendermint chain ID.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/fn.decode_light_block.html b/rust/oasis_core_runtime/consensus/tendermint/fn.decode_light_block.html new file mode 100644 index 0000000000..b47b1da2f7 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/fn.decode_light_block.html @@ -0,0 +1,2 @@ +decode_light_block in oasis_core_runtime::consensus::tendermint - Rust
pub fn decode_light_block(light_block: LightBlock) -> Result<LightBlockMeta>
Expand description

Decode the light block metadata as a Tendermint light block.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/fn.encode_light_block.html b/rust/oasis_core_runtime/consensus/tendermint/fn.encode_light_block.html new file mode 100644 index 0000000000..445bca0ef2 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/fn.encode_light_block.html @@ -0,0 +1,4 @@ +encode_light_block in oasis_core_runtime::consensus::tendermint - Rust
pub fn encode_light_block(
+    light_block_meta: LightBlockMeta,
+) -> Result<LightBlock>
Expand description

Encode the light block metadata to a Tendermint light block.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/fn.state_root_from_header.html b/rust/oasis_core_runtime/consensus/tendermint/fn.state_root_from_header.html new file mode 100644 index 0000000000..7e0f3c2e7a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/fn.state_root_from_header.html @@ -0,0 +1,5 @@ +state_root_from_header in oasis_core_runtime::consensus::tendermint - Rust
pub fn state_root_from_header(signed_header: &SignedHeader) -> Root
Expand description

Extract state root from the given signed block header.

+

§Panics

+

The signed header must be present and the application hash must be a valid Oasis Core +application hash (state root hash).

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/index.html b/rust/oasis_core_runtime/consensus/tendermint/index.html new file mode 100644 index 0000000000..d93376c96a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/index.html @@ -0,0 +1,4 @@ +oasis_core_runtime::consensus::tendermint - Rust

Module oasis_core_runtime::consensus::tendermint

source ·
Expand description

Tendermint consensus layer backend.

+

Modules§

  • Merkle proofs used in Tendermint networks
  • Tendermint consensus layer verification logic.

Structs§

Constants§

  • Tendermint consensus backend name. +Keep synced with go/consensus/cometbft/api/api.go.
  • The domain separation context used by Oasis Core for Tendermint cryptography. +Keep synced with go/consensus/cometbft/crypto/signature.go.

Functions§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/merkle/constant.MAX_AUNTS.html b/rust/oasis_core_runtime/consensus/tendermint/merkle/constant.MAX_AUNTS.html new file mode 100644 index 0000000000..a90708b900 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/merkle/constant.MAX_AUNTS.html @@ -0,0 +1,4 @@ +MAX_AUNTS in oasis_core_runtime::consensus::tendermint::merkle - Rust

Constant oasis_core_runtime::consensus::tendermint::merkle::MAX_AUNTS

source ·
pub const MAX_AUNTS: usize = 100;
Expand description

Maximum number of aunts that can be included in a Proof. +This corresponds to a tree of size 2^100, which should be sufficient for all conceivable purposes. +This maximum helps prevent Denial-of-Service attacks by limiting the size of the proofs.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/merkle/index.html b/rust/oasis_core_runtime/consensus/tendermint/merkle/index.html new file mode 100644 index 0000000000..ceeceb2839 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/merkle/index.html @@ -0,0 +1,8 @@ +oasis_core_runtime::consensus::tendermint::merkle - Rust

Module oasis_core_runtime::consensus::tendermint::merkle

source ·
Expand description

Merkle proofs used in Tendermint networks

+

Rewritten to Rust from: +https://github.com/tendermint/tendermint/blob/main/crypto/merkle/proof.go

+

Helper functions copied from: +https://github.com/informalsystems/tendermint-rs/blob/main/tendermint/src/merkle.rs

+

Structs§

  • Proof represents a Merkle proof.

Constants§

  • Maximum number of aunts that can be included in a Proof. +This corresponds to a tree of size 2^100, which should be sufficient for all conceivable purposes. +This maximum helps prevent Denial-of-Service attacks by limiting the size of the proofs.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/merkle/sidebar-items.js b/rust/oasis_core_runtime/consensus/tendermint/merkle/sidebar-items.js new file mode 100644 index 0000000000..844635ecce --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/merkle/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["MAX_AUNTS"],"struct":["Proof"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/merkle/struct.Proof.html b/rust/oasis_core_runtime/consensus/tendermint/merkle/struct.Proof.html new file mode 100644 index 0000000000..dbff10488e --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/merkle/struct.Proof.html @@ -0,0 +1,39 @@ +Proof in oasis_core_runtime::consensus::tendermint::merkle - Rust

Struct oasis_core_runtime::consensus::tendermint::merkle::Proof

source ·
pub struct Proof {
+    pub total: i64,
+    pub index: i64,
+    pub leaf_hash: Hash,
+    pub aunts: Vec<Hash>,
+}
Expand description

Proof represents a Merkle proof.

+

NOTE: The convention for proofs is to include leaf hashes but to +exclude the root hash. +This convention is implemented across IAVL range proofs as well. +Keep this consistent unless there’s a very good reason to change +everything. This also affects the generalized proof system as +well.

+

Fields§

§total: i64§index: i64§leaf_hash: Hash§aunts: Vec<Hash>

Implementations§

source§

impl Proof

source

pub fn verify(&self, root_hash: Hash, leaf: Hash) -> Result<()>

Verify that the Proof proves the root hash. +Check index/total manually if needed.

+
source

pub fn compute_root_hash(&self) -> Option<Hash>

Compute the root hash given a leaf hash. Does not verify the result.

+

Trait Implementations§

source§

impl Debug for Proof

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Proof

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Proof

source§

fn default() -> Proof

Returns the “default value” for a type. Read more
source§

impl Encode for Proof

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Proof

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Proof

§

impl RefUnwindSafe for Proof

§

impl Send for Proof

§

impl Sync for Proof

§

impl Unpin for Proof

§

impl UnwindSafe for Proof

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/sidebar-items.js b/rust/oasis_core_runtime/consensus/tendermint/sidebar-items.js new file mode 100644 index 0000000000..e5aeae269a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["BACKEND_NAME","TENDERMINT_CONTEXT"],"fn":["chain_id","decode_light_block","encode_light_block","state_root_from_header"],"mod":["merkle","verifier"],"struct":["LightBlockMeta"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/struct.LightBlockMeta.html b/rust/oasis_core_runtime/consensus/tendermint/struct.LightBlockMeta.html new file mode 100644 index 0000000000..5d3218f657 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/struct.LightBlockMeta.html @@ -0,0 +1,37 @@ +LightBlockMeta in oasis_core_runtime::consensus::tendermint - Rust
pub struct LightBlockMeta {
+    pub signed_header: Option<SignedHeader>,
+    pub validators: Set,
+}
Expand description

Tendermint light consensus block metadata.

+

Fields§

§signed_header: Option<SignedHeader>§validators: Set

Implementations§

source§

impl LightBlockMeta

source

pub fn get_state_root(&self) -> Root

State root specified by this light block.

+
§Panics
+

The signed header must be present and the application hash must be a valid Oasis Core +application hash (state root hash).

+

Trait Implementations§

source§

impl Clone for LightBlockMeta

source§

fn clone(&self) -> LightBlockMeta

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LightBlockMeta

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<LightBlockMeta> for LightBlock

source§

fn from(value: LightBlockMeta) -> Self

Converts to this type from the input type.
source§

impl Protobuf<LightBlock> for LightBlockMeta

§

fn encode<B>(self, buf: &mut B) -> Result<(), Error>
where + B: BufMut,

Encode into a buffer in Protobuf format. Read more
§

fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>
where + B: BufMut,

Encode with a length-delimiter to a buffer in Protobuf format. Read more
§

fn decode<B>(buf: B) -> Result<Self, Error>
where + B: Buf,

Constructor that attempts to decode an instance from a buffer. Read more
§

fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>
where + B: Buf,

Constructor that attempts to decode a length-delimited instance from +the buffer. Read more
§

fn encoded_len(self) -> usize

Returns the encoded length of the message without a length delimiter. Read more
§

fn encode_vec(self) -> Vec<u8>

Encodes into a Protobuf-encoded Vec<u8>.
§

fn decode_vec(v: &[u8]) -> Result<Self, Error>

Constructor that attempts to decode a Protobuf-encoded instance from a +Vec<u8> (or equivalent).
§

fn encode_length_delimited_vec(self) -> Vec<u8>

Encode with a length-delimiter to a Vec<u8> Protobuf-encoded message.
§

fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>

Constructor that attempts to decode a Protobuf-encoded instance with a +length-delimiter from a Vec<u8> or equivalent.
source§

impl TryFrom<LightBlock> for LightBlockMeta

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: RawLightBlock) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/verifier/index.html b/rust/oasis_core_runtime/consensus/tendermint/verifier/index.html new file mode 100644 index 0000000000..7434820b35 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/verifier/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::tendermint::verifier - Rust

Module oasis_core_runtime::consensus::tendermint::verifier

source ·
Expand description

Tendermint consensus layer verification logic.

+

Structs§

  • A verifier which performs no verification.
  • Tendermint consensus layer verifier.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/verifier/noop/struct.NopVerifier.html b/rust/oasis_core_runtime/consensus/tendermint/verifier/noop/struct.NopVerifier.html new file mode 100644 index 0000000000..356e73dba9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/verifier/noop/struct.NopVerifier.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/consensus/tendermint/verifier/struct.NopVerifier.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/verifier/sidebar-items.js b/rust/oasis_core_runtime/consensus/tendermint/verifier/sidebar-items.js new file mode 100644 index 0000000000..9bd8b333fd --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/verifier/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["NopVerifier","Verifier"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/verifier/struct.NopVerifier.html b/rust/oasis_core_runtime/consensus/tendermint/verifier/struct.NopVerifier.html new file mode 100644 index 0000000000..c757d75fa1 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/verifier/struct.NopVerifier.html @@ -0,0 +1,69 @@ +NopVerifier in oasis_core_runtime::consensus::tendermint::verifier - Rust
pub struct NopVerifier { /* private fields */ }
Expand description

A verifier which performs no verification.

+

Implementations§

source§

impl NopVerifier

source

pub fn new(protocol: Arc<Protocol>) -> Self

Create a new non-verifying verifier.

+
source

pub fn start(&self)

Start the non-verifying verifier.

+

Trait Implementations§

source§

impl Verifier for NopVerifier

source§

fn sync<'life0, 'async_trait>( + &'life0 self, + height: u64, +) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Synchronize the verifier state up to including the passed consensus height.
source§

fn verify<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, + _runtime_header: Header, + _epoch: EpochTime, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Verify that the given runtime header is valid at the given consensus layer block and return +the consensus layer state accessor for that block. Read more
source§

fn verify_for_query<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, + _runtime_header: Header, + _epoch: EpochTime, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Verify that the given runtime header is valid at the given consensus layer block and return +the consensus layer state accessor for that block. Read more
source§

fn unverified_state<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the consensus layer state accessor for the given consensus layer block WITHOUT +performing any verification. This method should only be used for operations that do not +require integrity guarantees.
source§

fn latest_state<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the latest verified consensus layer state. Read more
source§

fn state_at<'life0, 'async_trait>( + &'life0 self, + height: u64, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the verified consensus layer state for a given height. Read more
source§

fn events_at<'life0, 'async_trait>( + &'life0 self, + height: u64, + kind: EventKind, +) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the consensus layer events at the given height. Read more
source§

fn latest_height<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the latest known consensus layer height.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/tendermint/verifier/struct.Verifier.html b/rust/oasis_core_runtime/consensus/tendermint/verifier/struct.Verifier.html new file mode 100644 index 0000000000..72850055c9 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/tendermint/verifier/struct.Verifier.html @@ -0,0 +1,29 @@ +Verifier in oasis_core_runtime::consensus::tendermint::verifier - Rust
pub struct Verifier { /* private fields */ }
Expand description

Tendermint consensus layer verifier.

+

Implementations§

source§

impl Verifier

source

pub fn new( + protocol: Arc<Protocol>, + tokio_runtime: Handle, + trust_root: TrustRoot, + runtime_id: Namespace, + chain_context: String, +) -> Self

Create a new Tendermint consensus layer verifier.

+
source

pub fn handle(&self) -> impl Verifier

Return a handle to interact with the verifier.

+
source

pub fn start(self)

Start the verifier in a separate thread.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/constant.SIGNATURE_CONTEXT.html b/rust/oasis_core_runtime/consensus/transaction/constant.SIGNATURE_CONTEXT.html new file mode 100644 index 0000000000..82cd917222 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/constant.SIGNATURE_CONTEXT.html @@ -0,0 +1 @@ +SIGNATURE_CONTEXT in oasis_core_runtime::consensus::transaction - Rust
pub const SIGNATURE_CONTEXT: &[u8] = b"oasis-core/consensus: tx";
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/index.html b/rust/oasis_core_runtime/consensus/transaction/index.html new file mode 100644 index 0000000000..1a5701eee7 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::transaction - Rust

Module oasis_core_runtime::consensus::transaction

source ·

Structs§

  • Consensus transaction fee the sender wishes to pay for operations which +require a fee to be paid to validators.
  • Proof of transaction inclusion in a block.
  • Signed consensus transaction with a proof of its inclusion in a block.
  • Unsigned consensus transaction.

Constants§

Type Aliases§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/sidebar-items.js b/rust/oasis_core_runtime/consensus/transaction/sidebar-items.js new file mode 100644 index 0000000000..2622c60633 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["SIGNATURE_CONTEXT"],"struct":["Fee","Proof","SignedTransactionWithProof","Transaction"],"type":["Gas","MethodName","SignedTransaction"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/struct.Fee.html b/rust/oasis_core_runtime/consensus/transaction/struct.Fee.html new file mode 100644 index 0000000000..b980da24c6 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/struct.Fee.html @@ -0,0 +1,31 @@ +Fee in oasis_core_runtime::consensus::transaction - Rust

Struct oasis_core_runtime::consensus::transaction::Fee

source ·
pub struct Fee {
+    pub amount: Quantity,
+    pub gas: Gas,
+}
Expand description

Consensus transaction fee the sender wishes to pay for operations which +require a fee to be paid to validators.

+

Fields§

§amount: Quantity

Fee amount to be paid.

+
§gas: Gas

Maximum gas that a transaction can use.

+

Trait Implementations§

source§

impl Debug for Fee

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Fee

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Fee

source§

fn default() -> Fee

Returns the “default value” for a type. Read more
source§

impl Encode for Fee

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Fee

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Fee

§

impl RefUnwindSafe for Fee

§

impl Send for Fee

§

impl Sync for Fee

§

impl Unpin for Fee

§

impl UnwindSafe for Fee

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/struct.Proof.html b/rust/oasis_core_runtime/consensus/transaction/struct.Proof.html new file mode 100644 index 0000000000..e2421c3496 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/struct.Proof.html @@ -0,0 +1,30 @@ +Proof in oasis_core_runtime::consensus::transaction - Rust

Struct oasis_core_runtime::consensus::transaction::Proof

source ·
pub struct Proof {
+    pub height: u64,
+    pub raw_proof: Vec<u8>,
+}
Expand description

Proof of transaction inclusion in a block.

+

Fields§

§height: u64

Block height at which the transaction was published.

+
§raw_proof: Vec<u8>

Actual raw proof.

+

Trait Implementations§

source§

impl Debug for Proof

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Proof

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Proof

source§

fn default() -> Proof

Returns the “default value” for a type. Read more
source§

impl Encode for Proof

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Proof

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Proof

§

impl RefUnwindSafe for Proof

§

impl Send for Proof

§

impl Sync for Proof

§

impl Unpin for Proof

§

impl UnwindSafe for Proof

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/struct.SignedTransactionWithProof.html b/rust/oasis_core_runtime/consensus/transaction/struct.SignedTransactionWithProof.html new file mode 100644 index 0000000000..d826d71fe5 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/struct.SignedTransactionWithProof.html @@ -0,0 +1,30 @@ +SignedTransactionWithProof in oasis_core_runtime::consensus::transaction - Rust
pub struct SignedTransactionWithProof {
+    pub signed_tx: SignedTransaction,
+    pub proof: Proof,
+}
Expand description

Signed consensus transaction with a proof of its inclusion in a block.

+

Fields§

§signed_tx: SignedTransaction

Signed transaction.

+
§proof: Proof

Proof of transaction inclusion in a block.

+

Trait Implementations§

source§

impl Debug for SignedTransactionWithProof

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignedTransactionWithProof

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SignedTransactionWithProof

source§

fn default() -> SignedTransactionWithProof

Returns the “default value” for a type. Read more
source§

impl Encode for SignedTransactionWithProof

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SignedTransactionWithProof

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/struct.Transaction.html b/rust/oasis_core_runtime/consensus/transaction/struct.Transaction.html new file mode 100644 index 0000000000..34d6be41a7 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/struct.Transaction.html @@ -0,0 +1,35 @@ +Transaction in oasis_core_runtime::consensus::transaction - Rust
pub struct Transaction {
+    pub nonce: u64,
+    pub fee: Option<Fee>,
+    pub method: MethodName,
+    pub body: Value,
+}
Expand description

Unsigned consensus transaction.

+

Fields§

§nonce: u64

Nonce to prevent replay.

+
§fee: Option<Fee>

Optional fee that the sender commits to pay to execute this transaction.

+
§method: MethodName

Method that should be called.

+
§body: Value

Method call body.

+

Trait Implementations§

source§

impl Debug for Transaction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Transaction

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Transaction

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Transaction

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/type.Gas.html b/rust/oasis_core_runtime/consensus/transaction/type.Gas.html new file mode 100644 index 0000000000..ddfa0bd13a --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/type.Gas.html @@ -0,0 +1,2 @@ +Gas in oasis_core_runtime::consensus::transaction - Rust

Type Alias oasis_core_runtime::consensus::transaction::Gas

source ·
pub type Gas = u64;
Expand description

Consensus gas representation.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/type.MethodName.html b/rust/oasis_core_runtime/consensus/transaction/type.MethodName.html new file mode 100644 index 0000000000..c305ee5c09 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/type.MethodName.html @@ -0,0 +1,2 @@ +MethodName in oasis_core_runtime::consensus::transaction - Rust

Type Alias oasis_core_runtime::consensus::transaction::MethodName

source ·
pub type MethodName = String;
Expand description

Method name.

+

Aliased Type§

struct MethodName { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/transaction/type.SignedTransaction.html b/rust/oasis_core_runtime/consensus/transaction/type.SignedTransaction.html new file mode 100644 index 0000000000..f0aadfc0c4 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/transaction/type.SignedTransaction.html @@ -0,0 +1,8 @@ +SignedTransaction in oasis_core_runtime::consensus::transaction - Rust
pub type SignedTransaction = Signed;
Expand description

Signed consensus transaction.

+

Aliased Type§

struct SignedTransaction {
+    pub blob: Vec<u8>,
+    pub signature: SignatureBundle,
+}

Fields§

§blob: Vec<u8>

Signed blob.

+
§signature: SignatureBundle

Signature over the blob.

+

Implementations§

source§

impl SignedTransaction

source

pub fn verify(&self, chain_context: &String) -> bool

Returns true iff the signature is valid.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/verifier/enum.Error.html b/rust/oasis_core_runtime/consensus/verifier/enum.Error.html new file mode 100644 index 0000000000..792bc28ed1 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/verifier/enum.Error.html @@ -0,0 +1,30 @@ +Error in oasis_core_runtime::consensus::verifier - Rust

Enum oasis_core_runtime::consensus::verifier::Error

source ·
pub enum Error {
+    Builder(Error),
+    VerificationFailed(Error),
+    TrustedStateLoadingFailed,
+    ChainContextTransitionFailed(Error),
+    FreshnessVerificationFailed(Error),
+    TransactionVerificationFailed(Error),
+    StateRoot(Error),
+    Internal,
+}

Variants§

§

Builder(Error)

§

VerificationFailed(Error)

§

TrustedStateLoadingFailed

§

ChainContextTransitionFailed(Error)

§

FreshnessVerificationFailed(Error)

§

TransactionVerificationFailed(Error)

§

StateRoot(Error)

§

Internal

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/verifier/fn.verify_state_freshness.html b/rust/oasis_core_runtime/consensus/verifier/fn.verify_state_freshness.html new file mode 100644 index 0000000000..b3393e2fb0 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/verifier/fn.verify_state_freshness.html @@ -0,0 +1,8 @@ +verify_state_freshness in oasis_core_runtime::consensus::verifier - Rust
pub fn verify_state_freshness(
+    state: &ConsensusState,
+    identity: &Identity,
+    runtime_id: &Namespace,
+    version: &Version,
+    host_node_id: &PublicKey,
+) -> Result<(), Error>
Expand description

Verify consensus layer state freshness based on our internal state.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/verifier/index.html b/rust/oasis_core_runtime/consensus/verifier/index.html new file mode 100644 index 0000000000..b8d9857d66 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/verifier/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::consensus::verifier - Rust

Module oasis_core_runtime::consensus::verifier

source ·
Expand description

Trait for consensus layer verification.

+

Structs§

Enums§

Traits§

  • Verifier is the consensus layer state verifier trait.

Functions§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/verifier/sidebar-items.js b/rust/oasis_core_runtime/consensus/verifier/sidebar-items.js new file mode 100644 index 0000000000..c9756d2eb8 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/verifier/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"fn":["verify_state_freshness"],"struct":["TrustRoot"],"trait":["Verifier"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/verifier/struct.TrustRoot.html b/rust/oasis_core_runtime/consensus/verifier/struct.TrustRoot.html new file mode 100644 index 0000000000..ea23b19748 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/verifier/struct.TrustRoot.html @@ -0,0 +1,40 @@ +TrustRoot in oasis_core_runtime::consensus::verifier - Rust

Struct oasis_core_runtime::consensus::verifier::TrustRoot

source ·
pub struct TrustRoot {
+    pub height: u64,
+    pub hash: String,
+    pub runtime_id: Namespace,
+    pub chain_context: String,
+}
Expand description

Consensus layer trust root.

+

Fields§

§height: u64

Known trusted height.

+
§hash: String

Known hex-encoded trusted consensus layer header hash.

+
§runtime_id: Namespace

Known runtime identifier.

+
§chain_context: String

Known consensus chain context.

+

Trait Implementations§

source§

impl Clone for TrustRoot

source§

fn clone(&self) -> TrustRoot

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TrustRoot

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TrustRoot

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TrustRoot

source§

fn default() -> TrustRoot

Returns the “default value” for a type. Read more
source§

impl Encode for TrustRoot

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TrustRoot

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for TrustRoot

source§

fn eq(&self, other: &TrustRoot) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TrustRoot

source§

impl StructuralPartialEq for TrustRoot

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/consensus/verifier/trait.Verifier.html b/rust/oasis_core_runtime/consensus/verifier/trait.Verifier.html new file mode 100644 index 0000000000..095e927c03 --- /dev/null +++ b/rust/oasis_core_runtime/consensus/verifier/trait.Verifier.html @@ -0,0 +1,165 @@ +Verifier in oasis_core_runtime::consensus::verifier - Rust

Trait oasis_core_runtime::consensus::verifier::Verifier

source ·
pub trait Verifier: Send + Sync {
+    // Required methods
+    fn sync<'life0, 'async_trait>(
+        &'life0 self,
+        height: u64,
+    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn verify<'life0, 'async_trait>(
+        &'life0 self,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn verify_for_query<'life0, 'async_trait>(
+        &'life0 self,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn unverified_state<'life0, 'async_trait>(
+        &'life0 self,
+        consensus_block: LightBlock,
+    ) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn latest_state<'life0, 'async_trait>(
+        &'life0 self,
+    ) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn state_at<'life0, 'async_trait>(
+        &'life0 self,
+        height: u64,
+    ) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn events_at<'life0, 'async_trait>(
+        &'life0 self,
+        height: u64,
+        kind: EventKind,
+    ) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn latest_height<'life0, 'async_trait>(
+        &'life0 self,
+    ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+}
Expand description

Verifier is the consensus layer state verifier trait.

+

Required Methods§

source

fn sync<'life0, 'async_trait>( + &'life0 self, + height: u64, +) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Synchronize the verifier state up to including the passed consensus height.

+
source

fn verify<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, + runtime_header: Header, + epoch: EpochTime, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Verify that the given runtime header is valid at the given consensus layer block and return +the consensus layer state accessor for that block.

+

This also verifies that the state is fresh.

+
source

fn verify_for_query<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, + runtime_header: Header, + epoch: EpochTime, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Verify that the given runtime header is valid at the given consensus layer block and return +the consensus layer state accessor for that block.

+

This is a relaxed version of the verify function that should be used for verifying state +in queries.

+
source

fn unverified_state<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the consensus layer state accessor for the given consensus layer block WITHOUT +performing any verification. This method should only be used for operations that do not +require integrity guarantees.

+
source

fn latest_state<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the latest verified consensus layer state.

+
§Warning
+

The state is not verified to be fresh. Use verify_state_freshness to perform this +verification manually if needed.

+
source

fn state_at<'life0, 'async_trait>( + &'life0 self, + height: u64, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the verified consensus layer state for a given height.

+
§Warning
+

The state is not verified to be fresh. Use verify_state_freshness to perform this +verification manually if needed.

+
source

fn events_at<'life0, 'async_trait>( + &'life0 self, + height: u64, + kind: EventKind, +) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the consensus layer events at the given height.

+
§Warning
+

Event integrity is currently not verified and it thus relies on replicated computation even +when using a TEE-enabled runtime.

+
source

fn latest_height<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Return the latest known consensus layer height.

+

Implementations on Foreign Types§

source§

impl<T: ?Sized + Verifier> Verifier for Arc<T>

source§

fn sync<'life0, 'async_trait>( + &'life0 self, + height: u64, +) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn verify<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, + runtime_header: Header, + epoch: EpochTime, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn verify_for_query<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, + runtime_header: Header, + epoch: EpochTime, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn unverified_state<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn latest_state<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn state_at<'life0, 'async_trait>( + &'life0 self, + height: u64, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn events_at<'life0, 'async_trait>( + &'life0 self, + height: u64, + kind: EventKind, +) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn latest_height<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/dispatcher/index.html b/rust/oasis_core_runtime/dispatcher/index.html new file mode 100644 index 0000000000..c7329050d4 --- /dev/null +++ b/rust/oasis_core_runtime/dispatcher/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::dispatcher - Rust

Module oasis_core_runtime::dispatcher

source ·
Expand description

Runtime call dispatcher.

+

Structs§

Traits§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/dispatcher/sidebar-items.js b/rust/oasis_core_runtime/dispatcher/sidebar-items.js new file mode 100644 index 0000000000..7aaac23ae8 --- /dev/null +++ b/rust/oasis_core_runtime/dispatcher/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Dispatcher","PostInitState","PreInitState"],"trait":["Initializer"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/dispatcher/struct.Dispatcher.html b/rust/oasis_core_runtime/dispatcher/struct.Dispatcher.html new file mode 100644 index 0000000000..9725ccd2f9 --- /dev/null +++ b/rust/oasis_core_runtime/dispatcher/struct.Dispatcher.html @@ -0,0 +1,31 @@ +Dispatcher in oasis_core_runtime::dispatcher - Rust

Struct oasis_core_runtime::dispatcher::Dispatcher

source ·
pub struct Dispatcher { /* private fields */ }
Expand description

Runtime call dispatcher.

+

Implementations§

source§

impl Dispatcher

source

pub fn new( + tokio_runtime: Handle, + initializer: Box<dyn Initializer>, + identity: Arc<Identity>, +) -> Arc<Self>

Create a new runtime call dispatcher.

+
source

pub fn start( + &self, + protocol: Arc<Protocol>, + consensus_verifier: Box<dyn Verifier>, +)

Start the dispatcher.

+
source

pub fn queue_request(&self, id: u64, body: Body) -> AnyResult<()>

Queue a new request to be dispatched.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/dispatcher/struct.PostInitState.html b/rust/oasis_core_runtime/dispatcher/struct.PostInitState.html new file mode 100644 index 0000000000..193f1e6ce1 --- /dev/null +++ b/rust/oasis_core_runtime/dispatcher/struct.PostInitState.html @@ -0,0 +1,25 @@ +PostInitState in oasis_core_runtime::dispatcher - Rust

Struct oasis_core_runtime::dispatcher::PostInitState

source ·
pub struct PostInitState {
+    pub txn_dispatcher: Option<Box<dyn TxnDispatcher>>,
+    pub app: Option<Box<dyn App>>,
+}
Expand description

State returned by the initializer.

+

Fields§

§txn_dispatcher: Option<Box<dyn TxnDispatcher>>

Optional transaction dispatcher that should be used.

+
§app: Option<Box<dyn App>>

Optional ROFL application.

+

Trait Implementations§

source§

impl Default for PostInitState

source§

fn default() -> PostInitState

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/dispatcher/struct.PreInitState.html b/rust/oasis_core_runtime/dispatcher/struct.PreInitState.html new file mode 100644 index 0000000000..9f258a4d50 --- /dev/null +++ b/rust/oasis_core_runtime/dispatcher/struct.PreInitState.html @@ -0,0 +1,31 @@ +PreInitState in oasis_core_runtime::dispatcher - Rust

Struct oasis_core_runtime::dispatcher::PreInitState

source ·
pub struct PreInitState<'a> {
+    pub protocol: &'a Arc<Protocol>,
+    pub identity: &'a Arc<Identity>,
+    pub rpc_demux: &'a mut Demux,
+    pub rpc_dispatcher: &'a mut Dispatcher,
+    pub consensus_verifier: &'a Arc<dyn Verifier>,
+}
Expand description

State available before initialization.

+

Fields§

§protocol: &'a Arc<Protocol>

Protocol instance.

+
§identity: &'a Arc<Identity>

Runtime Attestation Key instance.

+
§rpc_demux: &'a mut Demux

RPC demultiplexer instance.

+
§rpc_dispatcher: &'a mut Dispatcher

RPC dispatcher instance.

+
§consensus_verifier: &'a Arc<dyn Verifier>

Consensus verifier instance.

+

Auto Trait Implementations§

§

impl<'a> Freeze for PreInitState<'a>

§

impl<'a> !RefUnwindSafe for PreInitState<'a>

§

impl<'a> Send for PreInitState<'a>

§

impl<'a> Sync for PreInitState<'a>

§

impl<'a> Unpin for PreInitState<'a>

§

impl<'a> !UnwindSafe for PreInitState<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/dispatcher/trait.Initializer.html b/rust/oasis_core_runtime/dispatcher/trait.Initializer.html new file mode 100644 index 0000000000..bb4ae272ab --- /dev/null +++ b/rust/oasis_core_runtime/dispatcher/trait.Initializer.html @@ -0,0 +1,7 @@ +Initializer in oasis_core_runtime::dispatcher - Rust

Trait oasis_core_runtime::dispatcher::Initializer

source ·
pub trait Initializer: Send + Sync {
+    // Required method
+    fn init(self: Box<Self>, state: PreInitState<'_>) -> PostInitState;
+}
Expand description

Interface for dispatcher initializers.

+

Required Methods§

source

fn init(self: Box<Self>, state: PreInitState<'_>) -> PostInitState

Initializes the dispatcher(s).

+

Implementors§

source§

impl<F> Initializer for F
where + F: FnOnce(PreInitState<'_>) -> PostInitState + Send + Sync,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/client/enum.RpcClientError.html b/rust/oasis_core_runtime/enclave_rpc/client/enum.RpcClientError.html new file mode 100644 index 0000000000..7ea3b585b3 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/client/enum.RpcClientError.html @@ -0,0 +1,32 @@ +RpcClientError in oasis_core_runtime::enclave_rpc::client - Rust
pub enum RpcClientError {
+    CallFailed(String),
+    ExpectedResponseMessage(Message),
+    ExpectedCloseMessage(Message),
+    Transport,
+    UnsupportedRpcKind,
+    Dropped,
+    DecodeError(DecodeError),
+    SessionsError(Error),
+    Unknown(Error),
+}
Expand description

RPC client error.

+

Variants§

§

CallFailed(String)

§

ExpectedResponseMessage(Message)

§

ExpectedCloseMessage(Message)

§

Transport

§

UnsupportedRpcKind

§

Dropped

§

DecodeError(DecodeError)

§

SessionsError(Error)

§

Unknown(Error)

Trait Implementations§

source§

impl Debug for RpcClientError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for RpcClientError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for RpcClientError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<DecodeError> for RpcClientError

source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RpcClientError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RpcClientError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/client/index.html b/rust/oasis_core_runtime/enclave_rpc/client/index.html new file mode 100644 index 0000000000..90b42f6d58 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/client/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::enclave_rpc::client - Rust

Module oasis_core_runtime::enclave_rpc::client

source ·
Expand description

Enclave RPC client.

+

Structs§

  • An EnclaveRPC response that can be used to provide peer feedback.
  • RPC client.

Enums§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/client/sidebar-items.js b/rust/oasis_core_runtime/enclave_rpc/client/sidebar-items.js new file mode 100644 index 0000000000..320fd1d180 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/client/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["RpcClientError"],"struct":["Response","RpcClient"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/client/struct.Response.html b/rust/oasis_core_runtime/enclave_rpc/client/struct.Response.html new file mode 100644 index 0000000000..e3cbb1391e --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/client/struct.Response.html @@ -0,0 +1,31 @@ +Response in oasis_core_runtime::enclave_rpc::client - Rust

Struct oasis_core_runtime::enclave_rpc::client::Response

source ·
pub struct Response<'a, T> { /* private fields */ }
Expand description

An EnclaveRPC response that can be used to provide peer feedback.

+

Implementations§

source§

impl<'a, T> Response<'a, T>

source

pub async fn into_result_with_feedback(self) -> Result<T, RpcClientError>

Report success if result was Ok(_) and failure if result was Err(_), then return the +inner result consuming the response instance.

+
source

pub fn result(&self) -> &Result<T, RpcClientError>

Reference to inner result.

+
source

pub fn into_result(self) -> Result<T, RpcClientError>

Consume the response instance returning the inner result.

+
source

pub async fn success(&mut self)

Report success as peer feedback.

+
source

pub async fn failure(&mut self)

Report failure as peer feedback.

+
source

pub async fn bad_peer(&mut self)

Report bad peer as peer feedback.

+

Auto Trait Implementations§

§

impl<'a, T> Freeze for Response<'a, T>
where + T: Freeze,

§

impl<'a, T> !RefUnwindSafe for Response<'a, T>

§

impl<'a, T> Send for Response<'a, T>
where + T: Send,

§

impl<'a, T> Sync for Response<'a, T>
where + T: Sync,

§

impl<'a, T> Unpin for Response<'a, T>
where + T: Unpin,

§

impl<'a, T> !UnwindSafe for Response<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/client/struct.RpcClient.html b/rust/oasis_core_runtime/enclave_rpc/client/struct.RpcClient.html new file mode 100644 index 0000000000..5044f7f4ed --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/client/struct.RpcClient.html @@ -0,0 +1,47 @@ +RpcClient in oasis_core_runtime::enclave_rpc::client - Rust

Struct oasis_core_runtime::enclave_rpc::client::RpcClient

source ·
pub struct RpcClient { /* private fields */ }
Expand description

RPC client.

+

Implementations§

source§

impl RpcClient

source

pub fn new_runtime( + protocol: Arc<Protocol>, + endpoint: &str, + builder: Builder, + max_sessions: usize, + max_sessions_per_peer: usize, + stale_session_timeout: i64, +) -> Self

Construct an unconnected RPC client with runtime-internal transport.

+
source

pub async fn update_enclaves(&self, enclaves: Option<HashSet<EnclaveIdentity>>)

Update allowed remote enclave identities.

+
source

pub async fn update_quote_policy(&self, policy: QuotePolicy)

Update remote end’s quote policy.

+
source

pub async fn update_runtime_id(&self, id: Option<Namespace>)

Update remote runtime id.

+
source

pub async fn secure_call<C, O>( + &self, + method: &'static str, + args: C, + nodes: Vec<PublicKey>, +) -> Response<'_, O>
where + C: Encode, + O: Decode + Send + 'static,

Call a remote method using an encrypted and authenticated Noise session.

+
source

pub async fn insecure_call<C, O>( + &self, + method: &'static str, + args: C, + nodes: Vec<PublicKey>, +) -> Response<'_, O>
where + C: Encode, + O: Decode + Send + 'static,

Call a remote method over an insecure channel where messages are sent in plain text.

+

Trait Implementations§

source§

impl Drop for RpcClient

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/context/index.html b/rust/oasis_core_runtime/enclave_rpc/context/index.html new file mode 100644 index 0000000000..9896f757c1 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/context/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::enclave_rpc::context - Rust

Module oasis_core_runtime::enclave_rpc::context

source ·
Expand description

RPC call context.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/context/sidebar-items.js b/rust/oasis_core_runtime/enclave_rpc/context/sidebar-items.js new file mode 100644 index 0000000000..d31239d146 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/context/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Context"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/context/struct.Context.html b/rust/oasis_core_runtime/enclave_rpc/context/struct.Context.html new file mode 100644 index 0000000000..fbee92f6d3 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/context/struct.Context.html @@ -0,0 +1,25 @@ +Context in oasis_core_runtime::enclave_rpc::context - Rust

Struct oasis_core_runtime::enclave_rpc::context::Context

source ·
pub struct Context {
+    pub session_info: Option<Arc<SessionInfo>>,
+}
Expand description

RPC call context.

+

Fields§

§session_info: Option<Arc<SessionInfo>>

Information about the session the RPC call was delivered over.

+

Implementations§

source§

impl Context

source

pub fn new(session_info: Option<Arc<SessionInfo>>) -> Self

Construct new transaction context.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/demux/enum.Error.html b/rust/oasis_core_runtime/enclave_rpc/demux/enum.Error.html new file mode 100644 index 0000000000..a9d6a612e1 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/demux/enum.Error.html @@ -0,0 +1,27 @@ +Error in oasis_core_runtime::enclave_rpc::demux - Rust

Enum oasis_core_runtime::enclave_rpc::demux::Error

source ·
pub enum Error {
+    MalformedPayload(DecodeError),
+    MalformedRequestMethod,
+    SessionsError(Error),
+    Other(Error),
+}
Expand description

Demultiplexer error.

+

Variants§

§

MalformedPayload(DecodeError)

§

MalformedRequestMethod

§

SessionsError(Error)

§

Other(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<DecodeError> for Error

source§

fn from(source: DecodeError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/demux/index.html b/rust/oasis_core_runtime/enclave_rpc/demux/index.html new file mode 100644 index 0000000000..e3cc7627c1 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/demux/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::enclave_rpc::demux - Rust

Module oasis_core_runtime::enclave_rpc::demux

source ·
Expand description

Session demultiplexer.

+

Structs§

  • Session demultiplexer.

Enums§

  • Demultiplexer error.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/demux/sidebar-items.js b/rust/oasis_core_runtime/enclave_rpc/demux/sidebar-items.js new file mode 100644 index 0000000000..15bbb93fc2 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/demux/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["Demux"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/demux/struct.Demux.html b/rust/oasis_core_runtime/enclave_rpc/demux/struct.Demux.html new file mode 100644 index 0000000000..f874047625 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/demux/struct.Demux.html @@ -0,0 +1,42 @@ +Demux in oasis_core_runtime::enclave_rpc::demux - Rust

Struct oasis_core_runtime::enclave_rpc::demux::Demux

source ·
pub struct Demux { /* private fields */ }
Expand description

Session demultiplexer.

+

Implementations§

source§

impl Demux

source

pub fn new( + builder: Builder, + max_sessions: usize, + max_sessions_per_peer: usize, + stale_session_timeout: i64, +) -> Self

Create new session demultiplexer.

+
source

pub fn set_session_builder(&self, builder: Builder)

Set the session builder to use.

+
source

pub async fn process_frame<W: Write>( + &self, + peer_id: Vec<u8>, + data: Vec<u8>, + writer: W, +) -> Result<(OwnedMutexGuard<MultiplexedSession<Vec<u8>>>, Option<Message>), Error>

Process a frame, returning the locked session guard and decoded message.

+

Any data that needs to be transmitted back to the peer is written to the passed writer.

+
source

pub fn close<W: Write>( + &self, + session: OwnedMutexGuard<MultiplexedSession<Vec<u8>>>, + writer: W, +) -> Result<(), Error>

Closes the given session.

+

Any data that needs to be transmitted back to the peer is written to the passed writer.

+
source

pub fn reset(&self)

Resets all open sessions.

+

Auto Trait Implementations§

§

impl !Freeze for Demux

§

impl RefUnwindSafe for Demux

§

impl Send for Demux

§

impl Sync for Demux

§

impl Unpin for Demux

§

impl UnwindSafe for Demux

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/index.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/index.html new file mode 100644 index 0000000000..2e771072fa --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::enclave_rpc::dispatcher - Rust

Module oasis_core_runtime::enclave_rpc::dispatcher

source ·
Expand description

RPC dispatcher.

+

Structs§

Traits§

Type Aliases§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/sidebar-items.js b/rust/oasis_core_runtime/enclave_rpc/dispatcher/sidebar-items.js new file mode 100644 index 0000000000..815ad44e1b --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Dispatcher","Method","MethodDescriptor"],"trait":["Handler","MethodHandler","MethodHandlerDispatch"],"type":["KeyManagerQuotePolicyHandler","KeyManagerStatusHandler"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.Dispatcher.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.Dispatcher.html new file mode 100644 index 0000000000..89b24329dd --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.Dispatcher.html @@ -0,0 +1,33 @@ +Dispatcher in oasis_core_runtime::enclave_rpc::dispatcher - Rust
pub struct Dispatcher { /* private fields */ }
Expand description

RPC call dispatcher.

+

Implementations§

source§

impl Dispatcher

source

pub fn add_method(&mut self, method: Method)

Register a new method in the dispatcher.

+
source

pub fn add_methods(&mut self, methods: Vec<Method>)

Register new methods in the dispatcher.

+
source

pub fn dispatch(&self, ctx: Context, request: Request, kind: Kind) -> Response

Dispatch request.

+
source

pub fn handle_km_status_update(&self, status: KeyManagerStatus)

Handle key manager status update.

+
source

pub fn handle_km_quote_policy_update(&self, policy: QuotePolicy)

Handle key manager quote policy update.

+
source

pub fn set_keymanager_status_update_handler( + &mut self, + f: Option<Box<KeyManagerStatusHandler>>, +)

Update key manager status update handler.

+
source

pub fn set_keymanager_quote_policy_update_handler( + &mut self, + f: Option<Box<KeyManagerQuotePolicyHandler>>, +)

Update key manager quote policy update handler.

+

Trait Implementations§

source§

impl Default for Dispatcher

source§

fn default() -> Dispatcher

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.Method.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.Method.html new file mode 100644 index 0000000000..d31e1b57ff --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.Method.html @@ -0,0 +1,24 @@ +Method in oasis_core_runtime::enclave_rpc::dispatcher - Rust

Struct oasis_core_runtime::enclave_rpc::dispatcher::Method

source ·
pub struct Method { /* private fields */ }
Expand description

RPC method dispatcher implementation.

+

Implementations§

source§

impl Method

source

pub fn new<Rq, Rsp, Handler>(method: MethodDescriptor, handler: Handler) -> Self
where + Rq: Decode + 'static, + Rsp: Encode + 'static, + Handler: MethodHandler<Rq, Rsp> + Send + Sync + 'static,

Create a new enclave method descriptor.

+

Auto Trait Implementations§

§

impl Freeze for Method

§

impl !RefUnwindSafe for Method

§

impl Send for Method

§

impl Sync for Method

§

impl Unpin for Method

§

impl !UnwindSafe for Method

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.MethodDescriptor.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.MethodDescriptor.html new file mode 100644 index 0000000000..59fd9913c4 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/struct.MethodDescriptor.html @@ -0,0 +1,28 @@ +MethodDescriptor in oasis_core_runtime::enclave_rpc::dispatcher - Rust
pub struct MethodDescriptor {
+    pub name: String,
+    pub kind: Kind,
+}
Expand description

Descriptor of a RPC API method.

+

Fields§

§name: String

Method name.

+
§kind: Kind

Specifies which kind of RPC is allowed to call the method.

+

Trait Implementations§

source§

impl Clone for MethodDescriptor

source§

fn clone(&self) -> MethodDescriptor

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MethodDescriptor

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.Handler.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.Handler.html new file mode 100644 index 0000000000..2a229be30a --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.Handler.html @@ -0,0 +1,6 @@ +Handler in oasis_core_runtime::enclave_rpc::dispatcher - Rust

Trait oasis_core_runtime::enclave_rpc::dispatcher::Handler

source ·
pub trait Handler {
+    // Required method
+    fn methods(&'static self) -> Vec<Method>;
+}
Expand description

RPC handler.

+

Required Methods§

source

fn methods(&'static self) -> Vec<Method>

Returns the list of RPC methods supported by this handler.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandler.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandler.html new file mode 100644 index 0000000000..7bdd1fcae5 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandler.html @@ -0,0 +1,9 @@ +MethodHandler in oasis_core_runtime::enclave_rpc::dispatcher - Rust
pub trait MethodHandler<Rq, Rsp> {
+    // Required method
+    fn handle(&self, ctx: &Context, request: &Rq) -> Result<Rsp>;
+}
Expand description

Handler for a RPC method.

+

Required Methods§

source

fn handle(&self, ctx: &Context, request: &Rq) -> Result<Rsp>

Invoke the method implementation and return a response.

+

Implementors§

source§

impl<Rq, Rsp, F> MethodHandler<Rq, Rsp> for F
where + Rq: 'static, + Rsp: 'static, + F: Fn(&Context, &Rq) -> Result<Rsp> + 'static,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandlerDispatch.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandlerDispatch.html new file mode 100644 index 0000000000..cd0e3aaf26 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandlerDispatch.html @@ -0,0 +1,8 @@ +MethodHandlerDispatch in oasis_core_runtime::enclave_rpc::dispatcher - Rust
pub trait MethodHandlerDispatch {
+    // Required methods
+    fn get_descriptor(&self) -> &MethodDescriptor;
+    fn dispatch(&self, ctx: &Context, request: Request) -> Result<Response>;
+}
Expand description

Dispatcher for a RPC method.

+

Required Methods§

source

fn get_descriptor(&self) -> &MethodDescriptor

Get method descriptor.

+
source

fn dispatch(&self, ctx: &Context, request: Request) -> Result<Response>

Dispatch request.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/type.KeyManagerQuotePolicyHandler.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/type.KeyManagerQuotePolicyHandler.html new file mode 100644 index 0000000000..1822ae6d62 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/type.KeyManagerQuotePolicyHandler.html @@ -0,0 +1,2 @@ +KeyManagerQuotePolicyHandler in oasis_core_runtime::enclave_rpc::dispatcher - Rust
pub type KeyManagerQuotePolicyHandler = dyn Fn(QuotePolicy) + Send + Sync;
Expand description

Key manager quote policy update handler callback.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/dispatcher/type.KeyManagerStatusHandler.html b/rust/oasis_core_runtime/enclave_rpc/dispatcher/type.KeyManagerStatusHandler.html new file mode 100644 index 0000000000..1ddbff6615 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/dispatcher/type.KeyManagerStatusHandler.html @@ -0,0 +1,2 @@ +KeyManagerStatusHandler in oasis_core_runtime::enclave_rpc::dispatcher - Rust
pub type KeyManagerStatusHandler = dyn Fn(Status) + Send + Sync;
Expand description

Key manager status update handler callback.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/index.html b/rust/oasis_core_runtime/enclave_rpc/index.html new file mode 100644 index 0000000000..8e8466ab1a --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::enclave_rpc - Rust

Module oasis_core_runtime::enclave_rpc

source ·
Expand description

Secure inter-enclave RPC.

+

Re-exports§

Modules§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/session/enum.RAKBinding.html b/rust/oasis_core_runtime/enclave_rpc/session/enum.RAKBinding.html new file mode 100644 index 0000000000..4c9310da2a --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/session/enum.RAKBinding.html @@ -0,0 +1,62 @@ +RAKBinding in oasis_core_runtime::enclave_rpc::session - Rust
pub enum RAKBinding {
+    V0 {
+        rak_pub: PublicKey,
+        binding: Signature,
+        avr: AVR,
+    },
+    V1 {
+        rak_pub: PublicKey,
+        binding: Signature,
+        quote: Quote,
+    },
+    V2 {
+        ect: EndorsedCapabilityTEE,
+        binding: Signature,
+    },
+}
Expand description

Binding of the session’s static public key to a remote attestation +verification report through the use of the remote attestation key.

+

The signature chain is as follows:

+
    +
  • avr contains the remote attestation verification report which +binds RAK to the remote attestation.
  • +
  • rak_pub contains the public part of RAK.
  • +
  • binding is signed by rak_pub and binds the session’s static +public key to RAK.
  • +
+

Variants§

§

V0

Old V0 format that only supported IAS quotes.

+

Fields

§rak_pub: PublicKey
§binding: Signature
§avr: AVR
§

V1

New V1 format that supports both IAS and PCS quotes.

+

Fields

§rak_pub: PublicKey
§binding: Signature
§quote: Quote
§

V2

V2 format which supports endorsed CapabilityTEE structures.

+

Implementations§

source§

impl RAKBinding

source

pub fn rak_pub(&self) -> PublicKey

Public part of the RAK.

+
source

pub fn verify( + &self, + remote_static: &[u8], + remote_enclaves: &Option<HashSet<EnclaveIdentity>>, + policy: &QuotePolicy, +) -> Result<VerifiedEndorsedCapabilityTEE>

Verify the RAK binding.

+

Trait Implementations§

source§

impl Clone for RAKBinding

source§

fn clone(&self) -> RAKBinding

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RAKBinding

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RAKBinding

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for RAKBinding

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RAKBinding

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/session/index.html b/rust/oasis_core_runtime/enclave_rpc/session/index.html new file mode 100644 index 0000000000..7434251a0f --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/session/index.html @@ -0,0 +1,3 @@ +oasis_core_runtime::enclave_rpc::session - Rust

Module oasis_core_runtime::enclave_rpc::session

source ·
Expand description

Secure channel session.

+

Structs§

Enums§

  • Binding of the session’s static public key to a remote attestation +verification report through the use of the remote attestation key.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/session/sidebar-items.js b/rust/oasis_core_runtime/enclave_rpc/session/sidebar-items.js new file mode 100644 index 0000000000..a09912d2e7 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/session/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["RAKBinding"],"struct":["Builder","Session","SessionInfo"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/session/struct.Builder.html b/rust/oasis_core_runtime/enclave_rpc/session/struct.Builder.html new file mode 100644 index 0000000000..14363603c1 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/session/struct.Builder.html @@ -0,0 +1,34 @@ +Builder in oasis_core_runtime::enclave_rpc::session - Rust

Struct oasis_core_runtime::enclave_rpc::session::Builder

source ·
pub struct Builder { /* private fields */ }
Expand description

Session builder.

+

Implementations§

source§

impl Builder

source

pub fn get_remote_enclaves(&self) -> &Option<HashSet<EnclaveIdentity>>

Return remote enclave identities if configured in the builder.

+
source

pub fn remote_enclaves(self, enclaves: Option<HashSet<EnclaveIdentity>>) -> Self

Enable remote enclave identity verification.

+
source

pub fn get_remote_runtime_id(&self) -> &Option<Namespace>

Return remote runtime ID if configured in the builder.

+
source

pub fn remote_runtime_id(self, id: Option<Namespace>) -> Self

Set remote runtime ID for node identity verification.

+
source

pub fn consensus_verifier(self, verifier: Option<Arc<dyn Verifier>>) -> Self

Enable remote node identity verification.

+
source

pub fn get_quote_policy(&self) -> &Option<Arc<QuotePolicy>>

Return quote policy if configured in the builder.

+
source

pub fn quote_policy(self, policy: Option<Arc<QuotePolicy>>) -> Self

Configure quote policy used for remote quote verification.

+
source

pub fn use_endorsement(self, use_endorsement: bool) -> Self

Use endorsement from host node when establishing sessions.

+
source

pub fn get_local_identity(&self) -> &Option<Arc<Identity>>

Return the local identity if configured in the builder.

+
source

pub fn local_identity(self, identity: Arc<Identity>) -> Self

Enable RAK binding.

+
source

pub fn build_initiator(self) -> Session

Build initiator session.

+
source

pub fn build_responder(self) -> Session

Build responder session.

+

Trait Implementations§

source§

impl Clone for Builder

source§

fn clone(&self) -> Builder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Builder

source§

fn default() -> Builder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/session/struct.Session.html b/rust/oasis_core_runtime/enclave_rpc/session/struct.Session.html new file mode 100644 index 0000000000..6f51415604 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/session/struct.Session.html @@ -0,0 +1,43 @@ +Session in oasis_core_runtime::enclave_rpc::session - Rust

Struct oasis_core_runtime::enclave_rpc::session::Session

source ·
pub struct Session { /* private fields */ }
Expand description

An encrypted and authenticated RPC session.

+

Implementations§

source§

impl Session

source

pub async fn process_data<W: Write>( + &mut self, + data: &[u8], + writer: W, +) -> Result<Option<Message>>

Process incoming data.

+

In case the session is in transport mode the returned result will +contained a parsed message. The writer will be used in case any +protocol replies need to be generated.

+
source

pub fn write_message<W: Write>(&mut self, msg: Message, writer: W) -> Result<()>

Write message to session.

+

The writer will be used for protocol message output which should +be transmitted to the remote session counterpart.

+
source

pub fn close(&mut self)

Mark the session as closed.

+

After the session is closed it can no longer be used to transmit +or receive messages and any such use will result in an error.

+
source

pub fn session_info(&self) -> Option<Arc<SessionInfo>>

Session information.

+
source

pub fn is_connected(&self) -> bool

Whether the session handshake has completed and the session +is in transport mode.

+
source

pub fn is_connected_to(&self, nodes: &Vec<PublicKey>) -> bool

Whether the session is connected to one of the given nodes.

+
source

pub fn is_closed(&self) -> bool

Whether the session is in closed state.

+
source

pub fn is_unauthenticated(&self) -> bool

Whether the session is in unauthenticated transport state. In this state the session can +only be used to transmit a close notification.

+
source

pub fn get_remote_node(&self) -> Result<PublicKey>

Return remote node identifier.

+
source

pub fn set_remote_node(&mut self, node: PublicKey) -> Result<()>

Set the remote node identifier.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/session/struct.SessionInfo.html b/rust/oasis_core_runtime/enclave_rpc/session/struct.SessionInfo.html new file mode 100644 index 0000000000..b4a71abb13 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/session/struct.SessionInfo.html @@ -0,0 +1,28 @@ +SessionInfo in oasis_core_runtime::enclave_rpc::session - Rust

Struct oasis_core_runtime::enclave_rpc::session::SessionInfo

source ·
pub struct SessionInfo {
+    pub rak_binding: RAKBinding,
+    pub verified_attestation: VerifiedAttestation,
+    pub endorsed_by: Option<PublicKey>,
+}
Expand description

Information about a session.

+

Fields§

§rak_binding: RAKBinding

RAK binding.

+
§verified_attestation: VerifiedAttestation

Verified TEE remote attestation.

+
§endorsed_by: Option<PublicKey>

Identifier of the node that endorsed the TEE.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sessions/enum.Error.html b/rust/oasis_core_runtime/enclave_rpc/sessions/enum.Error.html new file mode 100644 index 0000000000..411781c4c2 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sessions/enum.Error.html @@ -0,0 +1,24 @@ +Error in oasis_core_runtime::enclave_rpc::sessions - Rust

Enum oasis_core_runtime::enclave_rpc::sessions::Error

source ·
pub enum Error {
+    MaxConcurrentSessions,
+}
Expand description

Sessions error.

+

Variants§

§

MaxConcurrentSessions

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RpcClientError

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sessions/index.html b/rust/oasis_core_runtime/enclave_rpc/sessions/index.html new file mode 100644 index 0000000000..4dffc8c26e --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sessions/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::enclave_rpc::sessions - Rust

Module oasis_core_runtime::enclave_rpc::sessions

source ·
Expand description

Session demultiplexer.

+

Structs§

Enums§

Type Aliases§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sessions/sidebar-items.js b/rust/oasis_core_runtime/enclave_rpc/sessions/sidebar-items.js new file mode 100644 index 0000000000..41e464ab43 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sessions/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["MultiplexedSession","SessionMeta","Sessions"],"type":["SessionByTimeKey","SharedSession"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sessions/struct.MultiplexedSession.html b/rust/oasis_core_runtime/enclave_rpc/sessions/struct.MultiplexedSession.html new file mode 100644 index 0000000000..e5480ba5f5 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sessions/struct.MultiplexedSession.html @@ -0,0 +1,44 @@ +MultiplexedSession in oasis_core_runtime::enclave_rpc::sessions - Rust
pub struct MultiplexedSession<PeerID> { /* private fields */ }
Expand description

A multiplexed session.

+

Implementations§

source§

impl<PeerID> MultiplexedSession<PeerID>

source

pub fn get_peer_id(&self) -> &PeerID

Return the session’s peer ID.

+
source

pub fn set_peer_id(&mut self, peer_id: PeerID)

Set the session’s peer ID.

+
source

pub fn get_session_id(&self) -> &SessionID

Return the session ID.

+
source

pub fn info(&self) -> Option<Arc<SessionInfo>>

Session information.

+
source

pub fn is_closed(&self) -> bool

Whether the session is in closed state.

+
source

pub async fn process_data<W: Write>( + &mut self, + data: &[u8], + writer: W, +) -> Result<Option<Message>>

Process incoming session data.

+
source

pub fn write_message<W: Write>(&mut self, msg: Message, writer: W) -> Result<()>

Write message to session and generate a response.

+
source

pub fn get_remote_node(&self) -> Result<PublicKey>

Return remote node identifier.

+
source

pub fn set_remote_node(&mut self, node: PublicKey) -> Result<()>

Set the remote node identifier.

+
source

pub fn is_connected(&self) -> bool

Whether the session handshake has completed and the session +is in transport mode.

+
source

pub fn is_unauthenticated(&self) -> bool

Whether the session is in unauthenticated transport state. In this state the session can +only be used to transmit a close notification.

+
source

pub fn close(&mut self)

Mark the session as closed.

+

After the session is closed it can no longer be used to transmit +or receive messages and any such use will result in an error.

+

Auto Trait Implementations§

§

impl<PeerID> Freeze for MultiplexedSession<PeerID>
where + PeerID: Freeze,

§

impl<PeerID> !RefUnwindSafe for MultiplexedSession<PeerID>

§

impl<PeerID> Send for MultiplexedSession<PeerID>
where + PeerID: Send,

§

impl<PeerID> Sync for MultiplexedSession<PeerID>
where + PeerID: Sync,

§

impl<PeerID> Unpin for MultiplexedSession<PeerID>
where + PeerID: Unpin,

§

impl<PeerID> !UnwindSafe for MultiplexedSession<PeerID>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sessions/struct.SessionMeta.html b/rust/oasis_core_runtime/enclave_rpc/sessions/struct.SessionMeta.html new file mode 100644 index 0000000000..eadcfdaa14 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sessions/struct.SessionMeta.html @@ -0,0 +1,24 @@ +SessionMeta in oasis_core_runtime::enclave_rpc::sessions - Rust

Struct oasis_core_runtime::enclave_rpc::sessions::SessionMeta

source ·
pub struct SessionMeta<PeerID: Clone + Ord + Hash> { /* private fields */ }
Expand description

Structure used for session accounting.

+

Auto Trait Implementations§

§

impl<PeerID> Freeze for SessionMeta<PeerID>
where + PeerID: Freeze,

§

impl<PeerID> !RefUnwindSafe for SessionMeta<PeerID>

§

impl<PeerID> Send for SessionMeta<PeerID>
where + PeerID: Send,

§

impl<PeerID> Sync for SessionMeta<PeerID>
where + PeerID: Sync + Send,

§

impl<PeerID> Unpin for SessionMeta<PeerID>
where + PeerID: Unpin,

§

impl<PeerID> !UnwindSafe for SessionMeta<PeerID>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sessions/struct.Sessions.html b/rust/oasis_core_runtime/enclave_rpc/sessions/struct.Sessions.html new file mode 100644 index 0000000000..2afe1344bd --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sessions/struct.Sessions.html @@ -0,0 +1,84 @@ +Sessions in oasis_core_runtime::enclave_rpc::sessions - Rust

Struct oasis_core_runtime::enclave_rpc::sessions::Sessions

source ·
pub struct Sessions<PeerID: Clone + Ord + Hash> { /* private fields */ }
Expand description

Session indices and management operations.

+

Implementations§

source§

impl<PeerID> Sessions<PeerID>
where + PeerID: Clone + Ord + Hash,

source

pub fn new( + builder: Builder, + max_sessions: usize, + max_sessions_per_peer: usize, + stale_session_timeout: i64, +) -> Self

Create a new session management instance.

+
source

pub fn set_builder(&mut self, builder: Builder)

Set the session builder to use.

+
source

pub fn update_enclaves( + &mut self, + enclaves: Option<HashSet<EnclaveIdentity>>, +) -> Vec<SharedSession<PeerID>>

Update remote enclave identity verification in the session builder +and clear all sessions if the identity has changed.

+
source

pub fn update_quote_policy( + &mut self, + policy: QuotePolicy, +) -> Vec<SharedSession<PeerID>>

Update quote policy used for remote quote verification in the session builder +and clear all sessions if the policy has changed.

+
source

pub fn update_runtime_id( + &mut self, + id: Option<Namespace>, +) -> Vec<SharedSession<PeerID>>

Update remote runtime ID for node identity verification in the session builder +and clear all sessions if the runtime ID has changed.

+
source

pub fn create_responder( + &mut self, + peer_id: PeerID, + session_id: SessionID, +) -> MultiplexedSession<PeerID>

Create a new multiplexed responder session.

+
source

pub fn create_initiator(&self, peer_id: PeerID) -> MultiplexedSession<PeerID>

Create a new multiplexed initiator session.

+
source

pub fn get( + &mut self, + peer_id: &PeerID, + session_id: &SessionID, +) -> Option<SharedSession<PeerID>>

Fetch an existing session given its identifier.

+
source

pub fn find(&mut self, peer_ids: &[PeerID]) -> Option<SharedSession<PeerID>>

Fetch an existing session from one of the given peers. If no peers +are provided, a session from any peer will be returned.

+
source

pub fn find_any(&mut self) -> Option<SharedSession<PeerID>>

Fetch an existing session from any peer.

+
source

pub fn find_one(&mut self, peer_ids: &[PeerID]) -> Option<SharedSession<PeerID>>

Fetch an existing session from one of the given peers.

+
source

pub fn remove_for( + &mut self, + peer_id: &PeerID, + now: i64, +) -> Result<Option<OwnedMutexGuard<MultiplexedSession<PeerID>>>, Error>

Remove one session to free up a slot for the given peer.

+
source

pub fn remove_from( + &mut self, + peer_id: &PeerID, +) -> Result<Option<OwnedMutexGuard<MultiplexedSession<PeerID>>>, Error>

Remove one existing session from the given peer if the peer has reached +the maximum number of sessions or if the total number of sessions exceeds +the global session limit.

+
source

pub fn remove_one( + &mut self, + now: i64, +) -> Result<Option<OwnedMutexGuard<MultiplexedSession<PeerID>>>, Error>

Remove one stale session if the total number of sessions exceeds +the global session limit.

+
source

pub fn add( + &mut self, + session: MultiplexedSession<PeerID>, + now: i64, +) -> Result<SharedSession<PeerID>, Error>

Add a session if there is an available spot.

+
source

pub fn remove(&mut self, session: &OwnedMutexGuard<MultiplexedSession<PeerID>>)

Remove a session that must be currently owned by the caller.

+
source

pub fn drain(&mut self) -> Vec<SharedSession<PeerID>>

Removes and returns all sessions.

+

Auto Trait Implementations§

§

impl<PeerID> Freeze for Sessions<PeerID>

§

impl<PeerID> !RefUnwindSafe for Sessions<PeerID>

§

impl<PeerID> Send for Sessions<PeerID>
where + PeerID: Send,

§

impl<PeerID> Sync for Sessions<PeerID>
where + PeerID: Sync + Send,

§

impl<PeerID> Unpin for Sessions<PeerID>
where + PeerID: Unpin,

§

impl<PeerID> !UnwindSafe for Sessions<PeerID>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sessions/type.SessionByTimeKey.html b/rust/oasis_core_runtime/enclave_rpc/sessions/type.SessionByTimeKey.html new file mode 100644 index 0000000000..9cbae8d882 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sessions/type.SessionByTimeKey.html @@ -0,0 +1,2 @@ +SessionByTimeKey in oasis_core_runtime::enclave_rpc::sessions - Rust

Type Alias oasis_core_runtime::enclave_rpc::sessions::SessionByTimeKey

source ·
pub type SessionByTimeKey<PeerID> = (i64, PeerID, SessionID);
Expand description

Key for use in the by-idle-time index.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sessions/type.SharedSession.html b/rust/oasis_core_runtime/enclave_rpc/sessions/type.SharedSession.html new file mode 100644 index 0000000000..9d532b163c --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sessions/type.SharedSession.html @@ -0,0 +1,2 @@ +SharedSession in oasis_core_runtime::enclave_rpc::sessions - Rust

Type Alias oasis_core_runtime::enclave_rpc::sessions::SharedSession

source ·
pub type SharedSession<PeerID> = Arc<Mutex<MultiplexedSession<PeerID>>>;
Expand description

Shared pointer to a multiplexed session.

+

Aliased Type§

struct SharedSession<PeerID> { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/sidebar-items.js b/rust/oasis_core_runtime/enclave_rpc/sidebar-items.js new file mode 100644 index 0000000000..52c8ab82b5 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["client","context","demux","dispatcher","session","sessions","types"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/enum.Body.html b/rust/oasis_core_runtime/enclave_rpc/types/enum.Body.html new file mode 100644 index 0000000000..3ef5cf9785 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/enum.Body.html @@ -0,0 +1,30 @@ +Body in oasis_core_runtime::enclave_rpc::types - Rust

Enum oasis_core_runtime::enclave_rpc::types::Body

source ·
pub enum Body {
+    Success(Value),
+    Error(String),
+}

Variants§

§

Success(Value)

§

Error(String)

Trait Implementations§

source§

impl Clone for Body

source§

fn clone(&self) -> Body

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Body

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Body

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Body

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Body

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Body

§

impl RefUnwindSafe for Body

§

impl Send for Body

§

impl Sync for Body

§

impl Unpin for Body

§

impl UnwindSafe for Body

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/enum.Kind.html b/rust/oasis_core_runtime/enclave_rpc/types/enum.Kind.html new file mode 100644 index 0000000000..d619bbace6 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/enum.Kind.html @@ -0,0 +1,39 @@ +Kind in oasis_core_runtime::enclave_rpc::types - Rust

Enum oasis_core_runtime::enclave_rpc::types::Kind

source ·
#[repr(u8)]
pub enum Kind { + NoiseSession = 0, + InsecureQuery = 1, + LocalQuery = 2, +}
Expand description

RPC call kind.

+

Variants§

§

NoiseSession = 0

A secure RPC call using an encrypted and authenticated Noise session.

+
§

InsecureQuery = 1

An insecure RPC call where messages are sent in plain text.

+
§

LocalQuery = 2

A local RPC call.

+

Trait Implementations§

source§

impl Clone for Kind

source§

fn clone(&self) -> Kind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Kind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Kind

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Kind

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for Kind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for Kind

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Kind

source§

fn eq(&self, other: &Kind) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Kind

source§

impl Eq for Kind

source§

impl StructuralPartialEq for Kind

Auto Trait Implementations§

§

impl Freeze for Kind

§

impl RefUnwindSafe for Kind

§

impl Send for Kind

§

impl Sync for Kind

§

impl Unpin for Kind

§

impl UnwindSafe for Kind

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/enum.Message.html b/rust/oasis_core_runtime/enclave_rpc/types/enum.Message.html new file mode 100644 index 0000000000..dfa50e2fbc --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/enum.Message.html @@ -0,0 +1,30 @@ +Message in oasis_core_runtime::enclave_rpc::types - Rust

Enum oasis_core_runtime::enclave_rpc::types::Message

source ·
pub enum Message {
+    Request(Request),
+    Response(Response),
+    Close,
+}
Expand description

Protocol message.

+

Variants§

§

Request(Request)

§

Response(Response)

§

Close

Trait Implementations§

source§

impl Clone for Message

source§

fn clone(&self) -> Message

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Message

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Message

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Message

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/enum.PeerFeedback.html b/rust/oasis_core_runtime/enclave_rpc/types/enum.PeerFeedback.html new file mode 100644 index 0000000000..2c3d06eb7c --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/enum.PeerFeedback.html @@ -0,0 +1,35 @@ +PeerFeedback in oasis_core_runtime::enclave_rpc::types - Rust
pub enum PeerFeedback {
+    Success = 0,
+    Failure = 1,
+    BadPeer = 2,
+}
Expand description

Feedback on the peer that handled the last EnclaveRPC call.

+

Variants§

§

Success = 0

§

Failure = 1

§

BadPeer = 2

Trait Implementations§

source§

impl Clone for PeerFeedback

source§

fn clone(&self) -> PeerFeedback

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PeerFeedback

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PeerFeedback

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PeerFeedback

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for PeerFeedback

source§

fn eq(&self, other: &PeerFeedback) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for PeerFeedback

source§

impl Eq for PeerFeedback

source§

impl StructuralPartialEq for PeerFeedback

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/index.html b/rust/oasis_core_runtime/enclave_rpc/types/index.html new file mode 100644 index 0000000000..e61982aff4 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::enclave_rpc::types - Rust

Module oasis_core_runtime::enclave_rpc::types

source ·
Expand description

RPC protocol types.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/sidebar-items.js b/rust/oasis_core_runtime/enclave_rpc/types/sidebar-items.js new file mode 100644 index 0000000000..3babb2f389 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Body","Kind","Message","PeerFeedback"],"struct":["Error","Frame","Request","Response","SessionID"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/struct.Error.html b/rust/oasis_core_runtime/enclave_rpc/types/struct.Error.html new file mode 100644 index 0000000000..2c0736c145 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/struct.Error.html @@ -0,0 +1,28 @@ +Error in oasis_core_runtime::enclave_rpc::types - Rust

Struct oasis_core_runtime::enclave_rpc::types::Error

source ·
pub struct Error {
+    pub message: String,
+}

Fields§

§message: String

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Error

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Error

source§

fn default() -> Error

Returns the “default value” for a type. Read more
source§

impl Encode for Error

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Error

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/struct.Frame.html b/rust/oasis_core_runtime/enclave_rpc/types/struct.Frame.html new file mode 100644 index 0000000000..6240f7efa5 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/struct.Frame.html @@ -0,0 +1,31 @@ +Frame in oasis_core_runtime::enclave_rpc::types - Rust

Struct oasis_core_runtime::enclave_rpc::types::Frame

source ·
pub struct Frame {
+    pub session: SessionID,
+    pub untrusted_plaintext: String,
+    pub payload: Vec<u8>,
+}
Expand description

Frame.

+

Fields§

§session: SessionID§untrusted_plaintext: String§payload: Vec<u8>

Trait Implementations§

source§

impl Clone for Frame

source§

fn clone(&self) -> Frame

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Frame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Frame

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Frame

source§

fn default() -> Frame

Returns the “default value” for a type. Read more
source§

impl Encode for Frame

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Frame

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Frame

§

impl RefUnwindSafe for Frame

§

impl Send for Frame

§

impl Sync for Frame

§

impl Unpin for Frame

§

impl UnwindSafe for Frame

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/struct.Request.html b/rust/oasis_core_runtime/enclave_rpc/types/struct.Request.html new file mode 100644 index 0000000000..aae907795b --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/struct.Request.html @@ -0,0 +1,30 @@ +Request in oasis_core_runtime::enclave_rpc::types - Rust

Struct oasis_core_runtime::enclave_rpc::types::Request

source ·
pub struct Request {
+    pub method: String,
+    pub args: Value,
+}

Fields§

§method: String§args: Value

Trait Implementations§

source§

impl Clone for Request

source§

fn clone(&self) -> Request

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Request

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Request

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Request

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Request

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/struct.Response.html b/rust/oasis_core_runtime/enclave_rpc/types/struct.Response.html new file mode 100644 index 0000000000..69a183f9a6 --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/struct.Response.html @@ -0,0 +1,29 @@ +Response in oasis_core_runtime::enclave_rpc::types - Rust

Struct oasis_core_runtime::enclave_rpc::types::Response

source ·
pub struct Response {
+    pub body: Body,
+}

Fields§

§body: Body

Trait Implementations§

source§

impl Clone for Response

source§

fn clone(&self) -> Response

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Response

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Response

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Response

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Response

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enclave_rpc/types/struct.SessionID.html b/rust/oasis_core_runtime/enclave_rpc/types/struct.SessionID.html new file mode 100644 index 0000000000..dc74c931de --- /dev/null +++ b/rust/oasis_core_runtime/enclave_rpc/types/struct.SessionID.html @@ -0,0 +1,49 @@ +SessionID in oasis_core_runtime::enclave_rpc::types - Rust

Struct oasis_core_runtime::enclave_rpc::types::SessionID

source ·
pub struct SessionID(pub [u8; 32]);
Expand description

Session identifier for multiplexing multiple sessions over the same transport

+

Tuple Fields§

§0: [u8; 32]

Implementations§

source§

impl SessionID

source

pub const fn len() -> usize

Size of this object in bytes.

+
source§

impl SessionID

source

pub fn random() -> Self

Generate a random session identifier.

+

Trait Implementations§

source§

impl AsRef<[u8]> for SessionID

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for SessionID

source§

fn clone(&self) -> SessionID

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SessionID

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SessionID

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for SessionID

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for SessionID

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for SessionID

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&[u8]> for SessionID

source§

fn from(b: &[u8]) -> SessionID

Converts to this type from the input type.
source§

impl From<&'static str> for SessionID

source§

fn from(s: &'static str) -> SessionID

Converts to this type from the input type.
source§

impl From<SessionID> for [u8; 32]

source§

fn from(b: SessionID) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for SessionID

source§

fn from(v: Vec<u8>) -> SessionID

Converts to this type from the input type.
source§

impl FromStr for SessionID

§

type Err = FromHexError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<SessionID, FromHexError>

Parses a string s to return a value of this type. Read more
source§

impl Hash for SessionID

source§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for SessionID

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for SessionID

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for SessionID

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for SessionID

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Zeroize for SessionID

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
source§

impl Copy for SessionID

source§

impl Eq for SessionID

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/enum.TeeType.html b/rust/oasis_core_runtime/enum.TeeType.html new file mode 100644 index 0000000000..2143930bc1 --- /dev/null +++ b/rust/oasis_core_runtime/enum.TeeType.html @@ -0,0 +1,29 @@ +TeeType in oasis_core_runtime - Rust

Enum oasis_core_runtime::TeeType

source ·
pub enum TeeType {
+    None,
+    Sgx,
+    Tdx,
+}
Expand description

TEE type this build is for.

+

Variants§

§

None

§

Sgx

§

Tdx

Trait Implementations§

source§

impl Debug for TeeType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TeeType

source§

fn default() -> TeeType

Returns the “default value” for a type. Read more
source§

impl PartialEq for TeeType

source§

fn eq(&self, other: &TeeType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TeeType

source§

impl StructuralPartialEq for TeeType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/future/fn.block_on.html b/rust/oasis_core_runtime/future/fn.block_on.html new file mode 100644 index 0000000000..0707c75c21 --- /dev/null +++ b/rust/oasis_core_runtime/future/fn.block_on.html @@ -0,0 +1,2 @@ +block_on in oasis_core_runtime::future - Rust

Function oasis_core_runtime::future::block_on

source ·
pub fn block_on<F: Future>(future: F) -> F::Output
Expand description

Runs a future to completion on the current Tokio handle’s associated Runtime.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/future/fn.new_tokio_runtime.html b/rust/oasis_core_runtime/future/fn.new_tokio_runtime.html new file mode 100644 index 0000000000..33678df911 --- /dev/null +++ b/rust/oasis_core_runtime/future/fn.new_tokio_runtime.html @@ -0,0 +1,2 @@ +new_tokio_runtime in oasis_core_runtime::future - Rust

Function oasis_core_runtime::future::new_tokio_runtime

source ·
pub fn new_tokio_runtime() -> Runtime
Expand description

Create a new asynchronous Tokio runtime.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/future/index.html b/rust/oasis_core_runtime/future/index.html new file mode 100644 index 0000000000..b746145437 --- /dev/null +++ b/rust/oasis_core_runtime/future/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::future - Rust

Module oasis_core_runtime::future

source ·
Expand description

Helper functions to use with the asynchronous Tokio runtime.

+

Functions§

  • Runs a future to completion on the current Tokio handle’s associated Runtime.
  • Create a new asynchronous Tokio runtime.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/future/sidebar-items.js b/rust/oasis_core_runtime/future/sidebar-items.js new file mode 100644 index 0000000000..00505d5ebb --- /dev/null +++ b/rust/oasis_core_runtime/future/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["block_on","new_tokio_runtime"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/host/enum.Error.html b/rust/oasis_core_runtime/host/enum.Error.html new file mode 100644 index 0000000000..785a6bb515 --- /dev/null +++ b/rust/oasis_core_runtime/host/enum.Error.html @@ -0,0 +1,25 @@ +Error in oasis_core_runtime::host - Rust

Enum oasis_core_runtime::host::Error

source ·
pub enum Error {
+    BadResponse,
+    Other(Error),
+}
Expand description

Errors.

+

Variants§

§

BadResponse

§

Other(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/host/index.html b/rust/oasis_core_runtime/host/index.html new file mode 100644 index 0000000000..7f0a25e34f --- /dev/null +++ b/rust/oasis_core_runtime/host/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::host - Rust

Module oasis_core_runtime::host

source ·
Expand description

Host interface.

+

Structs§

Enums§

Traits§

  • Interface to the (untrusted) host node.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/host/sidebar-items.js b/rust/oasis_core_runtime/host/sidebar-items.js new file mode 100644 index 0000000000..5898752996 --- /dev/null +++ b/rust/oasis_core_runtime/host/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["RegisterNotifyOpts","SubmitTxOpts","TxResult"],"trait":["Host"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/host/struct.RegisterNotifyOpts.html b/rust/oasis_core_runtime/host/struct.RegisterNotifyOpts.html new file mode 100644 index 0000000000..7814f77173 --- /dev/null +++ b/rust/oasis_core_runtime/host/struct.RegisterNotifyOpts.html @@ -0,0 +1,28 @@ +RegisterNotifyOpts in oasis_core_runtime::host - Rust

Struct oasis_core_runtime::host::RegisterNotifyOpts

source ·
pub struct RegisterNotifyOpts {
+    pub runtime_block: bool,
+    pub runtime_event: Vec<Vec<u8>>,
+}
Expand description

Notification registration options.

+

Fields§

§runtime_block: bool

Subscribe to runtime block notifications.

+
§runtime_event: Vec<Vec<u8>>

Subscribe to runtime event notifications.

+

Trait Implementations§

source§

impl Clone for RegisterNotifyOpts

source§

fn clone(&self) -> RegisterNotifyOpts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RegisterNotifyOpts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for RegisterNotifyOpts

source§

fn default() -> RegisterNotifyOpts

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/host/struct.SubmitTxOpts.html b/rust/oasis_core_runtime/host/struct.SubmitTxOpts.html new file mode 100644 index 0000000000..894cf914b2 --- /dev/null +++ b/rust/oasis_core_runtime/host/struct.SubmitTxOpts.html @@ -0,0 +1,30 @@ +SubmitTxOpts in oasis_core_runtime::host - Rust

Struct oasis_core_runtime::host::SubmitTxOpts

source ·
pub struct SubmitTxOpts {
+    pub runtime_id: Option<Namespace>,
+    pub wait: bool,
+    pub prove: bool,
+}
Expand description

Transaction submission options.

+

Fields§

§runtime_id: Option<Namespace>

Target runtime identifier. If not specified, own runtime identifier is used.

+
§wait: bool

Whether the call should wait until the transaction is included in a block.

+
§prove: bool

Whether the response should include a proof of transaction being included in a block.

+

Trait Implementations§

source§

impl Clone for SubmitTxOpts

source§

fn clone(&self) -> SubmitTxOpts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SubmitTxOpts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SubmitTxOpts

source§

fn default() -> SubmitTxOpts

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/host/struct.TxResult.html b/rust/oasis_core_runtime/host/struct.TxResult.html new file mode 100644 index 0000000000..145e09a52f --- /dev/null +++ b/rust/oasis_core_runtime/host/struct.TxResult.html @@ -0,0 +1,32 @@ +TxResult in oasis_core_runtime::host - Rust

Struct oasis_core_runtime::host::TxResult

source ·
pub struct TxResult {
+    pub output: Vec<u8>,
+    pub round: u64,
+    pub batch_order: u32,
+    pub proof: Option<Proof>,
+}
Expand description

Transaction submission result.

+

Fields§

§output: Vec<u8>

Transaction output.

+
§round: u64

Round in which the transaction was executed.

+
§batch_order: u32

Order of the transaction in the execution batch.

+
§proof: Option<Proof>

Optional inclusion proof.

+

Trait Implementations§

source§

impl Clone for TxResult

source§

fn clone(&self) -> TxResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TxResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TxResult

source§

fn default() -> TxResult

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/host/trait.Host.html b/rust/oasis_core_runtime/host/trait.Host.html new file mode 100644 index 0000000000..802d314563 --- /dev/null +++ b/rust/oasis_core_runtime/host/trait.Host.html @@ -0,0 +1,40 @@ +Host in oasis_core_runtime::host - Rust

Trait oasis_core_runtime::host::Host

source ·
pub trait Host: Send + Sync {
+    // Required methods
+    fn identity<'life0, 'async_trait>(
+        &'life0 self,
+    ) -> Pin<Box<dyn Future<Output = Result<PublicKey, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn submit_tx<'life0, 'async_trait>(
+        &'life0 self,
+        data: Vec<u8>,
+        opts: SubmitTxOpts,
+    ) -> Pin<Box<dyn Future<Output = Result<Option<TxResult>, Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn register_notify<'life0, 'async_trait>(
+        &'life0 self,
+        opts: RegisterNotifyOpts,
+    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+}
Expand description

Interface to the (untrusted) host node.

+

Required Methods§

source

fn identity<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<PublicKey, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Returns the identity of the host node.

+
source

fn submit_tx<'life0, 'async_trait>( + &'life0 self, + data: Vec<u8>, + opts: SubmitTxOpts, +) -> Pin<Box<dyn Future<Output = Result<Option<TxResult>, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Submit a transaction.

+
source

fn register_notify<'life0, 'async_trait>( + &'life0 self, + opts: RegisterNotifyOpts, +) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Register for receiving notifications.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/identity/index.html b/rust/oasis_core_runtime/identity/index.html new file mode 100644 index 0000000000..a29a9d7f86 --- /dev/null +++ b/rust/oasis_core_runtime/identity/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::identity - Rust

Module oasis_core_runtime::identity

source ·
Expand description

Runtime attestation key handling.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/identity/sidebar-items.js b/rust/oasis_core_runtime/identity/sidebar-items.js new file mode 100644 index 0000000000..2a4c312ac0 --- /dev/null +++ b/rust/oasis_core_runtime/identity/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Identity"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/identity/struct.Identity.html b/rust/oasis_core_runtime/identity/struct.Identity.html new file mode 100644 index 0000000000..045eea8809 --- /dev/null +++ b/rust/oasis_core_runtime/identity/struct.Identity.html @@ -0,0 +1,52 @@ +Identity in oasis_core_runtime::identity - Rust

Struct oasis_core_runtime::identity::Identity

source ·
pub struct Identity { /* private fields */ }
Expand description

Runtime identity.

+

The identity can be used to sign remote attestations with runtime +attestation key (RAK) or to decrypt ciphertexts sent to the enclave +with runtime encryption key (REK). RAK avoids round trips to IAS/PCS +for each verification as the verifier can instead verify the RAK signature +and the signature on the provided quote which binds RAK to the enclave. +REK allows enclaves to publish encrypted data on-chain to an enclave +instance.

+

Implementations§

source§

impl Identity

source

pub fn new() -> Self

Create an uninitialized runtime identity.

+
source

pub fn endorsed_capability_tee(&self) -> Option<EndorsedCapabilityTEE>

Endorsed TEE capability.

+
source

pub fn node_identity(&self) -> Option<PublicKey>

Host node identity public key.

+
source

pub fn public_rak(&self) -> PublicKey

Public part of RAK.

+

This method will return an insecure test key in the case where +the enclave is not running on SGX hardware.

+
source

pub fn public_rek(&self) -> PublicKey

Public part of REK.

+

This method will return an insecure test key in the case where +the enclave is not running on SGX hardware.

+
source

pub fn quote(&self) -> Option<Arc<Quote>>

Quote for RAK.

+

This method may return None in case quote has not yet been set from +the outside, or if the quote has expired.

+
source

pub fn quote_policy(&self) -> Option<Arc<QuotePolicy>>

Runtime quote policy.

+

This method may return None in the case where the enclave is not +running on SGX hardware or if the quote policy has not yet been +fetched from the consensus layer.

+
source

pub fn verify_binding(quote: &VerifiedQuote, rak: &PublicKey) -> Result<()>

Verify a provided RAK binding.

+
source

pub fn rak_matches(&self, rak: &PublicKey, quote: &Quote) -> bool

Checks whether the RAK matches another specified (RAK_pub, quote) pair.

+

Trait Implementations§

source§

impl Default for Identity

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Opener for Identity

source§

fn box_open( + &self, + nonce: &[u8; 15], + ciphertext: Vec<u8>, + additional_data: Vec<u8>, + peers_public_key: &PublicKey, +) -> Result<Vec<u8>>

Unboxes (“opens”) the provided additional data and ciphertext.
source§

impl Signer for Identity

source§

fn public(&self) -> PublicKey

Returns the public key corresponding to the signer.
source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature>

Generates a signature over the context and message.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/index.html b/rust/oasis_core_runtime/index.html new file mode 100644 index 0000000000..956f7e3c27 --- /dev/null +++ b/rust/oasis_core_runtime/index.html @@ -0,0 +1,9 @@ +oasis_core_runtime - Rust

Crate oasis_core_runtime

source ·
Expand description

Oasis Core runtime SDK.

+

§Examples

+

To create a minimal runtime that doesn’t expose any APIs to the +outside world, you need to call the start_runtime function:

+ +
oasis_core_runtime::start_runtime(Some(Box::new(reg)), config);
+

This will start the required services needed to communicate with +the worker host.

+

Re-exports§

  • pub use self::enclave_rpc::demux::Demux as RpcDemux;
  • pub use self::enclave_rpc::dispatcher::Dispatcher as RpcDispatcher;
  • pub use self::init::start_runtime;
  • pub use self::protocol::Protocol;
  • pub use self::transaction::dispatcher::Dispatcher as TxnDispatcher;
  • pub use cbor;

Modules§

  • Runtime apps.
  • In-memory cache of trees.
  • Common types.
  • Runtime configuration.
  • Consensus service interfaces.
  • Runtime call dispatcher.
  • Secure inter-enclave RPC.
  • Helper functions to use with the asynchronous Tokio runtime.
  • Host interface.
  • Runtime attestation key handling.
  • Runtime initialization.
  • Consensus SGX and quote policy handling.
  • Runtime side of the worker-host protocol.
  • Runtime storage interfaces and implementations.
  • Runtime transaction processing.
  • Types used by the worker-host protocol.

Macros§

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/init/fn.start_runtime.html b/rust/oasis_core_runtime/init/fn.start_runtime.html new file mode 100644 index 0000000000..e90c28a990 --- /dev/null +++ b/rust/oasis_core_runtime/init/fn.start_runtime.html @@ -0,0 +1,2 @@ +start_runtime in oasis_core_runtime::init - Rust

Function oasis_core_runtime::init::start_runtime

source ·
pub fn start_runtime(initializer: Box<dyn Initializer>, config: Config)
Expand description

Starts the runtime.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/init/index.html b/rust/oasis_core_runtime/init/index.html new file mode 100644 index 0000000000..a61cbeab32 --- /dev/null +++ b/rust/oasis_core_runtime/init/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::init - Rust

Module oasis_core_runtime::init

source ·
Expand description

Runtime initialization.

+

Functions§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/init/sidebar-items.js b/rust/oasis_core_runtime/init/sidebar-items.js new file mode 100644 index 0000000000..0b73ee6595 --- /dev/null +++ b/rust/oasis_core_runtime/init/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["start_runtime"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.classify_noderef!.html b/rust/oasis_core_runtime/macro.classify_noderef!.html new file mode 100644 index 0000000000..854a977fde --- /dev/null +++ b/rust/oasis_core_runtime/macro.classify_noderef!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.classify_noderef.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.classify_noderef.html b/rust/oasis_core_runtime/macro.classify_noderef.html new file mode 100644 index 0000000000..f6b6e92e35 --- /dev/null +++ b/rust/oasis_core_runtime/macro.classify_noderef.html @@ -0,0 +1,4 @@ +classify_noderef in oasis_core_runtime - Rust

Macro oasis_core_runtime::classify_noderef

source ·
macro_rules! classify_noderef {
+    (? $e:expr) => { ... };
+    ($e:expr) => { ... };
+}
\ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.impl_bytes!.html b/rust/oasis_core_runtime/macro.impl_bytes!.html new file mode 100644 index 0000000000..783af7edc2 --- /dev/null +++ b/rust/oasis_core_runtime/macro.impl_bytes!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.impl_bytes.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.impl_bytes.html b/rust/oasis_core_runtime/macro.impl_bytes.html new file mode 100644 index 0000000000..415f1b487b --- /dev/null +++ b/rust/oasis_core_runtime/macro.impl_bytes.html @@ -0,0 +1,6 @@ +impl_bytes in oasis_core_runtime - Rust

Macro oasis_core_runtime::impl_bytes

source ·
macro_rules! impl_bytes {
+    ($name:ident, $size:expr, $doc:expr) => { ... };
+}
Expand description

Define a byte array-like type.

+

§Examples

+
impl_bytes!(MyType, 32, "A 32-byte type.");
+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.key_format!.html b/rust/oasis_core_runtime/macro.key_format!.html new file mode 100644 index 0000000000..e5da6242bb --- /dev/null +++ b/rust/oasis_core_runtime/macro.key_format!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.key_format.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.key_format.html b/rust/oasis_core_runtime/macro.key_format.html new file mode 100644 index 0000000000..055ec492fa --- /dev/null +++ b/rust/oasis_core_runtime/macro.key_format.html @@ -0,0 +1,6 @@ +key_format in oasis_core_runtime - Rust

Macro oasis_core_runtime::key_format

source ·
macro_rules! key_format {
+    ($name:ident, $prefix:expr, $inner:ty) => { ... };
+}
Expand description

Define a KeyFormat from KeyFormatAtom and a prefix.

+

§Examples

+
key_format!(NewKeyFormatName, 0x01, InnerType);
+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.noderef_as!.html b/rust/oasis_core_runtime/macro.noderef_as!.html new file mode 100644 index 0000000000..81c9ce07e7 --- /dev/null +++ b/rust/oasis_core_runtime/macro.noderef_as!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.noderef_as.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.noderef_as.html b/rust/oasis_core_runtime/macro.noderef_as.html new file mode 100644 index 0000000000..2354f86f2d --- /dev/null +++ b/rust/oasis_core_runtime/macro.noderef_as.html @@ -0,0 +1,3 @@ +noderef_as in oasis_core_runtime - Rust

Macro oasis_core_runtime::noderef_as

source ·
macro_rules! noderef_as {
+    ($ref:expr, $type:ident) => { ... };
+}
\ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.noderef_as_mut!.html b/rust/oasis_core_runtime/macro.noderef_as_mut!.html new file mode 100644 index 0000000000..11293fc3d7 --- /dev/null +++ b/rust/oasis_core_runtime/macro.noderef_as_mut!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.noderef_as_mut.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.noderef_as_mut.html b/rust/oasis_core_runtime/macro.noderef_as_mut.html new file mode 100644 index 0000000000..faf9eaa277 --- /dev/null +++ b/rust/oasis_core_runtime/macro.noderef_as_mut.html @@ -0,0 +1,3 @@ +noderef_as_mut in oasis_core_runtime - Rust

Macro oasis_core_runtime::noderef_as_mut

source ·
macro_rules! noderef_as_mut {
+    ($ref:expr, $type:ident) => { ... };
+}
\ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.version_from_cargo!.html b/rust/oasis_core_runtime/macro.version_from_cargo!.html new file mode 100644 index 0000000000..c5e9f7f133 --- /dev/null +++ b/rust/oasis_core_runtime/macro.version_from_cargo!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.version_from_cargo.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/macro.version_from_cargo.html b/rust/oasis_core_runtime/macro.version_from_cargo.html new file mode 100644 index 0000000000..5cab8e3a1d --- /dev/null +++ b/rust/oasis_core_runtime/macro.version_from_cargo.html @@ -0,0 +1,3 @@ +version_from_cargo in oasis_core_runtime - Rust

Macro oasis_core_runtime::version_from_cargo

source ·
macro_rules! version_from_cargo {
+    () => { ... };
+}
\ No newline at end of file diff --git a/rust/oasis_core_runtime/policy/enum.PolicyVerifierError.html b/rust/oasis_core_runtime/policy/enum.PolicyVerifierError.html new file mode 100644 index 0000000000..f0687ba200 --- /dev/null +++ b/rust/oasis_core_runtime/policy/enum.PolicyVerifierError.html @@ -0,0 +1,32 @@ +PolicyVerifierError in oasis_core_runtime::policy - Rust
pub enum PolicyVerifierError {
+    MissingRuntimeDescriptor,
+    NoDeployment,
+    BadTEEConstraints,
+    PolicyMismatch,
+    PolicyNotPublished,
+    StatusMismatch,
+    StatusNotPublished,
+    HardwareMismatch,
+    NoKeyManager,
+}
Expand description

Policy verifier error.

+

Variants§

§

MissingRuntimeDescriptor

§

NoDeployment

§

BadTEEConstraints

§

PolicyMismatch

§

PolicyNotPublished

§

StatusMismatch

§

StatusNotPublished

§

HardwareMismatch

§

NoKeyManager

Trait Implementations§

source§

impl Debug for PolicyVerifierError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for PolicyVerifierError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for PolicyVerifierError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/policy/index.html b/rust/oasis_core_runtime/policy/index.html new file mode 100644 index 0000000000..b34f06e23b --- /dev/null +++ b/rust/oasis_core_runtime/policy/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::policy - Rust

Module oasis_core_runtime::policy

source ·
Expand description

Consensus SGX and quote policy handling.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/policy/sidebar-items.js b/rust/oasis_core_runtime/policy/sidebar-items.js new file mode 100644 index 0000000000..a9817121e8 --- /dev/null +++ b/rust/oasis_core_runtime/policy/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["PolicyVerifierError"],"struct":["PolicyVerifier"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/policy/struct.PolicyVerifier.html b/rust/oasis_core_runtime/policy/struct.PolicyVerifier.html new file mode 100644 index 0000000000..50be7c13e1 --- /dev/null +++ b/rust/oasis_core_runtime/policy/struct.PolicyVerifier.html @@ -0,0 +1,49 @@ +PolicyVerifier in oasis_core_runtime::policy - Rust

Struct oasis_core_runtime::policy::PolicyVerifier

source ·
pub struct PolicyVerifier { /* private fields */ }
Expand description

Consensus policy verifier.

+

Implementations§

source§

impl PolicyVerifier

source

pub fn new(consensus_verifier: Arc<dyn Verifier>) -> Self

Create a new consensus policy verifier.

+
source

pub fn quote_policy( + &self, + runtime_id: &Namespace, + version: Option<Version>, +) -> Result<QuotePolicy>

Fetch runtime’s quote policy from the latest verified consensus layer state.

+

If the runtime version is not provided, the policy for the active deployment is returned.

+
source

pub fn verify_quote_policy( + &self, + policy: QuotePolicy, + runtime_id: &Namespace, + version: Option<Version>, +) -> Result<QuotePolicy>

Verify that runtime’s quote policy has been published in the consensus layer.

+
source

pub fn key_manager_status(&self, key_manager: Namespace) -> Result<Status>

Fetch key manager’s status from the latest verified consensus layer state.

+
source

pub fn verify_key_manager_status( + &self, + status: Status, + key_manager: Namespace, +) -> Result<Status>

Verify that key manager’s status has been published in the consensus layer.

+
source

pub fn key_manager_policy( + &self, + key_manager: Namespace, +) -> Result<SignedPolicySGX>

Fetch key manager’s policy from the latest verified consensus layer state.

+
source

pub fn verify_key_manager_policy( + &self, + policy: SignedPolicySGX, + key_manager: Namespace, +) -> Result<SignedPolicySGX>

Verify that key manager’s policy has been published in the consensus layer.

+
source

pub fn key_manager(&self, runtime_id: &Namespace) -> Result<Namespace>

Fetch runtime’s key manager.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/protocol/enum.ProtocolError.html b/rust/oasis_core_runtime/protocol/enum.ProtocolError.html new file mode 100644 index 0000000000..5264ffdc31 --- /dev/null +++ b/rust/oasis_core_runtime/protocol/enum.ProtocolError.html @@ -0,0 +1,31 @@ +ProtocolError in oasis_core_runtime::protocol - Rust

Enum oasis_core_runtime::protocol::ProtocolError

source ·
pub enum ProtocolError {
+    MessageTooLarge,
+    MethodNotSupported,
+    InvalidResponse,
+    AttestationRequired,
+    HostInfoNotConfigured,
+    IncompatibleConsensusBackend,
+    InvalidRuntimeId(Namespace, Namespace),
+    AlreadyInitialized,
+    ChannelClosed,
+}

Variants§

§

MessageTooLarge

§

MethodNotSupported

§

InvalidResponse

§

AttestationRequired

§

HostInfoNotConfigured

§

IncompatibleConsensusBackend

§

InvalidRuntimeId(Namespace, Namespace)

§

AlreadyInitialized

§

ChannelClosed

Trait Implementations§

source§

impl Debug for ProtocolError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ProtocolError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ProtocolError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ProtocolError> for Error

source§

fn from(err: ProtocolError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/protocol/enum.Stream.html b/rust/oasis_core_runtime/protocol/enum.Stream.html new file mode 100644 index 0000000000..115164e8ce --- /dev/null +++ b/rust/oasis_core_runtime/protocol/enum.Stream.html @@ -0,0 +1,35 @@ +Stream in oasis_core_runtime::protocol - Rust

Enum oasis_core_runtime::protocol::Stream

source ·
pub enum Stream {
+    Unix(UnixStream),
+    Tcp(TcpStream),
+}
Expand description

Stream used to communicate with the host.

+

Variants§

Trait Implementations§

source§

impl Read for &Stream

source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Pull some bytes from this source into the specified buffer, returning +how many bytes were read. Read more
1.36.0 · source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored +implementation. Read more
1.0.0 · source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Read all bytes until EOF in this source, placing them into buf. Read more
1.0.0 · source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Read all bytes until EOF in this source, appending them to buf. Read more
1.6.0 · source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Read the exact number of bytes required to fill buf. Read more
source§

fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Read the exact number of bytes required to fill cursor. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · source§

fn bytes(self) -> Bytes<Self>
where + Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · source§

fn chain<R>(self, next: R) -> Chain<Self, R>
where + R: Read, + Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · source§

fn take(self, limit: u64) -> Take<Self>
where + Self: Sized,

Creates an adapter which will read at most limit bytes from it. Read more
source§

impl Write for &Stream

source§

fn write(&mut self, buf: &[u8]) -> Result<usize>

Write a buffer into this writer, returning how many bytes were written. Read more
source§

fn flush(&mut self) -> Result<()>

Flush this output stream, ensuring that all intermediately buffered +contents reach their destination. Read more
1.36.0 · source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored +implementation. Read more
1.0.0 · source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error +encountered. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more

Auto Trait Implementations§

§

impl Freeze for Stream

§

impl RefUnwindSafe for Stream

§

impl Send for Stream

§

impl Sync for Stream

§

impl Unpin for Stream

§

impl UnwindSafe for Stream

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/protocol/index.html b/rust/oasis_core_runtime/protocol/index.html new file mode 100644 index 0000000000..2d8fb35423 --- /dev/null +++ b/rust/oasis_core_runtime/protocol/index.html @@ -0,0 +1,3 @@ +oasis_core_runtime::protocol - Rust

Module oasis_core_runtime::protocol

source ·
Expand description

Runtime side of the worker-host protocol.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/protocol/sidebar-items.js b/rust/oasis_core_runtime/protocol/sidebar-items.js new file mode 100644 index 0000000000..a3a448a1ae --- /dev/null +++ b/rust/oasis_core_runtime/protocol/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ProtocolError","Stream"],"struct":["HostInfo","Protocol","ProtocolUntrustedLocalStorage"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/protocol/struct.HostInfo.html b/rust/oasis_core_runtime/protocol/struct.HostInfo.html new file mode 100644 index 0000000000..035cdff6bb --- /dev/null +++ b/rust/oasis_core_runtime/protocol/struct.HostInfo.html @@ -0,0 +1,36 @@ +HostInfo in oasis_core_runtime::protocol - Rust

Struct oasis_core_runtime::protocol::HostInfo

source ·
pub struct HostInfo {
+    pub runtime_id: Namespace,
+    pub consensus_backend: String,
+    pub consensus_protocol_version: Version,
+    pub consensus_chain_context: String,
+    pub local_config: BTreeMap<String, Value>,
+}
Expand description

Information about the host environment.

+

Fields§

§runtime_id: Namespace

Assigned runtime identifier of the loaded runtime.

+
§consensus_backend: String

Name of the consensus backend that is in use for the consensus layer.

+
§consensus_protocol_version: Version

Consensus protocol version that is in use for the consensus layer.

+
§consensus_chain_context: String

Consensus layer chain domain separation context.

+
§local_config: BTreeMap<String, Value>

Node-local runtime configuration.

+

This configuration must not be used in any context which requires determinism across +replicated runtime instances.

+

Trait Implementations§

source§

impl Clone for HostInfo

source§

fn clone(&self) -> HostInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HostInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/protocol/struct.Protocol.html b/rust/oasis_core_runtime/protocol/struct.Protocol.html new file mode 100644 index 0000000000..f373c65cbc --- /dev/null +++ b/rust/oasis_core_runtime/protocol/struct.Protocol.html @@ -0,0 +1,50 @@ +Protocol in oasis_core_runtime::protocol - Rust

Struct oasis_core_runtime::protocol::Protocol

source ·
pub struct Protocol { /* private fields */ }
Expand description

Runtime part of the runtime host protocol.

+

Implementations§

source§

impl Protocol

source

pub fn get_config(&self) -> &Config

The supplied runtime configuration.

+
source

pub fn get_identity(&self) -> Option<&Arc<Identity>>

The runtime identity.

+
source

pub fn get_runtime_id(&self) -> Namespace

The runtime identifier for this instance.

+
§Panics
+

Panics, if the host environment information is not set.

+
source

pub fn get_host_info(&self) -> HostInfo

The host environment information for this instance.

+
§Panics
+

Panics, if the host environment information is not set.

+
source

pub fn call_host(&self, body: Body) -> Result<Body, Error>

Make a new request to the runtime host and wait for the response.

+

This is a blocking variant of call_host_async.

+
§Panics
+

This function panics if called within an asynchronous execution context.

+
source

pub async fn call_host_async(&self, body: Body) -> Result<Body, Error>

Make a new request to the runtime host and wait for the response.

+
source

pub fn send_response(&self, id: u64, body: Body) -> Result<()>

Send an async response to a previous request back to the host.

+
source

pub fn ensure_initialized(&self) -> Result<()>

Ensure that the runtime is ready to process requests and fail otherwise.

+

Trait Implementations§

source§

impl Host for Protocol

source§

fn identity<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<PublicKey, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Returns the identity of the host node.
source§

fn submit_tx<'life0, 'async_trait>( + &'life0 self, + data: Vec<u8>, + opts: SubmitTxOpts, +) -> Pin<Box<dyn Future<Output = Result<Option<TxResult>, Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Submit a transaction.
source§

fn register_notify<'life0, 'async_trait>( + &'life0 self, + opts: RegisterNotifyOpts, +) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where + Self: 'async_trait, + 'life0: 'async_trait,

Register for receiving notifications.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/protocol/struct.ProtocolUntrustedLocalStorage.html b/rust/oasis_core_runtime/protocol/struct.ProtocolUntrustedLocalStorage.html new file mode 100644 index 0000000000..055c5e8dcb --- /dev/null +++ b/rust/oasis_core_runtime/protocol/struct.ProtocolUntrustedLocalStorage.html @@ -0,0 +1,25 @@ +ProtocolUntrustedLocalStorage in oasis_core_runtime::protocol - Rust
pub struct ProtocolUntrustedLocalStorage { /* private fields */ }
Expand description

Untrusted key/value store which stores arbitrary binary key/value pairs +on the worker host.

+

Care MUST be taken to not trust this interface at all. The worker host +is capable of doing whatever it wants including but not limited to, +hiding data, tampering with keys/values, ignoring writes, replaying +past values, etc.

+

Implementations§

Trait Implementations§

source§

impl KeyValue for ProtocolUntrustedLocalStorage

source§

fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>

Fetch the value for a specific key.
source§

fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>

Store a specific key/value into storage.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/sidebar-items.js b/rust/oasis_core_runtime/sidebar-items.js new file mode 100644 index 0000000000..6da8947f23 --- /dev/null +++ b/rust/oasis_core_runtime/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["TeeType"],"macro":["classify_noderef","impl_bytes","key_format","noderef_as","noderef_as_mut","version_from_cargo"],"mod":["app","cache","common","config","consensus","dispatcher","enclave_rpc","future","host","identity","init","policy","protocol","storage","transaction","types"],"struct":["BUILD_INFO","BuildInfo"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/index.html b/rust/oasis_core_runtime/storage/index.html new file mode 100644 index 0000000000..9812a94bd2 --- /dev/null +++ b/rust/oasis_core_runtime/storage/index.html @@ -0,0 +1,3 @@ +oasis_core_runtime::storage - Rust

Module oasis_core_runtime::storage

source ·
Expand description

Runtime storage interfaces and implementations.

+

Re-exports§

  • pub use self::mkvs::MKVS;

Modules§

  • Merklized key-value store.

Structs§

Traits§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/enum.LogEntryKind.html b/rust/oasis_core_runtime/storage/mkvs/enum.LogEntryKind.html new file mode 100644 index 0000000000..fc8a251b4a --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/enum.LogEntryKind.html @@ -0,0 +1,31 @@ +LogEntryKind in oasis_core_runtime::storage::mkvs - Rust

Enum oasis_core_runtime::storage::mkvs::LogEntryKind

source ·
pub enum LogEntryKind {
+    Insert,
+    Delete,
+}
Expand description

The type of entry in the log.

+

Variants§

§

Insert

§

Delete

Trait Implementations§

source§

impl Clone for LogEntryKind

source§

fn clone(&self) -> LogEntryKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LogEntryKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for LogEntryKind

source§

fn eq(&self, other: &LogEntryKind) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for LogEntryKind

source§

impl Eq for LogEntryKind

source§

impl StructuralPartialEq for LogEntryKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/enum.NodeBox.html b/rust/oasis_core_runtime/storage/mkvs/enum.NodeBox.html new file mode 100644 index 0000000000..cd6bbbc69c --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/enum.NodeBox.html @@ -0,0 +1,27 @@ +NodeBox in oasis_core_runtime::storage::mkvs - Rust

Enum oasis_core_runtime::storage::mkvs::NodeBox

source ·
pub enum NodeBox {
+    Internal(InternalNode),
+    Leaf(LeafNode),
+}
Expand description

A box type that can contain either internal or leaf nodes.

+

Variants§

§

Internal(InternalNode)

§

Leaf(LeafNode)

Implementations§

Trait Implementations§

source§

impl Debug for NodeBox

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for NodeBox

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Marshal for NodeBox

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

Marshal the object into a binary form and return it as a new vector.
source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

Unmarshal from the given byte slice reference and modify self.
source§

impl PartialEq for NodeBox

source§

fn eq(&self, other: &NodeBox) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for NodeBox

source§

impl StructuralPartialEq for NodeBox

Auto Trait Implementations§

§

impl Freeze for NodeBox

§

impl !RefUnwindSafe for NodeBox

§

impl !Send for NodeBox

§

impl !Sync for NodeBox

§

impl Unpin for NodeBox

§

impl !UnwindSafe for NodeBox

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/enum.RootType.html b/rust/oasis_core_runtime/storage/mkvs/enum.RootType.html new file mode 100644 index 0000000000..277e644444 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/enum.RootType.html @@ -0,0 +1,40 @@ +RootType in oasis_core_runtime::storage::mkvs - Rust

Enum oasis_core_runtime::storage::mkvs::RootType

source ·
#[repr(u8)]
pub enum RootType { + Invalid = 0, + State = 1, + IO = 2, +}
Expand description

Storage root type.

+

Variants§

§

Invalid = 0

Invalid or uninitialized storage root type.

+
§

State = 1

Storage root for runtime state.

+
§

IO = 2

Storage root for transaction IO.

+

Trait Implementations§

source§

impl Clone for RootType

source§

fn clone(&self) -> RootType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RootType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RootType

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RootType

source§

fn default() -> RootType

Returns the “default value” for a type. Read more
source§

impl Encode for RootType

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for RootType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for RootType

source§

fn eq(&self, other: &RootType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for RootType

source§

impl Eq for RootType

source§

impl StructuralPartialEq for RootType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/index.html b/rust/oasis_core_runtime/storage/mkvs/index.html new file mode 100644 index 0000000000..f30004c467 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/index.html @@ -0,0 +1,3 @@ +oasis_core_runtime::storage::mkvs - Rust

Module oasis_core_runtime::storage::mkvs

source ·
Expand description

Merklized key-value store.

+

Modules§

Structs§

  • An entry in the write log, describing a single update.
  • A pointer to a node in the tree.
  • A key-value tree overlay that holds all updates in memory and only commits them if requested. +This can be used to create snapshots that can be discarded.
  • A key prefix.
  • Storage root.
  • A patricia tree-based MKVS implementation.

Enums§

Traits§

  • Merklized key-value store where methods return errors instead of panicking.
  • Immutable merkalized key value store.
  • An MKVS iterator.
  • Merklized key-value store.

Type Aliases§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/marshal/index.html b/rust/oasis_core_runtime/storage/mkvs/marshal/index.html new file mode 100644 index 0000000000..1314952f7d --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/marshal/index.html @@ -0,0 +1 @@ +oasis_core_runtime::storage::mkvs::marshal - Rust

Module oasis_core_runtime::storage::mkvs::marshal

source ·

Traits§

  • The Marshal trait is used for marshaling and unmarshaling MKVS trees.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/marshal/sidebar-items.js b/rust/oasis_core_runtime/storage/mkvs/marshal/sidebar-items.js new file mode 100644 index 0000000000..9789e9325e --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/marshal/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["Marshal"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/marshal/trait.Marshal.html b/rust/oasis_core_runtime/storage/mkvs/marshal/trait.Marshal.html new file mode 100644 index 0000000000..90affd0110 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/marshal/trait.Marshal.html @@ -0,0 +1,8 @@ +Marshal in oasis_core_runtime::storage::mkvs::marshal - Rust

Trait oasis_core_runtime::storage::mkvs::marshal::Marshal

source ·
pub trait Marshal {
+    // Required methods
+    fn marshal_binary(&self) -> Result<Vec<u8>>;
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>;
+}
Expand description

The Marshal trait is used for marshaling and unmarshaling MKVS trees.

+

Required Methods§

source

fn marshal_binary(&self) -> Result<Vec<u8>>

Marshal the object into a binary form and return it as a new vector.

+
source

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

Unmarshal from the given byte slice reference and modify self.

+

Implementations on Foreign Types§

source§

impl Marshal for u16

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

source§

impl Marshal for u32

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

source§

impl Marshal for u64

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sidebar-items.js b/rust/oasis_core_runtime/storage/mkvs/sidebar-items.js new file mode 100644 index 0000000000..a552237d8b --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["LogEntryKind","NodeBox","RootType"],"mod":["marshal","sync"],"struct":["LogEntry","NodePointer","OverlayTree","Prefix","Root","Tree"],"trait":["FallibleMKVS","ImmutableMKVS","Iterator","MKVS"],"type":["Depth","Key","NodePtrRef","WriteLog"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/struct.LogEntry.html b/rust/oasis_core_runtime/storage/mkvs/struct.LogEntry.html new file mode 100644 index 0000000000..b237d6cf26 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/struct.LogEntry.html @@ -0,0 +1,36 @@ +LogEntry in oasis_core_runtime::storage::mkvs - Rust

Struct oasis_core_runtime::storage::mkvs::LogEntry

source ·
pub struct LogEntry {
+    pub key: Vec<u8>,
+    pub value: Option<Vec<u8>>,
+}
Expand description

An entry in the write log, describing a single update.

+

Fields§

§key: Vec<u8>

The key that was inserted or deleted.

+
§value: Option<Vec<u8>>

The inserted value (empty if the key was deleted).

+

Implementations§

source§

impl LogEntry

source

pub fn new(key: &[u8], value: &[u8]) -> Self

source

pub fn kind(&self) -> LogEntryKind

Trait Implementations§

source§

impl Clone for LogEntry

source§

fn clone(&self) -> LogEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LogEntry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for LogEntry

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for LogEntry

source§

fn default() -> LogEntry

Returns the “default value” for a type. Read more
source§

impl Encode for LogEntry

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for LogEntry

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for LogEntry

source§

fn eq(&self, other: &LogEntry) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for LogEntry

source§

impl StructuralPartialEq for LogEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/struct.NodePointer.html b/rust/oasis_core_runtime/storage/mkvs/struct.NodePointer.html new file mode 100644 index 0000000000..da304638f1 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/struct.NodePointer.html @@ -0,0 +1,36 @@ +NodePointer in oasis_core_runtime::storage::mkvs - Rust

Struct oasis_core_runtime::storage::mkvs::NodePointer

source ·
pub struct NodePointer {
+    pub clean: bool,
+    pub hash: Hash,
+    pub node: Option<Rc<RefCell<NodeBox>>>,
+    pub cache_extra: Option<NonNull<CacheItemBox<NodePointer>>>,
+}
Expand description

A pointer to a node in the tree.

+

Fields§

§clean: bool§hash: Hash§node: Option<Rc<RefCell<NodeBox>>>§cache_extra: Option<NonNull<CacheItemBox<NodePointer>>>

Implementations§

source§

impl NodePointer

source

pub fn null_ptr() -> NodePtrRef

Construct a null pointer.

+
source

pub fn hash_ptr(hash: Hash) -> NodePtrRef

Construct a hash-only pointer.

+
source

pub fn from_node(node: NodeBox) -> NodePtrRef

Construct a node pointer from a full node.

+
source

pub fn is_null(&self) -> bool

Check if the pointer is a null pointer.

+
source

pub fn has_node(&self) -> bool

Check if the pointer has a resolved reference to a concrete node.

+
source

pub fn get_node(&self) -> Rc<RefCell<NodeBox>>

Get a reference to the node the pointer is pointing to.

+
source

pub fn extract(&self) -> NodePtrRef

Return a copy of this pointer containing only hash references.

+

Trait Implementations§

source§

impl Debug for NodePointer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for NodePointer

source§

fn default() -> NodePointer

Returns the “default value” for a type. Read more
source§

impl PartialEq for NodePointer

source§

fn eq(&self, other: &NodePointer) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for NodePointer

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/struct.OverlayTree.html b/rust/oasis_core_runtime/storage/mkvs/struct.OverlayTree.html new file mode 100644 index 0000000000..cc98b2e0ca --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/struct.OverlayTree.html @@ -0,0 +1,48 @@ +OverlayTree in oasis_core_runtime::storage::mkvs - Rust

Struct oasis_core_runtime::storage::mkvs::OverlayTree

source ·
pub struct OverlayTree<T: FallibleMKVS> { /* private fields */ }
Expand description

A key-value tree overlay that holds all updates in memory and only commits them if requested. +This can be used to create snapshots that can be discarded.

+

While updates (inserts, removes) are stored in the overlay, reads are not cached in the overlay +as the inner tree has its own cache and double caching makes less sense.

+

Implementations§

source§

impl<T: FallibleMKVS> OverlayTree<T>

source

pub fn new(inner: T) -> Self

Create a new overlay tree.

+
source

pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Get an existing key.

+
source

pub fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>

source

pub fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>>

Insert a key/value pair into the tree.

+
source

pub fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>

Remove entry with given key, returning the value at the key if the key was previously +in the database.

+
source

pub fn iter(&self) -> OverlayTreeIterator<'_, T>

Return an iterator over the tree.

+
source

pub fn commit(&mut self) -> Result<WriteLog>

Commit any modifications to the underlying tree.

+
source

pub fn commit_both( + &mut self, + namespace: Namespace, + version: u64, +) -> Result<(WriteLog, Hash)>

Commit any modifications to the underlying tree and then immediately commit the underlying +tree, returning the new root hash.

+

Trait Implementations§

source§

impl<T: FallibleMKVS> MKVS for OverlayTree<T>

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.
source§

fn get_proof(&self, key: &[u8]) -> Option<Proof>

Fetch proof for entry with given key.
source§

fn cache_contains_key(&self, key: &[u8]) -> bool

Check if the local MKVS cache contains the given key. Read more
source§

fn insert(&mut self, key: &[u8], value: &[u8]) -> Option<Vec<u8>>

Update entry with given key. Read more
source§

fn remove(&mut self, key: &[u8]) -> Option<Vec<u8>>

Remove entry with given key, returning the value at the key if the key was previously +in the database.
source§

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

fn commit( + &mut self, + namespace: Namespace, + version: u64, +) -> Result<(WriteLog, Hash)>

Commit all database changes to the underlying store.

Auto Trait Implementations§

§

impl<T> Freeze for OverlayTree<T>
where + T: Freeze,

§

impl<T> RefUnwindSafe for OverlayTree<T>
where + T: RefUnwindSafe,

§

impl<T> Send for OverlayTree<T>
where + T: Send,

§

impl<T> Sync for OverlayTree<T>
where + T: Sync,

§

impl<T> Unpin for OverlayTree<T>
where + T: Unpin,

§

impl<T> UnwindSafe for OverlayTree<T>
where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/struct.Prefix.html b/rust/oasis_core_runtime/storage/mkvs/struct.Prefix.html new file mode 100644 index 0000000000..ad53768e54 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/struct.Prefix.html @@ -0,0 +1,3141 @@ +Prefix in oasis_core_runtime::storage::mkvs - Rust

Struct oasis_core_runtime::storage::mkvs::Prefix

source ·
pub struct Prefix(/* private fields */);
Expand description

A key prefix.

+

Methods from Deref<Target = Vec<u8>>§

1.0.0 · source

pub fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without +reallocating.

+
§Examples
+
let mut vec: Vec<i32> = Vec::with_capacity(10);
+vec.push(42);
+assert!(vec.capacity() >= 10);
+
1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more elements to be inserted +in the given Vec<T>. The collection may reserve more space to +speculatively avoid frequent reallocations. After calling reserve, +capacity will be greater than or equal to self.len() + additional. +Does nothing if capacity is already sufficient.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1];
+vec.reserve(10);
+assert!(vec.capacity() >= 11);
+
1.0.0 · source

pub fn reserve_exact(&mut self, additional: usize)

Reserves the minimum capacity for at least additional more elements to +be inserted in the given Vec<T>. Unlike reserve, this will not +deliberately over-allocate to speculatively avoid frequent allocations. +After calling reserve_exact, capacity will be greater than or equal to +self.len() + additional. Does nothing if the capacity is already +sufficient.

+

Note that the allocator may give the collection more space than it +requests. Therefore, capacity can not be relied upon to be precisely +minimal. Prefer reserve if future insertions are expected.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1];
+vec.reserve_exact(10);
+assert!(vec.capacity() >= 11);
+
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional more elements to be inserted +in the given Vec<T>. The collection may reserve more space to speculatively avoid +frequent reallocations. After calling try_reserve, capacity will be +greater than or equal to self.len() + additional if it returns +Ok(()). Does nothing if capacity is already sufficient. This method +preserves the contents even if an error occurs.

+
§Errors
+

If the capacity overflows, or the allocator reports a failure, then an error +is returned.

+
§Examples
+
use std::collections::TryReserveError;
+
+fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {
+    let mut output = Vec::new();
+
+    // Pre-reserve the memory, exiting if we can't
+    output.try_reserve(data.len())?;
+
+    // Now we know this can't OOM in the middle of our complex work
+    output.extend(data.iter().map(|&val| {
+        val * 2 + 5 // very complicated
+    }));
+
+    Ok(output)
+}
+
1.57.0 · source

pub fn try_reserve_exact( + &mut self, + additional: usize, +) -> Result<(), TryReserveError>

Tries to reserve the minimum capacity for at least additional +elements to be inserted in the given Vec<T>. Unlike try_reserve, +this will not deliberately over-allocate to speculatively avoid frequent +allocations. After calling try_reserve_exact, capacity will be greater +than or equal to self.len() + additional if it returns Ok(()). +Does nothing if the capacity is already sufficient.

+

Note that the allocator may give the collection more space than it +requests. Therefore, capacity can not be relied upon to be precisely +minimal. Prefer try_reserve if future insertions are expected.

+
§Errors
+

If the capacity overflows, or the allocator reports a failure, then an error +is returned.

+
§Examples
+
use std::collections::TryReserveError;
+
+fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {
+    let mut output = Vec::new();
+
+    // Pre-reserve the memory, exiting if we can't
+    output.try_reserve_exact(data.len())?;
+
+    // Now we know this can't OOM in the middle of our complex work
+    output.extend(data.iter().map(|&val| {
+        val * 2 + 5 // very complicated
+    }));
+
+    Ok(output)
+}
+
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the vector as much as possible.

+

The behavior of this method depends on the allocator, which may either shrink the vector +in-place or reallocate. The resulting vector might still have some excess capacity, just as +is the case for with_capacity. See Allocator::shrink for more details.

+
§Examples
+
let mut vec = Vec::with_capacity(10);
+vec.extend([1, 2, 3]);
+assert!(vec.capacity() >= 10);
+vec.shrink_to_fit();
+assert!(vec.capacity() >= 3);
+
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of the vector with a lower bound.

+

The capacity will remain at least as large as both the length +and the supplied value.

+

If the current capacity is less than the lower limit, this is a no-op.

+
§Examples
+
let mut vec = Vec::with_capacity(10);
+vec.extend([1, 2, 3]);
+assert!(vec.capacity() >= 10);
+vec.shrink_to(4);
+assert!(vec.capacity() >= 4);
+vec.shrink_to(0);
+assert!(vec.capacity() >= 3);
+
1.0.0 · source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping +the rest.

+

If len is greater or equal to the vector’s current length, this has +no effect.

+

The drain method can emulate truncate, but causes the excess +elements to be returned instead of dropped.

+

Note that this method has no effect on the allocated capacity +of the vector.

+
§Examples
+

Truncating a five element vector to two elements:

+ +
let mut vec = vec![1, 2, 3, 4, 5];
+vec.truncate(2);
+assert_eq!(vec, [1, 2]);
+

No truncation occurs when len is greater than the vector’s current +length:

+ +
let mut vec = vec![1, 2, 3];
+vec.truncate(8);
+assert_eq!(vec, [1, 2, 3]);
+

Truncating when len == 0 is equivalent to calling the clear +method.

+ +
let mut vec = vec![1, 2, 3];
+vec.truncate(0);
+assert_eq!(vec, []);
+
1.7.0 · source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

+

Equivalent to &s[..].

+
§Examples
+
use std::io::{self, Write};
+let buffer = vec![1, 2, 3, 5, 8];
+io::sink().write(buffer.as_slice()).unwrap();
+
1.7.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Extracts a mutable slice of the entire vector.

+

Equivalent to &mut s[..].

+
§Examples
+
use std::io::{self, Read};
+let mut buffer = vec![0; 3];
+io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
+
1.37.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer +valid for zero sized reads if the vector didn’t allocate.

+

The caller must ensure that the vector outlives the pointer this +function returns, or else it will end up pointing to garbage. +Modifying the vector may cause its buffer to be reallocated, +which would also make any pointers to it invalid.

+

The caller must also ensure that the memory the pointer (non-transitively) points to +is never written to (except inside an UnsafeCell) using this pointer or any pointer +derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

+

This method guarantees that for the purpose of the aliasing model, this method +does not materialize a reference to the underlying slice, and thus the returned pointer +will remain valid when mixed with other calls to as_ptr and as_mut_ptr. +Note that calling other methods that materialize mutable references to the slice, +or mutable references to specific elements you are planning on accessing through this pointer, +as well as writing to those elements, may still invalidate this pointer. +See the second example below for how this guarantee can be used.

+
§Examples
+
let x = vec![1, 2, 4];
+let x_ptr = x.as_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        assert_eq!(*x_ptr.add(i), 1 << i);
+    }
+}
+

Due to the aliasing guarantee, the following code is legal:

+ +
unsafe {
+    let mut v = vec![0, 1, 2];
+    let ptr1 = v.as_ptr();
+    let _ = ptr1.read();
+    let ptr2 = v.as_mut_ptr().offset(2);
+    ptr2.write(2);
+    // Notably, the write to `ptr2` did *not* invalidate `ptr1`
+    // because it mutated a different element:
+    let _ = ptr1.read();
+}
+
1.37.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the vector’s buffer, or a dangling +raw pointer valid for zero sized reads if the vector didn’t allocate.

+

The caller must ensure that the vector outlives the pointer this +function returns, or else it will end up pointing to garbage. +Modifying the vector may cause its buffer to be reallocated, +which would also make any pointers to it invalid.

+

This method guarantees that for the purpose of the aliasing model, this method +does not materialize a reference to the underlying slice, and thus the returned pointer +will remain valid when mixed with other calls to as_ptr and as_mut_ptr. +Note that calling other methods that materialize references to the slice, +or references to specific elements you are planning on accessing through this pointer, +may still invalidate this pointer. +See the second example below for how this guarantee can be used.

+
§Examples
+
// Allocate vector big enough for 4 elements.
+let size = 4;
+let mut x: Vec<i32> = Vec::with_capacity(size);
+let x_ptr = x.as_mut_ptr();
+
+// Initialize elements via raw pointer writes, then set length.
+unsafe {
+    for i in 0..size {
+        *x_ptr.add(i) = i as i32;
+    }
+    x.set_len(size);
+}
+assert_eq!(&*x, &[0, 1, 2, 3]);
+

Due to the aliasing guarantee, the following code is legal:

+ +
unsafe {
+    let mut v = vec![0];
+    let ptr1 = v.as_mut_ptr();
+    ptr1.write(1);
+    let ptr2 = v.as_mut_ptr();
+    ptr2.write(2);
+    // Notably, the write to `ptr2` did *not* invalidate `ptr1`:
+    ptr1.write(3);
+}
+
source

pub fn allocator(&self) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

+
1.0.0 · source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

+

This is a low-level operation that maintains none of the normal +invariants of the type. Normally changing the length of a vector +is done using one of the safe operations instead, such as +truncate, resize, extend, or clear.

+
§Safety
+
    +
  • new_len must be less than or equal to capacity().
  • +
  • The elements at old_len..new_len must be initialized.
  • +
+
§Examples
+

This method can be useful for situations in which the vector +is serving as a buffer for other code, particularly over FFI:

+ +
pub fn get_dictionary(&self) -> Option<Vec<u8>> {
+    // Per the FFI method's docs, "32768 bytes is always enough".
+    let mut dict = Vec::with_capacity(32_768);
+    let mut dict_length = 0;
+    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
+    // 1. `dict_length` elements were initialized.
+    // 2. `dict_length` <= the capacity (32_768)
+    // which makes `set_len` safe to call.
+    unsafe {
+        // Make the FFI call...
+        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
+        if r == Z_OK {
+            // ...and update the length to what was initialized.
+            dict.set_len(dict_length);
+            Some(dict)
+        } else {
+            None
+        }
+    }
+}
+

While the following example is sound, there is a memory leak since +the inner vectors were not freed prior to the set_len call:

+ +
let mut vec = vec![vec![1, 0, 0],
+                   vec![0, 1, 0],
+                   vec![0, 0, 1]];
+// SAFETY:
+// 1. `old_len..0` is empty so no elements need to be initialized.
+// 2. `0 <= capacity` always holds whatever `capacity` is.
+unsafe {
+    vec.set_len(0);
+}
+

Normally, here, one would use clear instead to correctly drop +the contents and thus not leak memory.

+
1.0.0 · source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

+

The removed element is replaced by the last element of the vector.

+

This does not preserve ordering of the remaining elements, but is O(1). +If you need to preserve the element order, use remove instead.

+
§Panics
+

Panics if index is out of bounds.

+
§Examples
+
let mut v = vec!["foo", "bar", "baz", "qux"];
+
+assert_eq!(v.swap_remove(1), "bar");
+assert_eq!(v, ["foo", "qux", "baz"]);
+
+assert_eq!(v.swap_remove(0), "foo");
+assert_eq!(v, ["baz", "qux"]);
+
1.0.0 · source

pub fn insert(&mut self, index: usize, element: T)

Inserts an element at position index within the vector, shifting all +elements after it to the right.

+
§Panics
+

Panics if index > len.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+vec.insert(1, 4);
+assert_eq!(vec, [1, 4, 2, 3]);
+vec.insert(4, 5);
+assert_eq!(vec, [1, 4, 2, 3, 5]);
+
§Time complexity
+

Takes O(Vec::len) time. All items after the insertion index must be +shifted to the right. In the worst case, all elements are shifted when +the insertion index is 0.

+
1.0.0 · source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector, +shifting all elements after it to the left.

+

Note: Because this shifts over the remaining elements, it has a +worst-case performance of O(n). If you don’t need the order of elements +to be preserved, use swap_remove instead. If you’d like to remove +elements from the beginning of the Vec, consider using +VecDeque::pop_front instead.

+
§Panics
+

Panics if index is out of bounds.

+
§Examples
+
let mut v = vec![1, 2, 3];
+assert_eq!(v.remove(1), 2);
+assert_eq!(v, [1, 3]);
+
1.0.0 · source

pub fn retain<F>(&mut self, f: F)
where + F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

+

In other words, remove all elements e for which f(&e) returns false. +This method operates in place, visiting each element exactly once in the +original order, and preserves the order of the retained elements.

+
§Examples
+
let mut vec = vec![1, 2, 3, 4];
+vec.retain(|&x| x % 2 == 0);
+assert_eq!(vec, [2, 4]);
+

Because the elements are visited exactly once in the original order, +external state may be used to decide which elements to keep.

+ +
let mut vec = vec![1, 2, 3, 4, 5];
+let keep = [false, true, true, false, true];
+let mut iter = keep.iter();
+vec.retain(|_| *iter.next().unwrap());
+assert_eq!(vec, [2, 3, 5]);
+
1.61.0 · source

pub fn retain_mut<F>(&mut self, f: F)
where + F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

+

In other words, remove all elements e such that f(&mut e) returns false. +This method operates in place, visiting each element exactly once in the +original order, and preserves the order of the retained elements.

+
§Examples
+
let mut vec = vec![1, 2, 3, 4];
+vec.retain_mut(|x| if *x <= 3 {
+    *x += 1;
+    true
+} else {
+    false
+});
+assert_eq!(vec, [2, 3, 4]);
+
1.16.0 · source

pub fn dedup_by_key<F, K>(&mut self, key: F)
where + F: FnMut(&mut T) -> K, + K: PartialEq,

Removes all but the first of consecutive elements in the vector that resolve to the same +key.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec![10, 20, 21, 30, 20];
+
+vec.dedup_by_key(|i| *i / 10);
+
+assert_eq!(vec, [10, 20, 30, 20]);
+
1.16.0 · source

pub fn dedup_by<F>(&mut self, same_bucket: F)
where + F: FnMut(&mut T, &mut T) -> bool,

Removes all but the first of consecutive elements in the vector satisfying a given equality +relation.

+

The same_bucket function is passed references to two elements from the vector and +must determine if the elements compare equal. The elements are passed in opposite order +from their order in the slice, so if same_bucket(a, b) returns true, a is removed.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec!["foo", "bar", "Bar", "baz", "bar"];
+
+vec.dedup_by(|a, b| a.eq_ignore_ascii_case(b));
+
+assert_eq!(vec, ["foo", "bar", "baz", "bar"]);
+
1.0.0 · source

pub fn push(&mut self, value: T)

Appends an element to the back of a collection.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1, 2];
+vec.push(3);
+assert_eq!(vec, [1, 2, 3]);
+
§Time complexity
+

Takes amortized O(1) time. If the vector’s length would exceed its +capacity after the push, O(capacity) time is taken to copy the +vector’s elements to a larger allocation. This expensive operation is +offset by the capacity O(1) insertions it allows.

+
source

pub fn push_within_capacity(&mut self, value: T) -> Result<(), T>

🔬This is a nightly-only experimental API. (vec_push_within_capacity)

Appends an element if there is sufficient spare capacity, otherwise an error is returned +with the element.

+

Unlike push this method will not reallocate when there’s insufficient capacity. +The caller should use reserve or try_reserve to ensure that there is enough capacity.

+
§Examples
+

A manual, panic-free alternative to FromIterator:

+ +
#![feature(vec_push_within_capacity)]
+
+use std::collections::TryReserveError;
+fn from_iter_fallible<T>(iter: impl Iterator<Item=T>) -> Result<Vec<T>, TryReserveError> {
+    let mut vec = Vec::new();
+    for value in iter {
+        if let Err(value) = vec.push_within_capacity(value) {
+            vec.try_reserve(1)?;
+            // this cannot fail, the previous line either returned or added at least 1 free slot
+            let _ = vec.push_within_capacity(value);
+        }
+    }
+    Ok(vec)
+}
+assert_eq!(from_iter_fallible(0..100), Ok(Vec::from_iter(0..100)));
+
§Time complexity
+

Takes O(1) time.

+
1.0.0 · source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it +is empty.

+

If you’d like to pop the first element, consider using +VecDeque::pop_front instead.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+assert_eq!(vec.pop(), Some(3));
+assert_eq!(vec, [1, 2]);
+
§Time complexity
+

Takes O(1) time.

+
source

pub fn pop_if<F>(&mut self, f: F) -> Option<T>
where + F: FnOnce(&mut T) -> bool,

🔬This is a nightly-only experimental API. (vec_pop_if)

Removes and returns the last element in a vector if the predicate +returns true, or None if the predicate returns false or the vector +is empty.

+
§Examples
+
#![feature(vec_pop_if)]
+
+let mut vec = vec![1, 2, 3, 4];
+let pred = |x: &mut i32| *x % 2 == 0;
+
+assert_eq!(vec.pop_if(pred), Some(4));
+assert_eq!(vec, [1, 2, 3]);
+assert_eq!(vec.pop_if(pred), None);
+
1.4.0 · source

pub fn append(&mut self, other: &mut Vec<T, A>)

Moves all the elements of other into self, leaving other empty.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+let mut vec2 = vec![4, 5, 6];
+vec.append(&mut vec2);
+assert_eq!(vec, [1, 2, 3, 4, 5, 6]);
+assert_eq!(vec2, []);
+
1.6.0 · source

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
where + R: RangeBounds<usize>,

Removes the specified range from the vector in bulk, returning all +removed elements as an iterator. If the iterator is dropped before +being fully consumed, it drops the remaining removed elements.

+

The returned iterator keeps a mutable borrow on the vector to optimize +its implementation.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Leaking
+

If the returned iterator goes out of scope without being dropped (due to +mem::forget, for example), the vector may have lost and leaked +elements arbitrarily, including elements outside the range.

+
§Examples
+
let mut v = vec![1, 2, 3];
+let u: Vec<_> = v.drain(1..).collect();
+assert_eq!(v, &[1]);
+assert_eq!(u, &[2, 3]);
+
+// A full range clears the vector, like `clear()` does
+v.drain(..);
+assert_eq!(v, &[]);
+
1.0.0 · source

pub fn clear(&mut self)

Clears the vector, removing all values.

+

Note that this method has no effect on the allocated capacity +of the vector.

+
§Examples
+
let mut v = vec![1, 2, 3];
+
+v.clear();
+
+assert!(v.is_empty());
+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to +as its ‘length’.

+
§Examples
+
let a = vec![1, 2, 3];
+assert_eq!(a.len(), 3);
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

+
§Examples
+
let mut v = Vec::new();
+assert!(v.is_empty());
+
+v.push(1);
+assert!(!v.is_empty());
+
1.4.0 · source

pub fn split_off(&mut self, at: usize) -> Vec<T, A>
where + A: Clone,

Splits the collection into two at the given index.

+

Returns a newly allocated vector containing the elements in the range +[at, len). After the call, the original vector will be left containing +the elements [0, at) with its previous capacity unchanged.

+
    +
  • If you want to take ownership of the entire contents and capacity of +the vector, see mem::take or mem::replace.
  • +
  • If you don’t need the returned vector at all, see Vec::truncate.
  • +
  • If you want to take ownership of an arbitrary subslice, or you don’t +necessarily want to store the removed items in a vector, see Vec::drain.
  • +
+
§Panics
+

Panics if at > len.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+let vec2 = vec.split_off(1);
+assert_eq!(vec, [1]);
+assert_eq!(vec2, [2, 3]);
+
1.33.0 · source

pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where + F: FnMut() -> T,

Resizes the Vec in-place so that len is equal to new_len.

+

If new_len is greater than len, the Vec is extended by the +difference, with each additional slot filled with the result of +calling the closure f. The return values from f will end up +in the Vec in the order they have been generated.

+

If new_len is less than len, the Vec is simply truncated.

+

This method uses a closure to create new values on every push. If +you’d rather Clone a given value, use Vec::resize. If you +want to use the Default trait to generate values, you can +pass Default::default as the second argument.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+vec.resize_with(5, Default::default);
+assert_eq!(vec, [1, 2, 3, 0, 0]);
+
+let mut vec = vec![];
+let mut p = 1;
+vec.resize_with(4, || { p *= 2; p });
+assert_eq!(vec, [2, 4, 8, 16]);
+
1.60.0 · source

pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]

Returns the remaining spare capacity of the vector as a slice of +MaybeUninit<T>.

+

The returned slice can be used to fill the vector with data (e.g. by +reading from a file) before marking the data as initialized using the +set_len method.

+
§Examples
+
// Allocate vector big enough for 10 elements.
+let mut v = Vec::with_capacity(10);
+
+// Fill in the first 3 elements.
+let uninit = v.spare_capacity_mut();
+uninit[0].write(0);
+uninit[1].write(1);
+uninit[2].write(2);
+
+// Mark the first 3 elements of the vector as being initialized.
+unsafe {
+    v.set_len(3);
+}
+
+assert_eq!(&v, &[0, 1, 2]);
+
source

pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>])

🔬This is a nightly-only experimental API. (vec_split_at_spare)

Returns vector content as a slice of T, along with the remaining spare +capacity of the vector as a slice of MaybeUninit<T>.

+

The returned spare capacity slice can be used to fill the vector with data +(e.g. by reading from a file) before marking the data as initialized using +the set_len method.

+

Note that this is a low-level API, which should be used with care for +optimization purposes. If you need to append data to a Vec +you can use push, extend, extend_from_slice, +extend_from_within, insert, append, resize or +resize_with, depending on your exact needs.

+
§Examples
+
#![feature(vec_split_at_spare)]
+
+let mut v = vec![1, 1, 2];
+
+// Reserve additional space big enough for 10 elements.
+v.reserve(10);
+
+let (init, uninit) = v.split_at_spare_mut();
+let sum = init.iter().copied().sum::<u32>();
+
+// Fill in the next 4 elements.
+uninit[0].write(sum);
+uninit[1].write(sum * 2);
+uninit[2].write(sum * 3);
+uninit[3].write(sum * 4);
+
+// Mark the 4 elements of the vector as being initialized.
+unsafe {
+    let len = v.len();
+    v.set_len(len + 4);
+}
+
+assert_eq!(&v, &[1, 1, 2, 4, 8, 12, 16]);
+
1.5.0 · source

pub fn resize(&mut self, new_len: usize, value: T)

Resizes the Vec in-place so that len is equal to new_len.

+

If new_len is greater than len, the Vec is extended by the +difference, with each additional slot filled with value. +If new_len is less than len, the Vec is simply truncated.

+

This method requires T to implement Clone, +in order to be able to clone the passed value. +If you need more flexibility (or want to rely on Default instead of +Clone), use Vec::resize_with. +If you only need to resize to a smaller size, use Vec::truncate.

+
§Examples
+
let mut vec = vec!["hello"];
+vec.resize(3, "world");
+assert_eq!(vec, ["hello", "world", "world"]);
+
+let mut vec = vec![1, 2, 3, 4];
+vec.resize(2, 0);
+assert_eq!(vec, [1, 2]);
+
1.6.0 · source

pub fn extend_from_slice(&mut self, other: &[T])

Clones and appends all elements in a slice to the Vec.

+

Iterates over the slice other, clones each element, and then appends +it to this Vec. The other slice is traversed in-order.

+

Note that this function is same as extend except that it is +specialized to work with slices instead. If and when Rust gets +specialization this function will likely be deprecated (but still +available).

+
§Examples
+
let mut vec = vec![1];
+vec.extend_from_slice(&[2, 3, 4]);
+assert_eq!(vec, [1, 2, 3, 4]);
+
1.53.0 · source

pub fn extend_from_within<R>(&mut self, src: R)
where + R: RangeBounds<usize>,

Copies elements from src range to the end of the vector.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Examples
+
let mut vec = vec![0, 1, 2, 3, 4];
+
+vec.extend_from_within(2..);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);
+
+vec.extend_from_within(..2);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);
+
+vec.extend_from_within(4..8);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
+
1.0.0 · source

pub fn dedup(&mut self)

Removes consecutive repeated elements in the vector according to the +PartialEq trait implementation.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec![1, 2, 2, 3, 2];
+
+vec.dedup();
+
+assert_eq!(vec, [1, 2, 3, 2]);
+
1.21.0 · source

pub fn splice<R, I>( + &mut self, + range: R, + replace_with: I, +) -> Splice<'_, <I as IntoIterator>::IntoIter, A>
where + R: RangeBounds<usize>, + I: IntoIterator<Item = T>,

Creates a splicing iterator that replaces the specified range in the vector +with the given replace_with iterator and yields the removed items. +replace_with does not need to be the same length as range.

+

range is removed even if the iterator is not consumed until the end.

+

It is unspecified how many elements are removed from the vector +if the Splice value is leaked.

+

The input iterator replace_with is only consumed when the Splice value is dropped.

+

This is optimal if:

+
    +
  • The tail (elements in the vector after range) is empty,
  • +
  • or replace_with yields fewer or equal elements than range’s length
  • +
  • or the lower bound of its size_hint() is exact.
  • +
+

Otherwise, a temporary vector is allocated and the tail is moved twice.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Examples
+
let mut v = vec![1, 2, 3, 4];
+let new = [7, 8, 9];
+let u: Vec<_> = v.splice(1..3, new).collect();
+assert_eq!(v, &[1, 7, 8, 9, 4]);
+assert_eq!(u, &[2, 3]);
+
source

pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
where + F: FnMut(&mut T) -> bool,

🔬This is a nightly-only experimental API. (extract_if)

Creates an iterator which uses a closure to determine if an element should be removed.

+

If the closure returns true, then the element is removed and yielded. +If the closure returns false, the element will remain in the vector and will not be yielded +by the iterator.

+

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating +or the iteration short-circuits, then the remaining elements will be retained. +Use retain with a negated predicate if you do not need the returned iterator.

+

Using this method is equivalent to the following code:

+ +
let mut i = 0;
+while i < vec.len() {
+    if some_predicate(&mut vec[i]) {
+        let val = vec.remove(i);
+        // your code here
+    } else {
+        i += 1;
+    }
+}
+
+

But extract_if is easier to use. extract_if is also more efficient, +because it can backshift the elements of the array in bulk.

+

Note that extract_if also lets you mutate every element in the filter closure, +regardless of whether you choose to keep or remove it.

+
§Examples
+

Splitting an array into evens and odds, reusing the original allocation:

+ +
#![feature(extract_if)]
+let mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15];
+
+let evens = numbers.extract_if(|x| *x % 2 == 0).collect::<Vec<_>>();
+let odds = numbers;
+
+assert_eq!(evens, vec![2, 4, 6, 8, 14]);
+assert_eq!(odds, vec![1, 3, 5, 9, 11, 13, 15]);
+

Methods from Deref<Target = [T]>§

source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

+
source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f32::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

+
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of +ASCII characters, otherwise returns None.

+
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, +without checking whether they’re valid.

+
§Safety
+

Every byte in the slice must be in 0..=127, or else this is UB.

+
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

+

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), +but without allocating and copying temporaries.

+
1.23.0 · source

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To return a new uppercased value without modifying the existing one, use +to_ascii_uppercase.

+
1.23.0 · source

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To return a new lowercased value without modifying the existing one, use +to_ascii_lowercase.

+
1.60.0 · source

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, +treating it as an ASCII string.

+
§Examples
+

+let s = b"0\t\r\n'\"\\\x9d";
+let escaped = s.escape_ascii().to_string();
+assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
+
1.80.0 · source

pub fn trim_ascii_start(&self) -> &[u8]

Returns a byte slice with leading ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
+assert_eq!(b"  ".trim_ascii_start(), b"");
+assert_eq!(b"".trim_ascii_start(), b"");
+
1.80.0 · source

pub fn trim_ascii_end(&self) -> &[u8]

Returns a byte slice with trailing ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
+assert_eq!(b"  ".trim_ascii_end(), b"");
+assert_eq!(b"".trim_ascii_end(), b"");
+
1.80.0 · source

pub fn trim_ascii(&self) -> &[u8]

Returns a byte slice with leading and trailing ASCII whitespace bytes +removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
+assert_eq!(b"  ".trim_ascii(), b"");
+assert_eq!(b"".trim_ascii(), b"");
+
1.79.0 · source

pub fn utf8_chunks(&self) -> Utf8Chunks<'_>

Creates an iterator over the contiguous valid UTF-8 ranges of this +slice, and the non-UTF-8 fragments in between.

+
§Examples
+

This function formats arbitrary but mostly-UTF-8 bytes into Rust source +code in the form of a C-string literal (c"...").

+ +
use std::fmt::Write as _;
+
+pub fn cstr_literal(bytes: &[u8]) -> String {
+    let mut repr = String::new();
+    repr.push_str("c\"");
+    for chunk in bytes.utf8_chunks() {
+        for ch in chunk.valid().chars() {
+            // Escapes \0, \t, \r, \n, \\, \', \", and uses \u{...} for non-printable characters.
+            write!(repr, "{}", ch.escape_debug()).unwrap();
+        }
+        for byte in chunk.invalid() {
+            write!(repr, "\\x{:02X}", byte).unwrap();
+        }
+    }
+    repr.push('"');
+    repr
+}
+
+fn main() {
+    let lit = cstr_literal(b"\xferris the \xf0\x9f\xa6\x80\x07");
+    let expected = stringify!(c"\xFErris the 🦀\u{7}");
+    assert_eq!(lit, expected);
+}
+
1.80.0 · source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened(), &[1, 2, 3, 4, 5, 6]);
+
+assert_eq!(
+    [[1, 2, 3], [4, 5, 6]].as_flattened(),
+    [[1, 2], [3, 4], [5, 6]].as_flattened(),
+);
+
+let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
+assert!(slice_of_empty_arrays.as_flattened().is_empty());
+
+let empty_slice_of_arrays: &[[u32; 10]] = &[];
+assert!(empty_slice_of_arrays.as_flattened().is_empty());
+
1.80.0 · source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
fn add_5_to_all(slice: &mut [i32]) {
+    for i in slice {
+        *i += 5;
+    }
+}
+
+let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
+add_5_to_all(array.as_flattened_mut());
+assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f64::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the slice.

+
§Examples
+
let a = [1, 2, 3];
+assert_eq!(a.len(), 3);
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

+
§Examples
+
let a = [1, 2, 3];
+assert!(!a.is_empty());
+
+let b: &[i32] = &[];
+assert!(b.is_empty());
+
1.0.0 · source

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&10), v.first());
+
+let w: &[i32] = &[];
+assert_eq!(None, w.first());
+
1.0.0 · source

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(first) = x.first_mut() {
+    *first = 5;
+}
+assert_eq!(x, &[5, 1, 2]);
+
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.first_mut());
+
1.5.0 · source

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((first, elements)) = x.split_first() {
+    assert_eq!(first, &0);
+    assert_eq!(elements, &[1, 2]);
+}
+
1.5.0 · source

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_mut() {
+    *first = 3;
+    elements[0] = 4;
+    elements[1] = 5;
+}
+assert_eq!(x, &[3, 4, 5]);
+
1.5.0 · source

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((last, elements)) = x.split_last() {
+    assert_eq!(last, &2);
+    assert_eq!(elements, &[0, 1]);
+}
+
1.5.0 · source

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((last, elements)) = x.split_last_mut() {
+    *last = 3;
+    elements[0] = 4;
+    elements[1] = 5;
+}
+assert_eq!(x, &[4, 5, 3]);
+
1.0.0 · source

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&30), v.last());
+
+let w: &[i32] = &[];
+assert_eq!(None, w.last());
+
1.0.0 · source

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable reference to the last item in the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(last) = x.last_mut() {
+    *last = 10;
+}
+assert_eq!(x, &[0, 1, 10]);
+
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.last_mut());
+
1.77.0 · source

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
+assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
+
+let v: &[i32] = &[10];
+assert_eq!(None, v.first_chunk::<2>());
+
+let w: &[i32] = &[];
+assert_eq!(Some(&[]), w.first_chunk::<0>());
+
1.77.0 · source

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(first) = x.first_chunk_mut::<2>() {
+    first[0] = 5;
+    first[1] = 4;
+}
+assert_eq!(x, &[5, 4, 2]);
+
+assert_eq!(None, x.first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

Return an array reference to the first N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_chunk::<2>() {
+    assert_eq!(first, &[0, 1]);
+    assert_eq!(elements, &[2]);
+}
+
+assert_eq!(None, x.split_first_chunk::<4>());
+
1.77.0 · source

pub fn split_first_chunk_mut<const N: usize>( + &mut self, +) -> Option<(&mut [T; N], &mut [T])>

Return a mutable array reference to the first N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_chunk_mut::<2>() {
+    first[0] = 3;
+    first[1] = 4;
+    elements[0] = 5;
+}
+assert_eq!(x, &[3, 4, 5]);
+
+assert_eq!(None, x.split_first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

Return an array reference to the last N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((elements, last)) = x.split_last_chunk::<2>() {
+    assert_eq!(elements, &[0]);
+    assert_eq!(last, &[1, 2]);
+}
+
+assert_eq!(None, x.split_last_chunk::<4>());
+
1.77.0 · source

pub fn split_last_chunk_mut<const N: usize>( + &mut self, +) -> Option<(&mut [T], &mut [T; N])>

Return a mutable array reference to the last N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((elements, last)) = x.split_last_chunk_mut::<2>() {
+    last[0] = 3;
+    last[1] = 4;
+    elements[0] = 5;
+}
+assert_eq!(x, &[5, 3, 4]);
+
+assert_eq!(None, x.split_last_chunk_mut::<4>());
+
1.77.0 · source

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
+assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
+
+let v: &[i32] = &[10];
+assert_eq!(None, v.last_chunk::<2>());
+
+let w: &[i32] = &[];
+assert_eq!(Some(&[]), w.last_chunk::<0>());
+
1.77.0 · source

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(last) = x.last_chunk_mut::<2>() {
+    last[0] = 10;
+    last[1] = 20;
+}
+assert_eq!(x, &[0, 10, 20]);
+
+assert_eq!(None, x.last_chunk_mut::<4>());
+
1.0.0 · source

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
where + I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of +index.

+
    +
  • If given a position, returns a reference to the element at that +position or None if out of bounds.
  • +
  • If given a range, returns the subslice corresponding to that range, +or None if out of bounds.
  • +
+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&40), v.get(1));
+assert_eq!(Some(&[10, 40][..]), v.get(0..2));
+assert_eq!(None, v.get(3));
+assert_eq!(None, v.get(0..4));
+
1.0.0 · source

pub fn get_mut<I>( + &mut self, + index: I, +) -> Option<&mut <I as SliceIndex<[T]>>::Output>
where + I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the +type of index (see get) or None if the index is out of bounds.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(elem) = x.get_mut(1) {
+    *elem = 42;
+}
+assert_eq!(x, &[0, 42, 2]);
+
1.0.0 · source

pub unsafe fn get_unchecked<I>( + &self, + index: I, +) -> &<I as SliceIndex<[T]>>::Output
where + I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds +checking.

+

For a safe alternative see get.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used.

+

You can think of this like .get(index).unwrap_unchecked(). It’s UB +to call .get_unchecked(len), even if you immediately convert to a +pointer. And it’s UB to call .get_unchecked(..len + 1), +.get_unchecked(..=len), or similar.

+
§Examples
+
let x = &[1, 2, 4];
+
+unsafe {
+    assert_eq!(x.get_unchecked(1), &2);
+}
+
1.0.0 · source

pub unsafe fn get_unchecked_mut<I>( + &mut self, + index: I, +) -> &mut <I as SliceIndex<[T]>>::Output
where + I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing +bounds checking.

+

For a safe alternative see get_mut.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used.

+

You can think of this like .get_mut(index).unwrap_unchecked(). It’s +UB to call .get_unchecked_mut(len), even if you immediately convert +to a pointer. And it’s UB to call .get_unchecked_mut(..len + 1), +.get_unchecked_mut(..=len), or similar.

+
§Examples
+
let x = &mut [1, 2, 4];
+
+unsafe {
+    let elem = x.get_unchecked_mut(1);
+    *elem = 13;
+}
+assert_eq!(x, &[1, 13, 4]);
+
1.0.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

+

The caller must ensure that the slice outlives the pointer this +function returns, or else it will end up pointing to garbage.

+

The caller must also ensure that the memory the pointer (non-transitively) points to +is never written to (except inside an UnsafeCell) using this pointer or any pointer +derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

+

Modifying the container referenced by this slice may cause its buffer +to be reallocated, which would also make any pointers to it invalid.

+
§Examples
+
let x = &[1, 2, 4];
+let x_ptr = x.as_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
+    }
+}
+
1.0.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

+

The caller must ensure that the slice outlives the pointer this +function returns, or else it will end up pointing to garbage.

+

Modifying the container referenced by this slice may cause its buffer +to be reallocated, which would also make any pointers to it invalid.

+
§Examples
+
let x = &mut [1, 2, 4];
+let x_ptr = x.as_mut_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        *x_ptr.add(i) += 2;
+    }
+}
+assert_eq!(x, &[3, 4, 6]);
+
1.48.0 · source

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

+

The returned range is half-open, which means that the end pointer +points one past the last element of the slice. This way, an empty +slice is represented by two equal pointers, and the difference between +the two pointers represents the size of the slice.

+

See as_ptr for warnings on using these pointers. The end pointer +requires extra caution, as it does not point to a valid element in the +slice.

+

This function is useful for interacting with foreign interfaces which +use two pointers to refer to a range of elements in memory, as is +common in C++.

+

It can also be useful to check if a pointer to an element refers to an +element of this slice:

+ +
let a = [1, 2, 3];
+let x = &a[1] as *const _;
+let y = &5 as *const _;
+
+assert!(a.as_ptr_range().contains(&x));
+assert!(!a.as_ptr_range().contains(&y));
+
1.48.0 · source

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

+

The returned range is half-open, which means that the end pointer +points one past the last element of the slice. This way, an empty +slice is represented by two equal pointers, and the difference between +the two pointers represents the size of the slice.

+

See as_mut_ptr for warnings on using these pointers. The end +pointer requires extra caution, as it does not point to a valid element +in the slice.

+

This function is useful for interacting with foreign interfaces which +use two pointers to refer to a range of elements in memory, as is +common in C++.

+
1.0.0 · source

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

+

If a equals to b, it’s guaranteed that elements won’t change value.

+
§Arguments
+
    +
  • a - The index of the first element
  • +
  • b - The index of the second element
  • +
+
§Panics
+

Panics if a or b are out of bounds.

+
§Examples
+
let mut v = ["a", "b", "c", "d", "e"];
+v.swap(2, 4);
+assert!(v == ["a", "b", "e", "d", "c"]);
+
source

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

+

For a safe alternative see swap.

+
§Arguments
+
    +
  • a - The index of the first element
  • +
  • b - The index of the second element
  • +
+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior. +The caller has to ensure that a < self.len() and b < self.len().

+
§Examples
+
#![feature(slice_swap_unchecked)]
+
+let mut v = ["a", "b", "c", "d"];
+// SAFETY: we know that 1 and 3 are both indices of the slice
+unsafe { v.swap_unchecked(1, 3) };
+assert!(v == ["a", "d", "c", "b"]);
+
1.0.0 · source

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

+
§Examples
+
let mut v = [1, 2, 3];
+v.reverse();
+assert!(v == [3, 2, 1]);
+
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

+

The iterator yields all items from start to end.

+
§Examples
+
let x = &[1, 2, 4];
+let mut iterator = x.iter();
+
+assert_eq!(iterator.next(), Some(&1));
+assert_eq!(iterator.next(), Some(&2));
+assert_eq!(iterator.next(), Some(&4));
+assert_eq!(iterator.next(), None);
+
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

+

The iterator yields all items from start to end.

+
§Examples
+
let x = &mut [1, 2, 4];
+for elem in x.iter_mut() {
+    *elem += 2;
+}
+assert_eq!(x, &[3, 4, 6]);
+
1.0.0 · source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +size. The windows overlap. If the slice is shorter than +size, the iterator returns no values.

+
§Panics
+

Panics if size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.windows(3);
+assert_eq!(iter.next().unwrap(), &['l', 'o', 'r']);
+assert_eq!(iter.next().unwrap(), &['o', 'r', 'e']);
+assert_eq!(iter.next().unwrap(), &['r', 'e', 'm']);
+assert!(iter.next().is_none());
+

If the slice is shorter than size:

+ +
let slice = ['f', 'o', 'o'];
+let mut iter = slice.windows(4);
+assert!(iter.next().is_none());
+

There’s no windows_mut, as that existing would let safe code violate the +“only one &mut at a time to the same thing” rule. However, you can sometimes +use Cell::as_slice_of_cells in +conjunction with windows to accomplish something similar:

+ +
use std::cell::Cell;
+
+let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
+let slice = &mut array[..];
+let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
+for w in slice_of_cells.windows(3) {
+    Cell::swap(&w[0], &w[2]);
+}
+assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
+
1.0.0 · source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last chunk will not have length chunk_size.

+

See chunks_exact for a variant of this iterator that returns chunks of always exactly +chunk_size elements, and rchunks for the same iterator but starting at the end of the +slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.chunks(2);
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert_eq!(iter.next().unwrap(), &['m']);
+assert!(iter.next().is_none());
+
1.0.0 · source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last chunk will not have length chunk_size.

+

See chunks_exact_mut for a variant of this iterator that returns chunks of always +exactly chunk_size elements, and rchunks_mut for the same iterator but starting at +the end of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.chunks_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 3]);
+
1.31.0 · source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved +from the remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks.

+

See chunks for a variant of this iterator that also returns the remainder as a smaller +chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.chunks_exact(2);
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['m']);
+
1.31.0 · source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last up to chunk_size-1 elements will be omitted and can be +retrieved from the into_remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks_mut.

+

See chunks_mut for a variant of this iterator that also returns the remainder as a +smaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of +the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.chunks_exact_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 0]);
+
source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +assuming that there’s no remainder.

+
§Safety
+

This may only be called when

+
    +
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • +
  • N != 0.
  • +
+
§Examples
+
#![feature(slice_as_chunks)]
+let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
+let chunks: &[[char; 1]] =
+    // SAFETY: 1-element chunks never have remainder
+    unsafe { slice.as_chunks_unchecked() };
+assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
+let chunks: &[[char; 3]] =
+    // SAFETY: The slice length (6) is a multiple of 3
+    unsafe { slice.as_chunks_unchecked() };
+assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
+
+// These would be unsound:
+// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
+// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
+
source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the beginning of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let (chunks, remainder) = slice.as_chunks();
+assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
+assert_eq!(remainder, &['m']);
+

If you expect the slice to be an exact multiple, you can combine +let-else with an empty slice pattern:

+ +
#![feature(slice_as_chunks)]
+let slice = ['R', 'u', 's', 't'];
+let (chunks, []) = slice.as_chunks::<2>() else {
+    panic!("slice didn't have even length")
+};
+assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
+
source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the end of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let (remainder, chunks) = slice.as_rchunks();
+assert_eq!(remainder, &['l']);
+assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
+
source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are array references and do not overlap. If N does not divide the +length of the slice, then the last up to N-1 elements will be omitted and can be +retrieved from the remainder function of the iterator.

+

This method is the const generic equivalent of chunks_exact.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.array_chunks();
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['m']);
+
source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( + &mut self, +) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +assuming that there’s no remainder.

+
§Safety
+

This may only be called when

+
    +
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • +
  • N != 0.
  • +
+
§Examples
+
#![feature(slice_as_chunks)]
+let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
+let chunks: &mut [[char; 1]] =
+    // SAFETY: 1-element chunks never have remainder
+    unsafe { slice.as_chunks_unchecked_mut() };
+chunks[0] = ['L'];
+assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);
+let chunks: &mut [[char; 3]] =
+    // SAFETY: The slice length (6) is a multiple of 3
+    unsafe { slice.as_chunks_unchecked_mut() };
+chunks[1] = ['a', 'x', '?'];
+assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);
+
+// These would be unsound:
+// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
+// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
+
source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the beginning of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+let (chunks, remainder) = v.as_chunks_mut();
+remainder[0] = 9;
+for chunk in chunks {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 9]);
+
source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the end of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+let (remainder, chunks) = v.as_rchunks_mut();
+remainder[0] = 9;
+for chunk in chunks {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[9, 1, 1, 2, 2]);
+
source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable array references and do not overlap. If N does not divide +the length of the slice, then the last up to N-1 elements will be omitted and +can be retrieved from the into_remainder function of the iterator.

+

This method is the const generic equivalent of chunks_exact_mut.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.array_chunks_mut() {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 0]);
+
source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +starting at the beginning of the slice.

+

This is the const generic equivalent of windows.

+

If N is greater than the size of the slice, it will return no windows.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_windows)]
+let slice = [0, 1, 2, 3];
+let mut iter = slice.array_windows();
+assert_eq!(iter.next().unwrap(), &[0, 1]);
+assert_eq!(iter.next().unwrap(), &[1, 2]);
+assert_eq!(iter.next().unwrap(), &[2, 3]);
+assert!(iter.next().is_none());
+
1.31.0 · source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last chunk will not have length chunk_size.

+

See rchunks_exact for a variant of this iterator that returns chunks of always exactly +chunk_size elements, and chunks for the same iterator but starting at the beginning +of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.rchunks(2);
+assert_eq!(iter.next().unwrap(), &['e', 'm']);
+assert_eq!(iter.next().unwrap(), &['o', 'r']);
+assert_eq!(iter.next().unwrap(), &['l']);
+assert!(iter.next().is_none());
+
1.31.0 · source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last chunk will not have length chunk_size.

+

See rchunks_exact_mut for a variant of this iterator that returns chunks of always +exactly chunk_size elements, and chunks_mut for the same iterator but starting at the +beginning of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.rchunks_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[3, 2, 2, 1, 1]);
+
1.31.0 · source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +end of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved +from the remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of rchunks.

+

See rchunks for a variant of this iterator that also returns the remainder as a smaller +chunk, and chunks_exact for the same iterator but starting at the beginning of the +slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.rchunks_exact(2);
+assert_eq!(iter.next().unwrap(), &['e', 'm']);
+assert_eq!(iter.next().unwrap(), &['o', 'r']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['l']);
+
1.31.0 · source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last up to chunk_size-1 elements will be omitted and can be +retrieved from the into_remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks_mut.

+

See rchunks_mut for a variant of this iterator that also returns the remainder as a +smaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning +of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.rchunks_exact_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[0, 2, 2, 1, 1]);
+
1.77.0 · source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs +of elements using the predicate to separate them.

+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
+
+let mut iter = slice.chunk_by(|a, b| a == b);
+
+assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
+assert_eq!(iter.next(), Some(&[3, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
+assert_eq!(iter.next(), None);
+

This method can be used to extract the sorted subslices:

+ +
let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
+
+let mut iter = slice.chunk_by(|a, b| a <= b);
+
+assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
+assert_eq!(iter.next(), None);
+
1.77.0 · source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable +runs of elements using the predicate to separate them.

+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
+
+let mut iter = slice.chunk_by_mut(|a, b| a == b);
+
+assert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));
+assert_eq!(iter.next(), Some(&mut [3, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 2, 2][..]));
+assert_eq!(iter.next(), None);
+

This method can be used to extract the sorted subslices:

+ +
let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
+
+let mut iter = slice.chunk_by_mut(|a, b| a <= b);
+
+assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));
+assert_eq!(iter.next(), None);
+
1.0.0 · source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_checked.

+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
+
+{
+   let (left, right) = v.split_at(0);
+   assert_eq!(left, []);
+   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_at(2);
+    assert_eq!(left, [1, 2]);
+    assert_eq!(right, [3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_at(6);
+    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, []);
+}
+
1.0.0 · source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_mut_checked.

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+let (left, right) = v.split_at_mut(2);
+assert_eq!(left, [1, 0]);
+assert_eq!(right, [3, 0, 5, 6]);
+left[1] = 2;
+right[1] = 4;
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
1.79.0 · source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+

For a safe alternative see split_at.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used. The caller has to ensure that +0 <= mid <= self.len().

+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
+
+unsafe {
+   let (left, right) = v.split_at_unchecked(0);
+   assert_eq!(left, []);
+   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+}
+
+unsafe {
+    let (left, right) = v.split_at_unchecked(2);
+    assert_eq!(left, [1, 2]);
+    assert_eq!(right, [3, 4, 5, 6]);
+}
+
+unsafe {
+    let (left, right) = v.split_at_unchecked(6);
+    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, []);
+}
+
1.79.0 · source

pub unsafe fn split_at_mut_unchecked( + &mut self, + mid: usize, +) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+

For a safe alternative see split_at_mut.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used. The caller has to ensure that +0 <= mid <= self.len().

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+// scoped to restrict the lifetime of the borrows
+unsafe {
+    let (left, right) = v.split_at_mut_unchecked(2);
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
+}
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
1.80.0 · source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
let v = [1, -2, 3, -4, 5, -6];
+
+{
+   let (left, right) = v.split_at_checked(0).unwrap();
+   assert_eq!(left, []);
+   assert_eq!(right, [1, -2, 3, -4, 5, -6]);
+}
+
+{
+    let (left, right) = v.split_at_checked(2).unwrap();
+    assert_eq!(left, [1, -2]);
+    assert_eq!(right, [3, -4, 5, -6]);
+}
+
+{
+    let (left, right) = v.split_at_checked(6).unwrap();
+    assert_eq!(left, [1, -2, 3, -4, 5, -6]);
+    assert_eq!(right, []);
+}
+
+assert_eq!(None, v.split_at_checked(7));
+
1.80.0 · source

pub fn split_at_mut_checked( + &mut self, + mid: usize, +) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the +slice is too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+
+if let Some((left, right)) = v.split_at_mut_checked(2) {
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
+}
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
+assert_eq!(None, v.split_at_mut_checked(7));
+
1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred. The matched element is not contained in the subslices.

+
§Examples
+
let slice = [10, 40, 33, 20];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+

If the first element is matched, an empty slice will be the first item +returned by the iterator. Similarly, if the last element in the slice +is matched, an empty slice will be the last item returned by the +iterator:

+ +
let slice = [10, 40, 33];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40]);
+assert_eq!(iter.next().unwrap(), &[]);
+assert!(iter.next().is_none());
+

If two matched elements are directly adjacent, an empty slice will be +present between them:

+ +
let slice = [10, 6, 33, 20];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10]);
+assert_eq!(iter.next().unwrap(), &[]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+
1.0.0 · source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred. The matched element is not contained in the subslices.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.split_mut(|num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(v, [1, 40, 30, 1, 60, 1]);
+
1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred. The matched element is contained in the end of the previous +subslice as a terminator.

+
§Examples
+
let slice = [10, 40, 33, 20];
+let mut iter = slice.split_inclusive(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+

If the last element of the slice is matched, +that element will be considered the terminator of the preceding slice. +That slice will be the last item returned by the iterator.

+ +
let slice = [3, 10, 40, 33];
+let mut iter = slice.split_inclusive(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[3]);
+assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
+assert!(iter.next().is_none());
+
1.51.0 · source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred. The matched element is contained in the previous +subslice as a terminator.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.split_inclusive_mut(|num| *num % 3 == 0) {
+    let terminator_idx = group.len()-1;
+    group[terminator_idx] = 1;
+}
+assert_eq!(v, [10, 40, 1, 20, 1, 1]);
+
1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred, starting at the end of the slice and working backwards. +The matched element is not contained in the subslices.

+
§Examples
+
let slice = [11, 22, 33, 0, 44, 55];
+let mut iter = slice.rsplit(|num| *num == 0);
+
+assert_eq!(iter.next().unwrap(), &[44, 55]);
+assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
+assert_eq!(iter.next(), None);
+

As with split(), if the first or last element is matched, an empty +slice will be the first (or last) item returned by the iterator.

+ +
let v = &[0, 1, 1, 2, 3, 5, 8];
+let mut it = v.rsplit(|n| *n % 2 == 0);
+assert_eq!(it.next().unwrap(), &[]);
+assert_eq!(it.next().unwrap(), &[3, 5]);
+assert_eq!(it.next().unwrap(), &[1, 1]);
+assert_eq!(it.next().unwrap(), &[]);
+assert_eq!(it.next(), None);
+
1.27.0 · source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred, starting at the end of the slice and working +backwards. The matched element is not contained in the subslices.

+
§Examples
+
let mut v = [100, 400, 300, 200, 600, 500];
+
+let mut count = 0;
+for group in v.rsplit_mut(|num| *num % 3 == 0) {
+    count += 1;
+    group[0] = count;
+}
+assert_eq!(v, [3, 400, 300, 2, 600, 1]);
+
1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred, limited to returning at most n items. The matched element is +not contained in the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], +[20, 60, 50]):

+ +
let v = [10, 40, 30, 20, 60, 50];
+
+for group in v.splitn(2, |num| *num % 3 == 0) {
+    println!("{group:?}");
+}
+
1.0.0 · source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match +pred, limited to returning at most n items. The matched element is +not contained in the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.splitn_mut(2, |num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(v, [1, 40, 30, 1, 60, 50]);
+
1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred limited to returning at most n items. This starts at the end of +the slice and works backwards. The matched element is not contained in +the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+

Print the slice split once, starting from the end, by numbers divisible +by 3 (i.e., [50], [10, 40, 30, 20]):

+ +
let v = [10, 40, 30, 20, 60, 50];
+
+for group in v.rsplitn(2, |num| *num % 3 == 0) {
+    println!("{group:?}");
+}
+
1.0.0 · source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred limited to returning at most n items. This starts at the end of +the slice and works backwards. The matched element is not contained in +the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+
let mut s = [10, 40, 30, 20, 60, 50];
+
+for group in s.rsplitn_mut(2, |num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(s, [1, 40, 30, 20, 60, 1]);
+
source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where + F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified +predicate.

+

If any matching elements are present in the slice, returns the prefix +before the match and suffix after. The matching element itself is not +included. If no elements match, returns None.

+
§Examples
+
#![feature(slice_split_once)]
+let s = [1, 2, 3, 2, 4];
+assert_eq!(s.split_once(|&x| x == 2), Some((
+    &[1][..],
+    &[3, 2, 4][..]
+)));
+assert_eq!(s.split_once(|&x| x == 0), None);
+
source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where + F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified +predicate.

+

If any matching elements are present in the slice, returns the prefix +before the match and suffix after. The matching element itself is not +included. If no elements match, returns None.

+
§Examples
+
#![feature(slice_split_once)]
+let s = [1, 2, 3, 2, 4];
+assert_eq!(s.rsplit_once(|&x| x == 2), Some((
+    &[1, 2, 3][..],
+    &[4][..]
+)));
+assert_eq!(s.rsplit_once(|&x| x == 0), None);
+
1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where + T: PartialEq,

Returns true if the slice contains an element with the given value.

+

This operation is O(n).

+

Note that if you have a sorted slice, binary_search may be faster.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.contains(&30));
+assert!(!v.contains(&50));
+

If you do not have a &T, but some other value that you can compare +with one (for example, String implements PartialEq<str>), you can +use iter().any:

+ +
let v = [String::from("hello"), String::from("world")]; // slice of `String`
+assert!(v.iter().any(|e| e == "hello")); // search with `&str`
+assert!(!v.iter().any(|e| e == "hi"));
+
1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.starts_with(&[10]));
+assert!(v.starts_with(&[10, 40]));
+assert!(v.starts_with(&v));
+assert!(!v.starts_with(&[50]));
+assert!(!v.starts_with(&[10, 50]));
+

Always returns true if needle is an empty slice:

+ +
let v = &[10, 40, 30];
+assert!(v.starts_with(&[]));
+let v: &[u8] = &[];
+assert!(v.starts_with(&[]));
+
1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.ends_with(&[30]));
+assert!(v.ends_with(&[40, 30]));
+assert!(v.ends_with(&v));
+assert!(!v.ends_with(&[50]));
+assert!(!v.ends_with(&[50, 30]));
+

Always returns true if needle is an empty slice:

+ +
let v = &[10, 40, 30];
+assert!(v.ends_with(&[]));
+let v: &[u8] = &[];
+assert!(v.ends_with(&[]));
+
1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where + P: SlicePattern<Item = T> + ?Sized, + T: PartialEq,

Returns a subslice with the prefix removed.

+

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. +If prefix is empty, simply returns the original slice. If prefix is equal to the +original slice, returns an empty slice.

+

If the slice does not start with prefix, returns None.

+
§Examples
+
let v = &[10, 40, 30];
+assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
+assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
+assert_eq!(v.strip_prefix(&[10, 40, 30]), Some(&[][..]));
+assert_eq!(v.strip_prefix(&[50]), None);
+assert_eq!(v.strip_prefix(&[10, 50]), None);
+
+let prefix : &str = "he";
+assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
+           Some(b"llo".as_ref()));
+
1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where + P: SlicePattern<Item = T> + ?Sized, + T: PartialEq,

Returns a subslice with the suffix removed.

+

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. +If suffix is empty, simply returns the original slice. If suffix is equal to the +original slice, returns an empty slice.

+

If the slice does not end with suffix, returns None.

+
§Examples
+
let v = &[10, 40, 30];
+assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
+assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
+assert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..]));
+assert_eq!(v.strip_suffix(&[50]), None);
+assert_eq!(v.strip_suffix(&[50, 30]), None);
+

Binary searches this slice for a given element. +If the slice is not sorted, the returned result is unspecified and +meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search_by, binary_search_by_key, and partition_point.

+
§Examples
+

Looks up a series of four elements. The first is found, with a +uniquely determined position; the second and third are not +found; the fourth could match any position in [1, 4].

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+assert_eq!(s.binary_search(&13),  Ok(9));
+assert_eq!(s.binary_search(&4),   Err(7));
+assert_eq!(s.binary_search(&100), Err(13));
+let r = s.binary_search(&1);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+

If you want to find that whole range of matching items, rather than +an arbitrary matching one, that can be done using partition_point:

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+let low = s.partition_point(|x| x < &1);
+assert_eq!(low, 1);
+let high = s.partition_point(|x| x <= &1);
+assert_eq!(high, 5);
+let r = s.binary_search(&1);
+assert!((low..high).contains(&r.unwrap()));
+
+assert!(s[..low].iter().all(|&x| x < 1));
+assert!(s[low..high].iter().all(|&x| x == 1));
+assert!(s[high..].iter().all(|&x| x > 1));
+
+// For something not found, the "range" of equal items is empty
+assert_eq!(s.partition_point(|x| x < &11), 9);
+assert_eq!(s.partition_point(|x| x <= &11), 9);
+assert_eq!(s.binary_search(&11), Err(9));
+

If you want to insert an item to a sorted vector, while maintaining +sort order, consider using partition_point:

+ +
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+let num = 42;
+let idx = s.partition_point(|&x| x <= num);
+// If `num` is unique, `s.partition_point(|&x| x < num)` (with `<`) is equivalent to
+// `s.binary_search(&num).unwrap_or_else(|x| x)`, but using `<=` will allow `insert`
+// to shift less elements.
+s.insert(idx, num);
+assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where + F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

+

The comparator function should return an order code that indicates +whether its argument is Less, Equal or Greater the desired +target. +If the slice is not sorted or if the comparator function does not +implement an order consistent with the sort order of the underlying +slice, the returned result is unspecified and meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search, binary_search_by_key, and partition_point.

+
§Examples
+

Looks up a series of four elements. The first is found, with a +uniquely determined position; the second and third are not +found; the fourth could match any position in [1, 4].

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+let seek = 13;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
+let seek = 4;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
+let seek = 100;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
+let seek = 1;
+let r = s.binary_search_by(|probe| probe.cmp(&seek));
+assert!(match r { Ok(1..=4) => true, _ => false, });
+
1.10.0 · source

pub fn binary_search_by_key<'a, B, F>( + &'a self, + b: &B, + f: F, +) -> Result<usize, usize>
where + F: FnMut(&'a T) -> B, + B: Ord,

Binary searches this slice with a key extraction function.

+

Assumes that the slice is sorted by the key, for instance with +sort_by_key using the same key extraction function. +If the slice is not sorted by the key, the returned result is +unspecified and meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search, binary_search_by, and partition_point.

+
§Examples
+

Looks up a series of four elements in a slice of pairs sorted by +their second elements. The first is found, with a uniquely +determined position; the second and third are not found; the +fourth could match any position in [1, 4].

+ +
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
+         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
+         (1, 21), (2, 34), (4, 55)];
+
+assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
+assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
+assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
+let r = s.binary_search_by_key(&1, |&(a, b)| b);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+
1.20.0 · source

pub fn sort_unstable(&mut self)
where + T: Ord,

Sorts the slice without preserving the initial order of equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

If T: Ord does not implement a total order the resulting order is unspecified. All +original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if T: Ord panics.

+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5, 4, 1, -3, 2];
+
+v.sort_unstable();
+assert!(v == [-5, -3, 1, 2, 4]);
+
1.20.0 · source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where + F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, without preserving the initial order of +equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

The comparator function should define a total ordering for the elements in the slice. If the +ordering is not total, the order of the elements is unspecified.

+

If the comparator function does not implement a total order the resulting order is +unspecified. All original elements will remain in the slice and any possible modifications +via interior mutability are observed in the input. Same is true if the comparator function +panics. A total order (for all a, b and c):

+
    +
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • +
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • +
+

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use +partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

+ +
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
+floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
+assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [5, 4, 1, 3, 2];
+v.sort_unstable_by(|a, b| a.cmp(b));
+assert!(v == [1, 2, 3, 4, 5]);
+
+// reverse sorting
+v.sort_unstable_by(|a, b| b.cmp(a));
+assert!(v == [5, 4, 3, 2, 1]);
+
1.20.0 · source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of +equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If K: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+v.sort_unstable_by_key(|k| k.abs());
+assert!(v == [1, 2, -3, 4, -5]);
+
1.49.0 · source

pub fn select_nth_unstable( + &mut self, + index: usize, +) -> (&mut [T], &mut T, &mut [T])
where + T: Ord,

Reorder the slice such that the element at index after the reordering is at its final +sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index. Additionally, this reordering is +unstable (i.e. any number of equal elements may end up at position index), in-place (i.e. +does not allocate), and runs in O(n) time. This function is also known as “kth element” +in other libraries.

+

It returns a triplet of the following from the reordered slice: the subslice prior to +index, the element at index, and the subslice after index; accordingly, the values in +those two subslices will respectively all be less-than-or-equal-to and +greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median.
+let (lesser, median, greater) = v.select_nth_unstable(2);
+
+assert!(lesser == [-3, -5] || lesser == [-5, -3]);
+assert_eq!(median, &mut 1);
+assert!(greater == [4, 2] || greater == [2, 4]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [-3, -5, 1, 2, 4] ||
+        v == [-5, -3, 1, 2, 4] ||
+        v == [-3, -5, 1, 4, 2] ||
+        v == [-5, -3, 1, 4, 2]);
+
1.49.0 · source

pub fn select_nth_unstable_by<F>( + &mut self, + index: usize, + compare: F, +) -> (&mut [T], &mut T, &mut [T])
where + F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index after the +reordering is at its final sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index using the comparator function. +Additionally, this reordering is unstable (i.e. any number of equal elements may end up at +position index), in-place (i.e. does not allocate), and runs in O(n) time. This +function is also known as “kth element” in other libraries.

+

It returns a triplet of the following from the slice reordered according to the provided +comparator function: the subslice prior to index, the element at index, and the subslice +after index; accordingly, the values in those two subslices will respectively all be +less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted in descending order.
+let (lesser, median, greater) = v.select_nth_unstable_by(2, |a, b| b.cmp(a));
+
+assert!(lesser == [4, 2] || lesser == [2, 4]);
+assert_eq!(median, &mut 1);
+assert!(greater == [-3, -5] || greater == [-5, -3]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [2, 4, 1, -5, -3] ||
+        v == [2, 4, 1, -3, -5] ||
+        v == [4, 2, 1, -5, -3] ||
+        v == [4, 2, 1, -3, -5]);
+
1.49.0 · source

pub fn select_nth_unstable_by_key<K, F>( + &mut self, + index: usize, + f: F, +) -> (&mut [T], &mut T, &mut [T])
where + F: FnMut(&T) -> K, + K: Ord,

Reorder the slice with a key extraction function such that the element at index after the +reordering is at its final sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index using the key extraction function. +Additionally, this reordering is unstable (i.e. any number of equal elements may end up at +position index), in-place (i.e. does not allocate), and runs in O(n) time. This +function is also known as “kth element” in other libraries.

+

It returns a triplet of the following from the slice reordered according to the provided key +extraction function: the subslice prior to index, the element at index, and the subslice +after index; accordingly, the values in those two subslices will respectively all be +less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted according to absolute value.
+let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
+
+assert!(lesser == [1, 2] || lesser == [2, 1]);
+assert_eq!(median, &mut -3);
+assert!(greater == [4, -5] || greater == [-5, 4]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [1, 2, -3, 4, -5] ||
+        v == [1, 2, -3, -5, 4] ||
+        v == [2, 1, -3, 4, -5] ||
+        v == [2, 1, -3, -5, 4]);
+
source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where + T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the +PartialEq trait implementation.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = [1, 2, 2, 3, 3, 2, 1, 1];
+
+let (dedup, duplicates) = slice.partition_dedup();
+
+assert_eq!(dedup, [1, 2, 3, 2, 1]);
+assert_eq!(duplicates, [2, 3, 1]);
+
source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where + F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying +a given equality relation.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

The same_bucket function is passed references to two elements from the slice and +must determine if the elements compare equal. The elements are passed in opposite order +from their order in the slice, so if same_bucket(a, b) returns true, a is moved +at the end of the slice.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"];
+
+let (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b));
+
+assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]);
+assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
+
source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where + F: FnMut(&mut T) -> K, + K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve +to the same key.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = [10, 20, 21, 30, 30, 20, 11, 13];
+
+let (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10);
+
+assert_eq!(dedup, [10, 20, 30, 20, 11]);
+assert_eq!(duplicates, [21, 30, 13]);
+
1.26.0 · source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +slice move to the end while the last self.len() - mid elements move to +the front. After calling rotate_left, the element previously at index +mid will become the first element in the slice.

+
§Panics
+

This function will panic if mid is greater than the length of the +slice. Note that mid == self.len() does not panic and is a no-op +rotation.

+
§Complexity
+

Takes linear (in self.len()) time.

+
§Examples
+
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a.rotate_left(2);
+assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
+

Rotating a subslice:

+ +
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a[1..5].rotate_left(1);
+assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
+
1.26.0 · source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +elements of the slice move to the end while the last k elements move +to the front. After calling rotate_right, the element previously at +index self.len() - k will become the first element in the slice.

+
§Panics
+

This function will panic if k is greater than the length of the +slice. Note that k == self.len() does not panic and is a no-op +rotation.

+
§Complexity
+

Takes linear (in self.len()) time.

+
§Examples
+
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a.rotate_right(2);
+assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
+

Rotating a subslice:

+ +
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a[1..5].rotate_right(1);
+assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
+
1.50.0 · source

pub fn fill(&mut self, value: T)
where + T: Clone,

Fills self with elements by cloning value.

+
§Examples
+
let mut buf = vec![0; 10];
+buf.fill(1);
+assert_eq!(buf, vec![1; 10]);
+
1.51.0 · source

pub fn fill_with<F>(&mut self, f: F)
where + F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

+

This method uses a closure to create new values. If you’d rather +Clone a given value, use fill. If you want to use the Default +trait to generate values, you can pass Default::default as the +argument.

+
§Examples
+
let mut buf = vec![1; 10];
+buf.fill_with(Default::default);
+assert_eq!(buf, vec![0; 10]);
+
1.7.0 · source

pub fn clone_from_slice(&mut self, src: &[T])
where + T: Clone,

Copies the elements from src into self.

+

The length of src must be the same as self.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Examples
+

Cloning two elements from a slice into another:

+ +
let src = [1, 2, 3, 4];
+let mut dst = [0, 0];
+
+// Because the slices have to be the same length,
+// we slice the source slice from four elements
+// to two. It will panic if we don't do this.
+dst.clone_from_slice(&src[2..]);
+
+assert_eq!(src, [1, 2, 3, 4]);
+assert_eq!(dst, [3, 4]);
+

Rust enforces that there can only be one mutable reference with no +immutable references to a particular piece of data in a particular +scope. Because of this, attempting to use clone_from_slice on a +single slice will result in a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+slice[..2].clone_from_slice(&slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.clone_from_slice(&right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 4, 5]);
+
1.9.0 · source

pub fn copy_from_slice(&mut self, src: &[T])
where + T: Copy,

Copies all elements from src into self, using a memcpy.

+

The length of src must be the same as self.

+

If T does not implement Copy, use clone_from_slice.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Examples
+

Copying two elements from a slice into another:

+ +
let src = [1, 2, 3, 4];
+let mut dst = [0, 0];
+
+// Because the slices have to be the same length,
+// we slice the source slice from four elements
+// to two. It will panic if we don't do this.
+dst.copy_from_slice(&src[2..]);
+
+assert_eq!(src, [1, 2, 3, 4]);
+assert_eq!(dst, [3, 4]);
+

Rust enforces that there can only be one mutable reference with no +immutable references to a particular piece of data in a particular +scope. Because of this, attempting to use copy_from_slice on a +single slice will result in a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+slice[..2].copy_from_slice(&slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.copy_from_slice(&right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 4, 5]);
+
1.37.0 · source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where + R: RangeBounds<usize>, + T: Copy,

Copies elements from one part of the slice to another part of itself, +using a memmove.

+

src is the range within self to copy from. dest is the starting +index of the range within self to copy to, which will have the same +length as src. The two ranges may overlap. The ends of the two ranges +must be less than or equal to self.len().

+
§Panics
+

This function will panic if either range exceeds the end of the slice, +or if the end of src is before the start.

+
§Examples
+

Copying four bytes within a slice:

+ +
let mut bytes = *b"Hello, World!";
+
+bytes.copy_within(1..5, 8);
+
+assert_eq!(&bytes, b"Hello, Wello!");
+
1.27.0 · source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+

The length of other must be the same as self.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Example
+

Swapping two elements across slices:

+ +
let mut slice1 = [0, 0];
+let mut slice2 = [1, 2, 3, 4];
+
+slice1.swap_with_slice(&mut slice2[2..]);
+
+assert_eq!(slice1, [3, 4]);
+assert_eq!(slice2, [1, 2, 0, 0]);
+

Rust enforces that there can only be one mutable reference to a +particular piece of data in a particular scope. Because of this, +attempting to use swap_with_slice on a single slice will result in +a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +mutable sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.swap_with_slice(&mut right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 1, 2]);
+
1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is +maintained.

+

This method splits the slice into three distinct slices: prefix, correctly aligned middle +slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

+

This method has no purpose when either input element T or output element U are +zero-sized and will return the original slice without splitting anything.

+
§Safety
+

This method is essentially a transmute with respect to the elements in the returned +middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

+
§Examples
+

Basic usage:

+ +
unsafe {
+    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
+    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
+    // less_efficient_algorithm_for_bytes(prefix);
+    // more_efficient_algorithm_for_aligned_shorts(shorts);
+    // less_efficient_algorithm_for_bytes(suffix);
+}
+
1.30.0 · source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the +types is maintained.

+

This method splits the slice into three distinct slices: prefix, correctly aligned middle +slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

+

This method has no purpose when either input element T or output element U are +zero-sized and will return the original slice without splitting anything.

+
§Safety
+

This method is essentially a transmute with respect to the elements in the returned +middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

+
§Examples
+

Basic usage:

+ +
unsafe {
+    let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
+    let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();
+    // less_efficient_algorithm_for_bytes(prefix);
+    // more_efficient_algorithm_for_aligned_shorts(shorts);
+    // less_efficient_algorithm_for_bytes(suffix);
+}
+
source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where + Simd<T, LANES>: AsRef<[T; LANES]>, + T: SimdElement, + LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

+

This is a safe wrapper around slice::align_to, so has the same weak +postconditions as that method. You’re only assured that +self.len() == prefix.len() + middle.len() * LANES + suffix.len().

+

Notably, all of the following are possible:

+
    +
  • prefix.len() >= LANES.
  • +
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • +
  • suffix.len() >= LANES.
  • +
+

That said, this is a safe method, so if you’re only writing safe code, +then this can at most cause incorrect logic, not unsoundness.

+
§Panics
+

This will panic if the size of the SIMD type is different from +LANES times that of the scalar.

+

At the time of writing, the trait restrictions on Simd<T, LANES> keeps +that from ever happening, as only power-of-two numbers of lanes are +supported. It’s possible that, in the future, those restrictions might +be lifted in a way that would make it possible to see panics from this +method for something like LANES == 3.

+
§Examples
+
#![feature(portable_simd)]
+use core::simd::prelude::*;
+
+let short = &[1, 2, 3];
+let (prefix, middle, suffix) = short.as_simd::<4>();
+assert_eq!(middle, []); // Not enough elements for anything in the middle
+
+// They might be split in any possible way between prefix and suffix
+let it = prefix.iter().chain(suffix).copied();
+assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
+
+fn basic_simd_sum(x: &[f32]) -> f32 {
+    use std::ops::Add;
+    let (prefix, middle, suffix) = x.as_simd();
+    let sums = f32x4::from_array([
+        prefix.iter().copied().sum(),
+        0.0,
+        0.0,
+        suffix.iter().copied().sum(),
+    ]);
+    let sums = middle.iter().copied().fold(sums, f32x4::add);
+    sums.reduce_sum()
+}
+
+let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
+assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
+
source

pub fn as_simd_mut<const LANES: usize>( + &mut self, +) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where + Simd<T, LANES>: AsMut<[T; LANES]>, + T: SimdElement, + LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a mutable slice into a mutable prefix, a middle of aligned SIMD types, +and a mutable suffix.

+

This is a safe wrapper around slice::align_to_mut, so has the same weak +postconditions as that method. You’re only assured that +self.len() == prefix.len() + middle.len() * LANES + suffix.len().

+

Notably, all of the following are possible:

+
    +
  • prefix.len() >= LANES.
  • +
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • +
  • suffix.len() >= LANES.
  • +
+

That said, this is a safe method, so if you’re only writing safe code, +then this can at most cause incorrect logic, not unsoundness.

+

This is the mutable version of slice::as_simd; see that for examples.

+
§Panics
+

This will panic if the size of the SIMD type is different from +LANES times that of the scalar.

+

At the time of writing, the trait restrictions on Simd<T, LANES> keeps +that from ever happening, as only power-of-two numbers of lanes are +supported. It’s possible that, in the future, those restrictions might +be lifted in a way that would make it possible to see panics from this +method for something like LANES == 3.

+
source

pub fn is_sorted(&self) -> bool
where + T: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

+

That is, for each element a and its following element b, a <= b must hold. If the +slice yields exactly zero or one element, true is returned.

+

Note that if Self::Item is only PartialOrd, but not Ord, the above definition +implies that this function returns false if any two consecutive items are not +comparable.

+
§Examples
+
#![feature(is_sorted)]
+let empty: [i32; 0] = [];
+
+assert!([1, 2, 2, 9].is_sorted());
+assert!(![1, 3, 2, 4].is_sorted());
+assert!([0].is_sorted());
+assert!(empty.is_sorted());
+assert!(![0.0, 1.0, f32::NAN].is_sorted());
+
source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where + F: FnMut(&'a T, &'a T) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

+

Instead of using PartialOrd::partial_cmp, this function uses the given compare +function to determine whether two elements are to be considered in sorted order.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!([1, 2, 2, 9].is_sorted_by(|a, b| a <= b));
+assert!(![1, 2, 2, 9].is_sorted_by(|a, b| a < b));
+
+assert!([0].is_sorted_by(|a, b| true));
+assert!([0].is_sorted_by(|a, b| false));
+
+let empty: [i32; 0] = [];
+assert!(empty.is_sorted_by(|a, b| false));
+assert!(empty.is_sorted_by(|a, b| true));
+
source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where + F: FnMut(&'a T) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

+

Instead of comparing the slice’s elements directly, this function compares the keys of the +elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its +documentation for more information.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
+assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
+
1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where + P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate +(the index of the first element of the second partition).

+

The slice is assumed to be partitioned according to the given predicate. +This means that all elements for which the predicate returns true are at the start of the slice +and all elements for which the predicate returns false are at the end. +For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 +(all odd numbers are at the start, all even at the end).

+

If this slice is not partitioned, the returned result is unspecified and meaningless, +as this method performs a kind of binary search.

+

See also binary_search, binary_search_by, and binary_search_by_key.

+
§Examples
+
let v = [1, 2, 3, 3, 5, 6, 7];
+let i = v.partition_point(|&x| x < 5);
+
+assert_eq!(i, 4);
+assert!(v[..i].iter().all(|&x| x < 5));
+assert!(v[i..].iter().all(|&x| !(x < 5)));
+

If all elements of the slice match the predicate, including if the slice +is empty, then the length of the slice will be returned:

+ +
let a = [2, 4, 8];
+assert_eq!(a.partition_point(|x| x < &100), a.len());
+let a: [i32; 0] = [];
+assert_eq!(a.partition_point(|x| x < &100), 0);
+

If you want to insert an item to a sorted vector, while maintaining +sort order:

+ +
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+let num = 42;
+let idx = s.partition_point(|&x| x <= num);
+s.insert(idx, num);
+assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where + R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range +and returns a reference to it.

+

Returns None and does not modify the slice if the given +range is out of bounds.

+

Note that this method only accepts one-sided ranges such as +2.. or ..6, but not 2..6.

+
§Examples
+

Taking the first three elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+let mut first_three = slice.take(..3).unwrap();
+
+assert_eq!(slice, &['d']);
+assert_eq!(first_three, &['a', 'b', 'c']);
+

Taking the last two elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+let mut tail = slice.take(2..).unwrap();
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(tail, &['c', 'd']);
+

Getting None when range is out of bounds:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+
+assert_eq!(None, slice.take(5..));
+assert_eq!(None, slice.take(..5));
+assert_eq!(None, slice.take(..=4));
+let expected: &[char] = &['a', 'b', 'c', 'd'];
+assert_eq!(Some(expected), slice.take(..4));
+
source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where + R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range +and returns a mutable reference to it.

+

Returns None and does not modify the slice if the given +range is out of bounds.

+

Note that this method only accepts one-sided ranges such as +2.. or ..6, but not 2..6.

+
§Examples
+

Taking the first three elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+let mut first_three = slice.take_mut(..3).unwrap();
+
+assert_eq!(slice, &mut ['d']);
+assert_eq!(first_three, &mut ['a', 'b', 'c']);
+

Taking the last two elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+let mut tail = slice.take_mut(2..).unwrap();
+
+assert_eq!(slice, &mut ['a', 'b']);
+assert_eq!(tail, &mut ['c', 'd']);
+

Getting None when range is out of bounds:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+
+assert_eq!(None, slice.take_mut(5..));
+assert_eq!(None, slice.take_mut(..5));
+assert_eq!(None, slice.take_mut(..=4));
+let expected: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+assert_eq!(Some(expected), slice.take_mut(..4));
+
source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c'];
+let first = slice.take_first().unwrap();
+
+assert_eq!(slice, &['b', 'c']);
+assert_eq!(first, &'a');
+
source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +reference to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
+let first = slice.take_first_mut().unwrap();
+*first = 'd';
+
+assert_eq!(slice, &['b', 'c']);
+assert_eq!(first, &'d');
+
source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c'];
+let last = slice.take_last().unwrap();
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(last, &'c');
+
source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +reference to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
+let last = slice.take_last_mut().unwrap();
+*last = 'd';
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(last, &'d');
+
source

pub unsafe fn get_many_unchecked_mut<const N: usize>( + &mut self, + indices: [usize; N], +) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

+

For a safe alternative see get_many_mut.

+
§Safety
+

Calling this method with overlapping or out-of-bounds indices is undefined behavior +even if the resulting references are not used.

+
§Examples
+
#![feature(get_many_mut)]
+
+let x = &mut [1, 2, 4];
+
+unsafe {
+    let [a, b] = x.get_many_unchecked_mut([0, 2]);
+    *a *= 10;
+    *b *= 100;
+}
+assert_eq!(x, &[10, 2, 400]);
+
source

pub fn get_many_mut<const N: usize>( + &mut self, + indices: [usize; N], +) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

+

Returns an error if any index is out-of-bounds, or if the same index was +passed more than once.

+
§Examples
+
#![feature(get_many_mut)]
+
+let v = &mut [1, 2, 3];
+if let Ok([a, b]) = v.get_many_mut([0, 2]) {
+    *a = 413;
+    *b = 612;
+}
+assert_eq!(v, &[413, 2, 612]);
+
1.0.0 · source

pub fn sort(&mut self)
where + T: Ord,

Sorts the slice, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) +worst-case.

+

If T: Ord does not implement a total order the resulting order is unspecified. All +original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if T: Ord panics.

+

When applicable, unstable sorting is preferred because it is generally faster than stable +sorting and it doesn’t allocate auxiliary memory. See +sort_unstable. The exception are partially sorted slices, which +may be better served with slice::sort.

+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5, 4, 1, -3, 2];
+
+v.sort();
+assert!(v == [-5, -3, 1, 2, 4]);
+
1.0.0 · source

pub fn sort_by<F>(&mut self, compare: F)
where + F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) +worst-case.

+

The comparator function should define a total ordering for the elements in the slice. If the +ordering is not total, the order of the elements is unspecified.

+

If the comparator function does not implement a total order the resulting order is +unspecified. All original elements will remain in the slice and any possible modifications +via interior mutability are observed in the input. Same is true if the comparator function +panics. A total order (for all a, b and c):

+
    +
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • +
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • +
+

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use +partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

+ +
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
+floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
+assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [5, 4, 1, 3, 2];
+v.sort_by(|a, b| a.cmp(b));
+assert!(v == [1, 2, 3, 4, 5]);
+
+// reverse sorting
+v.sort_by(|a, b| b.cmp(a));
+assert!(v == [5, 4, 3, 2, 1]);
+
1.7.0 · source

pub fn sort_by_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) +worst-case, where the key function is O(m).

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If K: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+v.sort_by_key(|k| k.abs());
+assert!(v == [1, 2, -3, 4, -5]);
+
1.34.0 · source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * +log(n)) worst-case, where the key function is O(m).

+

During sorting, the key function is called at most once per element, by using temporary +storage to remember the results of key evaluation. The order of calls to the key function is +unspecified and may change in future versions of the standard library.

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+

For simple key functions (e.g., functions that are property accesses or basic operations), +sort_by_key is likely to be faster.

+
§Current implementation
+

The current implementation is based on instruction-parallel-network sort by Lukas +Bergdoll, which combines the fast average case of randomized quicksort with the fast worst +case of heapsort, while achieving linear time on fully sorted and reversed inputs. And +O(k * log(n)) where k is the number of distinct elements in the input. It leverages +superscalar out-of-order execution capabilities commonly found in CPUs, to efficiently +perform the operation.

+

In the worst case, the algorithm allocates temporary storage in a Vec<(K, usize)> the +length of the slice.

+
§Examples
+
let mut v = [-5i32, 4, 32, -3, 2];
+
+v.sort_by_cached_key(|k| k.to_string());
+assert!(v == [-3, -5, 2, 32, 4]);
+
1.0.0 · source

pub fn to_vec(&self) -> Vec<T>
where + T: Clone,

Copies self into a new Vec.

+
§Examples
+
let s = [10, 40, 30];
+let x = s.to_vec();
+// Here, `s` and `x` can be modified independently.
+
source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where + A: Allocator, + T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::alloc::System;
+
+let s = [10, 40, 30];
+let x = s.to_vec_in(System);
+// Here, `s` and `x` can be modified independently.
+
1.40.0 · source

pub fn repeat(&self, n: usize) -> Vec<T>
where + T: Copy,

Creates a vector by copying a slice n times.

+
§Panics
+

This function will panic if the capacity would overflow.

+
§Examples
+

Basic usage:

+ +
assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
+

A panic upon overflow:

+ +
// this will panic at runtime
+b"0123456789abcdef".repeat(usize::MAX);
+
1.0.0 · source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where + [T]: Concat<Item>, + Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

+
§Examples
+
assert_eq!(["hello", "world"].concat(), "helloworld");
+assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
+
1.3.0 · source

pub fn join<Separator>( + &self, + sep: Separator, +) -> <[T] as Join<Separator>>::Output
where + [T]: Join<Separator>,

Flattens a slice of T into a single value Self::Output, placing a +given separator between each.

+
§Examples
+
assert_eq!(["hello", "world"].join(" "), "hello world");
+assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
+assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
+
1.0.0 · source

pub fn connect<Separator>( + &self, + sep: Separator, +) -> <[T] as Join<Separator>>::Output
where + [T]: Join<Separator>,

👎Deprecated since 1.3.0: renamed to join

Flattens a slice of T into a single value Self::Output, placing a +given separator between each.

+
§Examples
+
assert_eq!(["hello", "world"].connect(" "), "hello world");
+assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
+
1.23.0 · source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +is mapped to its ASCII upper case equivalent.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To uppercase the value in-place, use make_ascii_uppercase.

+
1.23.0 · source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +is mapped to its ASCII lower case equivalent.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To lowercase the value in-place, use make_ascii_lowercase.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Prefix

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Prefix

source§

fn clone(&self) -> Prefix

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Prefix

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Prefix

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Prefix

source§

fn default() -> Prefix

Returns the “default value” for a type. Read more
source§

impl DerefMut for Prefix

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Encode for Prefix

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<Prefix> for Vec<u8>

source§

fn from(val: Prefix) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Prefix

source§

fn from(v: Vec<u8>) -> Prefix

Converts to this type from the input type.
source§

impl Ord for Prefix

source§

fn cmp(&self, other: &Prefix) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Prefix

source§

fn eq(&self, other: &Prefix) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Prefix

source§

fn partial_cmp(&self, other: &Prefix) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Deref for Prefix

§

type Target = Vec<u8>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Eq for Prefix

source§

impl StructuralPartialEq for Prefix

Auto Trait Implementations§

§

impl Freeze for Prefix

§

impl RefUnwindSafe for Prefix

§

impl Send for Prefix

§

impl Sync for Prefix

§

impl Unpin for Prefix

§

impl UnwindSafe for Prefix

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/struct.Root.html b/rust/oasis_core_runtime/storage/mkvs/struct.Root.html new file mode 100644 index 0000000000..7112dc3181 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/struct.Root.html @@ -0,0 +1,41 @@ +Root in oasis_core_runtime::storage::mkvs - Rust

Struct oasis_core_runtime::storage::mkvs::Root

source ·
pub struct Root {
+    pub namespace: Namespace,
+    pub version: u64,
+    pub root_type: RootType,
+    pub hash: Hash,
+}
Expand description

Storage root.

+

Fields§

§namespace: Namespace

Namespace under which the root is stored.

+
§version: u64

Monotonically increasing version number in which the root is stored.

+
§root_type: RootType

The storage type that this root has data for.

+
§hash: Hash

Merkle root hash.

+

Trait Implementations§

source§

impl Clone for Root

source§

fn clone(&self) -> Root

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Root

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Root

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Root

source§

fn default() -> Root

Returns the “default value” for a type. Read more
source§

impl Encode for Root

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Root

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Root

source§

fn eq(&self, other: &Root) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Root

source§

impl Eq for Root

source§

impl StructuralPartialEq for Root

Auto Trait Implementations§

§

impl Freeze for Root

§

impl RefUnwindSafe for Root

§

impl Send for Root

§

impl Sync for Root

§

impl Unpin for Root

§

impl UnwindSafe for Root

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/struct.Tree.html b/rust/oasis_core_runtime/storage/mkvs/struct.Tree.html new file mode 100644 index 0000000000..62009e7983 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/struct.Tree.html @@ -0,0 +1,37 @@ +Tree in oasis_core_runtime::storage::mkvs - Rust

Struct oasis_core_runtime::storage::mkvs::Tree

source ·
pub struct Tree { /* private fields */ }
Expand description

A patricia tree-based MKVS implementation.

+

Implementations§

source§

impl Tree

source

pub fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash>

Commit tree updates to the underlying database and return +the write log and new merkle root.

+
source§

impl Tree

source

pub fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>>

Insert a key/value pair into the tree.

+
source§

impl Tree

source

pub fn iter(&self) -> TreeIterator<'_>

Return an iterator over the tree.

+
source§

impl Tree

source

pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Get an existing key.

+
source

pub fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>

source

pub fn cache_contains_key(&self, key: &[u8]) -> bool

Check if the key exists in the local cache.

+
source§

impl Tree

source

pub fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>

Populate the in-memory tree with nodes for keys starting with given prefixes.

+
source§

impl Tree

source

pub fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>

Remove entry with given key, returning the value at the key if the key was previously +in the database.

+
source§

impl Tree

source

pub fn new(read_syncer: Box<dyn ReadSync>, opts: &Options) -> Tree

Construct a new tree instance using the given read syncer and options struct.

+
source

pub fn builder() -> Builder

Return an builder struct to chain configuration calls on.

+

Trait Implementations§

source§

impl Debug for Tree

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl FallibleMKVS for Tree

source§

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Fetch entry with given key.
source§

fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>

Fetch proof for entry with given key.
source§

fn cache_contains_key(&self, key: &[u8]) -> bool

Check if the local MKVS cache contains the given key. Read more
source§

fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>>

Update entry with given key. Read more
source§

fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>

Remove entry with given key, returning the value at the key if the key was previously +in the database.
source§

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>

Populate the in-memory tree with nodes for keys starting with given prefixes.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash>

Commit all database changes to the underlying store.
source§

impl Send for Tree

Auto Trait Implementations§

§

impl !Freeze for Tree

§

impl !RefUnwindSafe for Tree

§

impl !Sync for Tree

§

impl Unpin for Tree

§

impl !UnwindSafe for Tree

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T> ImmutableMKVS for T
where + T: FallibleMKVS,

source§

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>

Fetch entry with given key.
source§

fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>, Error>

Fetch proof for entry with given key.
source§

fn prefetch_prefixes( + &self, + prefixes: &[Prefix], + limit: u16, +) -> Result<(), Error>

Populate the in-memory tree with nodes for keys starting with given prefixes.
source§

fn iter(&self) -> Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + '_>

Returns an iterator over the tree.
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/enum.SyncerError.html b/rust/oasis_core_runtime/storage/mkvs/sync/enum.SyncerError.html new file mode 100644 index 0000000000..ee6f8596e4 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/enum.SyncerError.html @@ -0,0 +1,23 @@ +SyncerError in oasis_core_runtime::storage::mkvs::sync - Rust

Enum oasis_core_runtime::storage::mkvs::sync::SyncerError

source ·
pub enum SyncerError {
+    Unsupported,
+}

Variants§

§

Unsupported

Trait Implementations§

source§

impl Debug for SyncerError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for SyncerError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for SyncerError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/errors/enum.SyncerError.html b/rust/oasis_core_runtime/storage/mkvs/sync/errors/enum.SyncerError.html new file mode 100644 index 0000000000..18526c8456 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/errors/enum.SyncerError.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/enum.SyncerError.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/fn.merge_verified_subtree.html b/rust/oasis_core_runtime/storage/mkvs/sync/fn.merge_verified_subtree.html new file mode 100644 index 0000000000..f9ca300947 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/fn.merge_verified_subtree.html @@ -0,0 +1,6 @@ +merge_verified_subtree in oasis_core_runtime::storage::mkvs::sync - Rust
pub fn merge_verified_subtree(
+    dst: NodePtrRef,
+    subtree: NodePtrRef,
+    updater: &mut Vec<NodePtrRef>,
+) -> Result<()>
Expand description

Merges a previously verified subtree with an existing tree.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/host/struct.HostReadSyncer.html b/rust/oasis_core_runtime/storage/mkvs/sync/host/struct.HostReadSyncer.html new file mode 100644 index 0000000000..7df25fa1e6 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/host/struct.HostReadSyncer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/struct.HostReadSyncer.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/index.html b/rust/oasis_core_runtime/storage/mkvs/sync/index.html new file mode 100644 index 0000000000..0a202c015d --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/index.html @@ -0,0 +1,3 @@ +oasis_core_runtime::storage::mkvs::sync - Rust

Module oasis_core_runtime::storage::mkvs::sync

source ·
Expand description

The read-only tree sync interface.

+

Structs§

Enums§

Traits§

  • ReadSync is the interface for synchronizing the in-memory cache +with another (potentially untrusted) MKVS.

Functions§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/merge/fn.merge_verified_subtree.html b/rust/oasis_core_runtime/storage/mkvs/sync/merge/fn.merge_verified_subtree.html new file mode 100644 index 0000000000..0b20a930e5 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/merge/fn.merge_verified_subtree.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/fn.merge_verified_subtree.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/noop/struct.NoopReadSyncer.html b/rust/oasis_core_runtime/storage/mkvs/sync/noop/struct.NoopReadSyncer.html new file mode 100644 index 0000000000..aabaa85277 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/noop/struct.NoopReadSyncer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/struct.NoopReadSyncer.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.Proof.html b/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.Proof.html new file mode 100644 index 0000000000..93e90f31e0 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.Proof.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/struct.Proof.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.ProofBuilder.html b/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.ProofBuilder.html new file mode 100644 index 0000000000..7bfd857a82 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.ProofBuilder.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/struct.ProofBuilder.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.ProofVerifier.html b/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.ProofVerifier.html new file mode 100644 index 0000000000..14e5185a03 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.ProofVerifier.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/struct.ProofVerifier.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.RawProofEntry.html b/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.RawProofEntry.html new file mode 100644 index 0000000000..1645aec26c --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/proof/struct.RawProofEntry.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/struct.RawProofEntry.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/sidebar-items.js b/rust/oasis_core_runtime/storage/mkvs/sync/sidebar-items.js new file mode 100644 index 0000000000..a4e6f85f74 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["SyncerError"],"fn":["merge_verified_subtree"],"struct":["GetPrefixesRequest","GetRequest","HostReadSyncer","IterateRequest","NoopReadSyncer","Proof","ProofBuilder","ProofResponse","ProofVerifier","RawProofEntry","StatsCollector","TreeID"],"trait":["ReadSync"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/stats/struct.StatsCollector.html b/rust/oasis_core_runtime/storage/mkvs/sync/stats/struct.StatsCollector.html new file mode 100644 index 0000000000..e9ea97b182 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/stats/struct.StatsCollector.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/sync/struct.StatsCollector.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.GetPrefixesRequest.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.GetPrefixesRequest.html new file mode 100644 index 0000000000..5c1c3a5b9d --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.GetPrefixesRequest.html @@ -0,0 +1,31 @@ +GetPrefixesRequest in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::GetPrefixesRequest

source ·
pub struct GetPrefixesRequest {
+    pub tree: TreeID,
+    pub prefixes: Vec<Prefix>,
+    pub limit: u16,
+}
Expand description

Request for the SyncGetPrefixes operation.

+

Fields§

§tree: TreeID§prefixes: Vec<Prefix>§limit: u16

Trait Implementations§

source§

impl Clone for GetPrefixesRequest

source§

fn clone(&self) -> GetPrefixesRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GetPrefixesRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GetPrefixesRequest

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for GetPrefixesRequest

source§

fn default() -> GetPrefixesRequest

Returns the “default value” for a type. Read more
source§

impl Encode for GetPrefixesRequest

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GetPrefixesRequest

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.GetRequest.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.GetRequest.html new file mode 100644 index 0000000000..770dede297 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.GetRequest.html @@ -0,0 +1,31 @@ +GetRequest in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::GetRequest

source ·
pub struct GetRequest {
+    pub tree: TreeID,
+    pub key: Vec<u8>,
+    pub include_siblings: bool,
+}
Expand description

Request for the SyncGet operation.

+

Fields§

§tree: TreeID§key: Vec<u8>§include_siblings: bool

Trait Implementations§

source§

impl Clone for GetRequest

source§

fn clone(&self) -> GetRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GetRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GetRequest

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for GetRequest

source§

fn default() -> GetRequest

Returns the “default value” for a type. Read more
source§

impl Encode for GetRequest

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GetRequest

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.HostReadSyncer.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.HostReadSyncer.html new file mode 100644 index 0000000000..1390105c98 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.HostReadSyncer.html @@ -0,0 +1,28 @@ +HostReadSyncer in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::HostReadSyncer

source ·
pub struct HostReadSyncer { /* private fields */ }
Expand description

A proxy read syncer which forwards calls to the runtime host.

+

Implementations§

source§

impl HostReadSyncer

source

pub fn new( + protocol: Arc<Protocol>, + endpoint: HostStorageEndpoint, +) -> HostReadSyncer

Construct a new host proxy instance.

+

Trait Implementations§

source§

impl ReadSync for HostReadSyncer

source§

fn as_any(&self) -> &dyn Any

Return self as an Any object, useful for downcasting.
source§

fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse>

Fetch a single key and returns the corresponding proof.
source§

fn sync_get_prefixes( + &mut self, + request: GetPrefixesRequest, +) -> Result<ProofResponse>

Fetch all keys under the given prefixes and returns the corresponding proofs.
source§

fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse>

Seek to a given key and then fetch the specified number of following items +based on key iteration order.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.IterateRequest.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.IterateRequest.html new file mode 100644 index 0000000000..f323ec096e --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.IterateRequest.html @@ -0,0 +1,31 @@ +IterateRequest in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::IterateRequest

source ·
pub struct IterateRequest {
+    pub tree: TreeID,
+    pub key: Vec<u8>,
+    pub prefetch: u16,
+}
Expand description

Request for the SyncIterate operation.

+

Fields§

§tree: TreeID§key: Vec<u8>§prefetch: u16

Trait Implementations§

source§

impl Clone for IterateRequest

source§

fn clone(&self) -> IterateRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for IterateRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for IterateRequest

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for IterateRequest

source§

fn default() -> IterateRequest

Returns the “default value” for a type. Read more
source§

impl Encode for IterateRequest

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for IterateRequest

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.NoopReadSyncer.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.NoopReadSyncer.html new file mode 100644 index 0000000000..c6db538b76 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.NoopReadSyncer.html @@ -0,0 +1,25 @@ +NoopReadSyncer in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::NoopReadSyncer

source ·
pub struct NoopReadSyncer;
Expand description

A no-op read syncer which doesn’t support any of the required operations.

+

Trait Implementations§

source§

impl ReadSync for NoopReadSyncer

source§

fn as_any(&self) -> &dyn Any

Return self as an Any object, useful for downcasting.
source§

fn sync_get(&mut self, _request: GetRequest) -> Result<ProofResponse>

Fetch a single key and returns the corresponding proof.
source§

fn sync_get_prefixes( + &mut self, + _request: GetPrefixesRequest, +) -> Result<ProofResponse>

Fetch all keys under the given prefixes and returns the corresponding proofs.
source§

fn sync_iterate(&mut self, _request: IterateRequest) -> Result<ProofResponse>

Seek to a given key and then fetch the specified number of following items +based on key iteration order.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.Proof.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.Proof.html new file mode 100644 index 0000000000..fd0b12df0d --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.Proof.html @@ -0,0 +1,39 @@ +Proof in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::Proof

source ·
pub struct Proof {
+    pub v: u16,
+    pub untrusted_root: Hash,
+    pub entries: Vec<Option<RawProofEntry>>,
+}
Expand description

A Merkle proof for a subtree.

+

Fields§

§v: u16§untrusted_root: Hash

The root hash this proof is for. This should only be used as a quick +sanity check and proof verification MUST use an independently obtained +root hash as the prover can provide any root.

+
§entries: Vec<Option<RawProofEntry>>

Proof entries in pre-order traversal.

+

Trait Implementations§

source§

impl Clone for Proof

source§

fn clone(&self) -> Proof

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Proof

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Proof

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Proof

source§

fn default() -> Proof

Returns the “default value” for a type. Read more
source§

impl Encode for Proof

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Proof

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Proof

source§

fn eq(&self, other: &Proof) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Proof

source§

impl StructuralPartialEq for Proof

Auto Trait Implementations§

§

impl Freeze for Proof

§

impl RefUnwindSafe for Proof

§

impl Send for Proof

§

impl Sync for Proof

§

impl Unpin for Proof

§

impl UnwindSafe for Proof

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofBuilder.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofBuilder.html new file mode 100644 index 0000000000..8dfb55976a --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofBuilder.html @@ -0,0 +1,27 @@ +ProofBuilder in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::ProofBuilder

source ·
pub struct ProofBuilder { /* private fields */ }
Expand description

A Merkle proof builder.

+

Implementations§

source§

impl ProofBuilder

source

pub fn new(root: Hash) -> Self

Create a new proof builder for the given root hash.

+
source

pub fn new_with_version(root: Hash, proof_version: u16) -> Result<Self>

Create a new proof builder for the given root hash and proof version.

+
source

pub fn include(&mut self, node: &NodeBox)

Add a node to the set of included nodes.

+
§Panics
+

Panics if the node is not clean.

+
source

pub fn build(&self) -> Proof

Build the (unverified) proof.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofResponse.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofResponse.html new file mode 100644 index 0000000000..2f93089e99 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofResponse.html @@ -0,0 +1,29 @@ +ProofResponse in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::ProofResponse

source ·
pub struct ProofResponse {
+    pub proof: Proof,
+}
Expand description

Response for requests that produce proofs.

+

Fields§

§proof: Proof

Trait Implementations§

source§

impl Clone for ProofResponse

source§

fn clone(&self) -> ProofResponse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProofResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ProofResponse

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ProofResponse

source§

fn default() -> ProofResponse

Returns the “default value” for a type. Read more
source§

impl Encode for ProofResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ProofResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofVerifier.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofVerifier.html new file mode 100644 index 0000000000..1fb9b403de --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.ProofVerifier.html @@ -0,0 +1,23 @@ +ProofVerifier in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::ProofVerifier

source ·
pub struct ProofVerifier;
Expand description

A proof verifier enables verifying proofs returned by the ReadSyncer API.

+

Implementations§

source§

impl ProofVerifier

source

pub fn verify_proof(&self, root: Hash, proof: &Proof) -> Result<NodePtrRef>

Verify a proof and generate an in-memory subtree representing the +nodes which are included in the proof.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.RawProofEntry.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.RawProofEntry.html new file mode 100644 index 0000000000..03c35967c1 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.RawProofEntry.html @@ -0,0 +1,3136 @@ +RawProofEntry in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::RawProofEntry

source ·
pub struct RawProofEntry(pub Vec<u8>);
Expand description

A raw proof entry.

+

Tuple Fields§

§0: Vec<u8>

Methods from Deref<Target = Vec<u8>>§

1.0.0 · source

pub fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without +reallocating.

+
§Examples
+
let mut vec: Vec<i32> = Vec::with_capacity(10);
+vec.push(42);
+assert!(vec.capacity() >= 10);
+
1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more elements to be inserted +in the given Vec<T>. The collection may reserve more space to +speculatively avoid frequent reallocations. After calling reserve, +capacity will be greater than or equal to self.len() + additional. +Does nothing if capacity is already sufficient.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1];
+vec.reserve(10);
+assert!(vec.capacity() >= 11);
+
1.0.0 · source

pub fn reserve_exact(&mut self, additional: usize)

Reserves the minimum capacity for at least additional more elements to +be inserted in the given Vec<T>. Unlike reserve, this will not +deliberately over-allocate to speculatively avoid frequent allocations. +After calling reserve_exact, capacity will be greater than or equal to +self.len() + additional. Does nothing if the capacity is already +sufficient.

+

Note that the allocator may give the collection more space than it +requests. Therefore, capacity can not be relied upon to be precisely +minimal. Prefer reserve if future insertions are expected.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1];
+vec.reserve_exact(10);
+assert!(vec.capacity() >= 11);
+
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional more elements to be inserted +in the given Vec<T>. The collection may reserve more space to speculatively avoid +frequent reallocations. After calling try_reserve, capacity will be +greater than or equal to self.len() + additional if it returns +Ok(()). Does nothing if capacity is already sufficient. This method +preserves the contents even if an error occurs.

+
§Errors
+

If the capacity overflows, or the allocator reports a failure, then an error +is returned.

+
§Examples
+
use std::collections::TryReserveError;
+
+fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {
+    let mut output = Vec::new();
+
+    // Pre-reserve the memory, exiting if we can't
+    output.try_reserve(data.len())?;
+
+    // Now we know this can't OOM in the middle of our complex work
+    output.extend(data.iter().map(|&val| {
+        val * 2 + 5 // very complicated
+    }));
+
+    Ok(output)
+}
+
1.57.0 · source

pub fn try_reserve_exact( + &mut self, + additional: usize, +) -> Result<(), TryReserveError>

Tries to reserve the minimum capacity for at least additional +elements to be inserted in the given Vec<T>. Unlike try_reserve, +this will not deliberately over-allocate to speculatively avoid frequent +allocations. After calling try_reserve_exact, capacity will be greater +than or equal to self.len() + additional if it returns Ok(()). +Does nothing if the capacity is already sufficient.

+

Note that the allocator may give the collection more space than it +requests. Therefore, capacity can not be relied upon to be precisely +minimal. Prefer try_reserve if future insertions are expected.

+
§Errors
+

If the capacity overflows, or the allocator reports a failure, then an error +is returned.

+
§Examples
+
use std::collections::TryReserveError;
+
+fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {
+    let mut output = Vec::new();
+
+    // Pre-reserve the memory, exiting if we can't
+    output.try_reserve_exact(data.len())?;
+
+    // Now we know this can't OOM in the middle of our complex work
+    output.extend(data.iter().map(|&val| {
+        val * 2 + 5 // very complicated
+    }));
+
+    Ok(output)
+}
+
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the vector as much as possible.

+

The behavior of this method depends on the allocator, which may either shrink the vector +in-place or reallocate. The resulting vector might still have some excess capacity, just as +is the case for with_capacity. See Allocator::shrink for more details.

+
§Examples
+
let mut vec = Vec::with_capacity(10);
+vec.extend([1, 2, 3]);
+assert!(vec.capacity() >= 10);
+vec.shrink_to_fit();
+assert!(vec.capacity() >= 3);
+
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of the vector with a lower bound.

+

The capacity will remain at least as large as both the length +and the supplied value.

+

If the current capacity is less than the lower limit, this is a no-op.

+
§Examples
+
let mut vec = Vec::with_capacity(10);
+vec.extend([1, 2, 3]);
+assert!(vec.capacity() >= 10);
+vec.shrink_to(4);
+assert!(vec.capacity() >= 4);
+vec.shrink_to(0);
+assert!(vec.capacity() >= 3);
+
1.0.0 · source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping +the rest.

+

If len is greater or equal to the vector’s current length, this has +no effect.

+

The drain method can emulate truncate, but causes the excess +elements to be returned instead of dropped.

+

Note that this method has no effect on the allocated capacity +of the vector.

+
§Examples
+

Truncating a five element vector to two elements:

+ +
let mut vec = vec![1, 2, 3, 4, 5];
+vec.truncate(2);
+assert_eq!(vec, [1, 2]);
+

No truncation occurs when len is greater than the vector’s current +length:

+ +
let mut vec = vec![1, 2, 3];
+vec.truncate(8);
+assert_eq!(vec, [1, 2, 3]);
+

Truncating when len == 0 is equivalent to calling the clear +method.

+ +
let mut vec = vec![1, 2, 3];
+vec.truncate(0);
+assert_eq!(vec, []);
+
1.7.0 · source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

+

Equivalent to &s[..].

+
§Examples
+
use std::io::{self, Write};
+let buffer = vec![1, 2, 3, 5, 8];
+io::sink().write(buffer.as_slice()).unwrap();
+
1.7.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Extracts a mutable slice of the entire vector.

+

Equivalent to &mut s[..].

+
§Examples
+
use std::io::{self, Read};
+let mut buffer = vec![0; 3];
+io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
+
1.37.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer +valid for zero sized reads if the vector didn’t allocate.

+

The caller must ensure that the vector outlives the pointer this +function returns, or else it will end up pointing to garbage. +Modifying the vector may cause its buffer to be reallocated, +which would also make any pointers to it invalid.

+

The caller must also ensure that the memory the pointer (non-transitively) points to +is never written to (except inside an UnsafeCell) using this pointer or any pointer +derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

+

This method guarantees that for the purpose of the aliasing model, this method +does not materialize a reference to the underlying slice, and thus the returned pointer +will remain valid when mixed with other calls to as_ptr and as_mut_ptr. +Note that calling other methods that materialize mutable references to the slice, +or mutable references to specific elements you are planning on accessing through this pointer, +as well as writing to those elements, may still invalidate this pointer. +See the second example below for how this guarantee can be used.

+
§Examples
+
let x = vec![1, 2, 4];
+let x_ptr = x.as_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        assert_eq!(*x_ptr.add(i), 1 << i);
+    }
+}
+

Due to the aliasing guarantee, the following code is legal:

+ +
unsafe {
+    let mut v = vec![0, 1, 2];
+    let ptr1 = v.as_ptr();
+    let _ = ptr1.read();
+    let ptr2 = v.as_mut_ptr().offset(2);
+    ptr2.write(2);
+    // Notably, the write to `ptr2` did *not* invalidate `ptr1`
+    // because it mutated a different element:
+    let _ = ptr1.read();
+}
+
1.37.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the vector’s buffer, or a dangling +raw pointer valid for zero sized reads if the vector didn’t allocate.

+

The caller must ensure that the vector outlives the pointer this +function returns, or else it will end up pointing to garbage. +Modifying the vector may cause its buffer to be reallocated, +which would also make any pointers to it invalid.

+

This method guarantees that for the purpose of the aliasing model, this method +does not materialize a reference to the underlying slice, and thus the returned pointer +will remain valid when mixed with other calls to as_ptr and as_mut_ptr. +Note that calling other methods that materialize references to the slice, +or references to specific elements you are planning on accessing through this pointer, +may still invalidate this pointer. +See the second example below for how this guarantee can be used.

+
§Examples
+
// Allocate vector big enough for 4 elements.
+let size = 4;
+let mut x: Vec<i32> = Vec::with_capacity(size);
+let x_ptr = x.as_mut_ptr();
+
+// Initialize elements via raw pointer writes, then set length.
+unsafe {
+    for i in 0..size {
+        *x_ptr.add(i) = i as i32;
+    }
+    x.set_len(size);
+}
+assert_eq!(&*x, &[0, 1, 2, 3]);
+

Due to the aliasing guarantee, the following code is legal:

+ +
unsafe {
+    let mut v = vec![0];
+    let ptr1 = v.as_mut_ptr();
+    ptr1.write(1);
+    let ptr2 = v.as_mut_ptr();
+    ptr2.write(2);
+    // Notably, the write to `ptr2` did *not* invalidate `ptr1`:
+    ptr1.write(3);
+}
+
source

pub fn allocator(&self) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

+
1.0.0 · source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

+

This is a low-level operation that maintains none of the normal +invariants of the type. Normally changing the length of a vector +is done using one of the safe operations instead, such as +truncate, resize, extend, or clear.

+
§Safety
+
    +
  • new_len must be less than or equal to capacity().
  • +
  • The elements at old_len..new_len must be initialized.
  • +
+
§Examples
+

This method can be useful for situations in which the vector +is serving as a buffer for other code, particularly over FFI:

+ +
pub fn get_dictionary(&self) -> Option<Vec<u8>> {
+    // Per the FFI method's docs, "32768 bytes is always enough".
+    let mut dict = Vec::with_capacity(32_768);
+    let mut dict_length = 0;
+    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
+    // 1. `dict_length` elements were initialized.
+    // 2. `dict_length` <= the capacity (32_768)
+    // which makes `set_len` safe to call.
+    unsafe {
+        // Make the FFI call...
+        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
+        if r == Z_OK {
+            // ...and update the length to what was initialized.
+            dict.set_len(dict_length);
+            Some(dict)
+        } else {
+            None
+        }
+    }
+}
+

While the following example is sound, there is a memory leak since +the inner vectors were not freed prior to the set_len call:

+ +
let mut vec = vec![vec![1, 0, 0],
+                   vec![0, 1, 0],
+                   vec![0, 0, 1]];
+// SAFETY:
+// 1. `old_len..0` is empty so no elements need to be initialized.
+// 2. `0 <= capacity` always holds whatever `capacity` is.
+unsafe {
+    vec.set_len(0);
+}
+

Normally, here, one would use clear instead to correctly drop +the contents and thus not leak memory.

+
1.0.0 · source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

+

The removed element is replaced by the last element of the vector.

+

This does not preserve ordering of the remaining elements, but is O(1). +If you need to preserve the element order, use remove instead.

+
§Panics
+

Panics if index is out of bounds.

+
§Examples
+
let mut v = vec!["foo", "bar", "baz", "qux"];
+
+assert_eq!(v.swap_remove(1), "bar");
+assert_eq!(v, ["foo", "qux", "baz"]);
+
+assert_eq!(v.swap_remove(0), "foo");
+assert_eq!(v, ["baz", "qux"]);
+
1.0.0 · source

pub fn insert(&mut self, index: usize, element: T)

Inserts an element at position index within the vector, shifting all +elements after it to the right.

+
§Panics
+

Panics if index > len.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+vec.insert(1, 4);
+assert_eq!(vec, [1, 4, 2, 3]);
+vec.insert(4, 5);
+assert_eq!(vec, [1, 4, 2, 3, 5]);
+
§Time complexity
+

Takes O(Vec::len) time. All items after the insertion index must be +shifted to the right. In the worst case, all elements are shifted when +the insertion index is 0.

+
1.0.0 · source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector, +shifting all elements after it to the left.

+

Note: Because this shifts over the remaining elements, it has a +worst-case performance of O(n). If you don’t need the order of elements +to be preserved, use swap_remove instead. If you’d like to remove +elements from the beginning of the Vec, consider using +VecDeque::pop_front instead.

+
§Panics
+

Panics if index is out of bounds.

+
§Examples
+
let mut v = vec![1, 2, 3];
+assert_eq!(v.remove(1), 2);
+assert_eq!(v, [1, 3]);
+
1.0.0 · source

pub fn retain<F>(&mut self, f: F)
where + F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

+

In other words, remove all elements e for which f(&e) returns false. +This method operates in place, visiting each element exactly once in the +original order, and preserves the order of the retained elements.

+
§Examples
+
let mut vec = vec![1, 2, 3, 4];
+vec.retain(|&x| x % 2 == 0);
+assert_eq!(vec, [2, 4]);
+

Because the elements are visited exactly once in the original order, +external state may be used to decide which elements to keep.

+ +
let mut vec = vec![1, 2, 3, 4, 5];
+let keep = [false, true, true, false, true];
+let mut iter = keep.iter();
+vec.retain(|_| *iter.next().unwrap());
+assert_eq!(vec, [2, 3, 5]);
+
1.61.0 · source

pub fn retain_mut<F>(&mut self, f: F)
where + F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

+

In other words, remove all elements e such that f(&mut e) returns false. +This method operates in place, visiting each element exactly once in the +original order, and preserves the order of the retained elements.

+
§Examples
+
let mut vec = vec![1, 2, 3, 4];
+vec.retain_mut(|x| if *x <= 3 {
+    *x += 1;
+    true
+} else {
+    false
+});
+assert_eq!(vec, [2, 3, 4]);
+
1.16.0 · source

pub fn dedup_by_key<F, K>(&mut self, key: F)
where + F: FnMut(&mut T) -> K, + K: PartialEq,

Removes all but the first of consecutive elements in the vector that resolve to the same +key.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec![10, 20, 21, 30, 20];
+
+vec.dedup_by_key(|i| *i / 10);
+
+assert_eq!(vec, [10, 20, 30, 20]);
+
1.16.0 · source

pub fn dedup_by<F>(&mut self, same_bucket: F)
where + F: FnMut(&mut T, &mut T) -> bool,

Removes all but the first of consecutive elements in the vector satisfying a given equality +relation.

+

The same_bucket function is passed references to two elements from the vector and +must determine if the elements compare equal. The elements are passed in opposite order +from their order in the slice, so if same_bucket(a, b) returns true, a is removed.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec!["foo", "bar", "Bar", "baz", "bar"];
+
+vec.dedup_by(|a, b| a.eq_ignore_ascii_case(b));
+
+assert_eq!(vec, ["foo", "bar", "baz", "bar"]);
+
1.0.0 · source

pub fn push(&mut self, value: T)

Appends an element to the back of a collection.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1, 2];
+vec.push(3);
+assert_eq!(vec, [1, 2, 3]);
+
§Time complexity
+

Takes amortized O(1) time. If the vector’s length would exceed its +capacity after the push, O(capacity) time is taken to copy the +vector’s elements to a larger allocation. This expensive operation is +offset by the capacity O(1) insertions it allows.

+
source

pub fn push_within_capacity(&mut self, value: T) -> Result<(), T>

🔬This is a nightly-only experimental API. (vec_push_within_capacity)

Appends an element if there is sufficient spare capacity, otherwise an error is returned +with the element.

+

Unlike push this method will not reallocate when there’s insufficient capacity. +The caller should use reserve or try_reserve to ensure that there is enough capacity.

+
§Examples
+

A manual, panic-free alternative to FromIterator:

+ +
#![feature(vec_push_within_capacity)]
+
+use std::collections::TryReserveError;
+fn from_iter_fallible<T>(iter: impl Iterator<Item=T>) -> Result<Vec<T>, TryReserveError> {
+    let mut vec = Vec::new();
+    for value in iter {
+        if let Err(value) = vec.push_within_capacity(value) {
+            vec.try_reserve(1)?;
+            // this cannot fail, the previous line either returned or added at least 1 free slot
+            let _ = vec.push_within_capacity(value);
+        }
+    }
+    Ok(vec)
+}
+assert_eq!(from_iter_fallible(0..100), Ok(Vec::from_iter(0..100)));
+
§Time complexity
+

Takes O(1) time.

+
1.0.0 · source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it +is empty.

+

If you’d like to pop the first element, consider using +VecDeque::pop_front instead.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+assert_eq!(vec.pop(), Some(3));
+assert_eq!(vec, [1, 2]);
+
§Time complexity
+

Takes O(1) time.

+
source

pub fn pop_if<F>(&mut self, f: F) -> Option<T>
where + F: FnOnce(&mut T) -> bool,

🔬This is a nightly-only experimental API. (vec_pop_if)

Removes and returns the last element in a vector if the predicate +returns true, or None if the predicate returns false or the vector +is empty.

+
§Examples
+
#![feature(vec_pop_if)]
+
+let mut vec = vec![1, 2, 3, 4];
+let pred = |x: &mut i32| *x % 2 == 0;
+
+assert_eq!(vec.pop_if(pred), Some(4));
+assert_eq!(vec, [1, 2, 3]);
+assert_eq!(vec.pop_if(pred), None);
+
1.4.0 · source

pub fn append(&mut self, other: &mut Vec<T, A>)

Moves all the elements of other into self, leaving other empty.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+let mut vec2 = vec![4, 5, 6];
+vec.append(&mut vec2);
+assert_eq!(vec, [1, 2, 3, 4, 5, 6]);
+assert_eq!(vec2, []);
+
1.6.0 · source

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
where + R: RangeBounds<usize>,

Removes the specified range from the vector in bulk, returning all +removed elements as an iterator. If the iterator is dropped before +being fully consumed, it drops the remaining removed elements.

+

The returned iterator keeps a mutable borrow on the vector to optimize +its implementation.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Leaking
+

If the returned iterator goes out of scope without being dropped (due to +mem::forget, for example), the vector may have lost and leaked +elements arbitrarily, including elements outside the range.

+
§Examples
+
let mut v = vec![1, 2, 3];
+let u: Vec<_> = v.drain(1..).collect();
+assert_eq!(v, &[1]);
+assert_eq!(u, &[2, 3]);
+
+// A full range clears the vector, like `clear()` does
+v.drain(..);
+assert_eq!(v, &[]);
+
1.0.0 · source

pub fn clear(&mut self)

Clears the vector, removing all values.

+

Note that this method has no effect on the allocated capacity +of the vector.

+
§Examples
+
let mut v = vec![1, 2, 3];
+
+v.clear();
+
+assert!(v.is_empty());
+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to +as its ‘length’.

+
§Examples
+
let a = vec![1, 2, 3];
+assert_eq!(a.len(), 3);
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

+
§Examples
+
let mut v = Vec::new();
+assert!(v.is_empty());
+
+v.push(1);
+assert!(!v.is_empty());
+
1.4.0 · source

pub fn split_off(&mut self, at: usize) -> Vec<T, A>
where + A: Clone,

Splits the collection into two at the given index.

+

Returns a newly allocated vector containing the elements in the range +[at, len). After the call, the original vector will be left containing +the elements [0, at) with its previous capacity unchanged.

+
    +
  • If you want to take ownership of the entire contents and capacity of +the vector, see mem::take or mem::replace.
  • +
  • If you don’t need the returned vector at all, see Vec::truncate.
  • +
  • If you want to take ownership of an arbitrary subslice, or you don’t +necessarily want to store the removed items in a vector, see Vec::drain.
  • +
+
§Panics
+

Panics if at > len.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+let vec2 = vec.split_off(1);
+assert_eq!(vec, [1]);
+assert_eq!(vec2, [2, 3]);
+
1.33.0 · source

pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where + F: FnMut() -> T,

Resizes the Vec in-place so that len is equal to new_len.

+

If new_len is greater than len, the Vec is extended by the +difference, with each additional slot filled with the result of +calling the closure f. The return values from f will end up +in the Vec in the order they have been generated.

+

If new_len is less than len, the Vec is simply truncated.

+

This method uses a closure to create new values on every push. If +you’d rather Clone a given value, use Vec::resize. If you +want to use the Default trait to generate values, you can +pass Default::default as the second argument.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+vec.resize_with(5, Default::default);
+assert_eq!(vec, [1, 2, 3, 0, 0]);
+
+let mut vec = vec![];
+let mut p = 1;
+vec.resize_with(4, || { p *= 2; p });
+assert_eq!(vec, [2, 4, 8, 16]);
+
1.60.0 · source

pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]

Returns the remaining spare capacity of the vector as a slice of +MaybeUninit<T>.

+

The returned slice can be used to fill the vector with data (e.g. by +reading from a file) before marking the data as initialized using the +set_len method.

+
§Examples
+
// Allocate vector big enough for 10 elements.
+let mut v = Vec::with_capacity(10);
+
+// Fill in the first 3 elements.
+let uninit = v.spare_capacity_mut();
+uninit[0].write(0);
+uninit[1].write(1);
+uninit[2].write(2);
+
+// Mark the first 3 elements of the vector as being initialized.
+unsafe {
+    v.set_len(3);
+}
+
+assert_eq!(&v, &[0, 1, 2]);
+
source

pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>])

🔬This is a nightly-only experimental API. (vec_split_at_spare)

Returns vector content as a slice of T, along with the remaining spare +capacity of the vector as a slice of MaybeUninit<T>.

+

The returned spare capacity slice can be used to fill the vector with data +(e.g. by reading from a file) before marking the data as initialized using +the set_len method.

+

Note that this is a low-level API, which should be used with care for +optimization purposes. If you need to append data to a Vec +you can use push, extend, extend_from_slice, +extend_from_within, insert, append, resize or +resize_with, depending on your exact needs.

+
§Examples
+
#![feature(vec_split_at_spare)]
+
+let mut v = vec![1, 1, 2];
+
+// Reserve additional space big enough for 10 elements.
+v.reserve(10);
+
+let (init, uninit) = v.split_at_spare_mut();
+let sum = init.iter().copied().sum::<u32>();
+
+// Fill in the next 4 elements.
+uninit[0].write(sum);
+uninit[1].write(sum * 2);
+uninit[2].write(sum * 3);
+uninit[3].write(sum * 4);
+
+// Mark the 4 elements of the vector as being initialized.
+unsafe {
+    let len = v.len();
+    v.set_len(len + 4);
+}
+
+assert_eq!(&v, &[1, 1, 2, 4, 8, 12, 16]);
+
1.5.0 · source

pub fn resize(&mut self, new_len: usize, value: T)

Resizes the Vec in-place so that len is equal to new_len.

+

If new_len is greater than len, the Vec is extended by the +difference, with each additional slot filled with value. +If new_len is less than len, the Vec is simply truncated.

+

This method requires T to implement Clone, +in order to be able to clone the passed value. +If you need more flexibility (or want to rely on Default instead of +Clone), use Vec::resize_with. +If you only need to resize to a smaller size, use Vec::truncate.

+
§Examples
+
let mut vec = vec!["hello"];
+vec.resize(3, "world");
+assert_eq!(vec, ["hello", "world", "world"]);
+
+let mut vec = vec![1, 2, 3, 4];
+vec.resize(2, 0);
+assert_eq!(vec, [1, 2]);
+
1.6.0 · source

pub fn extend_from_slice(&mut self, other: &[T])

Clones and appends all elements in a slice to the Vec.

+

Iterates over the slice other, clones each element, and then appends +it to this Vec. The other slice is traversed in-order.

+

Note that this function is same as extend except that it is +specialized to work with slices instead. If and when Rust gets +specialization this function will likely be deprecated (but still +available).

+
§Examples
+
let mut vec = vec![1];
+vec.extend_from_slice(&[2, 3, 4]);
+assert_eq!(vec, [1, 2, 3, 4]);
+
1.53.0 · source

pub fn extend_from_within<R>(&mut self, src: R)
where + R: RangeBounds<usize>,

Copies elements from src range to the end of the vector.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Examples
+
let mut vec = vec![0, 1, 2, 3, 4];
+
+vec.extend_from_within(2..);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);
+
+vec.extend_from_within(..2);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);
+
+vec.extend_from_within(4..8);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
+
1.0.0 · source

pub fn dedup(&mut self)

Removes consecutive repeated elements in the vector according to the +PartialEq trait implementation.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec![1, 2, 2, 3, 2];
+
+vec.dedup();
+
+assert_eq!(vec, [1, 2, 3, 2]);
+
1.21.0 · source

pub fn splice<R, I>( + &mut self, + range: R, + replace_with: I, +) -> Splice<'_, <I as IntoIterator>::IntoIter, A>
where + R: RangeBounds<usize>, + I: IntoIterator<Item = T>,

Creates a splicing iterator that replaces the specified range in the vector +with the given replace_with iterator and yields the removed items. +replace_with does not need to be the same length as range.

+

range is removed even if the iterator is not consumed until the end.

+

It is unspecified how many elements are removed from the vector +if the Splice value is leaked.

+

The input iterator replace_with is only consumed when the Splice value is dropped.

+

This is optimal if:

+
    +
  • The tail (elements in the vector after range) is empty,
  • +
  • or replace_with yields fewer or equal elements than range’s length
  • +
  • or the lower bound of its size_hint() is exact.
  • +
+

Otherwise, a temporary vector is allocated and the tail is moved twice.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Examples
+
let mut v = vec![1, 2, 3, 4];
+let new = [7, 8, 9];
+let u: Vec<_> = v.splice(1..3, new).collect();
+assert_eq!(v, &[1, 7, 8, 9, 4]);
+assert_eq!(u, &[2, 3]);
+
source

pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
where + F: FnMut(&mut T) -> bool,

🔬This is a nightly-only experimental API. (extract_if)

Creates an iterator which uses a closure to determine if an element should be removed.

+

If the closure returns true, then the element is removed and yielded. +If the closure returns false, the element will remain in the vector and will not be yielded +by the iterator.

+

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating +or the iteration short-circuits, then the remaining elements will be retained. +Use retain with a negated predicate if you do not need the returned iterator.

+

Using this method is equivalent to the following code:

+ +
let mut i = 0;
+while i < vec.len() {
+    if some_predicate(&mut vec[i]) {
+        let val = vec.remove(i);
+        // your code here
+    } else {
+        i += 1;
+    }
+}
+
+

But extract_if is easier to use. extract_if is also more efficient, +because it can backshift the elements of the array in bulk.

+

Note that extract_if also lets you mutate every element in the filter closure, +regardless of whether you choose to keep or remove it.

+
§Examples
+

Splitting an array into evens and odds, reusing the original allocation:

+ +
#![feature(extract_if)]
+let mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15];
+
+let evens = numbers.extract_if(|x| *x % 2 == 0).collect::<Vec<_>>();
+let odds = numbers;
+
+assert_eq!(evens, vec![2, 4, 6, 8, 14]);
+assert_eq!(odds, vec![1, 3, 5, 9, 11, 13, 15]);
+

Methods from Deref<Target = [T]>§

source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

+
source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f32::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

+
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of +ASCII characters, otherwise returns None.

+
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, +without checking whether they’re valid.

+
§Safety
+

Every byte in the slice must be in 0..=127, or else this is UB.

+
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

+

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), +but without allocating and copying temporaries.

+
1.23.0 · source

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To return a new uppercased value without modifying the existing one, use +to_ascii_uppercase.

+
1.23.0 · source

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To return a new lowercased value without modifying the existing one, use +to_ascii_lowercase.

+
1.60.0 · source

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, +treating it as an ASCII string.

+
§Examples
+

+let s = b"0\t\r\n'\"\\\x9d";
+let escaped = s.escape_ascii().to_string();
+assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
+
1.80.0 · source

pub fn trim_ascii_start(&self) -> &[u8]

Returns a byte slice with leading ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
+assert_eq!(b"  ".trim_ascii_start(), b"");
+assert_eq!(b"".trim_ascii_start(), b"");
+
1.80.0 · source

pub fn trim_ascii_end(&self) -> &[u8]

Returns a byte slice with trailing ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
+assert_eq!(b"  ".trim_ascii_end(), b"");
+assert_eq!(b"".trim_ascii_end(), b"");
+
1.80.0 · source

pub fn trim_ascii(&self) -> &[u8]

Returns a byte slice with leading and trailing ASCII whitespace bytes +removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
+assert_eq!(b"  ".trim_ascii(), b"");
+assert_eq!(b"".trim_ascii(), b"");
+
1.79.0 · source

pub fn utf8_chunks(&self) -> Utf8Chunks<'_>

Creates an iterator over the contiguous valid UTF-8 ranges of this +slice, and the non-UTF-8 fragments in between.

+
§Examples
+

This function formats arbitrary but mostly-UTF-8 bytes into Rust source +code in the form of a C-string literal (c"...").

+ +
use std::fmt::Write as _;
+
+pub fn cstr_literal(bytes: &[u8]) -> String {
+    let mut repr = String::new();
+    repr.push_str("c\"");
+    for chunk in bytes.utf8_chunks() {
+        for ch in chunk.valid().chars() {
+            // Escapes \0, \t, \r, \n, \\, \', \", and uses \u{...} for non-printable characters.
+            write!(repr, "{}", ch.escape_debug()).unwrap();
+        }
+        for byte in chunk.invalid() {
+            write!(repr, "\\x{:02X}", byte).unwrap();
+        }
+    }
+    repr.push('"');
+    repr
+}
+
+fn main() {
+    let lit = cstr_literal(b"\xferris the \xf0\x9f\xa6\x80\x07");
+    let expected = stringify!(c"\xFErris the 🦀\u{7}");
+    assert_eq!(lit, expected);
+}
+
1.80.0 · source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened(), &[1, 2, 3, 4, 5, 6]);
+
+assert_eq!(
+    [[1, 2, 3], [4, 5, 6]].as_flattened(),
+    [[1, 2], [3, 4], [5, 6]].as_flattened(),
+);
+
+let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
+assert!(slice_of_empty_arrays.as_flattened().is_empty());
+
+let empty_slice_of_arrays: &[[u32; 10]] = &[];
+assert!(empty_slice_of_arrays.as_flattened().is_empty());
+
1.80.0 · source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
fn add_5_to_all(slice: &mut [i32]) {
+    for i in slice {
+        *i += 5;
+    }
+}
+
+let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
+add_5_to_all(array.as_flattened_mut());
+assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f64::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the slice.

+
§Examples
+
let a = [1, 2, 3];
+assert_eq!(a.len(), 3);
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

+
§Examples
+
let a = [1, 2, 3];
+assert!(!a.is_empty());
+
+let b: &[i32] = &[];
+assert!(b.is_empty());
+
1.0.0 · source

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&10), v.first());
+
+let w: &[i32] = &[];
+assert_eq!(None, w.first());
+
1.0.0 · source

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(first) = x.first_mut() {
+    *first = 5;
+}
+assert_eq!(x, &[5, 1, 2]);
+
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.first_mut());
+
1.5.0 · source

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((first, elements)) = x.split_first() {
+    assert_eq!(first, &0);
+    assert_eq!(elements, &[1, 2]);
+}
+
1.5.0 · source

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_mut() {
+    *first = 3;
+    elements[0] = 4;
+    elements[1] = 5;
+}
+assert_eq!(x, &[3, 4, 5]);
+
1.5.0 · source

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((last, elements)) = x.split_last() {
+    assert_eq!(last, &2);
+    assert_eq!(elements, &[0, 1]);
+}
+
1.5.0 · source

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((last, elements)) = x.split_last_mut() {
+    *last = 3;
+    elements[0] = 4;
+    elements[1] = 5;
+}
+assert_eq!(x, &[4, 5, 3]);
+
1.0.0 · source

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&30), v.last());
+
+let w: &[i32] = &[];
+assert_eq!(None, w.last());
+
1.0.0 · source

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable reference to the last item in the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(last) = x.last_mut() {
+    *last = 10;
+}
+assert_eq!(x, &[0, 1, 10]);
+
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.last_mut());
+
1.77.0 · source

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
+assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
+
+let v: &[i32] = &[10];
+assert_eq!(None, v.first_chunk::<2>());
+
+let w: &[i32] = &[];
+assert_eq!(Some(&[]), w.first_chunk::<0>());
+
1.77.0 · source

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(first) = x.first_chunk_mut::<2>() {
+    first[0] = 5;
+    first[1] = 4;
+}
+assert_eq!(x, &[5, 4, 2]);
+
+assert_eq!(None, x.first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

Return an array reference to the first N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_chunk::<2>() {
+    assert_eq!(first, &[0, 1]);
+    assert_eq!(elements, &[2]);
+}
+
+assert_eq!(None, x.split_first_chunk::<4>());
+
1.77.0 · source

pub fn split_first_chunk_mut<const N: usize>( + &mut self, +) -> Option<(&mut [T; N], &mut [T])>

Return a mutable array reference to the first N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_chunk_mut::<2>() {
+    first[0] = 3;
+    first[1] = 4;
+    elements[0] = 5;
+}
+assert_eq!(x, &[3, 4, 5]);
+
+assert_eq!(None, x.split_first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

Return an array reference to the last N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((elements, last)) = x.split_last_chunk::<2>() {
+    assert_eq!(elements, &[0]);
+    assert_eq!(last, &[1, 2]);
+}
+
+assert_eq!(None, x.split_last_chunk::<4>());
+
1.77.0 · source

pub fn split_last_chunk_mut<const N: usize>( + &mut self, +) -> Option<(&mut [T], &mut [T; N])>

Return a mutable array reference to the last N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((elements, last)) = x.split_last_chunk_mut::<2>() {
+    last[0] = 3;
+    last[1] = 4;
+    elements[0] = 5;
+}
+assert_eq!(x, &[5, 3, 4]);
+
+assert_eq!(None, x.split_last_chunk_mut::<4>());
+
1.77.0 · source

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
+assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
+
+let v: &[i32] = &[10];
+assert_eq!(None, v.last_chunk::<2>());
+
+let w: &[i32] = &[];
+assert_eq!(Some(&[]), w.last_chunk::<0>());
+
1.77.0 · source

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(last) = x.last_chunk_mut::<2>() {
+    last[0] = 10;
+    last[1] = 20;
+}
+assert_eq!(x, &[0, 10, 20]);
+
+assert_eq!(None, x.last_chunk_mut::<4>());
+
1.0.0 · source

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
where + I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of +index.

+
    +
  • If given a position, returns a reference to the element at that +position or None if out of bounds.
  • +
  • If given a range, returns the subslice corresponding to that range, +or None if out of bounds.
  • +
+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&40), v.get(1));
+assert_eq!(Some(&[10, 40][..]), v.get(0..2));
+assert_eq!(None, v.get(3));
+assert_eq!(None, v.get(0..4));
+
1.0.0 · source

pub fn get_mut<I>( + &mut self, + index: I, +) -> Option<&mut <I as SliceIndex<[T]>>::Output>
where + I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the +type of index (see get) or None if the index is out of bounds.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(elem) = x.get_mut(1) {
+    *elem = 42;
+}
+assert_eq!(x, &[0, 42, 2]);
+
1.0.0 · source

pub unsafe fn get_unchecked<I>( + &self, + index: I, +) -> &<I as SliceIndex<[T]>>::Output
where + I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds +checking.

+

For a safe alternative see get.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used.

+

You can think of this like .get(index).unwrap_unchecked(). It’s UB +to call .get_unchecked(len), even if you immediately convert to a +pointer. And it’s UB to call .get_unchecked(..len + 1), +.get_unchecked(..=len), or similar.

+
§Examples
+
let x = &[1, 2, 4];
+
+unsafe {
+    assert_eq!(x.get_unchecked(1), &2);
+}
+
1.0.0 · source

pub unsafe fn get_unchecked_mut<I>( + &mut self, + index: I, +) -> &mut <I as SliceIndex<[T]>>::Output
where + I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing +bounds checking.

+

For a safe alternative see get_mut.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used.

+

You can think of this like .get_mut(index).unwrap_unchecked(). It’s +UB to call .get_unchecked_mut(len), even if you immediately convert +to a pointer. And it’s UB to call .get_unchecked_mut(..len + 1), +.get_unchecked_mut(..=len), or similar.

+
§Examples
+
let x = &mut [1, 2, 4];
+
+unsafe {
+    let elem = x.get_unchecked_mut(1);
+    *elem = 13;
+}
+assert_eq!(x, &[1, 13, 4]);
+
1.0.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

+

The caller must ensure that the slice outlives the pointer this +function returns, or else it will end up pointing to garbage.

+

The caller must also ensure that the memory the pointer (non-transitively) points to +is never written to (except inside an UnsafeCell) using this pointer or any pointer +derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

+

Modifying the container referenced by this slice may cause its buffer +to be reallocated, which would also make any pointers to it invalid.

+
§Examples
+
let x = &[1, 2, 4];
+let x_ptr = x.as_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
+    }
+}
+
1.0.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

+

The caller must ensure that the slice outlives the pointer this +function returns, or else it will end up pointing to garbage.

+

Modifying the container referenced by this slice may cause its buffer +to be reallocated, which would also make any pointers to it invalid.

+
§Examples
+
let x = &mut [1, 2, 4];
+let x_ptr = x.as_mut_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        *x_ptr.add(i) += 2;
+    }
+}
+assert_eq!(x, &[3, 4, 6]);
+
1.48.0 · source

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

+

The returned range is half-open, which means that the end pointer +points one past the last element of the slice. This way, an empty +slice is represented by two equal pointers, and the difference between +the two pointers represents the size of the slice.

+

See as_ptr for warnings on using these pointers. The end pointer +requires extra caution, as it does not point to a valid element in the +slice.

+

This function is useful for interacting with foreign interfaces which +use two pointers to refer to a range of elements in memory, as is +common in C++.

+

It can also be useful to check if a pointer to an element refers to an +element of this slice:

+ +
let a = [1, 2, 3];
+let x = &a[1] as *const _;
+let y = &5 as *const _;
+
+assert!(a.as_ptr_range().contains(&x));
+assert!(!a.as_ptr_range().contains(&y));
+
1.48.0 · source

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

+

The returned range is half-open, which means that the end pointer +points one past the last element of the slice. This way, an empty +slice is represented by two equal pointers, and the difference between +the two pointers represents the size of the slice.

+

See as_mut_ptr for warnings on using these pointers. The end +pointer requires extra caution, as it does not point to a valid element +in the slice.

+

This function is useful for interacting with foreign interfaces which +use two pointers to refer to a range of elements in memory, as is +common in C++.

+
1.0.0 · source

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

+

If a equals to b, it’s guaranteed that elements won’t change value.

+
§Arguments
+
    +
  • a - The index of the first element
  • +
  • b - The index of the second element
  • +
+
§Panics
+

Panics if a or b are out of bounds.

+
§Examples
+
let mut v = ["a", "b", "c", "d", "e"];
+v.swap(2, 4);
+assert!(v == ["a", "b", "e", "d", "c"]);
+
source

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

+

For a safe alternative see swap.

+
§Arguments
+
    +
  • a - The index of the first element
  • +
  • b - The index of the second element
  • +
+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior. +The caller has to ensure that a < self.len() and b < self.len().

+
§Examples
+
#![feature(slice_swap_unchecked)]
+
+let mut v = ["a", "b", "c", "d"];
+// SAFETY: we know that 1 and 3 are both indices of the slice
+unsafe { v.swap_unchecked(1, 3) };
+assert!(v == ["a", "d", "c", "b"]);
+
1.0.0 · source

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

+
§Examples
+
let mut v = [1, 2, 3];
+v.reverse();
+assert!(v == [3, 2, 1]);
+
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

+

The iterator yields all items from start to end.

+
§Examples
+
let x = &[1, 2, 4];
+let mut iterator = x.iter();
+
+assert_eq!(iterator.next(), Some(&1));
+assert_eq!(iterator.next(), Some(&2));
+assert_eq!(iterator.next(), Some(&4));
+assert_eq!(iterator.next(), None);
+
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

+

The iterator yields all items from start to end.

+
§Examples
+
let x = &mut [1, 2, 4];
+for elem in x.iter_mut() {
+    *elem += 2;
+}
+assert_eq!(x, &[3, 4, 6]);
+
1.0.0 · source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +size. The windows overlap. If the slice is shorter than +size, the iterator returns no values.

+
§Panics
+

Panics if size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.windows(3);
+assert_eq!(iter.next().unwrap(), &['l', 'o', 'r']);
+assert_eq!(iter.next().unwrap(), &['o', 'r', 'e']);
+assert_eq!(iter.next().unwrap(), &['r', 'e', 'm']);
+assert!(iter.next().is_none());
+

If the slice is shorter than size:

+ +
let slice = ['f', 'o', 'o'];
+let mut iter = slice.windows(4);
+assert!(iter.next().is_none());
+

There’s no windows_mut, as that existing would let safe code violate the +“only one &mut at a time to the same thing” rule. However, you can sometimes +use Cell::as_slice_of_cells in +conjunction with windows to accomplish something similar:

+ +
use std::cell::Cell;
+
+let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
+let slice = &mut array[..];
+let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
+for w in slice_of_cells.windows(3) {
+    Cell::swap(&w[0], &w[2]);
+}
+assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
+
1.0.0 · source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last chunk will not have length chunk_size.

+

See chunks_exact for a variant of this iterator that returns chunks of always exactly +chunk_size elements, and rchunks for the same iterator but starting at the end of the +slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.chunks(2);
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert_eq!(iter.next().unwrap(), &['m']);
+assert!(iter.next().is_none());
+
1.0.0 · source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last chunk will not have length chunk_size.

+

See chunks_exact_mut for a variant of this iterator that returns chunks of always +exactly chunk_size elements, and rchunks_mut for the same iterator but starting at +the end of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.chunks_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 3]);
+
1.31.0 · source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved +from the remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks.

+

See chunks for a variant of this iterator that also returns the remainder as a smaller +chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.chunks_exact(2);
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['m']);
+
1.31.0 · source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last up to chunk_size-1 elements will be omitted and can be +retrieved from the into_remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks_mut.

+

See chunks_mut for a variant of this iterator that also returns the remainder as a +smaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of +the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.chunks_exact_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 0]);
+
source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +assuming that there’s no remainder.

+
§Safety
+

This may only be called when

+
    +
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • +
  • N != 0.
  • +
+
§Examples
+
#![feature(slice_as_chunks)]
+let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
+let chunks: &[[char; 1]] =
+    // SAFETY: 1-element chunks never have remainder
+    unsafe { slice.as_chunks_unchecked() };
+assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
+let chunks: &[[char; 3]] =
+    // SAFETY: The slice length (6) is a multiple of 3
+    unsafe { slice.as_chunks_unchecked() };
+assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
+
+// These would be unsound:
+// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
+// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
+
source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the beginning of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let (chunks, remainder) = slice.as_chunks();
+assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
+assert_eq!(remainder, &['m']);
+

If you expect the slice to be an exact multiple, you can combine +let-else with an empty slice pattern:

+ +
#![feature(slice_as_chunks)]
+let slice = ['R', 'u', 's', 't'];
+let (chunks, []) = slice.as_chunks::<2>() else {
+    panic!("slice didn't have even length")
+};
+assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
+
source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the end of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let (remainder, chunks) = slice.as_rchunks();
+assert_eq!(remainder, &['l']);
+assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
+
source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are array references and do not overlap. If N does not divide the +length of the slice, then the last up to N-1 elements will be omitted and can be +retrieved from the remainder function of the iterator.

+

This method is the const generic equivalent of chunks_exact.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.array_chunks();
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['m']);
+
source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( + &mut self, +) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +assuming that there’s no remainder.

+
§Safety
+

This may only be called when

+
    +
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • +
  • N != 0.
  • +
+
§Examples
+
#![feature(slice_as_chunks)]
+let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
+let chunks: &mut [[char; 1]] =
+    // SAFETY: 1-element chunks never have remainder
+    unsafe { slice.as_chunks_unchecked_mut() };
+chunks[0] = ['L'];
+assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);
+let chunks: &mut [[char; 3]] =
+    // SAFETY: The slice length (6) is a multiple of 3
+    unsafe { slice.as_chunks_unchecked_mut() };
+chunks[1] = ['a', 'x', '?'];
+assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);
+
+// These would be unsound:
+// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
+// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
+
source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the beginning of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+let (chunks, remainder) = v.as_chunks_mut();
+remainder[0] = 9;
+for chunk in chunks {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 9]);
+
source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the end of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+let (remainder, chunks) = v.as_rchunks_mut();
+remainder[0] = 9;
+for chunk in chunks {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[9, 1, 1, 2, 2]);
+
source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable array references and do not overlap. If N does not divide +the length of the slice, then the last up to N-1 elements will be omitted and +can be retrieved from the into_remainder function of the iterator.

+

This method is the const generic equivalent of chunks_exact_mut.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.array_chunks_mut() {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 0]);
+
source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +starting at the beginning of the slice.

+

This is the const generic equivalent of windows.

+

If N is greater than the size of the slice, it will return no windows.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_windows)]
+let slice = [0, 1, 2, 3];
+let mut iter = slice.array_windows();
+assert_eq!(iter.next().unwrap(), &[0, 1]);
+assert_eq!(iter.next().unwrap(), &[1, 2]);
+assert_eq!(iter.next().unwrap(), &[2, 3]);
+assert!(iter.next().is_none());
+
1.31.0 · source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last chunk will not have length chunk_size.

+

See rchunks_exact for a variant of this iterator that returns chunks of always exactly +chunk_size elements, and chunks for the same iterator but starting at the beginning +of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.rchunks(2);
+assert_eq!(iter.next().unwrap(), &['e', 'm']);
+assert_eq!(iter.next().unwrap(), &['o', 'r']);
+assert_eq!(iter.next().unwrap(), &['l']);
+assert!(iter.next().is_none());
+
1.31.0 · source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last chunk will not have length chunk_size.

+

See rchunks_exact_mut for a variant of this iterator that returns chunks of always +exactly chunk_size elements, and chunks_mut for the same iterator but starting at the +beginning of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.rchunks_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[3, 2, 2, 1, 1]);
+
1.31.0 · source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +end of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved +from the remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of rchunks.

+

See rchunks for a variant of this iterator that also returns the remainder as a smaller +chunk, and chunks_exact for the same iterator but starting at the beginning of the +slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.rchunks_exact(2);
+assert_eq!(iter.next().unwrap(), &['e', 'm']);
+assert_eq!(iter.next().unwrap(), &['o', 'r']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['l']);
+
1.31.0 · source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last up to chunk_size-1 elements will be omitted and can be +retrieved from the into_remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks_mut.

+

See rchunks_mut for a variant of this iterator that also returns the remainder as a +smaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning +of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.rchunks_exact_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[0, 2, 2, 1, 1]);
+
1.77.0 · source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs +of elements using the predicate to separate them.

+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
+
+let mut iter = slice.chunk_by(|a, b| a == b);
+
+assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
+assert_eq!(iter.next(), Some(&[3, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
+assert_eq!(iter.next(), None);
+

This method can be used to extract the sorted subslices:

+ +
let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
+
+let mut iter = slice.chunk_by(|a, b| a <= b);
+
+assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
+assert_eq!(iter.next(), None);
+
1.77.0 · source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable +runs of elements using the predicate to separate them.

+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
+
+let mut iter = slice.chunk_by_mut(|a, b| a == b);
+
+assert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));
+assert_eq!(iter.next(), Some(&mut [3, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 2, 2][..]));
+assert_eq!(iter.next(), None);
+

This method can be used to extract the sorted subslices:

+ +
let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
+
+let mut iter = slice.chunk_by_mut(|a, b| a <= b);
+
+assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));
+assert_eq!(iter.next(), None);
+
1.0.0 · source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_checked.

+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
+
+{
+   let (left, right) = v.split_at(0);
+   assert_eq!(left, []);
+   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_at(2);
+    assert_eq!(left, [1, 2]);
+    assert_eq!(right, [3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_at(6);
+    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, []);
+}
+
1.0.0 · source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_mut_checked.

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+let (left, right) = v.split_at_mut(2);
+assert_eq!(left, [1, 0]);
+assert_eq!(right, [3, 0, 5, 6]);
+left[1] = 2;
+right[1] = 4;
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
1.79.0 · source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+

For a safe alternative see split_at.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used. The caller has to ensure that +0 <= mid <= self.len().

+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
+
+unsafe {
+   let (left, right) = v.split_at_unchecked(0);
+   assert_eq!(left, []);
+   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+}
+
+unsafe {
+    let (left, right) = v.split_at_unchecked(2);
+    assert_eq!(left, [1, 2]);
+    assert_eq!(right, [3, 4, 5, 6]);
+}
+
+unsafe {
+    let (left, right) = v.split_at_unchecked(6);
+    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, []);
+}
+
1.79.0 · source

pub unsafe fn split_at_mut_unchecked( + &mut self, + mid: usize, +) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+

For a safe alternative see split_at_mut.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used. The caller has to ensure that +0 <= mid <= self.len().

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+// scoped to restrict the lifetime of the borrows
+unsafe {
+    let (left, right) = v.split_at_mut_unchecked(2);
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
+}
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
1.80.0 · source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
let v = [1, -2, 3, -4, 5, -6];
+
+{
+   let (left, right) = v.split_at_checked(0).unwrap();
+   assert_eq!(left, []);
+   assert_eq!(right, [1, -2, 3, -4, 5, -6]);
+}
+
+{
+    let (left, right) = v.split_at_checked(2).unwrap();
+    assert_eq!(left, [1, -2]);
+    assert_eq!(right, [3, -4, 5, -6]);
+}
+
+{
+    let (left, right) = v.split_at_checked(6).unwrap();
+    assert_eq!(left, [1, -2, 3, -4, 5, -6]);
+    assert_eq!(right, []);
+}
+
+assert_eq!(None, v.split_at_checked(7));
+
1.80.0 · source

pub fn split_at_mut_checked( + &mut self, + mid: usize, +) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the +slice is too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+
+if let Some((left, right)) = v.split_at_mut_checked(2) {
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
+}
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
+assert_eq!(None, v.split_at_mut_checked(7));
+
1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred. The matched element is not contained in the subslices.

+
§Examples
+
let slice = [10, 40, 33, 20];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+

If the first element is matched, an empty slice will be the first item +returned by the iterator. Similarly, if the last element in the slice +is matched, an empty slice will be the last item returned by the +iterator:

+ +
let slice = [10, 40, 33];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40]);
+assert_eq!(iter.next().unwrap(), &[]);
+assert!(iter.next().is_none());
+

If two matched elements are directly adjacent, an empty slice will be +present between them:

+ +
let slice = [10, 6, 33, 20];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10]);
+assert_eq!(iter.next().unwrap(), &[]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+
1.0.0 · source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred. The matched element is not contained in the subslices.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.split_mut(|num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(v, [1, 40, 30, 1, 60, 1]);
+
1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred. The matched element is contained in the end of the previous +subslice as a terminator.

+
§Examples
+
let slice = [10, 40, 33, 20];
+let mut iter = slice.split_inclusive(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+

If the last element of the slice is matched, +that element will be considered the terminator of the preceding slice. +That slice will be the last item returned by the iterator.

+ +
let slice = [3, 10, 40, 33];
+let mut iter = slice.split_inclusive(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[3]);
+assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
+assert!(iter.next().is_none());
+
1.51.0 · source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred. The matched element is contained in the previous +subslice as a terminator.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.split_inclusive_mut(|num| *num % 3 == 0) {
+    let terminator_idx = group.len()-1;
+    group[terminator_idx] = 1;
+}
+assert_eq!(v, [10, 40, 1, 20, 1, 1]);
+
1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred, starting at the end of the slice and working backwards. +The matched element is not contained in the subslices.

+
§Examples
+
let slice = [11, 22, 33, 0, 44, 55];
+let mut iter = slice.rsplit(|num| *num == 0);
+
+assert_eq!(iter.next().unwrap(), &[44, 55]);
+assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
+assert_eq!(iter.next(), None);
+

As with split(), if the first or last element is matched, an empty +slice will be the first (or last) item returned by the iterator.

+ +
let v = &[0, 1, 1, 2, 3, 5, 8];
+let mut it = v.rsplit(|n| *n % 2 == 0);
+assert_eq!(it.next().unwrap(), &[]);
+assert_eq!(it.next().unwrap(), &[3, 5]);
+assert_eq!(it.next().unwrap(), &[1, 1]);
+assert_eq!(it.next().unwrap(), &[]);
+assert_eq!(it.next(), None);
+
1.27.0 · source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred, starting at the end of the slice and working +backwards. The matched element is not contained in the subslices.

+
§Examples
+
let mut v = [100, 400, 300, 200, 600, 500];
+
+let mut count = 0;
+for group in v.rsplit_mut(|num| *num % 3 == 0) {
+    count += 1;
+    group[0] = count;
+}
+assert_eq!(v, [3, 400, 300, 2, 600, 1]);
+
1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred, limited to returning at most n items. The matched element is +not contained in the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], +[20, 60, 50]):

+ +
let v = [10, 40, 30, 20, 60, 50];
+
+for group in v.splitn(2, |num| *num % 3 == 0) {
+    println!("{group:?}");
+}
+
1.0.0 · source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match +pred, limited to returning at most n items. The matched element is +not contained in the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.splitn_mut(2, |num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(v, [1, 40, 30, 1, 60, 50]);
+
1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred limited to returning at most n items. This starts at the end of +the slice and works backwards. The matched element is not contained in +the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+

Print the slice split once, starting from the end, by numbers divisible +by 3 (i.e., [50], [10, 40, 30, 20]):

+ +
let v = [10, 40, 30, 20, 60, 50];
+
+for group in v.rsplitn(2, |num| *num % 3 == 0) {
+    println!("{group:?}");
+}
+
1.0.0 · source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred limited to returning at most n items. This starts at the end of +the slice and works backwards. The matched element is not contained in +the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+
let mut s = [10, 40, 30, 20, 60, 50];
+
+for group in s.rsplitn_mut(2, |num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(s, [1, 40, 30, 20, 60, 1]);
+
source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where + F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified +predicate.

+

If any matching elements are present in the slice, returns the prefix +before the match and suffix after. The matching element itself is not +included. If no elements match, returns None.

+
§Examples
+
#![feature(slice_split_once)]
+let s = [1, 2, 3, 2, 4];
+assert_eq!(s.split_once(|&x| x == 2), Some((
+    &[1][..],
+    &[3, 2, 4][..]
+)));
+assert_eq!(s.split_once(|&x| x == 0), None);
+
source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where + F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified +predicate.

+

If any matching elements are present in the slice, returns the prefix +before the match and suffix after. The matching element itself is not +included. If no elements match, returns None.

+
§Examples
+
#![feature(slice_split_once)]
+let s = [1, 2, 3, 2, 4];
+assert_eq!(s.rsplit_once(|&x| x == 2), Some((
+    &[1, 2, 3][..],
+    &[4][..]
+)));
+assert_eq!(s.rsplit_once(|&x| x == 0), None);
+
1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where + T: PartialEq,

Returns true if the slice contains an element with the given value.

+

This operation is O(n).

+

Note that if you have a sorted slice, binary_search may be faster.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.contains(&30));
+assert!(!v.contains(&50));
+

If you do not have a &T, but some other value that you can compare +with one (for example, String implements PartialEq<str>), you can +use iter().any:

+ +
let v = [String::from("hello"), String::from("world")]; // slice of `String`
+assert!(v.iter().any(|e| e == "hello")); // search with `&str`
+assert!(!v.iter().any(|e| e == "hi"));
+
1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.starts_with(&[10]));
+assert!(v.starts_with(&[10, 40]));
+assert!(v.starts_with(&v));
+assert!(!v.starts_with(&[50]));
+assert!(!v.starts_with(&[10, 50]));
+

Always returns true if needle is an empty slice:

+ +
let v = &[10, 40, 30];
+assert!(v.starts_with(&[]));
+let v: &[u8] = &[];
+assert!(v.starts_with(&[]));
+
1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.ends_with(&[30]));
+assert!(v.ends_with(&[40, 30]));
+assert!(v.ends_with(&v));
+assert!(!v.ends_with(&[50]));
+assert!(!v.ends_with(&[50, 30]));
+

Always returns true if needle is an empty slice:

+ +
let v = &[10, 40, 30];
+assert!(v.ends_with(&[]));
+let v: &[u8] = &[];
+assert!(v.ends_with(&[]));
+
1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where + P: SlicePattern<Item = T> + ?Sized, + T: PartialEq,

Returns a subslice with the prefix removed.

+

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. +If prefix is empty, simply returns the original slice. If prefix is equal to the +original slice, returns an empty slice.

+

If the slice does not start with prefix, returns None.

+
§Examples
+
let v = &[10, 40, 30];
+assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
+assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
+assert_eq!(v.strip_prefix(&[10, 40, 30]), Some(&[][..]));
+assert_eq!(v.strip_prefix(&[50]), None);
+assert_eq!(v.strip_prefix(&[10, 50]), None);
+
+let prefix : &str = "he";
+assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
+           Some(b"llo".as_ref()));
+
1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where + P: SlicePattern<Item = T> + ?Sized, + T: PartialEq,

Returns a subslice with the suffix removed.

+

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. +If suffix is empty, simply returns the original slice. If suffix is equal to the +original slice, returns an empty slice.

+

If the slice does not end with suffix, returns None.

+
§Examples
+
let v = &[10, 40, 30];
+assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
+assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
+assert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..]));
+assert_eq!(v.strip_suffix(&[50]), None);
+assert_eq!(v.strip_suffix(&[50, 30]), None);
+

Binary searches this slice for a given element. +If the slice is not sorted, the returned result is unspecified and +meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search_by, binary_search_by_key, and partition_point.

+
§Examples
+

Looks up a series of four elements. The first is found, with a +uniquely determined position; the second and third are not +found; the fourth could match any position in [1, 4].

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+assert_eq!(s.binary_search(&13),  Ok(9));
+assert_eq!(s.binary_search(&4),   Err(7));
+assert_eq!(s.binary_search(&100), Err(13));
+let r = s.binary_search(&1);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+

If you want to find that whole range of matching items, rather than +an arbitrary matching one, that can be done using partition_point:

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+let low = s.partition_point(|x| x < &1);
+assert_eq!(low, 1);
+let high = s.partition_point(|x| x <= &1);
+assert_eq!(high, 5);
+let r = s.binary_search(&1);
+assert!((low..high).contains(&r.unwrap()));
+
+assert!(s[..low].iter().all(|&x| x < 1));
+assert!(s[low..high].iter().all(|&x| x == 1));
+assert!(s[high..].iter().all(|&x| x > 1));
+
+// For something not found, the "range" of equal items is empty
+assert_eq!(s.partition_point(|x| x < &11), 9);
+assert_eq!(s.partition_point(|x| x <= &11), 9);
+assert_eq!(s.binary_search(&11), Err(9));
+

If you want to insert an item to a sorted vector, while maintaining +sort order, consider using partition_point:

+ +
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+let num = 42;
+let idx = s.partition_point(|&x| x <= num);
+// If `num` is unique, `s.partition_point(|&x| x < num)` (with `<`) is equivalent to
+// `s.binary_search(&num).unwrap_or_else(|x| x)`, but using `<=` will allow `insert`
+// to shift less elements.
+s.insert(idx, num);
+assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where + F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

+

The comparator function should return an order code that indicates +whether its argument is Less, Equal or Greater the desired +target. +If the slice is not sorted or if the comparator function does not +implement an order consistent with the sort order of the underlying +slice, the returned result is unspecified and meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search, binary_search_by_key, and partition_point.

+
§Examples
+

Looks up a series of four elements. The first is found, with a +uniquely determined position; the second and third are not +found; the fourth could match any position in [1, 4].

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+let seek = 13;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
+let seek = 4;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
+let seek = 100;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
+let seek = 1;
+let r = s.binary_search_by(|probe| probe.cmp(&seek));
+assert!(match r { Ok(1..=4) => true, _ => false, });
+
1.10.0 · source

pub fn binary_search_by_key<'a, B, F>( + &'a self, + b: &B, + f: F, +) -> Result<usize, usize>
where + F: FnMut(&'a T) -> B, + B: Ord,

Binary searches this slice with a key extraction function.

+

Assumes that the slice is sorted by the key, for instance with +sort_by_key using the same key extraction function. +If the slice is not sorted by the key, the returned result is +unspecified and meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search, binary_search_by, and partition_point.

+
§Examples
+

Looks up a series of four elements in a slice of pairs sorted by +their second elements. The first is found, with a uniquely +determined position; the second and third are not found; the +fourth could match any position in [1, 4].

+ +
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
+         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
+         (1, 21), (2, 34), (4, 55)];
+
+assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
+assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
+assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
+let r = s.binary_search_by_key(&1, |&(a, b)| b);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+
1.20.0 · source

pub fn sort_unstable(&mut self)
where + T: Ord,

Sorts the slice without preserving the initial order of equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

If T: Ord does not implement a total order the resulting order is unspecified. All +original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if T: Ord panics.

+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5, 4, 1, -3, 2];
+
+v.sort_unstable();
+assert!(v == [-5, -3, 1, 2, 4]);
+
1.20.0 · source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where + F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, without preserving the initial order of +equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

The comparator function should define a total ordering for the elements in the slice. If the +ordering is not total, the order of the elements is unspecified.

+

If the comparator function does not implement a total order the resulting order is +unspecified. All original elements will remain in the slice and any possible modifications +via interior mutability are observed in the input. Same is true if the comparator function +panics. A total order (for all a, b and c):

+
    +
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • +
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • +
+

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use +partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

+ +
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
+floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
+assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [5, 4, 1, 3, 2];
+v.sort_unstable_by(|a, b| a.cmp(b));
+assert!(v == [1, 2, 3, 4, 5]);
+
+// reverse sorting
+v.sort_unstable_by(|a, b| b.cmp(a));
+assert!(v == [5, 4, 3, 2, 1]);
+
1.20.0 · source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of +equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If K: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+v.sort_unstable_by_key(|k| k.abs());
+assert!(v == [1, 2, -3, 4, -5]);
+
1.49.0 · source

pub fn select_nth_unstable( + &mut self, + index: usize, +) -> (&mut [T], &mut T, &mut [T])
where + T: Ord,

Reorder the slice such that the element at index after the reordering is at its final +sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index. Additionally, this reordering is +unstable (i.e. any number of equal elements may end up at position index), in-place (i.e. +does not allocate), and runs in O(n) time. This function is also known as “kth element” +in other libraries.

+

It returns a triplet of the following from the reordered slice: the subslice prior to +index, the element at index, and the subslice after index; accordingly, the values in +those two subslices will respectively all be less-than-or-equal-to and +greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median.
+let (lesser, median, greater) = v.select_nth_unstable(2);
+
+assert!(lesser == [-3, -5] || lesser == [-5, -3]);
+assert_eq!(median, &mut 1);
+assert!(greater == [4, 2] || greater == [2, 4]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [-3, -5, 1, 2, 4] ||
+        v == [-5, -3, 1, 2, 4] ||
+        v == [-3, -5, 1, 4, 2] ||
+        v == [-5, -3, 1, 4, 2]);
+
1.49.0 · source

pub fn select_nth_unstable_by<F>( + &mut self, + index: usize, + compare: F, +) -> (&mut [T], &mut T, &mut [T])
where + F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index after the +reordering is at its final sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index using the comparator function. +Additionally, this reordering is unstable (i.e. any number of equal elements may end up at +position index), in-place (i.e. does not allocate), and runs in O(n) time. This +function is also known as “kth element” in other libraries.

+

It returns a triplet of the following from the slice reordered according to the provided +comparator function: the subslice prior to index, the element at index, and the subslice +after index; accordingly, the values in those two subslices will respectively all be +less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted in descending order.
+let (lesser, median, greater) = v.select_nth_unstable_by(2, |a, b| b.cmp(a));
+
+assert!(lesser == [4, 2] || lesser == [2, 4]);
+assert_eq!(median, &mut 1);
+assert!(greater == [-3, -5] || greater == [-5, -3]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [2, 4, 1, -5, -3] ||
+        v == [2, 4, 1, -3, -5] ||
+        v == [4, 2, 1, -5, -3] ||
+        v == [4, 2, 1, -3, -5]);
+
1.49.0 · source

pub fn select_nth_unstable_by_key<K, F>( + &mut self, + index: usize, + f: F, +) -> (&mut [T], &mut T, &mut [T])
where + F: FnMut(&T) -> K, + K: Ord,

Reorder the slice with a key extraction function such that the element at index after the +reordering is at its final sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index using the key extraction function. +Additionally, this reordering is unstable (i.e. any number of equal elements may end up at +position index), in-place (i.e. does not allocate), and runs in O(n) time. This +function is also known as “kth element” in other libraries.

+

It returns a triplet of the following from the slice reordered according to the provided key +extraction function: the subslice prior to index, the element at index, and the subslice +after index; accordingly, the values in those two subslices will respectively all be +less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted according to absolute value.
+let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
+
+assert!(lesser == [1, 2] || lesser == [2, 1]);
+assert_eq!(median, &mut -3);
+assert!(greater == [4, -5] || greater == [-5, 4]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [1, 2, -3, 4, -5] ||
+        v == [1, 2, -3, -5, 4] ||
+        v == [2, 1, -3, 4, -5] ||
+        v == [2, 1, -3, -5, 4]);
+
source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where + T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the +PartialEq trait implementation.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = [1, 2, 2, 3, 3, 2, 1, 1];
+
+let (dedup, duplicates) = slice.partition_dedup();
+
+assert_eq!(dedup, [1, 2, 3, 2, 1]);
+assert_eq!(duplicates, [2, 3, 1]);
+
source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where + F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying +a given equality relation.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

The same_bucket function is passed references to two elements from the slice and +must determine if the elements compare equal. The elements are passed in opposite order +from their order in the slice, so if same_bucket(a, b) returns true, a is moved +at the end of the slice.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"];
+
+let (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b));
+
+assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]);
+assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
+
source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where + F: FnMut(&mut T) -> K, + K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve +to the same key.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = [10, 20, 21, 30, 30, 20, 11, 13];
+
+let (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10);
+
+assert_eq!(dedup, [10, 20, 30, 20, 11]);
+assert_eq!(duplicates, [21, 30, 13]);
+
1.26.0 · source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +slice move to the end while the last self.len() - mid elements move to +the front. After calling rotate_left, the element previously at index +mid will become the first element in the slice.

+
§Panics
+

This function will panic if mid is greater than the length of the +slice. Note that mid == self.len() does not panic and is a no-op +rotation.

+
§Complexity
+

Takes linear (in self.len()) time.

+
§Examples
+
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a.rotate_left(2);
+assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
+

Rotating a subslice:

+ +
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a[1..5].rotate_left(1);
+assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
+
1.26.0 · source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +elements of the slice move to the end while the last k elements move +to the front. After calling rotate_right, the element previously at +index self.len() - k will become the first element in the slice.

+
§Panics
+

This function will panic if k is greater than the length of the +slice. Note that k == self.len() does not panic and is a no-op +rotation.

+
§Complexity
+

Takes linear (in self.len()) time.

+
§Examples
+
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a.rotate_right(2);
+assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
+

Rotating a subslice:

+ +
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a[1..5].rotate_right(1);
+assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
+
1.50.0 · source

pub fn fill(&mut self, value: T)
where + T: Clone,

Fills self with elements by cloning value.

+
§Examples
+
let mut buf = vec![0; 10];
+buf.fill(1);
+assert_eq!(buf, vec![1; 10]);
+
1.51.0 · source

pub fn fill_with<F>(&mut self, f: F)
where + F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

+

This method uses a closure to create new values. If you’d rather +Clone a given value, use fill. If you want to use the Default +trait to generate values, you can pass Default::default as the +argument.

+
§Examples
+
let mut buf = vec![1; 10];
+buf.fill_with(Default::default);
+assert_eq!(buf, vec![0; 10]);
+
1.7.0 · source

pub fn clone_from_slice(&mut self, src: &[T])
where + T: Clone,

Copies the elements from src into self.

+

The length of src must be the same as self.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Examples
+

Cloning two elements from a slice into another:

+ +
let src = [1, 2, 3, 4];
+let mut dst = [0, 0];
+
+// Because the slices have to be the same length,
+// we slice the source slice from four elements
+// to two. It will panic if we don't do this.
+dst.clone_from_slice(&src[2..]);
+
+assert_eq!(src, [1, 2, 3, 4]);
+assert_eq!(dst, [3, 4]);
+

Rust enforces that there can only be one mutable reference with no +immutable references to a particular piece of data in a particular +scope. Because of this, attempting to use clone_from_slice on a +single slice will result in a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+slice[..2].clone_from_slice(&slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.clone_from_slice(&right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 4, 5]);
+
1.9.0 · source

pub fn copy_from_slice(&mut self, src: &[T])
where + T: Copy,

Copies all elements from src into self, using a memcpy.

+

The length of src must be the same as self.

+

If T does not implement Copy, use clone_from_slice.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Examples
+

Copying two elements from a slice into another:

+ +
let src = [1, 2, 3, 4];
+let mut dst = [0, 0];
+
+// Because the slices have to be the same length,
+// we slice the source slice from four elements
+// to two. It will panic if we don't do this.
+dst.copy_from_slice(&src[2..]);
+
+assert_eq!(src, [1, 2, 3, 4]);
+assert_eq!(dst, [3, 4]);
+

Rust enforces that there can only be one mutable reference with no +immutable references to a particular piece of data in a particular +scope. Because of this, attempting to use copy_from_slice on a +single slice will result in a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+slice[..2].copy_from_slice(&slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.copy_from_slice(&right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 4, 5]);
+
1.37.0 · source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where + R: RangeBounds<usize>, + T: Copy,

Copies elements from one part of the slice to another part of itself, +using a memmove.

+

src is the range within self to copy from. dest is the starting +index of the range within self to copy to, which will have the same +length as src. The two ranges may overlap. The ends of the two ranges +must be less than or equal to self.len().

+
§Panics
+

This function will panic if either range exceeds the end of the slice, +or if the end of src is before the start.

+
§Examples
+

Copying four bytes within a slice:

+ +
let mut bytes = *b"Hello, World!";
+
+bytes.copy_within(1..5, 8);
+
+assert_eq!(&bytes, b"Hello, Wello!");
+
1.27.0 · source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+

The length of other must be the same as self.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Example
+

Swapping two elements across slices:

+ +
let mut slice1 = [0, 0];
+let mut slice2 = [1, 2, 3, 4];
+
+slice1.swap_with_slice(&mut slice2[2..]);
+
+assert_eq!(slice1, [3, 4]);
+assert_eq!(slice2, [1, 2, 0, 0]);
+

Rust enforces that there can only be one mutable reference to a +particular piece of data in a particular scope. Because of this, +attempting to use swap_with_slice on a single slice will result in +a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +mutable sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.swap_with_slice(&mut right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 1, 2]);
+
1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is +maintained.

+

This method splits the slice into three distinct slices: prefix, correctly aligned middle +slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

+

This method has no purpose when either input element T or output element U are +zero-sized and will return the original slice without splitting anything.

+
§Safety
+

This method is essentially a transmute with respect to the elements in the returned +middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

+
§Examples
+

Basic usage:

+ +
unsafe {
+    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
+    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
+    // less_efficient_algorithm_for_bytes(prefix);
+    // more_efficient_algorithm_for_aligned_shorts(shorts);
+    // less_efficient_algorithm_for_bytes(suffix);
+}
+
1.30.0 · source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the +types is maintained.

+

This method splits the slice into three distinct slices: prefix, correctly aligned middle +slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

+

This method has no purpose when either input element T or output element U are +zero-sized and will return the original slice without splitting anything.

+
§Safety
+

This method is essentially a transmute with respect to the elements in the returned +middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

+
§Examples
+

Basic usage:

+ +
unsafe {
+    let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
+    let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();
+    // less_efficient_algorithm_for_bytes(prefix);
+    // more_efficient_algorithm_for_aligned_shorts(shorts);
+    // less_efficient_algorithm_for_bytes(suffix);
+}
+
source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where + Simd<T, LANES>: AsRef<[T; LANES]>, + T: SimdElement, + LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

+

This is a safe wrapper around slice::align_to, so has the same weak +postconditions as that method. You’re only assured that +self.len() == prefix.len() + middle.len() * LANES + suffix.len().

+

Notably, all of the following are possible:

+
    +
  • prefix.len() >= LANES.
  • +
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • +
  • suffix.len() >= LANES.
  • +
+

That said, this is a safe method, so if you’re only writing safe code, +then this can at most cause incorrect logic, not unsoundness.

+
§Panics
+

This will panic if the size of the SIMD type is different from +LANES times that of the scalar.

+

At the time of writing, the trait restrictions on Simd<T, LANES> keeps +that from ever happening, as only power-of-two numbers of lanes are +supported. It’s possible that, in the future, those restrictions might +be lifted in a way that would make it possible to see panics from this +method for something like LANES == 3.

+
§Examples
+
#![feature(portable_simd)]
+use core::simd::prelude::*;
+
+let short = &[1, 2, 3];
+let (prefix, middle, suffix) = short.as_simd::<4>();
+assert_eq!(middle, []); // Not enough elements for anything in the middle
+
+// They might be split in any possible way between prefix and suffix
+let it = prefix.iter().chain(suffix).copied();
+assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
+
+fn basic_simd_sum(x: &[f32]) -> f32 {
+    use std::ops::Add;
+    let (prefix, middle, suffix) = x.as_simd();
+    let sums = f32x4::from_array([
+        prefix.iter().copied().sum(),
+        0.0,
+        0.0,
+        suffix.iter().copied().sum(),
+    ]);
+    let sums = middle.iter().copied().fold(sums, f32x4::add);
+    sums.reduce_sum()
+}
+
+let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
+assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
+
source

pub fn as_simd_mut<const LANES: usize>( + &mut self, +) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where + Simd<T, LANES>: AsMut<[T; LANES]>, + T: SimdElement, + LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a mutable slice into a mutable prefix, a middle of aligned SIMD types, +and a mutable suffix.

+

This is a safe wrapper around slice::align_to_mut, so has the same weak +postconditions as that method. You’re only assured that +self.len() == prefix.len() + middle.len() * LANES + suffix.len().

+

Notably, all of the following are possible:

+
    +
  • prefix.len() >= LANES.
  • +
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • +
  • suffix.len() >= LANES.
  • +
+

That said, this is a safe method, so if you’re only writing safe code, +then this can at most cause incorrect logic, not unsoundness.

+

This is the mutable version of slice::as_simd; see that for examples.

+
§Panics
+

This will panic if the size of the SIMD type is different from +LANES times that of the scalar.

+

At the time of writing, the trait restrictions on Simd<T, LANES> keeps +that from ever happening, as only power-of-two numbers of lanes are +supported. It’s possible that, in the future, those restrictions might +be lifted in a way that would make it possible to see panics from this +method for something like LANES == 3.

+
source

pub fn is_sorted(&self) -> bool
where + T: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

+

That is, for each element a and its following element b, a <= b must hold. If the +slice yields exactly zero or one element, true is returned.

+

Note that if Self::Item is only PartialOrd, but not Ord, the above definition +implies that this function returns false if any two consecutive items are not +comparable.

+
§Examples
+
#![feature(is_sorted)]
+let empty: [i32; 0] = [];
+
+assert!([1, 2, 2, 9].is_sorted());
+assert!(![1, 3, 2, 4].is_sorted());
+assert!([0].is_sorted());
+assert!(empty.is_sorted());
+assert!(![0.0, 1.0, f32::NAN].is_sorted());
+
source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where + F: FnMut(&'a T, &'a T) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

+

Instead of using PartialOrd::partial_cmp, this function uses the given compare +function to determine whether two elements are to be considered in sorted order.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!([1, 2, 2, 9].is_sorted_by(|a, b| a <= b));
+assert!(![1, 2, 2, 9].is_sorted_by(|a, b| a < b));
+
+assert!([0].is_sorted_by(|a, b| true));
+assert!([0].is_sorted_by(|a, b| false));
+
+let empty: [i32; 0] = [];
+assert!(empty.is_sorted_by(|a, b| false));
+assert!(empty.is_sorted_by(|a, b| true));
+
source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where + F: FnMut(&'a T) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

+

Instead of comparing the slice’s elements directly, this function compares the keys of the +elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its +documentation for more information.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
+assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
+
1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where + P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate +(the index of the first element of the second partition).

+

The slice is assumed to be partitioned according to the given predicate. +This means that all elements for which the predicate returns true are at the start of the slice +and all elements for which the predicate returns false are at the end. +For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 +(all odd numbers are at the start, all even at the end).

+

If this slice is not partitioned, the returned result is unspecified and meaningless, +as this method performs a kind of binary search.

+

See also binary_search, binary_search_by, and binary_search_by_key.

+
§Examples
+
let v = [1, 2, 3, 3, 5, 6, 7];
+let i = v.partition_point(|&x| x < 5);
+
+assert_eq!(i, 4);
+assert!(v[..i].iter().all(|&x| x < 5));
+assert!(v[i..].iter().all(|&x| !(x < 5)));
+

If all elements of the slice match the predicate, including if the slice +is empty, then the length of the slice will be returned:

+ +
let a = [2, 4, 8];
+assert_eq!(a.partition_point(|x| x < &100), a.len());
+let a: [i32; 0] = [];
+assert_eq!(a.partition_point(|x| x < &100), 0);
+

If you want to insert an item to a sorted vector, while maintaining +sort order:

+ +
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+let num = 42;
+let idx = s.partition_point(|&x| x <= num);
+s.insert(idx, num);
+assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where + R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range +and returns a reference to it.

+

Returns None and does not modify the slice if the given +range is out of bounds.

+

Note that this method only accepts one-sided ranges such as +2.. or ..6, but not 2..6.

+
§Examples
+

Taking the first three elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+let mut first_three = slice.take(..3).unwrap();
+
+assert_eq!(slice, &['d']);
+assert_eq!(first_three, &['a', 'b', 'c']);
+

Taking the last two elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+let mut tail = slice.take(2..).unwrap();
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(tail, &['c', 'd']);
+

Getting None when range is out of bounds:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+
+assert_eq!(None, slice.take(5..));
+assert_eq!(None, slice.take(..5));
+assert_eq!(None, slice.take(..=4));
+let expected: &[char] = &['a', 'b', 'c', 'd'];
+assert_eq!(Some(expected), slice.take(..4));
+
source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where + R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range +and returns a mutable reference to it.

+

Returns None and does not modify the slice if the given +range is out of bounds.

+

Note that this method only accepts one-sided ranges such as +2.. or ..6, but not 2..6.

+
§Examples
+

Taking the first three elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+let mut first_three = slice.take_mut(..3).unwrap();
+
+assert_eq!(slice, &mut ['d']);
+assert_eq!(first_three, &mut ['a', 'b', 'c']);
+

Taking the last two elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+let mut tail = slice.take_mut(2..).unwrap();
+
+assert_eq!(slice, &mut ['a', 'b']);
+assert_eq!(tail, &mut ['c', 'd']);
+

Getting None when range is out of bounds:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+
+assert_eq!(None, slice.take_mut(5..));
+assert_eq!(None, slice.take_mut(..5));
+assert_eq!(None, slice.take_mut(..=4));
+let expected: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+assert_eq!(Some(expected), slice.take_mut(..4));
+
source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c'];
+let first = slice.take_first().unwrap();
+
+assert_eq!(slice, &['b', 'c']);
+assert_eq!(first, &'a');
+
source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +reference to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
+let first = slice.take_first_mut().unwrap();
+*first = 'd';
+
+assert_eq!(slice, &['b', 'c']);
+assert_eq!(first, &'d');
+
source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c'];
+let last = slice.take_last().unwrap();
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(last, &'c');
+
source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +reference to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
+let last = slice.take_last_mut().unwrap();
+*last = 'd';
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(last, &'d');
+
source

pub unsafe fn get_many_unchecked_mut<const N: usize>( + &mut self, + indices: [usize; N], +) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

+

For a safe alternative see get_many_mut.

+
§Safety
+

Calling this method with overlapping or out-of-bounds indices is undefined behavior +even if the resulting references are not used.

+
§Examples
+
#![feature(get_many_mut)]
+
+let x = &mut [1, 2, 4];
+
+unsafe {
+    let [a, b] = x.get_many_unchecked_mut([0, 2]);
+    *a *= 10;
+    *b *= 100;
+}
+assert_eq!(x, &[10, 2, 400]);
+
source

pub fn get_many_mut<const N: usize>( + &mut self, + indices: [usize; N], +) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

+

Returns an error if any index is out-of-bounds, or if the same index was +passed more than once.

+
§Examples
+
#![feature(get_many_mut)]
+
+let v = &mut [1, 2, 3];
+if let Ok([a, b]) = v.get_many_mut([0, 2]) {
+    *a = 413;
+    *b = 612;
+}
+assert_eq!(v, &[413, 2, 612]);
+
1.0.0 · source

pub fn sort(&mut self)
where + T: Ord,

Sorts the slice, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) +worst-case.

+

If T: Ord does not implement a total order the resulting order is unspecified. All +original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if T: Ord panics.

+

When applicable, unstable sorting is preferred because it is generally faster than stable +sorting and it doesn’t allocate auxiliary memory. See +sort_unstable. The exception are partially sorted slices, which +may be better served with slice::sort.

+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5, 4, 1, -3, 2];
+
+v.sort();
+assert!(v == [-5, -3, 1, 2, 4]);
+
1.0.0 · source

pub fn sort_by<F>(&mut self, compare: F)
where + F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) +worst-case.

+

The comparator function should define a total ordering for the elements in the slice. If the +ordering is not total, the order of the elements is unspecified.

+

If the comparator function does not implement a total order the resulting order is +unspecified. All original elements will remain in the slice and any possible modifications +via interior mutability are observed in the input. Same is true if the comparator function +panics. A total order (for all a, b and c):

+
    +
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • +
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • +
+

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use +partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

+ +
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
+floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
+assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [5, 4, 1, 3, 2];
+v.sort_by(|a, b| a.cmp(b));
+assert!(v == [1, 2, 3, 4, 5]);
+
+// reverse sorting
+v.sort_by(|a, b| b.cmp(a));
+assert!(v == [5, 4, 3, 2, 1]);
+
1.7.0 · source

pub fn sort_by_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) +worst-case, where the key function is O(m).

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If K: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+v.sort_by_key(|k| k.abs());
+assert!(v == [1, 2, -3, 4, -5]);
+
1.34.0 · source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * +log(n)) worst-case, where the key function is O(m).

+

During sorting, the key function is called at most once per element, by using temporary +storage to remember the results of key evaluation. The order of calls to the key function is +unspecified and may change in future versions of the standard library.

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+

For simple key functions (e.g., functions that are property accesses or basic operations), +sort_by_key is likely to be faster.

+
§Current implementation
+

The current implementation is based on instruction-parallel-network sort by Lukas +Bergdoll, which combines the fast average case of randomized quicksort with the fast worst +case of heapsort, while achieving linear time on fully sorted and reversed inputs. And +O(k * log(n)) where k is the number of distinct elements in the input. It leverages +superscalar out-of-order execution capabilities commonly found in CPUs, to efficiently +perform the operation.

+

In the worst case, the algorithm allocates temporary storage in a Vec<(K, usize)> the +length of the slice.

+
§Examples
+
let mut v = [-5i32, 4, 32, -3, 2];
+
+v.sort_by_cached_key(|k| k.to_string());
+assert!(v == [-3, -5, 2, 32, 4]);
+
1.0.0 · source

pub fn to_vec(&self) -> Vec<T>
where + T: Clone,

Copies self into a new Vec.

+
§Examples
+
let s = [10, 40, 30];
+let x = s.to_vec();
+// Here, `s` and `x` can be modified independently.
+
source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where + A: Allocator, + T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::alloc::System;
+
+let s = [10, 40, 30];
+let x = s.to_vec_in(System);
+// Here, `s` and `x` can be modified independently.
+
1.40.0 · source

pub fn repeat(&self, n: usize) -> Vec<T>
where + T: Copy,

Creates a vector by copying a slice n times.

+
§Panics
+

This function will panic if the capacity would overflow.

+
§Examples
+

Basic usage:

+ +
assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
+

A panic upon overflow:

+ +
// this will panic at runtime
+b"0123456789abcdef".repeat(usize::MAX);
+
1.0.0 · source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where + [T]: Concat<Item>, + Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

+
§Examples
+
assert_eq!(["hello", "world"].concat(), "helloworld");
+assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
+
1.3.0 · source

pub fn join<Separator>( + &self, + sep: Separator, +) -> <[T] as Join<Separator>>::Output
where + [T]: Join<Separator>,

Flattens a slice of T into a single value Self::Output, placing a +given separator between each.

+
§Examples
+
assert_eq!(["hello", "world"].join(" "), "hello world");
+assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
+assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
+
1.0.0 · source

pub fn connect<Separator>( + &self, + sep: Separator, +) -> <[T] as Join<Separator>>::Output
where + [T]: Join<Separator>,

👎Deprecated since 1.3.0: renamed to join

Flattens a slice of T into a single value Self::Output, placing a +given separator between each.

+
§Examples
+
assert_eq!(["hello", "world"].connect(" "), "hello world");
+assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
+
1.23.0 · source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +is mapped to its ASCII upper case equivalent.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To uppercase the value in-place, use make_ascii_uppercase.

+
1.23.0 · source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +is mapped to its ASCII lower case equivalent.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To lowercase the value in-place, use make_ascii_lowercase.

+

Trait Implementations§

source§

impl<'arbitrary> Arbitrary<'arbitrary> for RawProofEntry

source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
source§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given +unstructured data. Read more
source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type +needs to construct itself. Read more
source§

impl AsRef<[u8]> for RawProofEntry

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for RawProofEntry

source§

fn clone(&self) -> RawProofEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RawProofEntry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RawProofEntry

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RawProofEntry

source§

fn default() -> RawProofEntry

Returns the “default value” for a type. Read more
source§

impl DerefMut for RawProofEntry

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Encode for RawProofEntry

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<RawProofEntry> for Vec<u8>

source§

fn from(val: RawProofEntry) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for RawProofEntry

source§

fn from(v: Vec<u8>) -> RawProofEntry

Converts to this type from the input type.
source§

impl PartialEq for RawProofEntry

source§

fn eq(&self, other: &RawProofEntry) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Deref for RawProofEntry

§

type Target = Vec<u8>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Eq for RawProofEntry

source§

impl StructuralPartialEq for RawProofEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.StatsCollector.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.StatsCollector.html new file mode 100644 index 0000000000..01ad6a226d --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.StatsCollector.html @@ -0,0 +1,33 @@ +StatsCollector in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::StatsCollector

source ·
pub struct StatsCollector {
+    pub sync_get_count: usize,
+    pub sync_get_prefixes_count: usize,
+    pub sync_iterate_count: usize,
+    /* private fields */
+}
Expand description

A proxy read syncer which keeps track of call statistics.

+

Fields§

§sync_get_count: usize

Count of sync_get calls made to the underlying read syncer.

+
§sync_get_prefixes_count: usize

Count of sync_get_prefixes calls made to the underlying read syncer.

+
§sync_iterate_count: usize

Count of sync_iterate calls made to the underlying read syncer.

+

Implementations§

source§

impl StatsCollector

source

pub fn new(rs: Box<dyn ReadSync>) -> StatsCollector

Construct a new instance, proxying to the given backing read syncer.

+

Trait Implementations§

source§

impl ReadSync for StatsCollector

source§

fn as_any(&self) -> &dyn Any

Return self as an Any object, useful for downcasting.
source§

fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse>

Fetch a single key and returns the corresponding proof.
source§

fn sync_get_prefixes( + &mut self, + request: GetPrefixesRequest, +) -> Result<ProofResponse>

Fetch all keys under the given prefixes and returns the corresponding proofs.
source§

fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse>

Seek to a given key and then fetch the specified number of following items +based on key iteration order.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/struct.TreeID.html b/rust/oasis_core_runtime/storage/mkvs/sync/struct.TreeID.html new file mode 100644 index 0000000000..b8205f556f --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/struct.TreeID.html @@ -0,0 +1,37 @@ +TreeID in oasis_core_runtime::storage::mkvs::sync - Rust

Struct oasis_core_runtime::storage::mkvs::sync::TreeID

source ·
pub struct TreeID {
+    pub root: Root,
+    pub position: Hash,
+}
Expand description

Identifies a specific tree and a position within that tree.

+

Fields§

§root: Root

The Merkle tree root.

+
§position: Hash

The caller’s position in the tree structure to allow +returning partial proofs if possible.

+

Trait Implementations§

source§

impl Clone for TreeID

source§

fn clone(&self) -> TreeID

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TreeID

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TreeID

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TreeID

source§

fn default() -> TreeID

Returns the “default value” for a type. Read more
source§

impl Encode for TreeID

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TreeID

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for TreeID

source§

fn eq(&self, other: &TreeID) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TreeID

source§

impl StructuralPartialEq for TreeID

Auto Trait Implementations§

§

impl Freeze for TreeID

§

impl RefUnwindSafe for TreeID

§

impl Send for TreeID

§

impl Sync for TreeID

§

impl Unpin for TreeID

§

impl UnwindSafe for TreeID

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/sync/trait.ReadSync.html b/rust/oasis_core_runtime/storage/mkvs/sync/trait.ReadSync.html new file mode 100644 index 0000000000..e94ea4ae79 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/sync/trait.ReadSync.html @@ -0,0 +1,20 @@ +ReadSync in oasis_core_runtime::storage::mkvs::sync - Rust

Trait oasis_core_runtime::storage::mkvs::sync::ReadSync

source ·
pub trait ReadSync {
+    // Required methods
+    fn as_any(&self) -> &dyn Any;
+    fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse>;
+    fn sync_get_prefixes(
+        &mut self,
+        request: GetPrefixesRequest,
+    ) -> Result<ProofResponse>;
+    fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse>;
+}
Expand description

ReadSync is the interface for synchronizing the in-memory cache +with another (potentially untrusted) MKVS.

+

Required Methods§

source

fn as_any(&self) -> &dyn Any

Return self as an Any object, useful for downcasting.

+
source

fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse>

Fetch a single key and returns the corresponding proof.

+
source

fn sync_get_prefixes( + &mut self, + request: GetPrefixesRequest, +) -> Result<ProofResponse>

Fetch all keys under the given prefixes and returns the corresponding proofs.

+
source

fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse>

Seek to a given key and then fetch the specified number of following items +based on key iteration order.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/trait.FallibleMKVS.html b/rust/oasis_core_runtime/storage/mkvs/trait.FallibleMKVS.html new file mode 100644 index 0000000000..534881c084 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/trait.FallibleMKVS.html @@ -0,0 +1,27 @@ +FallibleMKVS in oasis_core_runtime::storage::mkvs - Rust

Trait oasis_core_runtime::storage::mkvs::FallibleMKVS

source ·
pub trait FallibleMKVS {
+    // Required methods
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;
+    fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>;
+    fn cache_contains_key(&self, key: &[u8]) -> bool;
+    fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>>;
+    fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>;
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>;
+    fn iter(&self) -> Box<dyn Iterator + '_>;
+    fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash>;
+}
Expand description

Merklized key-value store where methods return errors instead of panicking.

+

Required Methods§

source

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Fetch entry with given key.

+
source

fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>

Fetch proof for entry with given key.

+
source

fn cache_contains_key(&self, key: &[u8]) -> bool

Check if the local MKVS cache contains the given key.

+

While get can be used to check if the MKVS as a whole contains +a given key, this function specifically guarantees that no remote +syncing will be invoked, only checking the local cache.

+
source

fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>>

Update entry with given key.

+

If the database did not have this key present, None is returned.

+

If the database did have this key present, the value is updated, and the old value is +returned.

+
source

fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>

Remove entry with given key, returning the value at the key if the key was previously +in the database.

+
source

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>

Populate the in-memory tree with nodes for keys starting with given prefixes.

+
source

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.

+
source

fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash>

Commit all database changes to the underlying store.

+

Implementations on Foreign Types§

source§

impl<T: FallibleMKVS + ?Sized> FallibleMKVS for &mut T

source§

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

source§

fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>

source§

fn cache_contains_key(&self, key: &[u8]) -> bool

source§

fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>>

source§

fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>

source§

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>

source§

fn iter(&self) -> Box<dyn Iterator + '_>

source§

fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash>

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/trait.ImmutableMKVS.html b/rust/oasis_core_runtime/storage/mkvs/trait.ImmutableMKVS.html new file mode 100644 index 0000000000..b353a7c615 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/trait.ImmutableMKVS.html @@ -0,0 +1,13 @@ +ImmutableMKVS in oasis_core_runtime::storage::mkvs - Rust

Trait oasis_core_runtime::storage::mkvs::ImmutableMKVS

source ·
pub trait ImmutableMKVS {
+    // Required methods
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;
+    fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>;
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>;
+    fn iter(&self) -> Box<dyn Iterator + '_>;
+}
Expand description

Immutable merkalized key value store.

+

Required Methods§

source

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Fetch entry with given key.

+
source

fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>

Fetch proof for entry with given key.

+
source

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>

Populate the in-memory tree with nodes for keys starting with given prefixes.

+
source

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/trait.Iterator.html b/rust/oasis_core_runtime/storage/mkvs/trait.Iterator.html new file mode 100644 index 0000000000..d0a166d01b --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/trait.Iterator.html @@ -0,0 +1,20 @@ +Iterator in oasis_core_runtime::storage::mkvs - Rust

Trait oasis_core_runtime::storage::mkvs::Iterator

source ·
pub trait Iterator: Iterator<Item = (Vec<u8>, Vec<u8>)> {
+    // Required methods
+    fn set_prefetch(&mut self, prefetch: usize);
+    fn is_valid(&self) -> bool;
+    fn error(&self) -> &Option<Error>;
+    fn rewind(&mut self);
+    fn seek(&mut self, key: &[u8]);
+    fn get_key(&self) -> &Option<Key>;
+    fn get_value(&self) -> &Option<Vec<u8>>;
+    fn next(&mut self);
+}
Expand description

An MKVS iterator.

+

Required Methods§

source

fn set_prefetch(&mut self, prefetch: usize)

Sets the number of next elements to prefetch.

+
source

fn is_valid(&self) -> bool

Return whether the iterator is valid.

+
source

fn error(&self) -> &Option<Error>

Return the error that occurred during iteration if any.

+
source

fn rewind(&mut self)

Moves the iterator to the first key in the tree.

+
source

fn seek(&mut self, key: &[u8])

Moves the iterator either at the given key or at the next larger key.

+
source

fn get_key(&self) -> &Option<Key>

The key under the iterator.

+
source

fn get_value(&self) -> &Option<Vec<u8>>

The value under the iterator.

+
source

fn next(&mut self)

Advance the iterator to the next key.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/trait.MKVS.html b/rust/oasis_core_runtime/storage/mkvs/trait.MKVS.html new file mode 100644 index 0000000000..a19962149e --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/trait.MKVS.html @@ -0,0 +1,39 @@ +MKVS in oasis_core_runtime::storage::mkvs - Rust

Trait oasis_core_runtime::storage::mkvs::MKVS

source ·
pub trait MKVS {
+    // Required methods
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;
+    fn get_proof(&self, key: &[u8]) -> Option<Proof>;
+    fn cache_contains_key(&self, key: &[u8]) -> bool;
+    fn insert(&mut self, key: &[u8], value: &[u8]) -> Option<Vec<u8>>;
+    fn remove(&mut self, key: &[u8]) -> Option<Vec<u8>>;
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16);
+    fn iter(&self) -> Box<dyn Iterator + '_>;
+    fn commit(
+        &mut self,
+        namespace: Namespace,
+        version: u64,
+    ) -> Result<(WriteLog, Hash)>;
+}
Expand description

Merklized key-value store.

+

Required Methods§

source

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.

+
source

fn get_proof(&self, key: &[u8]) -> Option<Proof>

Fetch proof for entry with given key.

+
source

fn cache_contains_key(&self, key: &[u8]) -> bool

Check if the local MKVS cache contains the given key.

+

While get can be used to check if the MKVS as a whole contains +a given key, this function specifically guarantees that no remote +syncing will be invoked, only checking the local cache.

+
source

fn insert(&mut self, key: &[u8], value: &[u8]) -> Option<Vec<u8>>

Update entry with given key.

+

If the database did not have this key present, None is returned.

+

If the database did have this key present, the value is updated, and the old value is +returned.

+
source

fn remove(&mut self, key: &[u8]) -> Option<Vec<u8>>

Remove entry with given key, returning the value at the key if the key was previously +in the database.

+
source

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.

+
source

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.

+
source

fn commit( + &mut self, + namespace: Namespace, + version: u64, +) -> Result<(WriteLog, Hash)>

Commit all database changes to the underlying store.

+

Implementations on Foreign Types§

source§

impl<T: MKVS + ?Sized> MKVS for &mut T

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

source§

fn get_proof(&self, key: &[u8]) -> Option<Proof>

source§

fn cache_contains_key(&self, key: &[u8]) -> bool

source§

fn insert(&mut self, key: &[u8], value: &[u8]) -> Option<Vec<u8>>

source§

fn remove(&mut self, key: &[u8]) -> Option<Vec<u8>>

source§

fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16)

source§

fn iter(&self) -> Box<dyn Iterator + '_>

source§

fn commit( + &mut self, + namespace: Namespace, + version: u64, +) -> Result<(WriteLog, Hash)>

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/node/enum.NodeBox.html b/rust/oasis_core_runtime/storage/mkvs/tree/node/enum.NodeBox.html new file mode 100644 index 0000000000..2f6b0b9a66 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/node/enum.NodeBox.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/enum.NodeBox.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/node/enum.RootType.html b/rust/oasis_core_runtime/storage/mkvs/tree/node/enum.RootType.html new file mode 100644 index 0000000000..35115b13e9 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/node/enum.RootType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/enum.RootType.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/node/struct.NodePointer.html b/rust/oasis_core_runtime/storage/mkvs/tree/node/struct.NodePointer.html new file mode 100644 index 0000000000..f61d26d524 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/node/struct.NodePointer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/struct.NodePointer.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/node/struct.Root.html b/rust/oasis_core_runtime/storage/mkvs/tree/node/struct.Root.html new file mode 100644 index 0000000000..200016b118 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/node/struct.Root.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/struct.Root.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/node/type.Depth.html b/rust/oasis_core_runtime/storage/mkvs/tree/node/type.Depth.html new file mode 100644 index 0000000000..69ff461108 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/node/type.Depth.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/type.Depth.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/node/type.Key.html b/rust/oasis_core_runtime/storage/mkvs/tree/node/type.Key.html new file mode 100644 index 0000000000..aad7a2c6c1 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/node/type.Key.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/type.Key.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/node/type.NodePtrRef.html b/rust/oasis_core_runtime/storage/mkvs/tree/node/type.NodePtrRef.html new file mode 100644 index 0000000000..75f222ad35 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/node/type.NodePtrRef.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/type.NodePtrRef.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/overlay/struct.OverlayTree.html b/rust/oasis_core_runtime/storage/mkvs/tree/overlay/struct.OverlayTree.html new file mode 100644 index 0000000000..2afe9447db --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/overlay/struct.OverlayTree.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_core_runtime/storage/mkvs/struct.OverlayTree.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/tree/struct.Tree.html b/rust/oasis_core_runtime/storage/mkvs/tree/struct.Tree.html new file mode 100644 index 0000000000..44c0a4ea0d --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/tree/struct.Tree.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_core_runtime/storage/mkvs/struct.Tree.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/type.Depth.html b/rust/oasis_core_runtime/storage/mkvs/type.Depth.html new file mode 100644 index 0000000000..0a9b06ab92 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/type.Depth.html @@ -0,0 +1 @@ +Depth in oasis_core_runtime::storage::mkvs - Rust

Type Alias oasis_core_runtime::storage::mkvs::Depth

source ·
pub type Depth = u16;
\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/type.Key.html b/rust/oasis_core_runtime/storage/mkvs/type.Key.html new file mode 100644 index 0000000000..039adffa7e --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/type.Key.html @@ -0,0 +1 @@ +Key in oasis_core_runtime::storage::mkvs - Rust

Type Alias oasis_core_runtime::storage::mkvs::Key

source ·
pub type Key = Vec<u8>;

Aliased Type§

struct Key { /* private fields */ }

Trait Implementations§

source§

impl Marshal for Key

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

Marshal the object into a binary form and return it as a new vector.
source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

Unmarshal from the given byte slice reference and modify self.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/type.NodePtrRef.html b/rust/oasis_core_runtime/storage/mkvs/type.NodePtrRef.html new file mode 100644 index 0000000000..a9f23c8843 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/type.NodePtrRef.html @@ -0,0 +1,2 @@ +NodePtrRef in oasis_core_runtime::storage::mkvs - Rust

Type Alias oasis_core_runtime::storage::mkvs::NodePtrRef

source ·
pub type NodePtrRef = Rc<RefCell<NodePointer>>;
Expand description

A reference-counted pointer to a pointer.

+

Aliased Type§

struct NodePtrRef { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/mkvs/type.WriteLog.html b/rust/oasis_core_runtime/storage/mkvs/type.WriteLog.html new file mode 100644 index 0000000000..f36c4800d4 --- /dev/null +++ b/rust/oasis_core_runtime/storage/mkvs/type.WriteLog.html @@ -0,0 +1,3 @@ +WriteLog in oasis_core_runtime::storage::mkvs - Rust

Type Alias oasis_core_runtime::storage::mkvs::WriteLog

source ·
pub type WriteLog = Vec<LogEntry>;
Expand description

The write log.

+

The keys in the write log must be unique.

+

Aliased Type§

struct WriteLog { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/sidebar-items.js b/rust/oasis_core_runtime/storage/sidebar-items.js new file mode 100644 index 0000000000..aadffdb994 --- /dev/null +++ b/rust/oasis_core_runtime/storage/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["mkvs"],"struct":["UntrustedInMemoryStorage"],"trait":["KeyValue"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/struct.UntrustedInMemoryStorage.html b/rust/oasis_core_runtime/storage/struct.UntrustedInMemoryStorage.html new file mode 100644 index 0000000000..5cc352096c --- /dev/null +++ b/rust/oasis_core_runtime/storage/struct.UntrustedInMemoryStorage.html @@ -0,0 +1,22 @@ +UntrustedInMemoryStorage in oasis_core_runtime::storage - Rust
pub struct UntrustedInMemoryStorage { /* private fields */ }
Expand description

Untrusted key/value storage which stores arbitrary binary key/value pairs +in memory.

+

Implementations§

Trait Implementations§

source§

impl Default for UntrustedInMemoryStorage

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl KeyValue for UntrustedInMemoryStorage

source§

fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>

Fetch the value for a specific key.
source§

fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>

Store a specific key/value into storage.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/storage/trait.KeyValue.html b/rust/oasis_core_runtime/storage/trait.KeyValue.html new file mode 100644 index 0000000000..d6eec1b8d3 --- /dev/null +++ b/rust/oasis_core_runtime/storage/trait.KeyValue.html @@ -0,0 +1,8 @@ +KeyValue in oasis_core_runtime::storage - Rust

Trait oasis_core_runtime::storage::KeyValue

source ·
pub trait KeyValue: Send + Sync {
+    // Required methods
+    fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>;
+    fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>;
+}
Expand description

Trivial key/value storage.

+

Required Methods§

source

fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>

Fetch the value for a specific key.

+
source

fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>

Store a specific key/value into storage.

+

Implementations on Foreign Types§

source§

impl<T: ?Sized + KeyValue> KeyValue for Arc<T>

source§

fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>

source§

fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/struct.BUILD_INFO.html b/rust/oasis_core_runtime/struct.BUILD_INFO.html new file mode 100644 index 0000000000..61c2e0c3b9 --- /dev/null +++ b/rust/oasis_core_runtime/struct.BUILD_INFO.html @@ -0,0 +1,20 @@ +BUILD_INFO in oasis_core_runtime - Rust

Struct oasis_core_runtime::BUILD_INFO

source ·
pub struct BUILD_INFO { /* private fields */ }

Trait Implementations§

source§

impl Deref for BUILD_INFO

§

type Target = BuildInfo

The resulting type after dereferencing.
source§

fn deref(&self) -> &BuildInfo

Dereferences the value.
source§

impl LazyStatic for BUILD_INFO

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/struct.BuildInfo.html b/rust/oasis_core_runtime/struct.BuildInfo.html new file mode 100644 index 0000000000..867a6c42ab --- /dev/null +++ b/rust/oasis_core_runtime/struct.BuildInfo.html @@ -0,0 +1,28 @@ +BuildInfo in oasis_core_runtime - Rust

Struct oasis_core_runtime::BuildInfo

source ·
pub struct BuildInfo {
+    pub tee_type: TeeType,
+    pub protocol_version: Version,
+    pub is_secure: bool,
+}
Expand description

Runtime build information.

+

Fields§

§tee_type: TeeType

TEE type this build is for.

+
§protocol_version: Version

Supported runtime protocol version.

+
§is_secure: bool

True iff the build can provide integrity and confidentiality.

+

Trait Implementations§

source§

impl Debug for BuildInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/context/index.html b/rust/oasis_core_runtime/transaction/context/index.html new file mode 100644 index 0000000000..8942e4075d --- /dev/null +++ b/rust/oasis_core_runtime/transaction/context/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::transaction::context - Rust

Module oasis_core_runtime::transaction::context

source ·
Expand description

Runtime call context.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/context/sidebar-items.js b/rust/oasis_core_runtime/transaction/context/sidebar-items.js new file mode 100644 index 0000000000..d31239d146 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/context/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Context"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/context/struct.Context.html b/rust/oasis_core_runtime/transaction/context/struct.Context.html new file mode 100644 index 0000000000..0b46fc4c97 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/context/struct.Context.html @@ -0,0 +1,51 @@ +Context in oasis_core_runtime::transaction::context - Rust

Struct oasis_core_runtime::transaction::context::Context

source ·
pub struct Context<'a> {
+    pub protocol: Arc<Protocol>,
+    pub consensus_block: &'a LightBlock,
+    pub consensus_state: ConsensusState,
+    pub runtime_state: &'a mut dyn MKVS,
+    pub header: &'a Header,
+    pub epoch: EpochTime,
+    pub round_results: &'a RoundResults,
+    pub max_messages: u32,
+    pub check_only: bool,
+}
Expand description

Transaction context.

+

Fields§

§protocol: Arc<Protocol>

Low-level access to the underlying Runtime Host Protocol.

+
§consensus_block: &'a LightBlock

Consensus light block.

+
§consensus_state: ConsensusState

Consensus state tree.

+
§runtime_state: &'a mut dyn MKVS

Runtime state.

+
§header: &'a Header

The block header accompanying this transaction.

+
§epoch: EpochTime

Epoch corresponding to the currently processed block.

+
§round_results: &'a RoundResults

Results of processing the previous successful round.

+
§max_messages: u32

The maximum number of messages that can be emitted in this round.

+
§check_only: bool

Flag indicating whether to only perform transaction check rather than +running the transaction.

+

Implementations§

source§

impl<'a> Context<'a>

source

pub fn new( + protocol: Arc<Protocol>, + consensus_block: &'a LightBlock, + consensus_state: ConsensusState, + runtime_state: &'a mut dyn MKVS, + header: &'a Header, + epoch: EpochTime, + round_results: &'a RoundResults, + max_messages: u32, + check_only: bool, +) -> Self

Construct new transaction context.

+

Auto Trait Implementations§

§

impl<'a> !Freeze for Context<'a>

§

impl<'a> !RefUnwindSafe for Context<'a>

§

impl<'a> !Send for Context<'a>

§

impl<'a> !Sync for Context<'a>

§

impl<'a> Unpin for Context<'a>

§

impl<'a> !UnwindSafe for Context<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/dispatcher/index.html b/rust/oasis_core_runtime/transaction/dispatcher/index.html new file mode 100644 index 0000000000..aac3e9a640 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/dispatcher/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::transaction::dispatcher - Rust

Module oasis_core_runtime::transaction::dispatcher

source ·
Expand description

Runtime transaction batch dispatcher.

+

Structs§

Traits§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/dispatcher/sidebar-items.js b/rust/oasis_core_runtime/transaction/dispatcher/sidebar-items.js new file mode 100644 index 0000000000..a4c35317ef --- /dev/null +++ b/rust/oasis_core_runtime/transaction/dispatcher/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ExecuteBatchResult","ExecuteTxResult","NoopDispatcher"],"trait":["Dispatcher"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/dispatcher/struct.ExecuteBatchResult.html b/rust/oasis_core_runtime/transaction/dispatcher/struct.ExecuteBatchResult.html new file mode 100644 index 0000000000..91eda4e8bc --- /dev/null +++ b/rust/oasis_core_runtime/transaction/dispatcher/struct.ExecuteBatchResult.html @@ -0,0 +1,33 @@ +ExecuteBatchResult in oasis_core_runtime::transaction::dispatcher - Rust
pub struct ExecuteBatchResult {
+    pub results: Vec<ExecuteTxResult>,
+    pub messages: Vec<Message>,
+    pub in_msgs_count: usize,
+    pub block_tags: Tags,
+    pub tx_reject_hashes: Vec<Hash>,
+}
Expand description

Result of processing a batch of ExecuteTx.

+

Fields§

§results: Vec<ExecuteTxResult>

Per-transaction execution results.

+
§messages: Vec<Message>

Emitted runtime messages.

+
§in_msgs_count: usize

Number of processed incoming messages.

+
§block_tags: Tags

Block emitted tags (not emitted by a specific transaction).

+
§tx_reject_hashes: Vec<Hash>

Hashes of transactions to reject.

+

Note that these are only taken into account in schedule execution mode.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/dispatcher/struct.ExecuteTxResult.html b/rust/oasis_core_runtime/transaction/dispatcher/struct.ExecuteTxResult.html new file mode 100644 index 0000000000..07ebc5153d --- /dev/null +++ b/rust/oasis_core_runtime/transaction/dispatcher/struct.ExecuteTxResult.html @@ -0,0 +1,26 @@ +ExecuteTxResult in oasis_core_runtime::transaction::dispatcher - Rust
pub struct ExecuteTxResult {
+    pub output: Vec<u8>,
+    pub tags: Tags,
+}
Expand description

Result of processing an ExecuteTx.

+

Fields§

§output: Vec<u8>

Transaction output.

+
§tags: Tags

Emitted tags.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/dispatcher/struct.NoopDispatcher.html b/rust/oasis_core_runtime/transaction/dispatcher/struct.NoopDispatcher.html new file mode 100644 index 0000000000..6eb8fdc4c1 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/dispatcher/struct.NoopDispatcher.html @@ -0,0 +1,42 @@ +NoopDispatcher in oasis_core_runtime::transaction::dispatcher - Rust
pub struct NoopDispatcher;
Expand description

No-op dispatcher.

+

This is mainly used by the runtime dispatcher as a fallback in case +the runtime’s initializer doesn’t produce its own dispatcher object.

+

Trait Implementations§

source§

impl Default for NoopDispatcher

source§

fn default() -> NoopDispatcher

Returns the “default value” for a type. Read more
source§

impl Dispatcher for NoopDispatcher

source§

fn is_supported(&self) -> bool

Whether dispatch is supported by this dispatcher.
source§

fn execute_batch( + &self, + _ctx: Context<'_>, + _batch: &TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

Execute the transactions in the given batch. Read more
source§

fn schedule_and_execute_batch( + &self, + _ctx: Context<'_>, + _initial_batch: &mut TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

Schedule and execute transactions in the given batch. Read more
source§

fn check_batch( + &self, + _ctx: Context<'_>, + _batch: &TxnBatch, +) -> Result<Vec<CheckTxResult>, RuntimeError>

Check the transactions in the given batch for validity. Read more
source§

fn finalize(&self, _new_storage_root: Hash)

Invoke the finalizer (if any).
source§

fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>)

Configure abort batch flag.
source§

fn query( + &self, + _ctx: Context<'_>, + _method: &str, + _args: Vec<u8>, +) -> Result<Vec<u8>, RuntimeError>

Process a query. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/dispatcher/trait.Dispatcher.html b/rust/oasis_core_runtime/transaction/dispatcher/trait.Dispatcher.html new file mode 100644 index 0000000000..7717d5adb2 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/dispatcher/trait.Dispatcher.html @@ -0,0 +1,112 @@ +Dispatcher in oasis_core_runtime::transaction::dispatcher - Rust
pub trait Dispatcher: Send + Sync {
+    // Required methods
+    fn execute_batch(
+        &self,
+        ctx: Context<'_>,
+        batch: &TxnBatch,
+        in_msgs: &[IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError>;
+    fn check_batch(
+        &self,
+        ctx: Context<'_>,
+        batch: &TxnBatch,
+    ) -> Result<Vec<CheckTxResult>, RuntimeError>;
+
+    // Provided methods
+    fn is_supported(&self) -> bool { ... }
+    fn schedule_and_execute_batch(
+        &self,
+        _ctx: Context<'_>,
+        _initial_batch: &mut TxnBatch,
+        _in_msgs: &[IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> { ... }
+    fn finalize(&self, _new_storage_root: Hash) { ... }
+    fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>) { ... }
+    fn query(
+        &self,
+        _ctx: Context<'_>,
+        _method: &str,
+        _args: Vec<u8>,
+    ) -> Result<Vec<u8>, RuntimeError> { ... }
+}
Expand description

Runtime transaction dispatcher trait.

+

It defines the interface used by the runtime call dispatcher +to process transactions.

+

Required Methods§

source

fn execute_batch( + &self, + ctx: Context<'_>, + batch: &TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

Execute the transactions in the given batch.

+
§Consensus Layer State Integrity
+

Before this method is invoked, consensus layer state integrity verification is performed.

+
source

fn check_batch( + &self, + ctx: Context<'_>, + batch: &TxnBatch, +) -> Result<Vec<CheckTxResult>, RuntimeError>

Check the transactions in the given batch for validity.

+
§Consensus Layer State Integrity
+

No consensus layer state integrity verification is performed for queries by default. The +runtime dispatcher implementation should perform integrity verification if needed on a +query-by-query basis.

+

Provided Methods§

source

fn is_supported(&self) -> bool

Whether dispatch is supported by this dispatcher.

+
source

fn schedule_and_execute_batch( + &self, + _ctx: Context<'_>, + _initial_batch: &mut TxnBatch, + _in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

Schedule and execute transactions in the given batch.

+

The passed batch is an initial batch. In case the runtime needs additional items it should +request them from the host.

+
§Consensus Layer State Integrity
+

Before this method is invoked, consensus layer state integrity verification is performed.

+
source

fn finalize(&self, _new_storage_root: Hash)

Invoke the finalizer (if any).

+
source

fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>)

Configure abort batch flag.

+
source

fn query( + &self, + _ctx: Context<'_>, + _method: &str, + _args: Vec<u8>, +) -> Result<Vec<u8>, RuntimeError>

Process a query.

+
§Consensus Layer State Integrity
+

No consensus layer state integrity verification is performed for queries by default. The +runtime dispatcher implementation should perform integrity verification if needed on a +query-by-query basis.

+

Implementations on Foreign Types§

source§

impl<T: Dispatcher + ?Sized> Dispatcher for Box<T>

source§

fn execute_batch( + &self, + ctx: Context<'_>, + batch: &TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

source§

fn schedule_and_execute_batch( + &self, + ctx: Context<'_>, + initial_batch: &mut TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

source§

fn check_batch( + &self, + ctx: Context<'_>, + batch: &TxnBatch, +) -> Result<Vec<CheckTxResult>, RuntimeError>

source§

fn finalize(&self, new_storage_root: Hash)

source§

fn set_abort_batch_flag(&mut self, abort_batch: Arc<AtomicBool>)

source§

fn query( + &self, + ctx: Context<'_>, + method: &str, + args: Vec<u8>, +) -> Result<Vec<u8>, RuntimeError>

source§

impl<T: Dispatcher + ?Sized> Dispatcher for Arc<T>

source§

fn execute_batch( + &self, + ctx: Context<'_>, + batch: &TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

source§

fn schedule_and_execute_batch( + &self, + ctx: Context<'_>, + initial_batch: &mut TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

source§

fn check_batch( + &self, + ctx: Context<'_>, + batch: &TxnBatch, +) -> Result<Vec<CheckTxResult>, RuntimeError>

source§

fn finalize(&self, new_storage_root: Hash)

source§

fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>)

source§

fn query( + &self, + ctx: Context<'_>, + method: &str, + args: Vec<u8>, +) -> Result<Vec<u8>, RuntimeError>

Implementors§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/index.html b/rust/oasis_core_runtime/transaction/index.html new file mode 100644 index 0000000000..f9a3299525 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::transaction - Rust

Module oasis_core_runtime::transaction

source ·
Expand description

Runtime transaction processing.

+

Re-exports§

Modules§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/rwset/index.html b/rust/oasis_core_runtime/transaction/rwset/index.html new file mode 100644 index 0000000000..ccfc3554f6 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/rwset/index.html @@ -0,0 +1,3 @@ +oasis_core_runtime::transaction::rwset - Rust

Module oasis_core_runtime::transaction::rwset

source ·
Expand description

Read/write set.

+

Structs§

Type Aliases§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/rwset/sidebar-items.js b/rust/oasis_core_runtime/transaction/rwset/sidebar-items.js new file mode 100644 index 0000000000..944a1ea3a0 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/rwset/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["CoarsenedKey","ReadWriteSet"],"type":["CoarsenedSet"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/rwset/struct.CoarsenedKey.html b/rust/oasis_core_runtime/transaction/rwset/struct.CoarsenedKey.html new file mode 100644 index 0000000000..80b0da1e82 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/rwset/struct.CoarsenedKey.html @@ -0,0 +1,35 @@ +CoarsenedKey in oasis_core_runtime::transaction::rwset - Rust

Struct oasis_core_runtime::transaction::rwset::CoarsenedKey

source ·
pub struct CoarsenedKey(pub Vec<u8>);
Expand description

A coarsened key prefix that represents any key that starts with +this prefix.

+

Tuple Fields§

§0: Vec<u8>

Trait Implementations§

source§

impl AsRef<[u8]> for CoarsenedKey

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for CoarsenedKey

source§

fn clone(&self) -> CoarsenedKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CoarsenedKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CoarsenedKey

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CoarsenedKey

source§

fn default() -> CoarsenedKey

Returns the “default value” for a type. Read more
source§

impl Encode for CoarsenedKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<CoarsenedKey> for Vec<u8>

source§

fn from(val: CoarsenedKey) -> Self

Converts to this type from the input type.
source§

impl From<Vec<u8>> for CoarsenedKey

source§

fn from(v: Vec<u8>) -> CoarsenedKey

Converts to this type from the input type.
source§

impl PartialEq for CoarsenedKey

source§

fn eq(&self, other: &CoarsenedKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for CoarsenedKey

source§

impl StructuralPartialEq for CoarsenedKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/rwset/struct.ReadWriteSet.html b/rust/oasis_core_runtime/transaction/rwset/struct.ReadWriteSet.html new file mode 100644 index 0000000000..c7bb6e091f --- /dev/null +++ b/rust/oasis_core_runtime/transaction/rwset/struct.ReadWriteSet.html @@ -0,0 +1,38 @@ +ReadWriteSet in oasis_core_runtime::transaction::rwset - Rust

Struct oasis_core_runtime::transaction::rwset::ReadWriteSet

source ·
pub struct ReadWriteSet {
+    pub granularity: u16,
+    pub read_set: CoarsenedSet,
+    pub write_set: CoarsenedSet,
+}
Expand description

A read/write set.

+

Fields§

§granularity: u16

Size of the key prefixes (in bytes) used for coarsening the keys.

+
§read_set: CoarsenedSet

The read set.

+
§write_set: CoarsenedSet

The write set.

+

Trait Implementations§

source§

impl Clone for ReadWriteSet

source§

fn clone(&self) -> ReadWriteSet

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ReadWriteSet

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ReadWriteSet

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ReadWriteSet

source§

fn default() -> ReadWriteSet

Returns the “default value” for a type. Read more
source§

impl Encode for ReadWriteSet

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ReadWriteSet

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for ReadWriteSet

source§

fn eq(&self, other: &ReadWriteSet) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ReadWriteSet

source§

impl StructuralPartialEq for ReadWriteSet

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/rwset/type.CoarsenedSet.html b/rust/oasis_core_runtime/transaction/rwset/type.CoarsenedSet.html new file mode 100644 index 0000000000..459e782201 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/rwset/type.CoarsenedSet.html @@ -0,0 +1,2 @@ +CoarsenedSet in oasis_core_runtime::transaction::rwset - Rust

Type Alias oasis_core_runtime::transaction::rwset::CoarsenedSet

source ·
pub type CoarsenedSet = Vec<CoarsenedKey>;
Expand description

A set of coarsened keys.

+

Aliased Type§

struct CoarsenedSet { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/sidebar-items.js b/rust/oasis_core_runtime/transaction/sidebar-items.js new file mode 100644 index 0000000000..08de1a7a93 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["context","dispatcher","rwset","tags","tree","types"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/tags/index.html b/rust/oasis_core_runtime/transaction/tags/index.html new file mode 100644 index 0000000000..103296f129 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/tags/index.html @@ -0,0 +1,4 @@ +oasis_core_runtime::transaction::tags - Rust

Module oasis_core_runtime::transaction::tags

source ·
Expand description

Transaction tags.

+

Structs§

  • Tag is a key/value pair of arbitrary byte blobs with runtime-dependent +semantics which can be indexed to allow easier lookup of blocks and +transactions on runtime clients.

Type Aliases§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/tags/sidebar-items.js b/rust/oasis_core_runtime/transaction/tags/sidebar-items.js new file mode 100644 index 0000000000..f4d6c72543 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/tags/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Tag"],"type":["Tags"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/tags/struct.Tag.html b/rust/oasis_core_runtime/transaction/tags/struct.Tag.html new file mode 100644 index 0000000000..d2f699a04d --- /dev/null +++ b/rust/oasis_core_runtime/transaction/tags/struct.Tag.html @@ -0,0 +1,34 @@ +Tag in oasis_core_runtime::transaction::tags - Rust

Struct oasis_core_runtime::transaction::tags::Tag

source ·
pub struct Tag {
+    pub key: Vec<u8>,
+    pub value: Vec<u8>,
+    pub tx_hash: Hash,
+}
Expand description

Tag is a key/value pair of arbitrary byte blobs with runtime-dependent +semantics which can be indexed to allow easier lookup of blocks and +transactions on runtime clients.

+

Fields§

§key: Vec<u8>

The tag key.

+
§value: Vec<u8>

The tag value.

+
§tx_hash: Hash

The hash of the transaction that emitted the tag.

+

Implementations§

source§

impl Tag

source

pub fn new(key: Vec<u8>, value: Vec<u8>) -> Self

Create a new tag.

+

The transaction hash is not initialized.

+

Trait Implementations§

source§

impl Clone for Tag

source§

fn clone(&self) -> Tag

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Tag

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Tag

source§

fn default() -> Tag

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Tag

§

impl RefUnwindSafe for Tag

§

impl Send for Tag

§

impl Sync for Tag

§

impl Unpin for Tag

§

impl UnwindSafe for Tag

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/tags/type.Tags.html b/rust/oasis_core_runtime/transaction/tags/type.Tags.html new file mode 100644 index 0000000000..005c55365d --- /dev/null +++ b/rust/oasis_core_runtime/transaction/tags/type.Tags.html @@ -0,0 +1,2 @@ +Tags in oasis_core_runtime::transaction::tags - Rust

Type Alias oasis_core_runtime::transaction::tags::Tags

source ·
pub type Tags = Vec<Tag>;
Expand description

A set of tags.

+

Aliased Type§

struct Tags { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/tree/constant.TAG_BLOCK_TX_HASH.html b/rust/oasis_core_runtime/transaction/tree/constant.TAG_BLOCK_TX_HASH.html new file mode 100644 index 0000000000..cde650b0c5 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/tree/constant.TAG_BLOCK_TX_HASH.html @@ -0,0 +1,2 @@ +TAG_BLOCK_TX_HASH in oasis_core_runtime::transaction::tree - Rust

Constant oasis_core_runtime::transaction::tree::TAG_BLOCK_TX_HASH

source ·
pub const TAG_BLOCK_TX_HASH: Hash;
Expand description

Hash used for block emitted tags not tied to a specific transaction.

+
\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/tree/index.html b/rust/oasis_core_runtime/transaction/tree/index.html new file mode 100644 index 0000000000..512e1e45f4 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/tree/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::transaction::tree - Rust

Module oasis_core_runtime::transaction::tree

source ·
Expand description

Transaction I/O tree.

+

Structs§

  • A Merkle tree containing transaction artifacts.

Constants§

  • Hash used for block emitted tags not tied to a specific transaction.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/tree/sidebar-items.js b/rust/oasis_core_runtime/transaction/tree/sidebar-items.js new file mode 100644 index 0000000000..245f7e584c --- /dev/null +++ b/rust/oasis_core_runtime/transaction/tree/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["TAG_BLOCK_TX_HASH"],"struct":["Tree"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/tree/struct.Tree.html b/rust/oasis_core_runtime/transaction/tree/struct.Tree.html new file mode 100644 index 0000000000..6c0aa2b474 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/tree/struct.Tree.html @@ -0,0 +1,31 @@ +Tree in oasis_core_runtime::transaction::tree - Rust

Struct oasis_core_runtime::transaction::tree::Tree

source ·
pub struct Tree { /* private fields */ }
Expand description

A Merkle tree containing transaction artifacts.

+

Implementations§

source§

impl Tree

source

pub fn new(read_syncer: Box<dyn ReadSync>, io_root: Root) -> Self

Create a new transaction artifacts tree.

+
source

pub fn add_input(&mut self, input: Vec<u8>, batch_order: u32) -> Result<()>

Add an input transaction artifact.

+
source

pub fn add_output( + &mut self, + tx_hash: Hash, + output: Vec<u8>, + tags: Tags, +) -> Result<()>

Add an output transaction artifact.

+
source

pub fn add_block_tags(&mut self, tags: Tags) -> Result<()>

Add block tags.

+
source

pub fn commit(&mut self) -> Result<(WriteLog, Hash)>

Commit updates to the underlying Merkle tree and return the write +log and root hash.

+

Auto Trait Implementations§

§

impl !Freeze for Tree

§

impl !RefUnwindSafe for Tree

§

impl Send for Tree

§

impl !Sync for Tree

§

impl Unpin for Tree

§

impl !UnwindSafe for Tree

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/types/index.html b/rust/oasis_core_runtime/transaction/types/index.html new file mode 100644 index 0000000000..cf903cf091 --- /dev/null +++ b/rust/oasis_core_runtime/transaction/types/index.html @@ -0,0 +1,2 @@ +oasis_core_runtime::transaction::types - Rust

Module oasis_core_runtime::transaction::types

source ·
Expand description

Transaction protocol types.

+

Structs§

  • Batch of transaction inputs/outputs.
\ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/types/sidebar-items.js b/rust/oasis_core_runtime/transaction/types/sidebar-items.js new file mode 100644 index 0000000000..f28b1c46ef --- /dev/null +++ b/rust/oasis_core_runtime/transaction/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["TxnBatch"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/transaction/types/struct.TxnBatch.html b/rust/oasis_core_runtime/transaction/types/struct.TxnBatch.html new file mode 100644 index 0000000000..dcd0bccadc --- /dev/null +++ b/rust/oasis_core_runtime/transaction/types/struct.TxnBatch.html @@ -0,0 +1,3129 @@ +TxnBatch in oasis_core_runtime::transaction::types - Rust

Struct oasis_core_runtime::transaction::types::TxnBatch

source ·
pub struct TxnBatch(pub Vec<Vec<u8>>);
Expand description

Batch of transaction inputs/outputs.

+

Tuple Fields§

§0: Vec<Vec<u8>>

Implementations§

Methods from Deref<Target = Vec<Vec<u8>>>§

1.0.0 · source

pub fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without +reallocating.

+
§Examples
+
let mut vec: Vec<i32> = Vec::with_capacity(10);
+vec.push(42);
+assert!(vec.capacity() >= 10);
+
1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more elements to be inserted +in the given Vec<T>. The collection may reserve more space to +speculatively avoid frequent reallocations. After calling reserve, +capacity will be greater than or equal to self.len() + additional. +Does nothing if capacity is already sufficient.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1];
+vec.reserve(10);
+assert!(vec.capacity() >= 11);
+
1.0.0 · source

pub fn reserve_exact(&mut self, additional: usize)

Reserves the minimum capacity for at least additional more elements to +be inserted in the given Vec<T>. Unlike reserve, this will not +deliberately over-allocate to speculatively avoid frequent allocations. +After calling reserve_exact, capacity will be greater than or equal to +self.len() + additional. Does nothing if the capacity is already +sufficient.

+

Note that the allocator may give the collection more space than it +requests. Therefore, capacity can not be relied upon to be precisely +minimal. Prefer reserve if future insertions are expected.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1];
+vec.reserve_exact(10);
+assert!(vec.capacity() >= 11);
+
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional more elements to be inserted +in the given Vec<T>. The collection may reserve more space to speculatively avoid +frequent reallocations. After calling try_reserve, capacity will be +greater than or equal to self.len() + additional if it returns +Ok(()). Does nothing if capacity is already sufficient. This method +preserves the contents even if an error occurs.

+
§Errors
+

If the capacity overflows, or the allocator reports a failure, then an error +is returned.

+
§Examples
+
use std::collections::TryReserveError;
+
+fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {
+    let mut output = Vec::new();
+
+    // Pre-reserve the memory, exiting if we can't
+    output.try_reserve(data.len())?;
+
+    // Now we know this can't OOM in the middle of our complex work
+    output.extend(data.iter().map(|&val| {
+        val * 2 + 5 // very complicated
+    }));
+
+    Ok(output)
+}
+
1.57.0 · source

pub fn try_reserve_exact( + &mut self, + additional: usize, +) -> Result<(), TryReserveError>

Tries to reserve the minimum capacity for at least additional +elements to be inserted in the given Vec<T>. Unlike try_reserve, +this will not deliberately over-allocate to speculatively avoid frequent +allocations. After calling try_reserve_exact, capacity will be greater +than or equal to self.len() + additional if it returns Ok(()). +Does nothing if the capacity is already sufficient.

+

Note that the allocator may give the collection more space than it +requests. Therefore, capacity can not be relied upon to be precisely +minimal. Prefer try_reserve if future insertions are expected.

+
§Errors
+

If the capacity overflows, or the allocator reports a failure, then an error +is returned.

+
§Examples
+
use std::collections::TryReserveError;
+
+fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {
+    let mut output = Vec::new();
+
+    // Pre-reserve the memory, exiting if we can't
+    output.try_reserve_exact(data.len())?;
+
+    // Now we know this can't OOM in the middle of our complex work
+    output.extend(data.iter().map(|&val| {
+        val * 2 + 5 // very complicated
+    }));
+
+    Ok(output)
+}
+
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the vector as much as possible.

+

The behavior of this method depends on the allocator, which may either shrink the vector +in-place or reallocate. The resulting vector might still have some excess capacity, just as +is the case for with_capacity. See Allocator::shrink for more details.

+
§Examples
+
let mut vec = Vec::with_capacity(10);
+vec.extend([1, 2, 3]);
+assert!(vec.capacity() >= 10);
+vec.shrink_to_fit();
+assert!(vec.capacity() >= 3);
+
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of the vector with a lower bound.

+

The capacity will remain at least as large as both the length +and the supplied value.

+

If the current capacity is less than the lower limit, this is a no-op.

+
§Examples
+
let mut vec = Vec::with_capacity(10);
+vec.extend([1, 2, 3]);
+assert!(vec.capacity() >= 10);
+vec.shrink_to(4);
+assert!(vec.capacity() >= 4);
+vec.shrink_to(0);
+assert!(vec.capacity() >= 3);
+
1.0.0 · source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping +the rest.

+

If len is greater or equal to the vector’s current length, this has +no effect.

+

The drain method can emulate truncate, but causes the excess +elements to be returned instead of dropped.

+

Note that this method has no effect on the allocated capacity +of the vector.

+
§Examples
+

Truncating a five element vector to two elements:

+ +
let mut vec = vec![1, 2, 3, 4, 5];
+vec.truncate(2);
+assert_eq!(vec, [1, 2]);
+

No truncation occurs when len is greater than the vector’s current +length:

+ +
let mut vec = vec![1, 2, 3];
+vec.truncate(8);
+assert_eq!(vec, [1, 2, 3]);
+

Truncating when len == 0 is equivalent to calling the clear +method.

+ +
let mut vec = vec![1, 2, 3];
+vec.truncate(0);
+assert_eq!(vec, []);
+
1.7.0 · source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

+

Equivalent to &s[..].

+
§Examples
+
use std::io::{self, Write};
+let buffer = vec![1, 2, 3, 5, 8];
+io::sink().write(buffer.as_slice()).unwrap();
+
1.7.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Extracts a mutable slice of the entire vector.

+

Equivalent to &mut s[..].

+
§Examples
+
use std::io::{self, Read};
+let mut buffer = vec![0; 3];
+io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
+
1.37.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer +valid for zero sized reads if the vector didn’t allocate.

+

The caller must ensure that the vector outlives the pointer this +function returns, or else it will end up pointing to garbage. +Modifying the vector may cause its buffer to be reallocated, +which would also make any pointers to it invalid.

+

The caller must also ensure that the memory the pointer (non-transitively) points to +is never written to (except inside an UnsafeCell) using this pointer or any pointer +derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

+

This method guarantees that for the purpose of the aliasing model, this method +does not materialize a reference to the underlying slice, and thus the returned pointer +will remain valid when mixed with other calls to as_ptr and as_mut_ptr. +Note that calling other methods that materialize mutable references to the slice, +or mutable references to specific elements you are planning on accessing through this pointer, +as well as writing to those elements, may still invalidate this pointer. +See the second example below for how this guarantee can be used.

+
§Examples
+
let x = vec![1, 2, 4];
+let x_ptr = x.as_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        assert_eq!(*x_ptr.add(i), 1 << i);
+    }
+}
+

Due to the aliasing guarantee, the following code is legal:

+ +
unsafe {
+    let mut v = vec![0, 1, 2];
+    let ptr1 = v.as_ptr();
+    let _ = ptr1.read();
+    let ptr2 = v.as_mut_ptr().offset(2);
+    ptr2.write(2);
+    // Notably, the write to `ptr2` did *not* invalidate `ptr1`
+    // because it mutated a different element:
+    let _ = ptr1.read();
+}
+
1.37.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the vector’s buffer, or a dangling +raw pointer valid for zero sized reads if the vector didn’t allocate.

+

The caller must ensure that the vector outlives the pointer this +function returns, or else it will end up pointing to garbage. +Modifying the vector may cause its buffer to be reallocated, +which would also make any pointers to it invalid.

+

This method guarantees that for the purpose of the aliasing model, this method +does not materialize a reference to the underlying slice, and thus the returned pointer +will remain valid when mixed with other calls to as_ptr and as_mut_ptr. +Note that calling other methods that materialize references to the slice, +or references to specific elements you are planning on accessing through this pointer, +may still invalidate this pointer. +See the second example below for how this guarantee can be used.

+
§Examples
+
// Allocate vector big enough for 4 elements.
+let size = 4;
+let mut x: Vec<i32> = Vec::with_capacity(size);
+let x_ptr = x.as_mut_ptr();
+
+// Initialize elements via raw pointer writes, then set length.
+unsafe {
+    for i in 0..size {
+        *x_ptr.add(i) = i as i32;
+    }
+    x.set_len(size);
+}
+assert_eq!(&*x, &[0, 1, 2, 3]);
+

Due to the aliasing guarantee, the following code is legal:

+ +
unsafe {
+    let mut v = vec![0];
+    let ptr1 = v.as_mut_ptr();
+    ptr1.write(1);
+    let ptr2 = v.as_mut_ptr();
+    ptr2.write(2);
+    // Notably, the write to `ptr2` did *not* invalidate `ptr1`:
+    ptr1.write(3);
+}
+
source

pub fn allocator(&self) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

+
1.0.0 · source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

+

This is a low-level operation that maintains none of the normal +invariants of the type. Normally changing the length of a vector +is done using one of the safe operations instead, such as +truncate, resize, extend, or clear.

+
§Safety
+
    +
  • new_len must be less than or equal to capacity().
  • +
  • The elements at old_len..new_len must be initialized.
  • +
+
§Examples
+

This method can be useful for situations in which the vector +is serving as a buffer for other code, particularly over FFI:

+ +
pub fn get_dictionary(&self) -> Option<Vec<u8>> {
+    // Per the FFI method's docs, "32768 bytes is always enough".
+    let mut dict = Vec::with_capacity(32_768);
+    let mut dict_length = 0;
+    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
+    // 1. `dict_length` elements were initialized.
+    // 2. `dict_length` <= the capacity (32_768)
+    // which makes `set_len` safe to call.
+    unsafe {
+        // Make the FFI call...
+        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
+        if r == Z_OK {
+            // ...and update the length to what was initialized.
+            dict.set_len(dict_length);
+            Some(dict)
+        } else {
+            None
+        }
+    }
+}
+

While the following example is sound, there is a memory leak since +the inner vectors were not freed prior to the set_len call:

+ +
let mut vec = vec![vec![1, 0, 0],
+                   vec![0, 1, 0],
+                   vec![0, 0, 1]];
+// SAFETY:
+// 1. `old_len..0` is empty so no elements need to be initialized.
+// 2. `0 <= capacity` always holds whatever `capacity` is.
+unsafe {
+    vec.set_len(0);
+}
+

Normally, here, one would use clear instead to correctly drop +the contents and thus not leak memory.

+
1.0.0 · source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

+

The removed element is replaced by the last element of the vector.

+

This does not preserve ordering of the remaining elements, but is O(1). +If you need to preserve the element order, use remove instead.

+
§Panics
+

Panics if index is out of bounds.

+
§Examples
+
let mut v = vec!["foo", "bar", "baz", "qux"];
+
+assert_eq!(v.swap_remove(1), "bar");
+assert_eq!(v, ["foo", "qux", "baz"]);
+
+assert_eq!(v.swap_remove(0), "foo");
+assert_eq!(v, ["baz", "qux"]);
+
1.0.0 · source

pub fn insert(&mut self, index: usize, element: T)

Inserts an element at position index within the vector, shifting all +elements after it to the right.

+
§Panics
+

Panics if index > len.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+vec.insert(1, 4);
+assert_eq!(vec, [1, 4, 2, 3]);
+vec.insert(4, 5);
+assert_eq!(vec, [1, 4, 2, 3, 5]);
+
§Time complexity
+

Takes O(Vec::len) time. All items after the insertion index must be +shifted to the right. In the worst case, all elements are shifted when +the insertion index is 0.

+
1.0.0 · source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector, +shifting all elements after it to the left.

+

Note: Because this shifts over the remaining elements, it has a +worst-case performance of O(n). If you don’t need the order of elements +to be preserved, use swap_remove instead. If you’d like to remove +elements from the beginning of the Vec, consider using +VecDeque::pop_front instead.

+
§Panics
+

Panics if index is out of bounds.

+
§Examples
+
let mut v = vec![1, 2, 3];
+assert_eq!(v.remove(1), 2);
+assert_eq!(v, [1, 3]);
+
1.0.0 · source

pub fn retain<F>(&mut self, f: F)
where + F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

+

In other words, remove all elements e for which f(&e) returns false. +This method operates in place, visiting each element exactly once in the +original order, and preserves the order of the retained elements.

+
§Examples
+
let mut vec = vec![1, 2, 3, 4];
+vec.retain(|&x| x % 2 == 0);
+assert_eq!(vec, [2, 4]);
+

Because the elements are visited exactly once in the original order, +external state may be used to decide which elements to keep.

+ +
let mut vec = vec![1, 2, 3, 4, 5];
+let keep = [false, true, true, false, true];
+let mut iter = keep.iter();
+vec.retain(|_| *iter.next().unwrap());
+assert_eq!(vec, [2, 3, 5]);
+
1.61.0 · source

pub fn retain_mut<F>(&mut self, f: F)
where + F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

+

In other words, remove all elements e such that f(&mut e) returns false. +This method operates in place, visiting each element exactly once in the +original order, and preserves the order of the retained elements.

+
§Examples
+
let mut vec = vec![1, 2, 3, 4];
+vec.retain_mut(|x| if *x <= 3 {
+    *x += 1;
+    true
+} else {
+    false
+});
+assert_eq!(vec, [2, 3, 4]);
+
1.16.0 · source

pub fn dedup_by_key<F, K>(&mut self, key: F)
where + F: FnMut(&mut T) -> K, + K: PartialEq,

Removes all but the first of consecutive elements in the vector that resolve to the same +key.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec![10, 20, 21, 30, 20];
+
+vec.dedup_by_key(|i| *i / 10);
+
+assert_eq!(vec, [10, 20, 30, 20]);
+
1.16.0 · source

pub fn dedup_by<F>(&mut self, same_bucket: F)
where + F: FnMut(&mut T, &mut T) -> bool,

Removes all but the first of consecutive elements in the vector satisfying a given equality +relation.

+

The same_bucket function is passed references to two elements from the vector and +must determine if the elements compare equal. The elements are passed in opposite order +from their order in the slice, so if same_bucket(a, b) returns true, a is removed.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec!["foo", "bar", "Bar", "baz", "bar"];
+
+vec.dedup_by(|a, b| a.eq_ignore_ascii_case(b));
+
+assert_eq!(vec, ["foo", "bar", "baz", "bar"]);
+
1.0.0 · source

pub fn push(&mut self, value: T)

Appends an element to the back of a collection.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1, 2];
+vec.push(3);
+assert_eq!(vec, [1, 2, 3]);
+
§Time complexity
+

Takes amortized O(1) time. If the vector’s length would exceed its +capacity after the push, O(capacity) time is taken to copy the +vector’s elements to a larger allocation. This expensive operation is +offset by the capacity O(1) insertions it allows.

+
source

pub fn push_within_capacity(&mut self, value: T) -> Result<(), T>

🔬This is a nightly-only experimental API. (vec_push_within_capacity)

Appends an element if there is sufficient spare capacity, otherwise an error is returned +with the element.

+

Unlike push this method will not reallocate when there’s insufficient capacity. +The caller should use reserve or try_reserve to ensure that there is enough capacity.

+
§Examples
+

A manual, panic-free alternative to FromIterator:

+ +
#![feature(vec_push_within_capacity)]
+
+use std::collections::TryReserveError;
+fn from_iter_fallible<T>(iter: impl Iterator<Item=T>) -> Result<Vec<T>, TryReserveError> {
+    let mut vec = Vec::new();
+    for value in iter {
+        if let Err(value) = vec.push_within_capacity(value) {
+            vec.try_reserve(1)?;
+            // this cannot fail, the previous line either returned or added at least 1 free slot
+            let _ = vec.push_within_capacity(value);
+        }
+    }
+    Ok(vec)
+}
+assert_eq!(from_iter_fallible(0..100), Ok(Vec::from_iter(0..100)));
+
§Time complexity
+

Takes O(1) time.

+
1.0.0 · source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it +is empty.

+

If you’d like to pop the first element, consider using +VecDeque::pop_front instead.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+assert_eq!(vec.pop(), Some(3));
+assert_eq!(vec, [1, 2]);
+
§Time complexity
+

Takes O(1) time.

+
source

pub fn pop_if<F>(&mut self, f: F) -> Option<T>
where + F: FnOnce(&mut T) -> bool,

🔬This is a nightly-only experimental API. (vec_pop_if)

Removes and returns the last element in a vector if the predicate +returns true, or None if the predicate returns false or the vector +is empty.

+
§Examples
+
#![feature(vec_pop_if)]
+
+let mut vec = vec![1, 2, 3, 4];
+let pred = |x: &mut i32| *x % 2 == 0;
+
+assert_eq!(vec.pop_if(pred), Some(4));
+assert_eq!(vec, [1, 2, 3]);
+assert_eq!(vec.pop_if(pred), None);
+
1.4.0 · source

pub fn append(&mut self, other: &mut Vec<T, A>)

Moves all the elements of other into self, leaving other empty.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+let mut vec2 = vec![4, 5, 6];
+vec.append(&mut vec2);
+assert_eq!(vec, [1, 2, 3, 4, 5, 6]);
+assert_eq!(vec2, []);
+
1.6.0 · source

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
where + R: RangeBounds<usize>,

Removes the specified range from the vector in bulk, returning all +removed elements as an iterator. If the iterator is dropped before +being fully consumed, it drops the remaining removed elements.

+

The returned iterator keeps a mutable borrow on the vector to optimize +its implementation.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Leaking
+

If the returned iterator goes out of scope without being dropped (due to +mem::forget, for example), the vector may have lost and leaked +elements arbitrarily, including elements outside the range.

+
§Examples
+
let mut v = vec![1, 2, 3];
+let u: Vec<_> = v.drain(1..).collect();
+assert_eq!(v, &[1]);
+assert_eq!(u, &[2, 3]);
+
+// A full range clears the vector, like `clear()` does
+v.drain(..);
+assert_eq!(v, &[]);
+
1.0.0 · source

pub fn clear(&mut self)

Clears the vector, removing all values.

+

Note that this method has no effect on the allocated capacity +of the vector.

+
§Examples
+
let mut v = vec![1, 2, 3];
+
+v.clear();
+
+assert!(v.is_empty());
+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to +as its ‘length’.

+
§Examples
+
let a = vec![1, 2, 3];
+assert_eq!(a.len(), 3);
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

+
§Examples
+
let mut v = Vec::new();
+assert!(v.is_empty());
+
+v.push(1);
+assert!(!v.is_empty());
+
1.4.0 · source

pub fn split_off(&mut self, at: usize) -> Vec<T, A>
where + A: Clone,

Splits the collection into two at the given index.

+

Returns a newly allocated vector containing the elements in the range +[at, len). After the call, the original vector will be left containing +the elements [0, at) with its previous capacity unchanged.

+
    +
  • If you want to take ownership of the entire contents and capacity of +the vector, see mem::take or mem::replace.
  • +
  • If you don’t need the returned vector at all, see Vec::truncate.
  • +
  • If you want to take ownership of an arbitrary subslice, or you don’t +necessarily want to store the removed items in a vector, see Vec::drain.
  • +
+
§Panics
+

Panics if at > len.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+let vec2 = vec.split_off(1);
+assert_eq!(vec, [1]);
+assert_eq!(vec2, [2, 3]);
+
1.33.0 · source

pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where + F: FnMut() -> T,

Resizes the Vec in-place so that len is equal to new_len.

+

If new_len is greater than len, the Vec is extended by the +difference, with each additional slot filled with the result of +calling the closure f. The return values from f will end up +in the Vec in the order they have been generated.

+

If new_len is less than len, the Vec is simply truncated.

+

This method uses a closure to create new values on every push. If +you’d rather Clone a given value, use Vec::resize. If you +want to use the Default trait to generate values, you can +pass Default::default as the second argument.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+vec.resize_with(5, Default::default);
+assert_eq!(vec, [1, 2, 3, 0, 0]);
+
+let mut vec = vec![];
+let mut p = 1;
+vec.resize_with(4, || { p *= 2; p });
+assert_eq!(vec, [2, 4, 8, 16]);
+
1.60.0 · source

pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]

Returns the remaining spare capacity of the vector as a slice of +MaybeUninit<T>.

+

The returned slice can be used to fill the vector with data (e.g. by +reading from a file) before marking the data as initialized using the +set_len method.

+
§Examples
+
// Allocate vector big enough for 10 elements.
+let mut v = Vec::with_capacity(10);
+
+// Fill in the first 3 elements.
+let uninit = v.spare_capacity_mut();
+uninit[0].write(0);
+uninit[1].write(1);
+uninit[2].write(2);
+
+// Mark the first 3 elements of the vector as being initialized.
+unsafe {
+    v.set_len(3);
+}
+
+assert_eq!(&v, &[0, 1, 2]);
+
source

pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>])

🔬This is a nightly-only experimental API. (vec_split_at_spare)

Returns vector content as a slice of T, along with the remaining spare +capacity of the vector as a slice of MaybeUninit<T>.

+

The returned spare capacity slice can be used to fill the vector with data +(e.g. by reading from a file) before marking the data as initialized using +the set_len method.

+

Note that this is a low-level API, which should be used with care for +optimization purposes. If you need to append data to a Vec +you can use push, extend, extend_from_slice, +extend_from_within, insert, append, resize or +resize_with, depending on your exact needs.

+
§Examples
+
#![feature(vec_split_at_spare)]
+
+let mut v = vec![1, 1, 2];
+
+// Reserve additional space big enough for 10 elements.
+v.reserve(10);
+
+let (init, uninit) = v.split_at_spare_mut();
+let sum = init.iter().copied().sum::<u32>();
+
+// Fill in the next 4 elements.
+uninit[0].write(sum);
+uninit[1].write(sum * 2);
+uninit[2].write(sum * 3);
+uninit[3].write(sum * 4);
+
+// Mark the 4 elements of the vector as being initialized.
+unsafe {
+    let len = v.len();
+    v.set_len(len + 4);
+}
+
+assert_eq!(&v, &[1, 1, 2, 4, 8, 12, 16]);
+
1.5.0 · source

pub fn resize(&mut self, new_len: usize, value: T)

Resizes the Vec in-place so that len is equal to new_len.

+

If new_len is greater than len, the Vec is extended by the +difference, with each additional slot filled with value. +If new_len is less than len, the Vec is simply truncated.

+

This method requires T to implement Clone, +in order to be able to clone the passed value. +If you need more flexibility (or want to rely on Default instead of +Clone), use Vec::resize_with. +If you only need to resize to a smaller size, use Vec::truncate.

+
§Examples
+
let mut vec = vec!["hello"];
+vec.resize(3, "world");
+assert_eq!(vec, ["hello", "world", "world"]);
+
+let mut vec = vec![1, 2, 3, 4];
+vec.resize(2, 0);
+assert_eq!(vec, [1, 2]);
+
1.6.0 · source

pub fn extend_from_slice(&mut self, other: &[T])

Clones and appends all elements in a slice to the Vec.

+

Iterates over the slice other, clones each element, and then appends +it to this Vec. The other slice is traversed in-order.

+

Note that this function is same as extend except that it is +specialized to work with slices instead. If and when Rust gets +specialization this function will likely be deprecated (but still +available).

+
§Examples
+
let mut vec = vec![1];
+vec.extend_from_slice(&[2, 3, 4]);
+assert_eq!(vec, [1, 2, 3, 4]);
+
1.53.0 · source

pub fn extend_from_within<R>(&mut self, src: R)
where + R: RangeBounds<usize>,

Copies elements from src range to the end of the vector.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Examples
+
let mut vec = vec![0, 1, 2, 3, 4];
+
+vec.extend_from_within(2..);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);
+
+vec.extend_from_within(..2);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);
+
+vec.extend_from_within(4..8);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
+
1.0.0 · source

pub fn dedup(&mut self)

Removes consecutive repeated elements in the vector according to the +PartialEq trait implementation.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec![1, 2, 2, 3, 2];
+
+vec.dedup();
+
+assert_eq!(vec, [1, 2, 3, 2]);
+
1.21.0 · source

pub fn splice<R, I>( + &mut self, + range: R, + replace_with: I, +) -> Splice<'_, <I as IntoIterator>::IntoIter, A>
where + R: RangeBounds<usize>, + I: IntoIterator<Item = T>,

Creates a splicing iterator that replaces the specified range in the vector +with the given replace_with iterator and yields the removed items. +replace_with does not need to be the same length as range.

+

range is removed even if the iterator is not consumed until the end.

+

It is unspecified how many elements are removed from the vector +if the Splice value is leaked.

+

The input iterator replace_with is only consumed when the Splice value is dropped.

+

This is optimal if:

+
    +
  • The tail (elements in the vector after range) is empty,
  • +
  • or replace_with yields fewer or equal elements than range’s length
  • +
  • or the lower bound of its size_hint() is exact.
  • +
+

Otherwise, a temporary vector is allocated and the tail is moved twice.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Examples
+
let mut v = vec![1, 2, 3, 4];
+let new = [7, 8, 9];
+let u: Vec<_> = v.splice(1..3, new).collect();
+assert_eq!(v, &[1, 7, 8, 9, 4]);
+assert_eq!(u, &[2, 3]);
+
source

pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
where + F: FnMut(&mut T) -> bool,

🔬This is a nightly-only experimental API. (extract_if)

Creates an iterator which uses a closure to determine if an element should be removed.

+

If the closure returns true, then the element is removed and yielded. +If the closure returns false, the element will remain in the vector and will not be yielded +by the iterator.

+

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating +or the iteration short-circuits, then the remaining elements will be retained. +Use retain with a negated predicate if you do not need the returned iterator.

+

Using this method is equivalent to the following code:

+ +
let mut i = 0;
+while i < vec.len() {
+    if some_predicate(&mut vec[i]) {
+        let val = vec.remove(i);
+        // your code here
+    } else {
+        i += 1;
+    }
+}
+
+

But extract_if is easier to use. extract_if is also more efficient, +because it can backshift the elements of the array in bulk.

+

Note that extract_if also lets you mutate every element in the filter closure, +regardless of whether you choose to keep or remove it.

+
§Examples
+

Splitting an array into evens and odds, reusing the original allocation:

+ +
#![feature(extract_if)]
+let mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15];
+
+let evens = numbers.extract_if(|x| *x % 2 == 0).collect::<Vec<_>>();
+let odds = numbers;
+
+assert_eq!(evens, vec![2, 4, 6, 8, 14]);
+assert_eq!(odds, vec![1, 3, 5, 9, 11, 13, 15]);
+

Methods from Deref<Target = [T]>§

source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

+
source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f32::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

+
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of +ASCII characters, otherwise returns None.

+
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, +without checking whether they’re valid.

+
§Safety
+

Every byte in the slice must be in 0..=127, or else this is UB.

+
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

+

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), +but without allocating and copying temporaries.

+
1.23.0 · source

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To return a new uppercased value without modifying the existing one, use +to_ascii_uppercase.

+
1.23.0 · source

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To return a new lowercased value without modifying the existing one, use +to_ascii_lowercase.

+
1.60.0 · source

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, +treating it as an ASCII string.

+
§Examples
+

+let s = b"0\t\r\n'\"\\\x9d";
+let escaped = s.escape_ascii().to_string();
+assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
+
1.80.0 · source

pub fn trim_ascii_start(&self) -> &[u8]

Returns a byte slice with leading ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
+assert_eq!(b"  ".trim_ascii_start(), b"");
+assert_eq!(b"".trim_ascii_start(), b"");
+
1.80.0 · source

pub fn trim_ascii_end(&self) -> &[u8]

Returns a byte slice with trailing ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
+assert_eq!(b"  ".trim_ascii_end(), b"");
+assert_eq!(b"".trim_ascii_end(), b"");
+
1.80.0 · source

pub fn trim_ascii(&self) -> &[u8]

Returns a byte slice with leading and trailing ASCII whitespace bytes +removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
+assert_eq!(b"  ".trim_ascii(), b"");
+assert_eq!(b"".trim_ascii(), b"");
+
1.79.0 · source

pub fn utf8_chunks(&self) -> Utf8Chunks<'_>

Creates an iterator over the contiguous valid UTF-8 ranges of this +slice, and the non-UTF-8 fragments in between.

+
§Examples
+

This function formats arbitrary but mostly-UTF-8 bytes into Rust source +code in the form of a C-string literal (c"...").

+ +
use std::fmt::Write as _;
+
+pub fn cstr_literal(bytes: &[u8]) -> String {
+    let mut repr = String::new();
+    repr.push_str("c\"");
+    for chunk in bytes.utf8_chunks() {
+        for ch in chunk.valid().chars() {
+            // Escapes \0, \t, \r, \n, \\, \', \", and uses \u{...} for non-printable characters.
+            write!(repr, "{}", ch.escape_debug()).unwrap();
+        }
+        for byte in chunk.invalid() {
+            write!(repr, "\\x{:02X}", byte).unwrap();
+        }
+    }
+    repr.push('"');
+    repr
+}
+
+fn main() {
+    let lit = cstr_literal(b"\xferris the \xf0\x9f\xa6\x80\x07");
+    let expected = stringify!(c"\xFErris the 🦀\u{7}");
+    assert_eq!(lit, expected);
+}
+
1.80.0 · source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened(), &[1, 2, 3, 4, 5, 6]);
+
+assert_eq!(
+    [[1, 2, 3], [4, 5, 6]].as_flattened(),
+    [[1, 2], [3, 4], [5, 6]].as_flattened(),
+);
+
+let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
+assert!(slice_of_empty_arrays.as_flattened().is_empty());
+
+let empty_slice_of_arrays: &[[u32; 10]] = &[];
+assert!(empty_slice_of_arrays.as_flattened().is_empty());
+
1.80.0 · source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
fn add_5_to_all(slice: &mut [i32]) {
+    for i in slice {
+        *i += 5;
+    }
+}
+
+let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
+add_5_to_all(array.as_flattened_mut());
+assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f64::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the slice.

+
§Examples
+
let a = [1, 2, 3];
+assert_eq!(a.len(), 3);
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

+
§Examples
+
let a = [1, 2, 3];
+assert!(!a.is_empty());
+
+let b: &[i32] = &[];
+assert!(b.is_empty());
+
1.0.0 · source

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&10), v.first());
+
+let w: &[i32] = &[];
+assert_eq!(None, w.first());
+
1.0.0 · source

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(first) = x.first_mut() {
+    *first = 5;
+}
+assert_eq!(x, &[5, 1, 2]);
+
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.first_mut());
+
1.5.0 · source

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((first, elements)) = x.split_first() {
+    assert_eq!(first, &0);
+    assert_eq!(elements, &[1, 2]);
+}
+
1.5.0 · source

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_mut() {
+    *first = 3;
+    elements[0] = 4;
+    elements[1] = 5;
+}
+assert_eq!(x, &[3, 4, 5]);
+
1.5.0 · source

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((last, elements)) = x.split_last() {
+    assert_eq!(last, &2);
+    assert_eq!(elements, &[0, 1]);
+}
+
1.5.0 · source

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((last, elements)) = x.split_last_mut() {
+    *last = 3;
+    elements[0] = 4;
+    elements[1] = 5;
+}
+assert_eq!(x, &[4, 5, 3]);
+
1.0.0 · source

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&30), v.last());
+
+let w: &[i32] = &[];
+assert_eq!(None, w.last());
+
1.0.0 · source

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable reference to the last item in the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(last) = x.last_mut() {
+    *last = 10;
+}
+assert_eq!(x, &[0, 1, 10]);
+
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.last_mut());
+
1.77.0 · source

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
+assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
+
+let v: &[i32] = &[10];
+assert_eq!(None, v.first_chunk::<2>());
+
+let w: &[i32] = &[];
+assert_eq!(Some(&[]), w.first_chunk::<0>());
+
1.77.0 · source

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(first) = x.first_chunk_mut::<2>() {
+    first[0] = 5;
+    first[1] = 4;
+}
+assert_eq!(x, &[5, 4, 2]);
+
+assert_eq!(None, x.first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

Return an array reference to the first N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_chunk::<2>() {
+    assert_eq!(first, &[0, 1]);
+    assert_eq!(elements, &[2]);
+}
+
+assert_eq!(None, x.split_first_chunk::<4>());
+
1.77.0 · source

pub fn split_first_chunk_mut<const N: usize>( + &mut self, +) -> Option<(&mut [T; N], &mut [T])>

Return a mutable array reference to the first N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_chunk_mut::<2>() {
+    first[0] = 3;
+    first[1] = 4;
+    elements[0] = 5;
+}
+assert_eq!(x, &[3, 4, 5]);
+
+assert_eq!(None, x.split_first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

Return an array reference to the last N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((elements, last)) = x.split_last_chunk::<2>() {
+    assert_eq!(elements, &[0]);
+    assert_eq!(last, &[1, 2]);
+}
+
+assert_eq!(None, x.split_last_chunk::<4>());
+
1.77.0 · source

pub fn split_last_chunk_mut<const N: usize>( + &mut self, +) -> Option<(&mut [T], &mut [T; N])>

Return a mutable array reference to the last N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((elements, last)) = x.split_last_chunk_mut::<2>() {
+    last[0] = 3;
+    last[1] = 4;
+    elements[0] = 5;
+}
+assert_eq!(x, &[5, 3, 4]);
+
+assert_eq!(None, x.split_last_chunk_mut::<4>());
+
1.77.0 · source

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
+assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
+
+let v: &[i32] = &[10];
+assert_eq!(None, v.last_chunk::<2>());
+
+let w: &[i32] = &[];
+assert_eq!(Some(&[]), w.last_chunk::<0>());
+
1.77.0 · source

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(last) = x.last_chunk_mut::<2>() {
+    last[0] = 10;
+    last[1] = 20;
+}
+assert_eq!(x, &[0, 10, 20]);
+
+assert_eq!(None, x.last_chunk_mut::<4>());
+
1.0.0 · source

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
where + I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of +index.

+
    +
  • If given a position, returns a reference to the element at that +position or None if out of bounds.
  • +
  • If given a range, returns the subslice corresponding to that range, +or None if out of bounds.
  • +
+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&40), v.get(1));
+assert_eq!(Some(&[10, 40][..]), v.get(0..2));
+assert_eq!(None, v.get(3));
+assert_eq!(None, v.get(0..4));
+
1.0.0 · source

pub fn get_mut<I>( + &mut self, + index: I, +) -> Option<&mut <I as SliceIndex<[T]>>::Output>
where + I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the +type of index (see get) or None if the index is out of bounds.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(elem) = x.get_mut(1) {
+    *elem = 42;
+}
+assert_eq!(x, &[0, 42, 2]);
+
1.0.0 · source

pub unsafe fn get_unchecked<I>( + &self, + index: I, +) -> &<I as SliceIndex<[T]>>::Output
where + I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds +checking.

+

For a safe alternative see get.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used.

+

You can think of this like .get(index).unwrap_unchecked(). It’s UB +to call .get_unchecked(len), even if you immediately convert to a +pointer. And it’s UB to call .get_unchecked(..len + 1), +.get_unchecked(..=len), or similar.

+
§Examples
+
let x = &[1, 2, 4];
+
+unsafe {
+    assert_eq!(x.get_unchecked(1), &2);
+}
+
1.0.0 · source

pub unsafe fn get_unchecked_mut<I>( + &mut self, + index: I, +) -> &mut <I as SliceIndex<[T]>>::Output
where + I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing +bounds checking.

+

For a safe alternative see get_mut.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used.

+

You can think of this like .get_mut(index).unwrap_unchecked(). It’s +UB to call .get_unchecked_mut(len), even if you immediately convert +to a pointer. And it’s UB to call .get_unchecked_mut(..len + 1), +.get_unchecked_mut(..=len), or similar.

+
§Examples
+
let x = &mut [1, 2, 4];
+
+unsafe {
+    let elem = x.get_unchecked_mut(1);
+    *elem = 13;
+}
+assert_eq!(x, &[1, 13, 4]);
+
1.0.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

+

The caller must ensure that the slice outlives the pointer this +function returns, or else it will end up pointing to garbage.

+

The caller must also ensure that the memory the pointer (non-transitively) points to +is never written to (except inside an UnsafeCell) using this pointer or any pointer +derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

+

Modifying the container referenced by this slice may cause its buffer +to be reallocated, which would also make any pointers to it invalid.

+
§Examples
+
let x = &[1, 2, 4];
+let x_ptr = x.as_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
+    }
+}
+
1.0.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

+

The caller must ensure that the slice outlives the pointer this +function returns, or else it will end up pointing to garbage.

+

Modifying the container referenced by this slice may cause its buffer +to be reallocated, which would also make any pointers to it invalid.

+
§Examples
+
let x = &mut [1, 2, 4];
+let x_ptr = x.as_mut_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        *x_ptr.add(i) += 2;
+    }
+}
+assert_eq!(x, &[3, 4, 6]);
+
1.48.0 · source

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

+

The returned range is half-open, which means that the end pointer +points one past the last element of the slice. This way, an empty +slice is represented by two equal pointers, and the difference between +the two pointers represents the size of the slice.

+

See as_ptr for warnings on using these pointers. The end pointer +requires extra caution, as it does not point to a valid element in the +slice.

+

This function is useful for interacting with foreign interfaces which +use two pointers to refer to a range of elements in memory, as is +common in C++.

+

It can also be useful to check if a pointer to an element refers to an +element of this slice:

+ +
let a = [1, 2, 3];
+let x = &a[1] as *const _;
+let y = &5 as *const _;
+
+assert!(a.as_ptr_range().contains(&x));
+assert!(!a.as_ptr_range().contains(&y));
+
1.48.0 · source

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

+

The returned range is half-open, which means that the end pointer +points one past the last element of the slice. This way, an empty +slice is represented by two equal pointers, and the difference between +the two pointers represents the size of the slice.

+

See as_mut_ptr for warnings on using these pointers. The end +pointer requires extra caution, as it does not point to a valid element +in the slice.

+

This function is useful for interacting with foreign interfaces which +use two pointers to refer to a range of elements in memory, as is +common in C++.

+
1.0.0 · source

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

+

If a equals to b, it’s guaranteed that elements won’t change value.

+
§Arguments
+
    +
  • a - The index of the first element
  • +
  • b - The index of the second element
  • +
+
§Panics
+

Panics if a or b are out of bounds.

+
§Examples
+
let mut v = ["a", "b", "c", "d", "e"];
+v.swap(2, 4);
+assert!(v == ["a", "b", "e", "d", "c"]);
+
source

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

+

For a safe alternative see swap.

+
§Arguments
+
    +
  • a - The index of the first element
  • +
  • b - The index of the second element
  • +
+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior. +The caller has to ensure that a < self.len() and b < self.len().

+
§Examples
+
#![feature(slice_swap_unchecked)]
+
+let mut v = ["a", "b", "c", "d"];
+// SAFETY: we know that 1 and 3 are both indices of the slice
+unsafe { v.swap_unchecked(1, 3) };
+assert!(v == ["a", "d", "c", "b"]);
+
1.0.0 · source

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

+
§Examples
+
let mut v = [1, 2, 3];
+v.reverse();
+assert!(v == [3, 2, 1]);
+
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

+

The iterator yields all items from start to end.

+
§Examples
+
let x = &[1, 2, 4];
+let mut iterator = x.iter();
+
+assert_eq!(iterator.next(), Some(&1));
+assert_eq!(iterator.next(), Some(&2));
+assert_eq!(iterator.next(), Some(&4));
+assert_eq!(iterator.next(), None);
+
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

+

The iterator yields all items from start to end.

+
§Examples
+
let x = &mut [1, 2, 4];
+for elem in x.iter_mut() {
+    *elem += 2;
+}
+assert_eq!(x, &[3, 4, 6]);
+
1.0.0 · source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +size. The windows overlap. If the slice is shorter than +size, the iterator returns no values.

+
§Panics
+

Panics if size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.windows(3);
+assert_eq!(iter.next().unwrap(), &['l', 'o', 'r']);
+assert_eq!(iter.next().unwrap(), &['o', 'r', 'e']);
+assert_eq!(iter.next().unwrap(), &['r', 'e', 'm']);
+assert!(iter.next().is_none());
+

If the slice is shorter than size:

+ +
let slice = ['f', 'o', 'o'];
+let mut iter = slice.windows(4);
+assert!(iter.next().is_none());
+

There’s no windows_mut, as that existing would let safe code violate the +“only one &mut at a time to the same thing” rule. However, you can sometimes +use Cell::as_slice_of_cells in +conjunction with windows to accomplish something similar:

+ +
use std::cell::Cell;
+
+let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
+let slice = &mut array[..];
+let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
+for w in slice_of_cells.windows(3) {
+    Cell::swap(&w[0], &w[2]);
+}
+assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
+
1.0.0 · source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last chunk will not have length chunk_size.

+

See chunks_exact for a variant of this iterator that returns chunks of always exactly +chunk_size elements, and rchunks for the same iterator but starting at the end of the +slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.chunks(2);
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert_eq!(iter.next().unwrap(), &['m']);
+assert!(iter.next().is_none());
+
1.0.0 · source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last chunk will not have length chunk_size.

+

See chunks_exact_mut for a variant of this iterator that returns chunks of always +exactly chunk_size elements, and rchunks_mut for the same iterator but starting at +the end of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.chunks_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 3]);
+
1.31.0 · source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved +from the remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks.

+

See chunks for a variant of this iterator that also returns the remainder as a smaller +chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.chunks_exact(2);
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['m']);
+
1.31.0 · source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last up to chunk_size-1 elements will be omitted and can be +retrieved from the into_remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks_mut.

+

See chunks_mut for a variant of this iterator that also returns the remainder as a +smaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of +the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.chunks_exact_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 0]);
+
source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +assuming that there’s no remainder.

+
§Safety
+

This may only be called when

+
    +
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • +
  • N != 0.
  • +
+
§Examples
+
#![feature(slice_as_chunks)]
+let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
+let chunks: &[[char; 1]] =
+    // SAFETY: 1-element chunks never have remainder
+    unsafe { slice.as_chunks_unchecked() };
+assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
+let chunks: &[[char; 3]] =
+    // SAFETY: The slice length (6) is a multiple of 3
+    unsafe { slice.as_chunks_unchecked() };
+assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
+
+// These would be unsound:
+// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
+// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
+
source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the beginning of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let (chunks, remainder) = slice.as_chunks();
+assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
+assert_eq!(remainder, &['m']);
+

If you expect the slice to be an exact multiple, you can combine +let-else with an empty slice pattern:

+ +
#![feature(slice_as_chunks)]
+let slice = ['R', 'u', 's', 't'];
+let (chunks, []) = slice.as_chunks::<2>() else {
+    panic!("slice didn't have even length")
+};
+assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
+
source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the end of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let (remainder, chunks) = slice.as_rchunks();
+assert_eq!(remainder, &['l']);
+assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
+
source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are array references and do not overlap. If N does not divide the +length of the slice, then the last up to N-1 elements will be omitted and can be +retrieved from the remainder function of the iterator.

+

This method is the const generic equivalent of chunks_exact.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.array_chunks();
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['m']);
+
source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( + &mut self, +) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +assuming that there’s no remainder.

+
§Safety
+

This may only be called when

+
    +
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • +
  • N != 0.
  • +
+
§Examples
+
#![feature(slice_as_chunks)]
+let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
+let chunks: &mut [[char; 1]] =
+    // SAFETY: 1-element chunks never have remainder
+    unsafe { slice.as_chunks_unchecked_mut() };
+chunks[0] = ['L'];
+assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);
+let chunks: &mut [[char; 3]] =
+    // SAFETY: The slice length (6) is a multiple of 3
+    unsafe { slice.as_chunks_unchecked_mut() };
+chunks[1] = ['a', 'x', '?'];
+assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);
+
+// These would be unsound:
+// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
+// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
+
source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the beginning of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+let (chunks, remainder) = v.as_chunks_mut();
+remainder[0] = 9;
+for chunk in chunks {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 9]);
+
source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the end of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+let (remainder, chunks) = v.as_rchunks_mut();
+remainder[0] = 9;
+for chunk in chunks {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[9, 1, 1, 2, 2]);
+
source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable array references and do not overlap. If N does not divide +the length of the slice, then the last up to N-1 elements will be omitted and +can be retrieved from the into_remainder function of the iterator.

+

This method is the const generic equivalent of chunks_exact_mut.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.array_chunks_mut() {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 0]);
+
source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +starting at the beginning of the slice.

+

This is the const generic equivalent of windows.

+

If N is greater than the size of the slice, it will return no windows.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_windows)]
+let slice = [0, 1, 2, 3];
+let mut iter = slice.array_windows();
+assert_eq!(iter.next().unwrap(), &[0, 1]);
+assert_eq!(iter.next().unwrap(), &[1, 2]);
+assert_eq!(iter.next().unwrap(), &[2, 3]);
+assert!(iter.next().is_none());
+
1.31.0 · source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last chunk will not have length chunk_size.

+

See rchunks_exact for a variant of this iterator that returns chunks of always exactly +chunk_size elements, and chunks for the same iterator but starting at the beginning +of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.rchunks(2);
+assert_eq!(iter.next().unwrap(), &['e', 'm']);
+assert_eq!(iter.next().unwrap(), &['o', 'r']);
+assert_eq!(iter.next().unwrap(), &['l']);
+assert!(iter.next().is_none());
+
1.31.0 · source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last chunk will not have length chunk_size.

+

See rchunks_exact_mut for a variant of this iterator that returns chunks of always +exactly chunk_size elements, and chunks_mut for the same iterator but starting at the +beginning of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.rchunks_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[3, 2, 2, 1, 1]);
+
1.31.0 · source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +end of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved +from the remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of rchunks.

+

See rchunks for a variant of this iterator that also returns the remainder as a smaller +chunk, and chunks_exact for the same iterator but starting at the beginning of the +slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.rchunks_exact(2);
+assert_eq!(iter.next().unwrap(), &['e', 'm']);
+assert_eq!(iter.next().unwrap(), &['o', 'r']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['l']);
+
1.31.0 · source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last up to chunk_size-1 elements will be omitted and can be +retrieved from the into_remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks_mut.

+

See rchunks_mut for a variant of this iterator that also returns the remainder as a +smaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning +of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.rchunks_exact_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[0, 2, 2, 1, 1]);
+
1.77.0 · source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs +of elements using the predicate to separate them.

+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
+
+let mut iter = slice.chunk_by(|a, b| a == b);
+
+assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
+assert_eq!(iter.next(), Some(&[3, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
+assert_eq!(iter.next(), None);
+

This method can be used to extract the sorted subslices:

+ +
let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
+
+let mut iter = slice.chunk_by(|a, b| a <= b);
+
+assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
+assert_eq!(iter.next(), None);
+
1.77.0 · source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable +runs of elements using the predicate to separate them.

+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
+
+let mut iter = slice.chunk_by_mut(|a, b| a == b);
+
+assert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));
+assert_eq!(iter.next(), Some(&mut [3, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 2, 2][..]));
+assert_eq!(iter.next(), None);
+

This method can be used to extract the sorted subslices:

+ +
let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
+
+let mut iter = slice.chunk_by_mut(|a, b| a <= b);
+
+assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));
+assert_eq!(iter.next(), None);
+
1.0.0 · source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_checked.

+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
+
+{
+   let (left, right) = v.split_at(0);
+   assert_eq!(left, []);
+   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_at(2);
+    assert_eq!(left, [1, 2]);
+    assert_eq!(right, [3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_at(6);
+    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, []);
+}
+
1.0.0 · source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_mut_checked.

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+let (left, right) = v.split_at_mut(2);
+assert_eq!(left, [1, 0]);
+assert_eq!(right, [3, 0, 5, 6]);
+left[1] = 2;
+right[1] = 4;
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
1.79.0 · source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+

For a safe alternative see split_at.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used. The caller has to ensure that +0 <= mid <= self.len().

+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
+
+unsafe {
+   let (left, right) = v.split_at_unchecked(0);
+   assert_eq!(left, []);
+   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+}
+
+unsafe {
+    let (left, right) = v.split_at_unchecked(2);
+    assert_eq!(left, [1, 2]);
+    assert_eq!(right, [3, 4, 5, 6]);
+}
+
+unsafe {
+    let (left, right) = v.split_at_unchecked(6);
+    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, []);
+}
+
1.79.0 · source

pub unsafe fn split_at_mut_unchecked( + &mut self, + mid: usize, +) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+

For a safe alternative see split_at_mut.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used. The caller has to ensure that +0 <= mid <= self.len().

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+// scoped to restrict the lifetime of the borrows
+unsafe {
+    let (left, right) = v.split_at_mut_unchecked(2);
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
+}
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
1.80.0 · source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
let v = [1, -2, 3, -4, 5, -6];
+
+{
+   let (left, right) = v.split_at_checked(0).unwrap();
+   assert_eq!(left, []);
+   assert_eq!(right, [1, -2, 3, -4, 5, -6]);
+}
+
+{
+    let (left, right) = v.split_at_checked(2).unwrap();
+    assert_eq!(left, [1, -2]);
+    assert_eq!(right, [3, -4, 5, -6]);
+}
+
+{
+    let (left, right) = v.split_at_checked(6).unwrap();
+    assert_eq!(left, [1, -2, 3, -4, 5, -6]);
+    assert_eq!(right, []);
+}
+
+assert_eq!(None, v.split_at_checked(7));
+
1.80.0 · source

pub fn split_at_mut_checked( + &mut self, + mid: usize, +) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the +slice is too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+
+if let Some((left, right)) = v.split_at_mut_checked(2) {
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
+}
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
+assert_eq!(None, v.split_at_mut_checked(7));
+
1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred. The matched element is not contained in the subslices.

+
§Examples
+
let slice = [10, 40, 33, 20];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+

If the first element is matched, an empty slice will be the first item +returned by the iterator. Similarly, if the last element in the slice +is matched, an empty slice will be the last item returned by the +iterator:

+ +
let slice = [10, 40, 33];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40]);
+assert_eq!(iter.next().unwrap(), &[]);
+assert!(iter.next().is_none());
+

If two matched elements are directly adjacent, an empty slice will be +present between them:

+ +
let slice = [10, 6, 33, 20];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10]);
+assert_eq!(iter.next().unwrap(), &[]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+
1.0.0 · source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred. The matched element is not contained in the subslices.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.split_mut(|num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(v, [1, 40, 30, 1, 60, 1]);
+
1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred. The matched element is contained in the end of the previous +subslice as a terminator.

+
§Examples
+
let slice = [10, 40, 33, 20];
+let mut iter = slice.split_inclusive(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+

If the last element of the slice is matched, +that element will be considered the terminator of the preceding slice. +That slice will be the last item returned by the iterator.

+ +
let slice = [3, 10, 40, 33];
+let mut iter = slice.split_inclusive(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[3]);
+assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
+assert!(iter.next().is_none());
+
1.51.0 · source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred. The matched element is contained in the previous +subslice as a terminator.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.split_inclusive_mut(|num| *num % 3 == 0) {
+    let terminator_idx = group.len()-1;
+    group[terminator_idx] = 1;
+}
+assert_eq!(v, [10, 40, 1, 20, 1, 1]);
+
1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred, starting at the end of the slice and working backwards. +The matched element is not contained in the subslices.

+
§Examples
+
let slice = [11, 22, 33, 0, 44, 55];
+let mut iter = slice.rsplit(|num| *num == 0);
+
+assert_eq!(iter.next().unwrap(), &[44, 55]);
+assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
+assert_eq!(iter.next(), None);
+

As with split(), if the first or last element is matched, an empty +slice will be the first (or last) item returned by the iterator.

+ +
let v = &[0, 1, 1, 2, 3, 5, 8];
+let mut it = v.rsplit(|n| *n % 2 == 0);
+assert_eq!(it.next().unwrap(), &[]);
+assert_eq!(it.next().unwrap(), &[3, 5]);
+assert_eq!(it.next().unwrap(), &[1, 1]);
+assert_eq!(it.next().unwrap(), &[]);
+assert_eq!(it.next(), None);
+
1.27.0 · source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred, starting at the end of the slice and working +backwards. The matched element is not contained in the subslices.

+
§Examples
+
let mut v = [100, 400, 300, 200, 600, 500];
+
+let mut count = 0;
+for group in v.rsplit_mut(|num| *num % 3 == 0) {
+    count += 1;
+    group[0] = count;
+}
+assert_eq!(v, [3, 400, 300, 2, 600, 1]);
+
1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred, limited to returning at most n items. The matched element is +not contained in the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], +[20, 60, 50]):

+ +
let v = [10, 40, 30, 20, 60, 50];
+
+for group in v.splitn(2, |num| *num % 3 == 0) {
+    println!("{group:?}");
+}
+
1.0.0 · source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match +pred, limited to returning at most n items. The matched element is +not contained in the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.splitn_mut(2, |num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(v, [1, 40, 30, 1, 60, 50]);
+
1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred limited to returning at most n items. This starts at the end of +the slice and works backwards. The matched element is not contained in +the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+

Print the slice split once, starting from the end, by numbers divisible +by 3 (i.e., [50], [10, 40, 30, 20]):

+ +
let v = [10, 40, 30, 20, 60, 50];
+
+for group in v.rsplitn(2, |num| *num % 3 == 0) {
+    println!("{group:?}");
+}
+
1.0.0 · source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred limited to returning at most n items. This starts at the end of +the slice and works backwards. The matched element is not contained in +the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+
let mut s = [10, 40, 30, 20, 60, 50];
+
+for group in s.rsplitn_mut(2, |num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(s, [1, 40, 30, 20, 60, 1]);
+
source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where + F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified +predicate.

+

If any matching elements are present in the slice, returns the prefix +before the match and suffix after. The matching element itself is not +included. If no elements match, returns None.

+
§Examples
+
#![feature(slice_split_once)]
+let s = [1, 2, 3, 2, 4];
+assert_eq!(s.split_once(|&x| x == 2), Some((
+    &[1][..],
+    &[3, 2, 4][..]
+)));
+assert_eq!(s.split_once(|&x| x == 0), None);
+
source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where + F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified +predicate.

+

If any matching elements are present in the slice, returns the prefix +before the match and suffix after. The matching element itself is not +included. If no elements match, returns None.

+
§Examples
+
#![feature(slice_split_once)]
+let s = [1, 2, 3, 2, 4];
+assert_eq!(s.rsplit_once(|&x| x == 2), Some((
+    &[1, 2, 3][..],
+    &[4][..]
+)));
+assert_eq!(s.rsplit_once(|&x| x == 0), None);
+
1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where + T: PartialEq,

Returns true if the slice contains an element with the given value.

+

This operation is O(n).

+

Note that if you have a sorted slice, binary_search may be faster.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.contains(&30));
+assert!(!v.contains(&50));
+

If you do not have a &T, but some other value that you can compare +with one (for example, String implements PartialEq<str>), you can +use iter().any:

+ +
let v = [String::from("hello"), String::from("world")]; // slice of `String`
+assert!(v.iter().any(|e| e == "hello")); // search with `&str`
+assert!(!v.iter().any(|e| e == "hi"));
+
1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.starts_with(&[10]));
+assert!(v.starts_with(&[10, 40]));
+assert!(v.starts_with(&v));
+assert!(!v.starts_with(&[50]));
+assert!(!v.starts_with(&[10, 50]));
+

Always returns true if needle is an empty slice:

+ +
let v = &[10, 40, 30];
+assert!(v.starts_with(&[]));
+let v: &[u8] = &[];
+assert!(v.starts_with(&[]));
+
1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.ends_with(&[30]));
+assert!(v.ends_with(&[40, 30]));
+assert!(v.ends_with(&v));
+assert!(!v.ends_with(&[50]));
+assert!(!v.ends_with(&[50, 30]));
+

Always returns true if needle is an empty slice:

+ +
let v = &[10, 40, 30];
+assert!(v.ends_with(&[]));
+let v: &[u8] = &[];
+assert!(v.ends_with(&[]));
+
1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where + P: SlicePattern<Item = T> + ?Sized, + T: PartialEq,

Returns a subslice with the prefix removed.

+

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. +If prefix is empty, simply returns the original slice. If prefix is equal to the +original slice, returns an empty slice.

+

If the slice does not start with prefix, returns None.

+
§Examples
+
let v = &[10, 40, 30];
+assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
+assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
+assert_eq!(v.strip_prefix(&[10, 40, 30]), Some(&[][..]));
+assert_eq!(v.strip_prefix(&[50]), None);
+assert_eq!(v.strip_prefix(&[10, 50]), None);
+
+let prefix : &str = "he";
+assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
+           Some(b"llo".as_ref()));
+
1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where + P: SlicePattern<Item = T> + ?Sized, + T: PartialEq,

Returns a subslice with the suffix removed.

+

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. +If suffix is empty, simply returns the original slice. If suffix is equal to the +original slice, returns an empty slice.

+

If the slice does not end with suffix, returns None.

+
§Examples
+
let v = &[10, 40, 30];
+assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
+assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
+assert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..]));
+assert_eq!(v.strip_suffix(&[50]), None);
+assert_eq!(v.strip_suffix(&[50, 30]), None);
+

Binary searches this slice for a given element. +If the slice is not sorted, the returned result is unspecified and +meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search_by, binary_search_by_key, and partition_point.

+
§Examples
+

Looks up a series of four elements. The first is found, with a +uniquely determined position; the second and third are not +found; the fourth could match any position in [1, 4].

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+assert_eq!(s.binary_search(&13),  Ok(9));
+assert_eq!(s.binary_search(&4),   Err(7));
+assert_eq!(s.binary_search(&100), Err(13));
+let r = s.binary_search(&1);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+

If you want to find that whole range of matching items, rather than +an arbitrary matching one, that can be done using partition_point:

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+let low = s.partition_point(|x| x < &1);
+assert_eq!(low, 1);
+let high = s.partition_point(|x| x <= &1);
+assert_eq!(high, 5);
+let r = s.binary_search(&1);
+assert!((low..high).contains(&r.unwrap()));
+
+assert!(s[..low].iter().all(|&x| x < 1));
+assert!(s[low..high].iter().all(|&x| x == 1));
+assert!(s[high..].iter().all(|&x| x > 1));
+
+// For something not found, the "range" of equal items is empty
+assert_eq!(s.partition_point(|x| x < &11), 9);
+assert_eq!(s.partition_point(|x| x <= &11), 9);
+assert_eq!(s.binary_search(&11), Err(9));
+

If you want to insert an item to a sorted vector, while maintaining +sort order, consider using partition_point:

+ +
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+let num = 42;
+let idx = s.partition_point(|&x| x <= num);
+// If `num` is unique, `s.partition_point(|&x| x < num)` (with `<`) is equivalent to
+// `s.binary_search(&num).unwrap_or_else(|x| x)`, but using `<=` will allow `insert`
+// to shift less elements.
+s.insert(idx, num);
+assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where + F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

+

The comparator function should return an order code that indicates +whether its argument is Less, Equal or Greater the desired +target. +If the slice is not sorted or if the comparator function does not +implement an order consistent with the sort order of the underlying +slice, the returned result is unspecified and meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search, binary_search_by_key, and partition_point.

+
§Examples
+

Looks up a series of four elements. The first is found, with a +uniquely determined position; the second and third are not +found; the fourth could match any position in [1, 4].

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+let seek = 13;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
+let seek = 4;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
+let seek = 100;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
+let seek = 1;
+let r = s.binary_search_by(|probe| probe.cmp(&seek));
+assert!(match r { Ok(1..=4) => true, _ => false, });
+
1.10.0 · source

pub fn binary_search_by_key<'a, B, F>( + &'a self, + b: &B, + f: F, +) -> Result<usize, usize>
where + F: FnMut(&'a T) -> B, + B: Ord,

Binary searches this slice with a key extraction function.

+

Assumes that the slice is sorted by the key, for instance with +sort_by_key using the same key extraction function. +If the slice is not sorted by the key, the returned result is +unspecified and meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search, binary_search_by, and partition_point.

+
§Examples
+

Looks up a series of four elements in a slice of pairs sorted by +their second elements. The first is found, with a uniquely +determined position; the second and third are not found; the +fourth could match any position in [1, 4].

+ +
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
+         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
+         (1, 21), (2, 34), (4, 55)];
+
+assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
+assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
+assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
+let r = s.binary_search_by_key(&1, |&(a, b)| b);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+
1.20.0 · source

pub fn sort_unstable(&mut self)
where + T: Ord,

Sorts the slice without preserving the initial order of equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

If T: Ord does not implement a total order the resulting order is unspecified. All +original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if T: Ord panics.

+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5, 4, 1, -3, 2];
+
+v.sort_unstable();
+assert!(v == [-5, -3, 1, 2, 4]);
+
1.20.0 · source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where + F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, without preserving the initial order of +equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

The comparator function should define a total ordering for the elements in the slice. If the +ordering is not total, the order of the elements is unspecified.

+

If the comparator function does not implement a total order the resulting order is +unspecified. All original elements will remain in the slice and any possible modifications +via interior mutability are observed in the input. Same is true if the comparator function +panics. A total order (for all a, b and c):

+
    +
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • +
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • +
+

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use +partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

+ +
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
+floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
+assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [5, 4, 1, 3, 2];
+v.sort_unstable_by(|a, b| a.cmp(b));
+assert!(v == [1, 2, 3, 4, 5]);
+
+// reverse sorting
+v.sort_unstable_by(|a, b| b.cmp(a));
+assert!(v == [5, 4, 3, 2, 1]);
+
1.20.0 · source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of +equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If K: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+v.sort_unstable_by_key(|k| k.abs());
+assert!(v == [1, 2, -3, 4, -5]);
+
1.49.0 · source

pub fn select_nth_unstable( + &mut self, + index: usize, +) -> (&mut [T], &mut T, &mut [T])
where + T: Ord,

Reorder the slice such that the element at index after the reordering is at its final +sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index. Additionally, this reordering is +unstable (i.e. any number of equal elements may end up at position index), in-place (i.e. +does not allocate), and runs in O(n) time. This function is also known as “kth element” +in other libraries.

+

It returns a triplet of the following from the reordered slice: the subslice prior to +index, the element at index, and the subslice after index; accordingly, the values in +those two subslices will respectively all be less-than-or-equal-to and +greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median.
+let (lesser, median, greater) = v.select_nth_unstable(2);
+
+assert!(lesser == [-3, -5] || lesser == [-5, -3]);
+assert_eq!(median, &mut 1);
+assert!(greater == [4, 2] || greater == [2, 4]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [-3, -5, 1, 2, 4] ||
+        v == [-5, -3, 1, 2, 4] ||
+        v == [-3, -5, 1, 4, 2] ||
+        v == [-5, -3, 1, 4, 2]);
+
1.49.0 · source

pub fn select_nth_unstable_by<F>( + &mut self, + index: usize, + compare: F, +) -> (&mut [T], &mut T, &mut [T])
where + F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index after the +reordering is at its final sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index using the comparator function. +Additionally, this reordering is unstable (i.e. any number of equal elements may end up at +position index), in-place (i.e. does not allocate), and runs in O(n) time. This +function is also known as “kth element” in other libraries.

+

It returns a triplet of the following from the slice reordered according to the provided +comparator function: the subslice prior to index, the element at index, and the subslice +after index; accordingly, the values in those two subslices will respectively all be +less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted in descending order.
+let (lesser, median, greater) = v.select_nth_unstable_by(2, |a, b| b.cmp(a));
+
+assert!(lesser == [4, 2] || lesser == [2, 4]);
+assert_eq!(median, &mut 1);
+assert!(greater == [-3, -5] || greater == [-5, -3]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [2, 4, 1, -5, -3] ||
+        v == [2, 4, 1, -3, -5] ||
+        v == [4, 2, 1, -5, -3] ||
+        v == [4, 2, 1, -3, -5]);
+
1.49.0 · source

pub fn select_nth_unstable_by_key<K, F>( + &mut self, + index: usize, + f: F, +) -> (&mut [T], &mut T, &mut [T])
where + F: FnMut(&T) -> K, + K: Ord,

Reorder the slice with a key extraction function such that the element at index after the +reordering is at its final sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index using the key extraction function. +Additionally, this reordering is unstable (i.e. any number of equal elements may end up at +position index), in-place (i.e. does not allocate), and runs in O(n) time. This +function is also known as “kth element” in other libraries.

+

It returns a triplet of the following from the slice reordered according to the provided key +extraction function: the subslice prior to index, the element at index, and the subslice +after index; accordingly, the values in those two subslices will respectively all be +less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted according to absolute value.
+let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
+
+assert!(lesser == [1, 2] || lesser == [2, 1]);
+assert_eq!(median, &mut -3);
+assert!(greater == [4, -5] || greater == [-5, 4]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [1, 2, -3, 4, -5] ||
+        v == [1, 2, -3, -5, 4] ||
+        v == [2, 1, -3, 4, -5] ||
+        v == [2, 1, -3, -5, 4]);
+
source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where + T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the +PartialEq trait implementation.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = [1, 2, 2, 3, 3, 2, 1, 1];
+
+let (dedup, duplicates) = slice.partition_dedup();
+
+assert_eq!(dedup, [1, 2, 3, 2, 1]);
+assert_eq!(duplicates, [2, 3, 1]);
+
source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where + F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying +a given equality relation.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

The same_bucket function is passed references to two elements from the slice and +must determine if the elements compare equal. The elements are passed in opposite order +from their order in the slice, so if same_bucket(a, b) returns true, a is moved +at the end of the slice.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"];
+
+let (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b));
+
+assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]);
+assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
+
source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where + F: FnMut(&mut T) -> K, + K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve +to the same key.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = [10, 20, 21, 30, 30, 20, 11, 13];
+
+let (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10);
+
+assert_eq!(dedup, [10, 20, 30, 20, 11]);
+assert_eq!(duplicates, [21, 30, 13]);
+
1.26.0 · source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +slice move to the end while the last self.len() - mid elements move to +the front. After calling rotate_left, the element previously at index +mid will become the first element in the slice.

+
§Panics
+

This function will panic if mid is greater than the length of the +slice. Note that mid == self.len() does not panic and is a no-op +rotation.

+
§Complexity
+

Takes linear (in self.len()) time.

+
§Examples
+
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a.rotate_left(2);
+assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
+

Rotating a subslice:

+ +
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a[1..5].rotate_left(1);
+assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
+
1.26.0 · source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +elements of the slice move to the end while the last k elements move +to the front. After calling rotate_right, the element previously at +index self.len() - k will become the first element in the slice.

+
§Panics
+

This function will panic if k is greater than the length of the +slice. Note that k == self.len() does not panic and is a no-op +rotation.

+
§Complexity
+

Takes linear (in self.len()) time.

+
§Examples
+
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a.rotate_right(2);
+assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
+

Rotating a subslice:

+ +
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a[1..5].rotate_right(1);
+assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
+
1.50.0 · source

pub fn fill(&mut self, value: T)
where + T: Clone,

Fills self with elements by cloning value.

+
§Examples
+
let mut buf = vec![0; 10];
+buf.fill(1);
+assert_eq!(buf, vec![1; 10]);
+
1.51.0 · source

pub fn fill_with<F>(&mut self, f: F)
where + F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

+

This method uses a closure to create new values. If you’d rather +Clone a given value, use fill. If you want to use the Default +trait to generate values, you can pass Default::default as the +argument.

+
§Examples
+
let mut buf = vec![1; 10];
+buf.fill_with(Default::default);
+assert_eq!(buf, vec![0; 10]);
+
1.7.0 · source

pub fn clone_from_slice(&mut self, src: &[T])
where + T: Clone,

Copies the elements from src into self.

+

The length of src must be the same as self.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Examples
+

Cloning two elements from a slice into another:

+ +
let src = [1, 2, 3, 4];
+let mut dst = [0, 0];
+
+// Because the slices have to be the same length,
+// we slice the source slice from four elements
+// to two. It will panic if we don't do this.
+dst.clone_from_slice(&src[2..]);
+
+assert_eq!(src, [1, 2, 3, 4]);
+assert_eq!(dst, [3, 4]);
+

Rust enforces that there can only be one mutable reference with no +immutable references to a particular piece of data in a particular +scope. Because of this, attempting to use clone_from_slice on a +single slice will result in a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+slice[..2].clone_from_slice(&slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.clone_from_slice(&right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 4, 5]);
+
1.9.0 · source

pub fn copy_from_slice(&mut self, src: &[T])
where + T: Copy,

Copies all elements from src into self, using a memcpy.

+

The length of src must be the same as self.

+

If T does not implement Copy, use clone_from_slice.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Examples
+

Copying two elements from a slice into another:

+ +
let src = [1, 2, 3, 4];
+let mut dst = [0, 0];
+
+// Because the slices have to be the same length,
+// we slice the source slice from four elements
+// to two. It will panic if we don't do this.
+dst.copy_from_slice(&src[2..]);
+
+assert_eq!(src, [1, 2, 3, 4]);
+assert_eq!(dst, [3, 4]);
+

Rust enforces that there can only be one mutable reference with no +immutable references to a particular piece of data in a particular +scope. Because of this, attempting to use copy_from_slice on a +single slice will result in a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+slice[..2].copy_from_slice(&slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.copy_from_slice(&right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 4, 5]);
+
1.37.0 · source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where + R: RangeBounds<usize>, + T: Copy,

Copies elements from one part of the slice to another part of itself, +using a memmove.

+

src is the range within self to copy from. dest is the starting +index of the range within self to copy to, which will have the same +length as src. The two ranges may overlap. The ends of the two ranges +must be less than or equal to self.len().

+
§Panics
+

This function will panic if either range exceeds the end of the slice, +or if the end of src is before the start.

+
§Examples
+

Copying four bytes within a slice:

+ +
let mut bytes = *b"Hello, World!";
+
+bytes.copy_within(1..5, 8);
+
+assert_eq!(&bytes, b"Hello, Wello!");
+
1.27.0 · source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+

The length of other must be the same as self.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Example
+

Swapping two elements across slices:

+ +
let mut slice1 = [0, 0];
+let mut slice2 = [1, 2, 3, 4];
+
+slice1.swap_with_slice(&mut slice2[2..]);
+
+assert_eq!(slice1, [3, 4]);
+assert_eq!(slice2, [1, 2, 0, 0]);
+

Rust enforces that there can only be one mutable reference to a +particular piece of data in a particular scope. Because of this, +attempting to use swap_with_slice on a single slice will result in +a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +mutable sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.swap_with_slice(&mut right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 1, 2]);
+
1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is +maintained.

+

This method splits the slice into three distinct slices: prefix, correctly aligned middle +slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

+

This method has no purpose when either input element T or output element U are +zero-sized and will return the original slice without splitting anything.

+
§Safety
+

This method is essentially a transmute with respect to the elements in the returned +middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

+
§Examples
+

Basic usage:

+ +
unsafe {
+    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
+    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
+    // less_efficient_algorithm_for_bytes(prefix);
+    // more_efficient_algorithm_for_aligned_shorts(shorts);
+    // less_efficient_algorithm_for_bytes(suffix);
+}
+
1.30.0 · source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the +types is maintained.

+

This method splits the slice into three distinct slices: prefix, correctly aligned middle +slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

+

This method has no purpose when either input element T or output element U are +zero-sized and will return the original slice without splitting anything.

+
§Safety
+

This method is essentially a transmute with respect to the elements in the returned +middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

+
§Examples
+

Basic usage:

+ +
unsafe {
+    let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
+    let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();
+    // less_efficient_algorithm_for_bytes(prefix);
+    // more_efficient_algorithm_for_aligned_shorts(shorts);
+    // less_efficient_algorithm_for_bytes(suffix);
+}
+
source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where + Simd<T, LANES>: AsRef<[T; LANES]>, + T: SimdElement, + LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

+

This is a safe wrapper around slice::align_to, so has the same weak +postconditions as that method. You’re only assured that +self.len() == prefix.len() + middle.len() * LANES + suffix.len().

+

Notably, all of the following are possible:

+
    +
  • prefix.len() >= LANES.
  • +
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • +
  • suffix.len() >= LANES.
  • +
+

That said, this is a safe method, so if you’re only writing safe code, +then this can at most cause incorrect logic, not unsoundness.

+
§Panics
+

This will panic if the size of the SIMD type is different from +LANES times that of the scalar.

+

At the time of writing, the trait restrictions on Simd<T, LANES> keeps +that from ever happening, as only power-of-two numbers of lanes are +supported. It’s possible that, in the future, those restrictions might +be lifted in a way that would make it possible to see panics from this +method for something like LANES == 3.

+
§Examples
+
#![feature(portable_simd)]
+use core::simd::prelude::*;
+
+let short = &[1, 2, 3];
+let (prefix, middle, suffix) = short.as_simd::<4>();
+assert_eq!(middle, []); // Not enough elements for anything in the middle
+
+// They might be split in any possible way between prefix and suffix
+let it = prefix.iter().chain(suffix).copied();
+assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
+
+fn basic_simd_sum(x: &[f32]) -> f32 {
+    use std::ops::Add;
+    let (prefix, middle, suffix) = x.as_simd();
+    let sums = f32x4::from_array([
+        prefix.iter().copied().sum(),
+        0.0,
+        0.0,
+        suffix.iter().copied().sum(),
+    ]);
+    let sums = middle.iter().copied().fold(sums, f32x4::add);
+    sums.reduce_sum()
+}
+
+let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
+assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
+
source

pub fn as_simd_mut<const LANES: usize>( + &mut self, +) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where + Simd<T, LANES>: AsMut<[T; LANES]>, + T: SimdElement, + LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a mutable slice into a mutable prefix, a middle of aligned SIMD types, +and a mutable suffix.

+

This is a safe wrapper around slice::align_to_mut, so has the same weak +postconditions as that method. You’re only assured that +self.len() == prefix.len() + middle.len() * LANES + suffix.len().

+

Notably, all of the following are possible:

+
    +
  • prefix.len() >= LANES.
  • +
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • +
  • suffix.len() >= LANES.
  • +
+

That said, this is a safe method, so if you’re only writing safe code, +then this can at most cause incorrect logic, not unsoundness.

+

This is the mutable version of slice::as_simd; see that for examples.

+
§Panics
+

This will panic if the size of the SIMD type is different from +LANES times that of the scalar.

+

At the time of writing, the trait restrictions on Simd<T, LANES> keeps +that from ever happening, as only power-of-two numbers of lanes are +supported. It’s possible that, in the future, those restrictions might +be lifted in a way that would make it possible to see panics from this +method for something like LANES == 3.

+
source

pub fn is_sorted(&self) -> bool
where + T: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

+

That is, for each element a and its following element b, a <= b must hold. If the +slice yields exactly zero or one element, true is returned.

+

Note that if Self::Item is only PartialOrd, but not Ord, the above definition +implies that this function returns false if any two consecutive items are not +comparable.

+
§Examples
+
#![feature(is_sorted)]
+let empty: [i32; 0] = [];
+
+assert!([1, 2, 2, 9].is_sorted());
+assert!(![1, 3, 2, 4].is_sorted());
+assert!([0].is_sorted());
+assert!(empty.is_sorted());
+assert!(![0.0, 1.0, f32::NAN].is_sorted());
+
source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where + F: FnMut(&'a T, &'a T) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

+

Instead of using PartialOrd::partial_cmp, this function uses the given compare +function to determine whether two elements are to be considered in sorted order.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!([1, 2, 2, 9].is_sorted_by(|a, b| a <= b));
+assert!(![1, 2, 2, 9].is_sorted_by(|a, b| a < b));
+
+assert!([0].is_sorted_by(|a, b| true));
+assert!([0].is_sorted_by(|a, b| false));
+
+let empty: [i32; 0] = [];
+assert!(empty.is_sorted_by(|a, b| false));
+assert!(empty.is_sorted_by(|a, b| true));
+
source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where + F: FnMut(&'a T) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

+

Instead of comparing the slice’s elements directly, this function compares the keys of the +elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its +documentation for more information.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
+assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
+
1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where + P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate +(the index of the first element of the second partition).

+

The slice is assumed to be partitioned according to the given predicate. +This means that all elements for which the predicate returns true are at the start of the slice +and all elements for which the predicate returns false are at the end. +For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 +(all odd numbers are at the start, all even at the end).

+

If this slice is not partitioned, the returned result is unspecified and meaningless, +as this method performs a kind of binary search.

+

See also binary_search, binary_search_by, and binary_search_by_key.

+
§Examples
+
let v = [1, 2, 3, 3, 5, 6, 7];
+let i = v.partition_point(|&x| x < 5);
+
+assert_eq!(i, 4);
+assert!(v[..i].iter().all(|&x| x < 5));
+assert!(v[i..].iter().all(|&x| !(x < 5)));
+

If all elements of the slice match the predicate, including if the slice +is empty, then the length of the slice will be returned:

+ +
let a = [2, 4, 8];
+assert_eq!(a.partition_point(|x| x < &100), a.len());
+let a: [i32; 0] = [];
+assert_eq!(a.partition_point(|x| x < &100), 0);
+

If you want to insert an item to a sorted vector, while maintaining +sort order:

+ +
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+let num = 42;
+let idx = s.partition_point(|&x| x <= num);
+s.insert(idx, num);
+assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where + R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range +and returns a reference to it.

+

Returns None and does not modify the slice if the given +range is out of bounds.

+

Note that this method only accepts one-sided ranges such as +2.. or ..6, but not 2..6.

+
§Examples
+

Taking the first three elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+let mut first_three = slice.take(..3).unwrap();
+
+assert_eq!(slice, &['d']);
+assert_eq!(first_three, &['a', 'b', 'c']);
+

Taking the last two elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+let mut tail = slice.take(2..).unwrap();
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(tail, &['c', 'd']);
+

Getting None when range is out of bounds:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+
+assert_eq!(None, slice.take(5..));
+assert_eq!(None, slice.take(..5));
+assert_eq!(None, slice.take(..=4));
+let expected: &[char] = &['a', 'b', 'c', 'd'];
+assert_eq!(Some(expected), slice.take(..4));
+
source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where + R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range +and returns a mutable reference to it.

+

Returns None and does not modify the slice if the given +range is out of bounds.

+

Note that this method only accepts one-sided ranges such as +2.. or ..6, but not 2..6.

+
§Examples
+

Taking the first three elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+let mut first_three = slice.take_mut(..3).unwrap();
+
+assert_eq!(slice, &mut ['d']);
+assert_eq!(first_three, &mut ['a', 'b', 'c']);
+

Taking the last two elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+let mut tail = slice.take_mut(2..).unwrap();
+
+assert_eq!(slice, &mut ['a', 'b']);
+assert_eq!(tail, &mut ['c', 'd']);
+

Getting None when range is out of bounds:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+
+assert_eq!(None, slice.take_mut(5..));
+assert_eq!(None, slice.take_mut(..5));
+assert_eq!(None, slice.take_mut(..=4));
+let expected: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+assert_eq!(Some(expected), slice.take_mut(..4));
+
source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c'];
+let first = slice.take_first().unwrap();
+
+assert_eq!(slice, &['b', 'c']);
+assert_eq!(first, &'a');
+
source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +reference to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
+let first = slice.take_first_mut().unwrap();
+*first = 'd';
+
+assert_eq!(slice, &['b', 'c']);
+assert_eq!(first, &'d');
+
source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c'];
+let last = slice.take_last().unwrap();
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(last, &'c');
+
source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +reference to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
+let last = slice.take_last_mut().unwrap();
+*last = 'd';
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(last, &'d');
+
source

pub unsafe fn get_many_unchecked_mut<const N: usize>( + &mut self, + indices: [usize; N], +) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

+

For a safe alternative see get_many_mut.

+
§Safety
+

Calling this method with overlapping or out-of-bounds indices is undefined behavior +even if the resulting references are not used.

+
§Examples
+
#![feature(get_many_mut)]
+
+let x = &mut [1, 2, 4];
+
+unsafe {
+    let [a, b] = x.get_many_unchecked_mut([0, 2]);
+    *a *= 10;
+    *b *= 100;
+}
+assert_eq!(x, &[10, 2, 400]);
+
source

pub fn get_many_mut<const N: usize>( + &mut self, + indices: [usize; N], +) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

+

Returns an error if any index is out-of-bounds, or if the same index was +passed more than once.

+
§Examples
+
#![feature(get_many_mut)]
+
+let v = &mut [1, 2, 3];
+if let Ok([a, b]) = v.get_many_mut([0, 2]) {
+    *a = 413;
+    *b = 612;
+}
+assert_eq!(v, &[413, 2, 612]);
+
1.0.0 · source

pub fn sort(&mut self)
where + T: Ord,

Sorts the slice, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) +worst-case.

+

If T: Ord does not implement a total order the resulting order is unspecified. All +original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if T: Ord panics.

+

When applicable, unstable sorting is preferred because it is generally faster than stable +sorting and it doesn’t allocate auxiliary memory. See +sort_unstable. The exception are partially sorted slices, which +may be better served with slice::sort.

+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5, 4, 1, -3, 2];
+
+v.sort();
+assert!(v == [-5, -3, 1, 2, 4]);
+
1.0.0 · source

pub fn sort_by<F>(&mut self, compare: F)
where + F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) +worst-case.

+

The comparator function should define a total ordering for the elements in the slice. If the +ordering is not total, the order of the elements is unspecified.

+

If the comparator function does not implement a total order the resulting order is +unspecified. All original elements will remain in the slice and any possible modifications +via interior mutability are observed in the input. Same is true if the comparator function +panics. A total order (for all a, b and c):

+
    +
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • +
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • +
+

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use +partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

+ +
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
+floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
+assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [5, 4, 1, 3, 2];
+v.sort_by(|a, b| a.cmp(b));
+assert!(v == [1, 2, 3, 4, 5]);
+
+// reverse sorting
+v.sort_by(|a, b| b.cmp(a));
+assert!(v == [5, 4, 3, 2, 1]);
+
1.7.0 · source

pub fn sort_by_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) +worst-case, where the key function is O(m).

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If K: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+v.sort_by_key(|k| k.abs());
+assert!(v == [1, 2, -3, 4, -5]);
+
1.34.0 · source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * +log(n)) worst-case, where the key function is O(m).

+

During sorting, the key function is called at most once per element, by using temporary +storage to remember the results of key evaluation. The order of calls to the key function is +unspecified and may change in future versions of the standard library.

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+

For simple key functions (e.g., functions that are property accesses or basic operations), +sort_by_key is likely to be faster.

+
§Current implementation
+

The current implementation is based on instruction-parallel-network sort by Lukas +Bergdoll, which combines the fast average case of randomized quicksort with the fast worst +case of heapsort, while achieving linear time on fully sorted and reversed inputs. And +O(k * log(n)) where k is the number of distinct elements in the input. It leverages +superscalar out-of-order execution capabilities commonly found in CPUs, to efficiently +perform the operation.

+

In the worst case, the algorithm allocates temporary storage in a Vec<(K, usize)> the +length of the slice.

+
§Examples
+
let mut v = [-5i32, 4, 32, -3, 2];
+
+v.sort_by_cached_key(|k| k.to_string());
+assert!(v == [-3, -5, 2, 32, 4]);
+
1.0.0 · source

pub fn to_vec(&self) -> Vec<T>
where + T: Clone,

Copies self into a new Vec.

+
§Examples
+
let s = [10, 40, 30];
+let x = s.to_vec();
+// Here, `s` and `x` can be modified independently.
+
source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where + A: Allocator, + T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::alloc::System;
+
+let s = [10, 40, 30];
+let x = s.to_vec_in(System);
+// Here, `s` and `x` can be modified independently.
+
1.40.0 · source

pub fn repeat(&self, n: usize) -> Vec<T>
where + T: Copy,

Creates a vector by copying a slice n times.

+
§Panics
+

This function will panic if the capacity would overflow.

+
§Examples
+

Basic usage:

+ +
assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
+

A panic upon overflow:

+ +
// this will panic at runtime
+b"0123456789abcdef".repeat(usize::MAX);
+
1.0.0 · source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where + [T]: Concat<Item>, + Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

+
§Examples
+
assert_eq!(["hello", "world"].concat(), "helloworld");
+assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
+
1.3.0 · source

pub fn join<Separator>( + &self, + sep: Separator, +) -> <[T] as Join<Separator>>::Output
where + [T]: Join<Separator>,

Flattens a slice of T into a single value Self::Output, placing a +given separator between each.

+
§Examples
+
assert_eq!(["hello", "world"].join(" "), "hello world");
+assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
+assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
+
1.0.0 · source

pub fn connect<Separator>( + &self, + sep: Separator, +) -> <[T] as Join<Separator>>::Output
where + [T]: Join<Separator>,

👎Deprecated since 1.3.0: renamed to join

Flattens a slice of T into a single value Self::Output, placing a +given separator between each.

+
§Examples
+
assert_eq!(["hello", "world"].connect(" "), "hello world");
+assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
+
1.23.0 · source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +is mapped to its ASCII upper case equivalent.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To uppercase the value in-place, use make_ascii_uppercase.

+
1.23.0 · source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +is mapped to its ASCII lower case equivalent.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To lowercase the value in-place, use make_ascii_lowercase.

+

Trait Implementations§

source§

impl Clone for TxnBatch

source§

fn clone(&self) -> TxnBatch

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TxnBatch

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TxnBatch

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TxnBatch

source§

fn default() -> TxnBatch

Returns the “default value” for a type. Read more
source§

impl DerefMut for TxnBatch

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Encode for TxnBatch

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<TxnBatch> for Vec<Vec<u8>>

source§

fn from(val: TxnBatch) -> Self

Converts to this type from the input type.
source§

impl From<TxnBatch> for VecDeque<Vec<u8>>

source§

fn from(val: TxnBatch) -> Self

Converts to this type from the input type.
source§

impl From<Vec<Vec<u8>>> for TxnBatch

source§

fn from(other: Vec<Vec<u8>>) -> TxnBatch

Converts to this type from the input type.
source§

impl From<VecDeque<Vec<u8>>> for TxnBatch

source§

fn from(other: VecDeque<Vec<u8>>) -> TxnBatch

Converts to this type from the input type.
source§

impl PartialEq for TxnBatch

source§

fn eq(&self, other: &TxnBatch) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Deref for TxnBatch

§

type Target = Vec<Vec<u8>>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Eq for TxnBatch

source§

impl StructuralPartialEq for TxnBatch

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/enum.Body.html b/rust/oasis_core_runtime/types/enum.Body.html new file mode 100644 index 0000000000..a83f278915 --- /dev/null +++ b/rust/oasis_core_runtime/types/enum.Body.html @@ -0,0 +1,215 @@ +Body in oasis_core_runtime::types - Rust

Enum oasis_core_runtime::types::Body

source ·
pub enum Body {
+
Show 64 variants Empty {}, + Error(Error), + RuntimeInfoRequest(RuntimeInfoRequest), + RuntimeInfoResponse(RuntimeInfoResponse), + RuntimePingRequest {}, + RuntimeShutdownRequest {}, + RuntimeAbortRequest {}, + RuntimeAbortResponse {}, + RuntimeCapabilityTEERakInitRequest { + target_info: Vec<u8>, + }, + RuntimeCapabilityTEERakInitResponse {}, + RuntimeCapabilityTEERakReportRequest {}, + RuntimeCapabilityTEERakReportResponse { + rak_pub: PublicKey, + rek_pub: PublicKey, + report: Vec<u8>, + nonce: String, + }, + RuntimeCapabilityTEERakAvrRequest { + avr: AVR, + }, + RuntimeCapabilityTEERakAvrResponse {}, + RuntimeCapabilityTEERakQuoteRequest { + quote: Quote, + }, + RuntimeCapabilityTEERakQuoteResponse { + height: u64, + signature: Signature, + }, + RuntimeCapabilityTEEUpdateEndorsementRequest { + ect: EndorsedCapabilityTEE, + }, + RuntimeCapabilityTEEUpdateEndorsementResponse {}, + RuntimeRPCCallRequest { + request: Vec<u8>, + kind: Kind, + peer_id: Vec<u8>, + }, + RuntimeRPCCallResponse { + response: Vec<u8>, + }, + RuntimeLocalRPCCallRequest { + request: Vec<u8>, + }, + RuntimeLocalRPCCallResponse { + response: Vec<u8>, + }, + RuntimeCheckTxBatchRequest { + consensus_block: LightBlock, + inputs: TxnBatch, + block: Block, + epoch: EpochTime, + max_messages: u32, + }, + RuntimeCheckTxBatchResponse { + results: Vec<CheckTxResult>, + }, + RuntimeExecuteTxBatchRequest { + mode: ExecutionMode, + consensus_block: LightBlock, + round_results: RoundResults, + io_root: Hash, + inputs: Option<TxnBatch>, + in_msgs: Vec<IncomingMessage>, + block: Block, + epoch: EpochTime, + max_messages: u32, + }, + RuntimeExecuteTxBatchResponse { + batch: ComputedBatch, + tx_hashes: Vec<Hash>, + tx_reject_hashes: Vec<Hash>, + tx_input_root: Hash, + tx_input_write_log: WriteLog, + }, + RuntimeKeyManagerStatusUpdateRequest { + status: Status, + }, + RuntimeKeyManagerStatusUpdateResponse {}, + RuntimeKeyManagerQuotePolicyUpdateRequest { + policy: QuotePolicy, + }, + RuntimeKeyManagerQuotePolicyUpdateResponse {}, + RuntimeQueryRequest { + consensus_block: LightBlock, + header: Header, + epoch: EpochTime, + max_messages: u32, + method: String, + args: Vec<u8>, + }, + RuntimeQueryResponse { + data: Vec<u8>, + }, + RuntimeConsensusSyncRequest { + height: u64, + }, + RuntimeConsensusSyncResponse {}, + RuntimeNotifyRequest { + runtime_block: Option<AnnotatedBlock>, + runtime_event: Option<RuntimeNotifyEvent>, + }, + RuntimeNotifyResponse {}, + HostRPCCallRequest { + endpoint: String, + request_id: u64, + request: Vec<u8>, + kind: Kind, + nodes: Vec<PublicKey>, + }, + HostRPCCallResponse { + response: Vec<u8>, + node: PublicKey, + }, + HostSubmitPeerFeedbackRequest { + endpoint: String, + request_id: u64, + peer_feedback: PeerFeedback, + }, + HostSubmitPeerFeedbackResponse {}, + HostStorageSyncRequest(StorageSyncRequestWithEndpoint), + HostStorageSyncResponse(StorageSyncResponse), + HostLocalStorageGetRequest { + key: Vec<u8>, + }, + HostLocalStorageGetResponse { + value: Vec<u8>, + }, + HostLocalStorageSetRequest { + key: Vec<u8>, + value: Vec<u8>, + }, + HostLocalStorageSetResponse {}, + HostFetchConsensusBlockRequest { + height: u64, + }, + HostFetchConsensusBlockResponse { + block: LightBlock, + }, + HostFetchConsensusEventsRequest(HostFetchConsensusEventsRequest), + HostFetchConsensusEventsResponse(HostFetchConsensusEventsResponse), + HostFetchTxBatchRequest { + offset: Option<Hash>, + limit: u32, + }, + HostFetchTxBatchResponse { + batch: Option<TxnBatch>, + }, + HostFetchBlockMetadataTxRequest { + height: u64, + }, + HostFetchBlockMetadataTxResponse { + signed_tx: SignedTransaction, + proof: Proof, + }, + HostFetchGenesisHeightRequest {}, + HostFetchGenesisHeightResponse { + height: u64, + }, + HostProveFreshnessRequest { + blob: Vec<u8>, + }, + HostProveFreshnessResponse { + signed_tx: SignedTransaction, + proof: Proof, + }, + HostIdentityRequest {}, + HostIdentityResponse { + node_id: PublicKey, + }, + HostSubmitTxRequest { + runtime_id: Namespace, + data: Vec<u8>, + wait: bool, + prove: bool, + }, + HostSubmitTxResponse { + output: Vec<u8>, + round: u64, + batch_order: u32, + proof: Option<Proof>, + }, + HostRegisterNotifyRequest { + runtime_block: bool, + runtime_event: Option<RegisterNotifyRuntimeEvent>, + }, + HostRegisterNotifyResponse {}, +
}
Expand description

Runtime host protocol message body.

+

Variants§

§

Empty

§

Error(Error)

§

RuntimeInfoRequest(RuntimeInfoRequest)

§

RuntimeInfoResponse(RuntimeInfoResponse)

§

RuntimePingRequest

§

RuntimeShutdownRequest

§

RuntimeAbortRequest

§

RuntimeAbortResponse

§

RuntimeCapabilityTEERakInitRequest

Fields

§target_info: Vec<u8>
§

RuntimeCapabilityTEERakInitResponse

§

RuntimeCapabilityTEERakReportRequest

§

RuntimeCapabilityTEERakReportResponse

Fields

§rak_pub: PublicKey
§rek_pub: PublicKey
§report: Vec<u8>
§nonce: String
§

RuntimeCapabilityTEERakAvrRequest

Fields

§avr: AVR
§

RuntimeCapabilityTEERakAvrResponse

§

RuntimeCapabilityTEERakQuoteRequest

Fields

§quote: Quote
§

RuntimeCapabilityTEERakQuoteResponse

Fields

§height: u64
§signature: Signature
§

RuntimeCapabilityTEEUpdateEndorsementRequest

§

RuntimeCapabilityTEEUpdateEndorsementResponse

§

RuntimeRPCCallRequest

Fields

§request: Vec<u8>
§kind: Kind
§peer_id: Vec<u8>
§

RuntimeRPCCallResponse

Fields

§response: Vec<u8>
§

RuntimeLocalRPCCallRequest

Fields

§request: Vec<u8>
§

RuntimeLocalRPCCallResponse

Fields

§response: Vec<u8>
§

RuntimeCheckTxBatchRequest

Fields

§consensus_block: LightBlock
§inputs: TxnBatch
§block: Block
§max_messages: u32
§

RuntimeCheckTxBatchResponse

Fields

§

RuntimeExecuteTxBatchRequest

Fields

§consensus_block: LightBlock
§round_results: RoundResults
§io_root: Hash
§block: Block
§max_messages: u32
§

RuntimeExecuteTxBatchResponse

Fields

§tx_hashes: Vec<Hash>
§tx_reject_hashes: Vec<Hash>
§tx_input_root: Hash
§tx_input_write_log: WriteLog
§

RuntimeKeyManagerStatusUpdateRequest

Fields

§status: Status
§

RuntimeKeyManagerStatusUpdateResponse

§

RuntimeKeyManagerQuotePolicyUpdateRequest

Fields

§

RuntimeKeyManagerQuotePolicyUpdateResponse

§

RuntimeQueryRequest

Fields

§consensus_block: LightBlock
§header: Header
§max_messages: u32
§method: String
§args: Vec<u8>
§

RuntimeQueryResponse

Fields

§data: Vec<u8>
§

RuntimeConsensusSyncRequest

Fields

§height: u64
§

RuntimeConsensusSyncResponse

§

RuntimeNotifyRequest

Fields

§runtime_block: Option<AnnotatedBlock>
§

RuntimeNotifyResponse

§

HostRPCCallRequest

Fields

§endpoint: String
§request_id: u64
§request: Vec<u8>
§kind: Kind
§

HostRPCCallResponse

Fields

§response: Vec<u8>
§

HostSubmitPeerFeedbackRequest

Fields

§endpoint: String
§request_id: u64
§peer_feedback: PeerFeedback
§

HostSubmitPeerFeedbackResponse

§

HostStorageSyncRequest(StorageSyncRequestWithEndpoint)

§

HostStorageSyncResponse(StorageSyncResponse)

§

HostLocalStorageGetRequest

Fields

§key: Vec<u8>
§

HostLocalStorageGetResponse

Fields

§value: Vec<u8>
§

HostLocalStorageSetRequest

Fields

§key: Vec<u8>
§value: Vec<u8>
§

HostLocalStorageSetResponse

§

HostFetchConsensusBlockRequest

Fields

§height: u64
§

HostFetchConsensusBlockResponse

Fields

§

HostFetchConsensusEventsRequest(HostFetchConsensusEventsRequest)

§

HostFetchConsensusEventsResponse(HostFetchConsensusEventsResponse)

§

HostFetchTxBatchRequest

Fields

§offset: Option<Hash>
§limit: u32
§

HostFetchTxBatchResponse

Fields

§

HostFetchBlockMetadataTxRequest

Fields

§height: u64
§

HostFetchBlockMetadataTxResponse

Fields

§proof: Proof
§

HostFetchGenesisHeightRequest

§

HostFetchGenesisHeightResponse

Fields

§height: u64
§

HostProveFreshnessRequest

Fields

§blob: Vec<u8>
§

HostProveFreshnessResponse

Fields

§proof: Proof
§

HostIdentityRequest

§

HostIdentityResponse

Fields

§node_id: PublicKey
§

HostSubmitTxRequest

Fields

§runtime_id: Namespace
§data: Vec<u8>
§wait: bool
§prove: bool
§

HostSubmitTxResponse

Fields

§output: Vec<u8>
§round: u64
§batch_order: u32
§proof: Option<Proof>
§

HostRegisterNotifyRequest

Fields

§runtime_block: bool
§

HostRegisterNotifyResponse

Trait Implementations§

source§

impl Debug for Body

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Body

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Body

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for Body

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Body

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Body

§

impl RefUnwindSafe for Body

§

impl Send for Body

§

impl Sync for Body

§

impl Unpin for Body

§

impl UnwindSafe for Body

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/enum.EventKind.html b/rust/oasis_core_runtime/types/enum.EventKind.html new file mode 100644 index 0000000000..9df383521c --- /dev/null +++ b/rust/oasis_core_runtime/types/enum.EventKind.html @@ -0,0 +1,32 @@ +EventKind in oasis_core_runtime::types - Rust

Enum oasis_core_runtime::types::EventKind

source ·
#[repr(u8)]
pub enum EventKind { + Staking = 1, + Registry = 2, + RootHash = 3, + Governance = 4, +}
Expand description

Consensus event kind.

+

Variants§

§

Staking = 1

§

Registry = 2

§

RootHash = 3

§

Governance = 4

Trait Implementations§

source§

impl Clone for EventKind

source§

fn clone(&self) -> EventKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EventKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EventKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for EventKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Copy for EventKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/enum.ExecutionMode.html b/rust/oasis_core_runtime/types/enum.ExecutionMode.html new file mode 100644 index 0000000000..37d2de088a --- /dev/null +++ b/rust/oasis_core_runtime/types/enum.ExecutionMode.html @@ -0,0 +1,39 @@ +ExecutionMode in oasis_core_runtime::types - Rust

Enum oasis_core_runtime::types::ExecutionMode

source ·
pub enum ExecutionMode {
+    Execute = 0,
+    Schedule = 1,
+}
Expand description

Batch execution mode.

+

Variants§

§

Execute = 0

Execution mode where the batch of transactions is executed as-is without the ability to +perform and modifications to the batch.

+
§

Schedule = 1

Execution mode where the runtime is in control of scheduling and may arbitrarily modify the +batch during execution.

+

This execution mode will only be used in case the runtime advertises to support the schedule +control feature. In this case the call will only contain up to InitialBatchSize transactions +and the runtime will need to request more if it needs more.

+

Trait Implementations§

source§

impl Clone for ExecutionMode

source§

fn clone(&self) -> ExecutionMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecutionMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecutionMode

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecutionMode

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for ExecutionMode

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for ExecutionMode

source§

fn eq(&self, other: &ExecutionMode) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ExecutionMode

source§

impl StructuralPartialEq for ExecutionMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/enum.HostStorageEndpoint.html b/rust/oasis_core_runtime/types/enum.HostStorageEndpoint.html new file mode 100644 index 0000000000..49d6eccca1 --- /dev/null +++ b/rust/oasis_core_runtime/types/enum.HostStorageEndpoint.html @@ -0,0 +1,36 @@ +HostStorageEndpoint in oasis_core_runtime::types - Rust

Enum oasis_core_runtime::types::HostStorageEndpoint

source ·
#[repr(u8)]
pub enum HostStorageEndpoint { + Runtime = 0, + Consensus = 1, +}
Expand description

Host storage endpoint.

+

Variants§

§

Runtime = 0

§

Consensus = 1

Trait Implementations§

source§

impl Clone for HostStorageEndpoint

source§

fn clone(&self) -> HostStorageEndpoint

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HostStorageEndpoint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for HostStorageEndpoint

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for HostStorageEndpoint

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for HostStorageEndpoint

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for HostStorageEndpoint

source§

fn eq(&self, other: &HostStorageEndpoint) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for HostStorageEndpoint

source§

impl Eq for HostStorageEndpoint

source§

impl StructuralPartialEq for HostStorageEndpoint

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/enum.MessageType.html b/rust/oasis_core_runtime/types/enum.MessageType.html new file mode 100644 index 0000000000..8dce77554b --- /dev/null +++ b/rust/oasis_core_runtime/types/enum.MessageType.html @@ -0,0 +1,33 @@ +MessageType in oasis_core_runtime::types - Rust

Enum oasis_core_runtime::types::MessageType

source ·
#[repr(u8)]
pub enum MessageType { + Invalid = 0, + Request = 1, + Response = 2, +}

Variants§

§

Invalid = 0

Invalid message (should never be seen on the wire).

+
§

Request = 1

Request.

+
§

Response = 2

Response.

+

Trait Implementations§

source§

impl Clone for MessageType

source§

fn clone(&self) -> MessageType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MessageType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MessageType

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for MessageType

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for MessageType

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Copy for MessageType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/enum.StorageSyncRequest.html b/rust/oasis_core_runtime/types/enum.StorageSyncRequest.html new file mode 100644 index 0000000000..9049594e91 --- /dev/null +++ b/rust/oasis_core_runtime/types/enum.StorageSyncRequest.html @@ -0,0 +1,30 @@ +StorageSyncRequest in oasis_core_runtime::types - Rust

Enum oasis_core_runtime::types::StorageSyncRequest

source ·
pub enum StorageSyncRequest {
+    SyncGet(GetRequest),
+    SyncGetPrefixes(GetPrefixesRequest),
+    SyncIterate(IterateRequest),
+}
Expand description

Storage sync request.

+

Variants§

§

SyncGet(GetRequest)

§

SyncGetPrefixes(GetPrefixesRequest)

§

SyncIterate(IterateRequest)

Trait Implementations§

source§

impl Debug for StorageSyncRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StorageSyncRequest

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for StorageSyncRequest

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for StorageSyncRequest

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/enum.StorageSyncResponse.html b/rust/oasis_core_runtime/types/enum.StorageSyncResponse.html new file mode 100644 index 0000000000..68b07e5776 --- /dev/null +++ b/rust/oasis_core_runtime/types/enum.StorageSyncResponse.html @@ -0,0 +1,28 @@ +StorageSyncResponse in oasis_core_runtime::types - Rust

Enum oasis_core_runtime::types::StorageSyncResponse

source ·
pub enum StorageSyncResponse {
+    ProofResponse(ProofResponse),
+}
Expand description

Storage sync response.

+

Variants§

§

ProofResponse(ProofResponse)

Trait Implementations§

source§

impl Debug for StorageSyncResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StorageSyncResponse

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for StorageSyncResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for StorageSyncResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/index.html b/rust/oasis_core_runtime/types/index.html new file mode 100644 index 0000000000..fd9bf180cc --- /dev/null +++ b/rust/oasis_core_runtime/types/index.html @@ -0,0 +1,4 @@ +oasis_core_runtime::types - Rust

Module oasis_core_runtime::types

source ·
Expand description

Types used by the worker-host protocol.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/sidebar-items.js b/rust/oasis_core_runtime/types/sidebar-items.js new file mode 100644 index 0000000000..26a8351a4a --- /dev/null +++ b/rust/oasis_core_runtime/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Body","EventKind","ExecutionMode","HostStorageEndpoint","MessageType","StorageSyncRequest","StorageSyncResponse"],"struct":["CheckTxMetadata","CheckTxResult","ComputedBatch","Error","FeatureScheduleControl","Features","HostFetchConsensusEventsRequest","HostFetchConsensusEventsResponse","Message","RegisterNotifyRuntimeEvent","RuntimeInfoRequest","RuntimeInfoResponse","RuntimeNotifyEvent","StorageSyncRequestWithEndpoint"]}; \ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.CheckTxMetadata.html b/rust/oasis_core_runtime/types/struct.CheckTxMetadata.html new file mode 100644 index 0000000000..246839f67d --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.CheckTxMetadata.html @@ -0,0 +1,32 @@ +CheckTxMetadata in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::CheckTxMetadata

source ·
pub struct CheckTxMetadata {
+    pub priority: u64,
+    pub sender: Vec<u8>,
+    pub sender_seq: u64,
+    pub sender_state_seq: u64,
+}
Expand description

CheckTx transaction metadata.

+

Fields§

§priority: u64§sender: Vec<u8>§sender_seq: u64§sender_state_seq: u64

Trait Implementations§

source§

impl Clone for CheckTxMetadata

source§

fn clone(&self) -> CheckTxMetadata

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CheckTxMetadata

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CheckTxMetadata

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CheckTxMetadata

source§

fn default() -> CheckTxMetadata

Returns the “default value” for a type. Read more
source§

impl Encode for CheckTxMetadata

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CheckTxMetadata

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.CheckTxResult.html b/rust/oasis_core_runtime/types/struct.CheckTxResult.html new file mode 100644 index 0000000000..bc3d2e1404 --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.CheckTxResult.html @@ -0,0 +1,30 @@ +CheckTxResult in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::CheckTxResult

source ·
pub struct CheckTxResult {
+    pub error: Error,
+    pub meta: Option<CheckTxMetadata>,
+}
Expand description

Result of a CheckTx operation.

+

Fields§

§error: Error§meta: Option<CheckTxMetadata>

Trait Implementations§

source§

impl Clone for CheckTxResult

source§

fn clone(&self) -> CheckTxResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CheckTxResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CheckTxResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CheckTxResult

source§

fn default() -> CheckTxResult

Returns the “default value” for a type. Read more
source§

impl Encode for CheckTxResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CheckTxResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.ComputedBatch.html b/rust/oasis_core_runtime/types/struct.ComputedBatch.html new file mode 100644 index 0000000000..a8103423ef --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.ComputedBatch.html @@ -0,0 +1,39 @@ +ComputedBatch in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::ComputedBatch

source ·
pub struct ComputedBatch {
+    pub header: ComputeResultsHeader,
+    pub io_write_log: WriteLog,
+    pub state_write_log: WriteLog,
+    pub rak_sig: Signature,
+    pub messages: Vec<Message>,
+}
Expand description

Computed batch.

+

Fields§

§header: ComputeResultsHeader

Compute results header.

+
§io_write_log: WriteLog

Log that generates the I/O tree.

+
§state_write_log: WriteLog

Log of changes to the state tree.

+
§rak_sig: Signature

If this runtime uses a TEE, then this is the signature of the batch’s +BatchSigMessage with the node’s RAK for this runtime.

+
§messages: Vec<Message>

Messages emitted by the runtime.

+

Trait Implementations§

source§

impl Clone for ComputedBatch

source§

fn clone(&self) -> ComputedBatch

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ComputedBatch

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ComputedBatch

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ComputedBatch

source§

fn default() -> ComputedBatch

Returns the “default value” for a type. Read more
source§

impl Encode for ComputedBatch

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ComputedBatch

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.Error.html b/rust/oasis_core_runtime/types/struct.Error.html new file mode 100644 index 0000000000..758cb296e2 --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.Error.html @@ -0,0 +1,33 @@ +Error in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::Error

source ·
pub struct Error {
+    pub module: String,
+    pub code: u32,
+    pub message: String,
+}
Expand description

A serializable error.

+

Fields§

§module: String§code: u32§message: String

Implementations§

source§

impl Error

source

pub fn new(module: &str, code: u32, msg: &str) -> Self

Create a new error.

+

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Error

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Error

source§

fn default() -> Error

Returns the “default value” for a type. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Error

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Error

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<JoinError> for Error

source§

fn from(e: JoinError) -> Self

Converts to this type from the input type.
source§

impl From<ProtocolError> for Error

source§

fn from(err: ProtocolError) -> Self

Converts to this type from the input type.
source§

impl From<StateError> for Error

source§

fn from(e: StateError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.FeatureScheduleControl.html b/rust/oasis_core_runtime/types/struct.FeatureScheduleControl.html new file mode 100644 index 0000000000..40a3938aad --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.FeatureScheduleControl.html @@ -0,0 +1,32 @@ +FeatureScheduleControl in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::FeatureScheduleControl

source ·
pub struct FeatureScheduleControl {
+    pub initial_batch_size: u32,
+}
Expand description

A feature specifying that the runtime supports controlling the scheduling of batches. This means +that the scheduler should only take priority into account and ignore weights, leaving it up to +the runtime to decide which transactions to include.

+

Fields§

§initial_batch_size: u32

Size of the initial batch of transactions.

+

Trait Implementations§

source§

impl Clone for FeatureScheduleControl

source§

fn clone(&self) -> FeatureScheduleControl

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FeatureScheduleControl

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for FeatureScheduleControl

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for FeatureScheduleControl

source§

fn default() -> FeatureScheduleControl

Returns the “default value” for a type. Read more
source§

impl Encode for FeatureScheduleControl

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for FeatureScheduleControl

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.Features.html b/rust/oasis_core_runtime/types/struct.Features.html new file mode 100644 index 0000000000..71ea95ca6f --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.Features.html @@ -0,0 +1,36 @@ +Features in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::Features

source ·
pub struct Features {
+    pub schedule_control: Option<FeatureScheduleControl>,
+    pub key_manager_quote_policy_updates: bool,
+    pub key_manager_status_updates: bool,
+    pub endorsed_capability_tee: bool,
+}
Expand description

Set of supported runtime features.

+

Fields§

§schedule_control: Option<FeatureScheduleControl>

Schedule control feature.

+
§key_manager_quote_policy_updates: bool

A feature specifying that the runtime supports updating key manager’s quote policy.

+
§key_manager_status_updates: bool

A feature specifying that the runtime supports updating key manager’s status.

+
§endorsed_capability_tee: bool

A feature specifying that the runtime supports endorsed TEE capabilities.

+

Trait Implementations§

source§

impl Clone for Features

source§

fn clone(&self) -> Features

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Features

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Features

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Features

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for Features

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Features

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.HostFetchConsensusEventsRequest.html b/rust/oasis_core_runtime/types/struct.HostFetchConsensusEventsRequest.html new file mode 100644 index 0000000000..25c42be14f --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.HostFetchConsensusEventsRequest.html @@ -0,0 +1,31 @@ +HostFetchConsensusEventsRequest in oasis_core_runtime::types - Rust
pub struct HostFetchConsensusEventsRequest {
+    pub height: u64,
+    pub kind: EventKind,
+}
Expand description

Request to host to fetch the consensus events for the given height.

+

Fields§

§height: u64§kind: EventKind

Trait Implementations§

source§

impl Clone for HostFetchConsensusEventsRequest

source§

fn clone(&self) -> HostFetchConsensusEventsRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HostFetchConsensusEventsRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for HostFetchConsensusEventsRequest

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for HostFetchConsensusEventsRequest

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for HostFetchConsensusEventsRequest

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.HostFetchConsensusEventsResponse.html b/rust/oasis_core_runtime/types/struct.HostFetchConsensusEventsResponse.html new file mode 100644 index 0000000000..20dc42920f --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.HostFetchConsensusEventsResponse.html @@ -0,0 +1,29 @@ +HostFetchConsensusEventsResponse in oasis_core_runtime::types - Rust
pub struct HostFetchConsensusEventsResponse {
+    pub events: Vec<Event>,
+}
Expand description

Response from host fetching the consensus events for the given height.

+

Fields§

§events: Vec<Event>

Trait Implementations§

source§

impl Clone for HostFetchConsensusEventsResponse

source§

fn clone(&self) -> HostFetchConsensusEventsResponse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HostFetchConsensusEventsResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for HostFetchConsensusEventsResponse

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for HostFetchConsensusEventsResponse

source§

fn default() -> HostFetchConsensusEventsResponse

Returns the “default value” for a type. Read more
source§

impl Encode for HostFetchConsensusEventsResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for HostFetchConsensusEventsResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.Message.html b/rust/oasis_core_runtime/types/struct.Message.html new file mode 100644 index 0000000000..3340ebc179 --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.Message.html @@ -0,0 +1,32 @@ +Message in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::Message

source ·
pub struct Message {
+    pub id: u64,
+    pub message_type: MessageType,
+    pub body: Body,
+}
Expand description

Runtime protocol message.

+

Fields§

§id: u64

Unique request identifier.

+
§message_type: MessageType

Message type.

+
§body: Body

Message body.

+

Trait Implementations§

source§

impl Debug for Message

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Message

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Message

source§

fn default() -> Message

Returns the “default value” for a type. Read more
source§

impl Encode for Message

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Message

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.RegisterNotifyRuntimeEvent.html b/rust/oasis_core_runtime/types/struct.RegisterNotifyRuntimeEvent.html new file mode 100644 index 0000000000..59399ecf7f --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.RegisterNotifyRuntimeEvent.html @@ -0,0 +1,30 @@ +RegisterNotifyRuntimeEvent in oasis_core_runtime::types - Rust
pub struct RegisterNotifyRuntimeEvent {
+    pub tags: Vec<Vec<u8>>,
+}
Expand description

Registration for runtime event notifications.

+

Fields§

§tags: Vec<Vec<u8>>

Event tags to subscribe to.

+

Trait Implementations§

source§

impl Clone for RegisterNotifyRuntimeEvent

source§

fn clone(&self) -> RegisterNotifyRuntimeEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RegisterNotifyRuntimeEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RegisterNotifyRuntimeEvent

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RegisterNotifyRuntimeEvent

source§

fn default() -> RegisterNotifyRuntimeEvent

Returns the “default value” for a type. Read more
source§

impl Encode for RegisterNotifyRuntimeEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RegisterNotifyRuntimeEvent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.RuntimeInfoRequest.html b/rust/oasis_core_runtime/types/struct.RuntimeInfoRequest.html new file mode 100644 index 0000000000..c7fc9fee35 --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.RuntimeInfoRequest.html @@ -0,0 +1,33 @@ +RuntimeInfoRequest in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::RuntimeInfoRequest

source ·
pub struct RuntimeInfoRequest {
+    pub runtime_id: Namespace,
+    pub consensus_backend: String,
+    pub consensus_protocol_version: Version,
+    pub consensus_chain_context: String,
+    pub local_config: BTreeMap<String, Value>,
+}
Expand description

Runtime information request.

+

Fields§

§runtime_id: Namespace§consensus_backend: String§consensus_protocol_version: Version§consensus_chain_context: String§local_config: BTreeMap<String, Value>

Trait Implementations§

source§

impl Clone for RuntimeInfoRequest

source§

fn clone(&self) -> RuntimeInfoRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeInfoRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeInfoRequest

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RuntimeInfoRequest

source§

fn default() -> RuntimeInfoRequest

Returns the “default value” for a type. Read more
source§

impl Encode for RuntimeInfoRequest

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RuntimeInfoRequest

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.RuntimeInfoResponse.html b/rust/oasis_core_runtime/types/struct.RuntimeInfoResponse.html new file mode 100644 index 0000000000..04f3b48f4e --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.RuntimeInfoResponse.html @@ -0,0 +1,34 @@ +RuntimeInfoResponse in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::RuntimeInfoResponse

source ·
pub struct RuntimeInfoResponse {
+    pub protocol_version: Version,
+    pub runtime_version: Version,
+    pub features: Features,
+}
Expand description

Runtime information response.

+

Fields§

§protocol_version: Version

The runtime protocol version supported by the runtime.

+
§runtime_version: Version

The version of the runtime.

+
§features: Features

Describes the features supported by the runtime.

+

Trait Implementations§

source§

impl Clone for RuntimeInfoResponse

source§

fn clone(&self) -> RuntimeInfoResponse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeInfoResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeInfoResponse

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RuntimeInfoResponse

source§

fn default() -> RuntimeInfoResponse

Returns the “default value” for a type. Read more
source§

impl Encode for RuntimeInfoResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RuntimeInfoResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.RuntimeNotifyEvent.html b/rust/oasis_core_runtime/types/struct.RuntimeNotifyEvent.html new file mode 100644 index 0000000000..223df31793 --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.RuntimeNotifyEvent.html @@ -0,0 +1,32 @@ +RuntimeNotifyEvent in oasis_core_runtime::types - Rust

Struct oasis_core_runtime::types::RuntimeNotifyEvent

source ·
pub struct RuntimeNotifyEvent {
+    pub block: AnnotatedBlock,
+    pub tags: Vec<Vec<u8>>,
+}
Expand description

An event notification.

+

Fields§

§block: AnnotatedBlock

Header of the block that emitted the event.

+
§tags: Vec<Vec<u8>>

Matching tags.

+

Trait Implementations§

source§

impl Clone for RuntimeNotifyEvent

source§

fn clone(&self) -> RuntimeNotifyEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeNotifyEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeNotifyEvent

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RuntimeNotifyEvent

source§

fn default() -> RuntimeNotifyEvent

Returns the “default value” for a type. Read more
source§

impl Encode for RuntimeNotifyEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RuntimeNotifyEvent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_core_runtime/types/struct.StorageSyncRequestWithEndpoint.html b/rust/oasis_core_runtime/types/struct.StorageSyncRequestWithEndpoint.html new file mode 100644 index 0000000000..6f78a2880f --- /dev/null +++ b/rust/oasis_core_runtime/types/struct.StorageSyncRequestWithEndpoint.html @@ -0,0 +1,26 @@ +StorageSyncRequestWithEndpoint in oasis_core_runtime::types - Rust
pub struct StorageSyncRequestWithEndpoint {
+    pub endpoint: HostStorageEndpoint,
+    pub request: StorageSyncRequest,
+}

Fields§

§endpoint: HostStorageEndpoint§request: StorageSyncRequest

Trait Implementations§

source§

impl Debug for StorageSyncRequestWithEndpoint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StorageSyncRequestWithEndpoint

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for StorageSyncRequestWithEndpoint

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/all.html b/rust/oasis_runtime_sdk/all.html new file mode 100644 index 0000000000..baa3eab665 --- /dev/null +++ b/rust/oasis_runtime_sdk/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Attribute Macros

Derive Macros

Functions

Type Aliases

Statics

Constants

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/attr.handler.html b/rust/oasis_runtime_sdk/attr.handler.html new file mode 100644 index 0000000000..1d358483ef --- /dev/null +++ b/rust/oasis_runtime_sdk/attr.handler.html @@ -0,0 +1,25 @@ +handler in oasis_runtime_sdk - Rust

Attribute Macro oasis_runtime_sdk::handler

#[handler]
Expand description

A helper attribute for #[sdk_derive(...)]. It doesn’t do anyting on its own; +it only marks functions that represent a paratime method handler. +The permitted forms are:

+
    +
  • #[handler(call = "my_module.MyCall")]: Marks a function that handles +the “my_module.MyCall” call and can be passed to +oasis_runtime_sdk::module::dispatch_call.
  • +
  • #[handler(prefetch = "my_module.MyCall")]: Marks a function that handles +the request to prefetch any data ahead of the “my_module.MyCall” call. +Its signature should be Fn( add_prefix: &mut dyn FnMut(Prefix) -> (), body: cbor::Value, auth_info: &AuthInfo, ) -> Result<(), oasis_runtime_sdk::error::RuntimeError>
  • +
  • #[handler(query = "my_module.MyQuery")]: Marks a function that handles +the “my_module.MyQuery” query and can be passed to +oasis_runtime_sdk::module::dispatch_query.
  • +
  • #[handler(message_result = "my_module.MyMR")]: Marks a function that handles +the “my_module.MyMR” message result and can be passed to +oasis_runtime_sdk::module::dispatch_message_result.
  • +
+

Query handler can also contain the expensive tag. Example: +#[handler(query = "my_module.MyQuery", expensive)]. +Queries tagged expensive can be enabled/disabled are disabled by default to avoid +excessive costs to the node operator. This can be overridden in the node config.

+

NOTE: This attribute is parsed by the #[sdk_derive(...)] macro, which cannot +interpret the attribute name semantically. Use #[handler], not +#[oasis_runtime_sdk_macros::handler] or other paths/aliases.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/attr.migration.html b/rust/oasis_runtime_sdk/attr.migration.html new file mode 100644 index 0000000000..c51a05f705 --- /dev/null +++ b/rust/oasis_runtime_sdk/attr.migration.html @@ -0,0 +1,9 @@ +migration in oasis_runtime_sdk - Rust

Attribute Macro oasis_runtime_sdk::migration

#[migration]
Expand description

A helper attribute for #[sdk_derive(...)]. It doesn’t do anything on its own; +it only marks functions that represent a module state migration.

+

The permitted forms are:

+
    +
  • #[migration(init)]: Marks the initial (genesis) migration.
  • +
  • #[migration(from = v)]: Marks a migration from version v to v+1, where v is +a non-negative integer.
  • +
+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/attr.sdk_derive.html b/rust/oasis_runtime_sdk/attr.sdk_derive.html new file mode 100644 index 0000000000..be857c85f5 --- /dev/null +++ b/rust/oasis_runtime_sdk/attr.sdk_derive.html @@ -0,0 +1,5 @@ +sdk_derive in oasis_runtime_sdk - Rust

Attribute Macro oasis_runtime_sdk::sdk_derive

#[sdk_derive]
Expand description

Derives traits from a non-trait impl block (rather than from a struct).

+

Only the Module trait is supported. In other words, given an impl MyModule block, the macro +derives implementations needed for implementing a module. +See also the #[handler] and #[migration] attributes.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/enum.Metadata.html b/rust/oasis_runtime_sdk/callformat/enum.Metadata.html new file mode 100644 index 0000000000..6bfdc083f8 --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/enum.Metadata.html @@ -0,0 +1,31 @@ +Metadata in oasis_runtime_sdk::callformat - Rust

Enum oasis_runtime_sdk::callformat::Metadata

source ·
pub enum Metadata {
+    Empty,
+    EncryptedX25519DeoxysII {
+        pk: PublicKey,
+        sk: PrivateKey,
+        index: usize,
+    },
+}
Expand description

Additional metadata required by the result encoding function.

+

Variants§

§

Empty

§

EncryptedX25519DeoxysII

Fields

§pk: PublicKey

Caller’s ephemeral public key used for X25519.

+
§sk: PrivateKey

Secret key.

+
§index: usize

Transaction index within the batch.

+

Trait Implementations§

source§

impl Debug for Metadata

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/fn.decode_call.html b/rust/oasis_runtime_sdk/callformat/fn.decode_call.html new file mode 100644 index 0000000000..d9a1588456 --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/fn.decode_call.html @@ -0,0 +1,8 @@ +decode_call in oasis_runtime_sdk::callformat - Rust

Function oasis_runtime_sdk::callformat::decode_call

source ·
pub fn decode_call<C: Context>(
+    ctx: &C,
+    call: Call,
+    index: usize,
+) -> Result<Option<(Call, Metadata)>, Error>
Expand description

Decode call arguments.

+

Returns Some((Call, Metadata)) when processing should proceed and None in case further +execution needs to be deferred (e.g., because key manager access is required).

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/fn.decode_call_ex.html b/rust/oasis_runtime_sdk/callformat/fn.decode_call_ex.html new file mode 100644 index 0000000000..e8f324013f --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/fn.decode_call_ex.html @@ -0,0 +1,10 @@ +decode_call_ex in oasis_runtime_sdk::callformat - Rust

Function oasis_runtime_sdk::callformat::decode_call_ex

source ·
pub fn decode_call_ex<C: Context>(
+    ctx: &C,
+    call: Call,
+    index: usize,
+    assume_km_reachable: bool,
+) -> Result<Option<(Call, Metadata)>, Error>
Expand description

Decode call arguments.

+

Returns Some((Call, Metadata)) when processing should proceed and None in case further +execution needs to be deferred (e.g., because key manager access is required). +If assume_km_reachable is set, then this method will return errors instead of None.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/fn.encode_result.html b/rust/oasis_runtime_sdk/callformat/fn.encode_result.html new file mode 100644 index 0000000000..d71edf37f6 --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/fn.encode_result.html @@ -0,0 +1,6 @@ +encode_result in oasis_runtime_sdk::callformat - Rust

Function oasis_runtime_sdk::callformat::encode_result

source ·
pub fn encode_result<C: Context>(
+    ctx: &C,
+    result: CallResult,
+    metadata: Metadata,
+) -> CallResult
Expand description

Encode call results.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/fn.encode_result_ex.html b/rust/oasis_runtime_sdk/callformat/fn.encode_result_ex.html new file mode 100644 index 0000000000..d632945033 --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/fn.encode_result_ex.html @@ -0,0 +1,8 @@ +encode_result_ex in oasis_runtime_sdk::callformat - Rust

Function oasis_runtime_sdk::callformat::encode_result_ex

source ·
pub fn encode_result_ex<C: Context>(
+    ctx: &C,
+    result: CallResult,
+    metadata: Metadata,
+    expose_failure: bool,
+) -> CallResult
Expand description

Encode call results.

+

If expose_failure is set, then this method will not encrypt errors.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/fn.encrypt_result_x25519_deoxysii.html b/rust/oasis_runtime_sdk/callformat/fn.encrypt_result_x25519_deoxysii.html new file mode 100644 index 0000000000..521644fde9 --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/fn.encrypt_result_x25519_deoxysii.html @@ -0,0 +1,8 @@ +encrypt_result_x25519_deoxysii in oasis_runtime_sdk::callformat - Rust
pub fn encrypt_result_x25519_deoxysii<C: Context>(
+    ctx: &C,
+    result: CallResult,
+    pk: PublicKey,
+    sk: PrivateKey,
+    index: usize,
+) -> Value
Expand description

Encrypt a call result using the X25519-Deoxys-II encryption scheme.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/fn.get_key_pair_id.html b/rust/oasis_runtime_sdk/callformat/fn.get_key_pair_id.html new file mode 100644 index 0000000000..1577efc891 --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/fn.get_key_pair_id.html @@ -0,0 +1,2 @@ +get_key_pair_id in oasis_runtime_sdk::callformat - Rust

Function oasis_runtime_sdk::callformat::get_key_pair_id

source ·
pub fn get_key_pair_id(epoch: EpochTime) -> KeyPairId
Expand description

Derive the key pair ID for the call data encryption key pair.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/index.html b/rust/oasis_runtime_sdk/callformat/index.html new file mode 100644 index 0000000000..1c54986dd7 --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::callformat - Rust

Module oasis_runtime_sdk::callformat

source ·
Expand description

Handling of different call formats.

+

Enums§

  • Additional metadata required by the result encoding function.

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/callformat/sidebar-items.js b/rust/oasis_runtime_sdk/callformat/sidebar-items.js new file mode 100644 index 0000000000..7e8a594308 --- /dev/null +++ b/rust/oasis_runtime_sdk/callformat/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Metadata"],"fn":["decode_call","decode_call_ex","encode_result","encode_result_ex","encrypt_result_x25519_deoxysii","get_key_pair_id"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/config/index.html b/rust/oasis_runtime_sdk/config/index.html new file mode 100644 index 0000000000..4a430ecad9 --- /dev/null +++ b/rust/oasis_runtime_sdk/config/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::config - Rust

Module oasis_runtime_sdk::config

source ·
Expand description

Configuration types.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/config/sidebar-items.js b/rust/oasis_runtime_sdk/config/sidebar-items.js new file mode 100644 index 0000000000..7a56dbe9d5 --- /dev/null +++ b/rust/oasis_runtime_sdk/config/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["ScheduleControl"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/config/struct.ScheduleControl.html b/rust/oasis_runtime_sdk/config/struct.ScheduleControl.html new file mode 100644 index 0000000000..2f387c33c7 --- /dev/null +++ b/rust/oasis_runtime_sdk/config/struct.ScheduleControl.html @@ -0,0 +1,33 @@ +ScheduleControl in oasis_runtime_sdk::config - Rust

Struct oasis_runtime_sdk::config::ScheduleControl

source ·
pub struct ScheduleControl {
+    pub initial_batch_size: u32,
+    pub batch_size: u32,
+    pub min_remaining_gas: u64,
+    pub max_tx_count: usize,
+}
Expand description

Runtime schedule control configuration.

+

Fields§

§initial_batch_size: u32

Size of the initial batch that the node should provide to the runtime.

+
§batch_size: u32

Size of each extra batch that the runtime should fetch.

+
§min_remaining_gas: u64

Minimum amount of gas that needs to be remaining in a batch in order to still consider +including new transactions.

+
§max_tx_count: usize

Maximum number of transactions that can go in a batch.

+

This is only used as a last resort to avoid the batch going over the runtime’s limit.

+

Implementations§

source§

impl ScheduleControl

source

pub const fn default() -> Self

Construct a default schedule control configuration.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/context/index.html b/rust/oasis_runtime_sdk/context/index.html new file mode 100644 index 0000000000..1734f3fcec --- /dev/null +++ b/rust/oasis_runtime_sdk/context/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::context - Rust

Module oasis_runtime_sdk::context

source ·
Expand description

Execution context.

+

Structs§

Traits§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/context/sidebar-items.js b/rust/oasis_runtime_sdk/context/sidebar-items.js new file mode 100644 index 0000000000..e98081f2f7 --- /dev/null +++ b/rust/oasis_runtime_sdk/context/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["RuntimeBatchContext"],"trait":["Context"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/context/struct.RuntimeBatchContext.html b/rust/oasis_runtime_sdk/context/struct.RuntimeBatchContext.html new file mode 100644 index 0000000000..2d395925f9 --- /dev/null +++ b/rust/oasis_runtime_sdk/context/struct.RuntimeBatchContext.html @@ -0,0 +1,32 @@ +RuntimeBatchContext in oasis_runtime_sdk::context - Rust

Struct oasis_runtime_sdk::context::RuntimeBatchContext

source ·
pub struct RuntimeBatchContext<'a, R: Runtime> { /* private fields */ }
Expand description

Dispatch context for the whole batch.

+

Implementations§

source§

impl<'a, R: Runtime> RuntimeBatchContext<'a, R>

source

pub fn new( + host_info: &'a HostInfo, + key_manager: Option<Box<dyn KeyManager>>, + runtime_header: &'a Header, + runtime_round_results: &'a RoundResults, + consensus_state: &'a ConsensusState, + history: &'a dyn HistoryHost, + epoch: EpochTime, + max_messages: u32, +) -> Self

Create a new dispatch context.

+

Trait Implementations§

source§

impl<'a, R: Runtime> Context for RuntimeBatchContext<'a, R>

§

type Runtime = R

Runtime that the context is being invoked in.
source§

fn clone(&self) -> Self

Clone this context.
source§

fn get_logger(&self, module: &'static str) -> Logger

Returns a logger.
source§

fn host_info(&self) -> &HostInfo

Information about the host environment.
source§

fn key_manager(&self) -> Option<&dyn KeyManager>

The key manager, if the runtime is confidential.
source§

fn runtime_header(&self) -> &Header

Last runtime block header.
source§

fn runtime_round_results(&self) -> &RoundResults

Results of executing the last successful runtime round.
source§

fn consensus_state(&self) -> &ConsensusState

Consensus state.
source§

fn history(&self) -> &dyn HistoryHost

Historical state.
source§

fn epoch(&self) -> EpochTime

Current epoch.
source§

fn max_messages(&self) -> u32

Maximum number of consensus messages that the runtime can emit in this block.
source§

fn should_execute_contracts(&self) -> bool

Whether smart contracts should be executed in this context.
source§

fn is_allowed_query<R: Runtime>(&self, method: &str) -> bool

Whether method is an allowed query per policy in the local config.
source§

fn local_config<T>(&self, key: &str) -> Option<T>
where + T: Decode,

Returns node operator-provided local configuration. Read more
source§

fn runtime_id(&self) -> &Namespace

Runtime ID.
source§

fn is_confidential(&self) -> bool

Whether the context has a key manager available (e.g. the runtime is confidential).

Auto Trait Implementations§

§

impl<'a, R> Freeze for RuntimeBatchContext<'a, R>

§

impl<'a, R> !RefUnwindSafe for RuntimeBatchContext<'a, R>

§

impl<'a, R> !Send for RuntimeBatchContext<'a, R>

§

impl<'a, R> !Sync for RuntimeBatchContext<'a, R>

§

impl<'a, R> Unpin for RuntimeBatchContext<'a, R>
where + R: Unpin,

§

impl<'a, R> !UnwindSafe for RuntimeBatchContext<'a, R>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/context/trait.Context.html b/rust/oasis_runtime_sdk/context/trait.Context.html new file mode 100644 index 0000000000..d38ebc23b2 --- /dev/null +++ b/rust/oasis_runtime_sdk/context/trait.Context.html @@ -0,0 +1,42 @@ +Context in oasis_runtime_sdk::context - Rust

Trait oasis_runtime_sdk::context::Context

source ·
pub trait Context {
+    type Runtime: Runtime;
+
+
Show 15 methods // Required methods + fn clone(&self) -> Self; + fn get_logger(&self, module: &'static str) -> Logger; + fn host_info(&self) -> &HostInfo; + fn key_manager(&self) -> Option<&dyn KeyManager>; + fn runtime_header(&self) -> &Header; + fn runtime_round_results(&self) -> &RoundResults; + fn consensus_state(&self) -> &ConsensusState; + fn history(&self) -> &dyn HistoryHost; + fn epoch(&self) -> EpochTime; + fn max_messages(&self) -> u32; + + // Provided methods + fn should_execute_contracts(&self) -> bool { ... } + fn is_allowed_query<R: Runtime>(&self, method: &str) -> bool { ... } + fn local_config<T>(&self, key: &str) -> Option<T> + where T: Decode { ... } + fn runtime_id(&self) -> &Namespace { ... } + fn is_confidential(&self) -> bool { ... } +
}
Expand description

Runtime SDK context.

+

Required Associated Types§

source

type Runtime: Runtime

Runtime that the context is being invoked in.

+

Required Methods§

source

fn clone(&self) -> Self

Clone this context.

+
source

fn get_logger(&self, module: &'static str) -> Logger

Returns a logger.

+
source

fn host_info(&self) -> &HostInfo

Information about the host environment.

+
source

fn key_manager(&self) -> Option<&dyn KeyManager>

The key manager, if the runtime is confidential.

+
source

fn runtime_header(&self) -> &Header

Last runtime block header.

+
source

fn runtime_round_results(&self) -> &RoundResults

Results of executing the last successful runtime round.

+
source

fn consensus_state(&self) -> &ConsensusState

Consensus state.

+
source

fn history(&self) -> &dyn HistoryHost

Historical state.

+
source

fn epoch(&self) -> EpochTime

Current epoch.

+
source

fn max_messages(&self) -> u32

Maximum number of consensus messages that the runtime can emit in this block.

+

Provided Methods§

source

fn should_execute_contracts(&self) -> bool

Whether smart contracts should be executed in this context.

+
source

fn is_allowed_query<R: Runtime>(&self, method: &str) -> bool

Whether method is an allowed query per policy in the local config.

+
source

fn local_config<T>(&self, key: &str) -> Option<T>
where + T: Decode,

Returns node operator-provided local configuration.

+

This method will always return None in Mode::ExecuteTx contexts.

+
source

fn runtime_id(&self) -> &Namespace

Runtime ID.

+
source

fn is_confidential(&self) -> bool

Whether the context has a key manager available (e.g. the runtime is confidential).

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, R: Runtime> Context for RuntimeBatchContext<'a, R>

§

type Runtime = R

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/index.html b/rust/oasis_runtime_sdk/crypto/index.html new file mode 100644 index 0000000000..a9c27ed674 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto - Rust

Module oasis_runtime_sdk::crypto

source ·
Expand description

Cryptography.

+

Modules§

  • Random number generator based on root VRF key and Merlin transcripts.
  • Cryptographic signatures.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/multisig/enum.Error.html b/rust/oasis_runtime_sdk/crypto/multisig/enum.Error.html new file mode 100644 index 0000000000..bcc81d326d --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/multisig/enum.Error.html @@ -0,0 +1,26 @@ +Error in oasis_runtime_sdk::crypto::multisig - Rust

Enum oasis_runtime_sdk::crypto::multisig::Error

source ·
pub enum Error {
+    InvalidConfig,
+    InvalidSignatureSet,
+    InsufficientWeight,
+}
Expand description

Error.

+

Variants§

§

InvalidConfig

§

InvalidSignatureSet

§

InsufficientWeight

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/multisig/index.html b/rust/oasis_runtime_sdk/crypto/multisig/index.html new file mode 100644 index 0000000000..f92cbf8dad --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/multisig/index.html @@ -0,0 +1,4 @@ +oasis_runtime_sdk::crypto::multisig - Rust

Module oasis_runtime_sdk::crypto::multisig

source ·

Structs§

  • A multisig configuration. +A set of signers with total “weight” greater than or equal to a “threshold” can authenticate +for the configuration.
  • One of the signers in a multisig configuration.

Enums§

Type Aliases§

  • A set of signatures corresponding to a multisig configuration. +The indices match the configuration’s signers vec.
  • A SignatureSet owned in a Vec.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/multisig/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/multisig/sidebar-items.js new file mode 100644 index 0000000000..f4c86cea17 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/multisig/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["Config","Signer"],"type":["SignatureSet","SignatureSetOwned"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/multisig/struct.Config.html b/rust/oasis_runtime_sdk/crypto/multisig/struct.Config.html new file mode 100644 index 0000000000..022bd2a5b0 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/multisig/struct.Config.html @@ -0,0 +1,41 @@ +Config in oasis_runtime_sdk::crypto::multisig - Rust

Struct oasis_runtime_sdk::crypto::multisig::Config

source ·
pub struct Config {
+    pub signers: Vec<Signer>,
+    pub threshold: u64,
+}
Expand description

A multisig configuration. +A set of signers with total “weight” greater than or equal to a “threshold” can authenticate +for the configuration.

+

Fields§

§signers: Vec<Signer>

The signers.

+
§threshold: u64

The threshold.

+

Implementations§

source§

impl Config

source

pub fn validate_basic(&self) -> Result<(), Error>

Performs some sanity checks. This looks at the configuration only. There is no cryptographic +verification of any signatures.

+
source

pub fn batch( + &self, + signature_set: &SignatureSet, +) -> Result<(Vec<PublicKey>, Vec<Signature>), Error>

Checks that the configuration and signature set are acceptable. +Returns vectors of public keys and signatures for batch verification of included signatures.

+

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Config

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Config

source§

fn default() -> Config

Returns the “default value” for a type. Read more
source§

impl Encode for Config

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Config

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/multisig/struct.Signer.html b/rust/oasis_runtime_sdk/crypto/multisig/struct.Signer.html new file mode 100644 index 0000000000..9c6961d3ad --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/multisig/struct.Signer.html @@ -0,0 +1,33 @@ +Signer in oasis_runtime_sdk::crypto::multisig - Rust

Struct oasis_runtime_sdk::crypto::multisig::Signer

source ·
pub struct Signer {
+    pub public_key: PublicKey,
+    pub weight: u64,
+}
Expand description

One of the signers in a multisig configuration.

+

Fields§

§public_key: PublicKey

The public key of the signer.

+
§weight: u64

The weight of the signer.

+

Trait Implementations§

source§

impl Clone for Signer

source§

fn clone(&self) -> Signer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Signer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Signer

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Signer

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Signer

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Signer

§

impl RefUnwindSafe for Signer

§

impl Send for Signer

§

impl Sync for Signer

§

impl Unpin for Signer

§

impl UnwindSafe for Signer

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/multisig/type.SignatureSet.html b/rust/oasis_runtime_sdk/crypto/multisig/type.SignatureSet.html new file mode 100644 index 0000000000..c6cda20f02 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/multisig/type.SignatureSet.html @@ -0,0 +1,3 @@ +SignatureSet in oasis_runtime_sdk::crypto::multisig - Rust

Type Alias oasis_runtime_sdk::crypto::multisig::SignatureSet

source ·
pub type SignatureSet = [Option<Signature>];
Expand description

A set of signatures corresponding to a multisig configuration. +The indices match the configuration’s signers vec.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/multisig/type.SignatureSetOwned.html b/rust/oasis_runtime_sdk/crypto/multisig/type.SignatureSetOwned.html new file mode 100644 index 0000000000..e6f1913bda --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/multisig/type.SignatureSetOwned.html @@ -0,0 +1,2 @@ +SignatureSetOwned in oasis_runtime_sdk::crypto::multisig - Rust

Type Alias oasis_runtime_sdk::crypto::multisig::SignatureSetOwned

source ·
pub type SignatureSetOwned = Vec<Option<Signature>>;
Expand description

A SignatureSet owned in a Vec.

+

Aliased Type§

struct SignatureSetOwned { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/random/index.html b/rust/oasis_runtime_sdk/crypto/random/index.html new file mode 100644 index 0000000000..f9e1b85563 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/random/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto::random - Rust

Module oasis_runtime_sdk::crypto::random

source ·
Expand description

Random number generator based on root VRF key and Merlin transcripts.

+

Structs§

  • A leaf RNG.
  • A root RNG that can be used to derive domain-separated leaf RNGs.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/random/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/random/sidebar-items.js new file mode 100644 index 0000000000..f2202f64a4 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/random/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["LeafRng","RootRng"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/random/struct.LeafRng.html b/rust/oasis_runtime_sdk/crypto/random/struct.LeafRng.html new file mode 100644 index 0000000000..e4913d804e --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/random/struct.LeafRng.html @@ -0,0 +1,42 @@ +LeafRng in oasis_runtime_sdk::crypto::random - Rust

Struct oasis_runtime_sdk::crypto::random::LeafRng

source ·
pub struct LeafRng(/* private fields */);
Expand description

A leaf RNG.

+

Trait Implementations§

source§

impl RngCore for LeafRng

source§

fn next_u32(&mut self) -> u32

Return the next random u32. Read more
source§

fn next_u64(&mut self) -> u64

Return the next random u64. Read more
source§

fn fill_bytes(&mut self, dest: &mut [u8])

Fill dest with random data. Read more
source§

fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>

Fill dest entirely with random data. Read more
source§

impl CryptoRng for LeafRng

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CryptoRngCore for T
where + T: CryptoRng + RngCore,

source§

fn as_rngcore(&mut self) -> &mut dyn RngCore

Upcast to an RngCore trait object.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R> RandBigInt for R
where + R: Rng + ?Sized,

source§

fn gen_biguint(&mut self, bit_size: usize) -> BigUint

Generate a random BigUint of the given bit size.
source§

fn gen_bigint(&mut self, bit_size: usize) -> BigInt

Generate a random BigInt of the given bit size.
source§

fn gen_biguint_below(&mut self, bound: &BigUint) -> BigUint

Generate a random BigUint less than the given bound. Fails +when the bound is zero.
source§

fn gen_biguint_range(&mut self, lbound: &BigUint, ubound: &BigUint) -> BigUint

Generate a random BigUint within the given range. The lower +bound is inclusive; the upper bound is exclusive. Fails when +the upper bound is not greater than the lower bound.
source§

fn gen_bigint_range(&mut self, lbound: &BigInt, ubound: &BigInt) -> BigInt

Generate a random BigInt within the given range. The lower +bound is inclusive; the upper bound is exclusive. Fails when +the upper bound is not greater than the lower bound.
source§

impl<R> RandPrime for R
where + R: Rng + ?Sized,

source§

fn gen_prime(&mut self, bit_size: usize) -> BigUint

Generate a random prime number with as many bits as given.
source§

impl<R> Rng for R
where + R: RngCore + ?Sized,

source§

fn gen<T>(&mut self) -> T
where + Standard: Distribution<T>,

Return a random value supporting the Standard distribution. Read more
source§

fn gen_range<T, R>(&mut self, range: R) -> T
where + T: SampleUniform, + R: SampleRange<T>,

Generate a random value in the given range. Read more
source§

fn sample<T, D>(&mut self, distr: D) -> T
where + D: Distribution<T>,

Sample a new value, using the given distribution. Read more
source§

fn sample_iter<T, D>(self, distr: D) -> DistIter<D, Self, T>
where + D: Distribution<T>, + Self: Sized,

Create an iterator that generates values using the given distribution. Read more
source§

fn fill<T>(&mut self, dest: &mut T)
where + T: Fill + ?Sized,

Fill any type implementing Fill with random data Read more
source§

fn try_fill<T>(&mut self, dest: &mut T) -> Result<(), Error>
where + T: Fill + ?Sized,

Fill any type implementing Fill with random data Read more
source§

fn gen_bool(&mut self, p: f64) -> bool

Return a bool with a probability p of being true. Read more
source§

fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool

Return a bool with a probability of numerator/denominator of being +true. I.e. gen_ratio(2, 3) has chance of 2 in 3, or about 67%, of +returning true. If numerator == denominator, then the returned value +is guaranteed to be true. If numerator == 0, then the returned +value is guaranteed to be false. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/random/struct.RootRng.html b/rust/oasis_runtime_sdk/crypto/random/struct.RootRng.html new file mode 100644 index 0000000000..4d27559b88 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/random/struct.RootRng.html @@ -0,0 +1,32 @@ +RootRng in oasis_runtime_sdk::crypto::random - Rust

Struct oasis_runtime_sdk::crypto::random::RootRng

source ·
pub struct RootRng { /* private fields */ }
Expand description

A root RNG that can be used to derive domain-separated leaf RNGs.

+

Implementations§

source§

impl RootRng

source

pub fn new(mode: Mode) -> Self

Create a new root RNG.

+
source

pub fn invalid() -> Self

Create an invalid root RNG which will fail when any leaf RNGs are requested.

+
source

pub fn append_local_entropy(&self)

Append local entropy to the root RNG.

+
§Non-determinism
+

Using this method will result in the RNG being non-deterministic.

+
source

pub fn append_tx(&self, tx_hash: Hash)

Append an observed transaction hash to RNG transcript.

+
source

pub fn append_subcontext(&self)

Append an observed subcontext to RNG transcript.

+
source

pub fn fork<C: Context + ?Sized>( + &self, + ctx: &C, + pers: &[u8], +) -> Result<LeafRng, Error>

Create an independent leaf RNG using this RNG as its parent.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/sidebar-items.js new file mode 100644 index 0000000000..3e386df4ad --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["multisig","random","signature"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/context/fn.get_chain_context_for.html b/rust/oasis_runtime_sdk/crypto/signature/context/fn.get_chain_context_for.html new file mode 100644 index 0000000000..38830e0d3c --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/context/fn.get_chain_context_for.html @@ -0,0 +1,7 @@ +get_chain_context_for in oasis_runtime_sdk::crypto::signature::context - Rust
pub fn get_chain_context_for(base: &[u8]) -> Vec<u8> 
Expand description

Return the globally configured chain domain separation context.

+

The returned domain separation context is computed as:

+
<base> || " for chain " || <chain-context>
+

§Panics

+

This function will panic in case the global chain domain separation context was not previously +set using set_chain_context.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/context/fn.set_chain_context.html b/rust/oasis_runtime_sdk/crypto/signature/context/fn.set_chain_context.html new file mode 100644 index 0000000000..f17b68f01a --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/context/fn.set_chain_context.html @@ -0,0 +1,6 @@ +set_chain_context in oasis_runtime_sdk::crypto::signature::context - Rust
pub fn set_chain_context(runtime_id: Namespace, consensus_chain_context: &str)
Expand description

Configure the global chain domain separation context.

+

The domain separation context is computed as:

+
Base-16(H(<runtime-id> || <consensus-chain-context>))
+

§Panics

+

This function will panic in case the global chain domain separation context was already set.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/context/index.html b/rust/oasis_runtime_sdk/crypto/signature/context/index.html new file mode 100644 index 0000000000..fe1f223b2b --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/context/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto::signature::context - Rust

Module oasis_runtime_sdk::crypto::signature::context

source ·
Expand description

Domain separation context helpers.

+

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/context/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/signature/context/sidebar-items.js new file mode 100644 index 0000000000..66baf55571 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/context/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["get_chain_context_for","set_chain_context"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/ed25519/index.html b/rust/oasis_runtime_sdk/crypto/signature/ed25519/index.html new file mode 100644 index 0000000000..24fc872dda --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/ed25519/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto::signature::ed25519 - Rust

Module oasis_runtime_sdk::crypto::signature::ed25519

source ·
Expand description

Ed25519 signatures.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/ed25519/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/signature/ed25519/sidebar-items.js new file mode 100644 index 0000000000..ab566cf397 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/ed25519/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["MemorySigner","PublicKey"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/ed25519/struct.MemorySigner.html b/rust/oasis_runtime_sdk/crypto/signature/ed25519/struct.MemorySigner.html new file mode 100644 index 0000000000..a2a5dc0c67 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/ed25519/struct.MemorySigner.html @@ -0,0 +1,22 @@ +MemorySigner in oasis_runtime_sdk::crypto::signature::ed25519 - Rust

Struct oasis_runtime_sdk::crypto::signature::ed25519::MemorySigner

source ·
pub struct MemorySigner { /* private fields */ }
Expand description

A memory-backed signer for Ed25519.

+

Implementations§

source§

impl MemorySigner

source

pub fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
where + D: Digest<OutputSize = U64>,

Trait Implementations§

source§

impl Signer for MemorySigner

source§

fn random(rng: &mut impl RngCore) -> Result<Self, Error>

Create a new random signer.
source§

fn new_from_seed(seed: &[u8]) -> Result<Self, Error>

Create a new signer from the given seed.
source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Recreate signer from a byte serialization.
source§

fn to_bytes(&self) -> Vec<u8>

Serialize the signer into bytes.
source§

fn public_key(&self) -> PublicKey

Return the public key counterpart to the signer’s secret key.
source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

Generate a signature over the context and message.
source§

fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>

Generate a signature over the message.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/ed25519/struct.PublicKey.html b/rust/oasis_runtime_sdk/crypto/signature/ed25519/struct.PublicKey.html new file mode 100644 index 0000000000..c8ed5919c2 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/ed25519/struct.PublicKey.html @@ -0,0 +1,58 @@ +PublicKey in oasis_runtime_sdk::crypto::signature::ed25519 - Rust

Struct oasis_runtime_sdk::crypto::signature::ed25519::PublicKey

source ·
pub struct PublicKey(/* private fields */);
Expand description

An Ed25519 public key.

+

Implementations§

source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8]

Return a byte representation of this public key.

+
source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Construct a public key from a slice of bytes.

+
source

pub fn verify( + &self, + context: &[u8], + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify a signature.

+
source

pub fn verify_raw( + &self, + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify signature without applying domain separation.

+
source

pub fn verify_digest<D>( + &self, + digest: D, + signature: &Signature, +) -> Result<(), Error>
where + D: Digest<OutputSize = U64>,

Verify signature of a pre-hashed message.

+

Trait Implementations§

source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKey

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PublicKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&PublicKey> for PublicKey

source§

fn from(pk: &CorePublicKey) -> PublicKey

Converts to this type from the input type.
source§

impl From<&'static str> for PublicKey

source§

fn from(s: &'static str) -> PublicKey

Converts to this type from the input type.
source§

impl From<PublicKey> for PublicKey

source§

fn from(pk: CorePublicKey) -> PublicKey

Converts to this type from the input type.
source§

impl From<PublicKey> for PublicKey

source§

fn from(pk: PublicKey) -> CorePublicKey

Converts to this type from the input type.
source§

impl Hash for PublicKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/enum.Error.html b/rust/oasis_runtime_sdk/crypto/signature/enum.Error.html new file mode 100644 index 0000000000..20d2c5a0b0 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/enum.Error.html @@ -0,0 +1,30 @@ +Error in oasis_runtime_sdk::crypto::signature - Rust

Enum oasis_runtime_sdk::crypto::signature::Error

source ·
pub enum Error {
+    MalformedPublicKey,
+    MalformedPrivateKey,
+    MalformedSignature,
+    VerificationFailed,
+    InvalidArgument,
+    InvalidDigestLength,
+    SigningError,
+}
Expand description

Error.

+

Variants§

§

MalformedPublicKey

§

MalformedPrivateKey

§

MalformedSignature

§

VerificationFailed

§

InvalidArgument

§

InvalidDigestLength

§

SigningError

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/enum.MemorySigner.html b/rust/oasis_runtime_sdk/crypto/signature/enum.MemorySigner.html new file mode 100644 index 0000000000..5927e37081 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/enum.MemorySigner.html @@ -0,0 +1,42 @@ +MemorySigner in oasis_runtime_sdk::crypto::signature - Rust

Enum oasis_runtime_sdk::crypto::signature::MemorySigner

source ·
pub enum MemorySigner {
+    Ed25519(MemorySigner),
+    Secp256k1(MemorySigner),
+    Secp256r1(MemorySigner),
+    Secp384r1(MemorySigner),
+}
Expand description

A memory-backed signer.

+

Variants§

§

Ed25519(MemorySigner)

§

Secp256k1(MemorySigner)

§

Secp256r1(MemorySigner)

§

Secp384r1(MemorySigner)

Implementations§

source§

impl MemorySigner

source

pub fn new_from_seed( + sig_type: SignatureType, + seed: &[u8], +) -> Result<Self, Error>

Create a new memory signer from a seed.

+
source

pub fn new_test(sig_type: SignatureType, name: &str) -> Self

Create a new signer for testing purposes.

+
source

pub fn from_bytes(sig_type: SignatureType, bytes: &[u8]) -> Result<Self, Error>

Reconstruct the signer from its byte representation.

+
source

pub fn to_bytes(&self) -> Vec<u8>

Return a byte representation of the signer.

+
source

pub fn public_key(&self) -> PublicKey

Public key corresponding to the signer.

+
source

pub fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

Generate a signature with the private key over the context and message.

+
source

pub fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>

Generate a signature with the private key over the message.

+
source

pub fn sign_by_type( + &self, + signature_type: SignatureType, + context_or_hash: &[u8], + message: &[u8], +) -> Result<Signature, Error>

Generate a signature for the specified message and optional context.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/enum.PublicKey.html b/rust/oasis_runtime_sdk/crypto/signature/enum.PublicKey.html new file mode 100644 index 0000000000..78f94f697d --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/enum.PublicKey.html @@ -0,0 +1,82 @@ +PublicKey in oasis_runtime_sdk::crypto::signature - Rust

Enum oasis_runtime_sdk::crypto::signature::PublicKey

source ·
pub enum PublicKey {
+    Ed25519(PublicKey),
+    Secp256k1(PublicKey),
+    Secp256r1(PublicKey),
+    Secp384r1(PublicKey),
+    Sr25519(PublicKey),
+}
Expand description

A public key used for signing.

+

Variants§

§

Ed25519(PublicKey)

§

Secp256k1(PublicKey)

§

Secp256r1(PublicKey)

§

Secp384r1(PublicKey)

§

Sr25519(PublicKey)

Implementations§

source§

impl PublicKey

source

pub fn key_type(&self) -> &str

Return the key type as string.

+
source

pub fn as_bytes(&self) -> &[u8]

Return a byte representation of this public key.

+
source

pub fn from_bytes(sig_type: SignatureType, bytes: &[u8]) -> Result<Self, Error>

Construct a public key from a slice of bytes.

+
source

pub fn verify( + &self, + context: &[u8], + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify a signature.

+
source

pub fn verify_raw( + &self, + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify signature raw using the underlying method, without the domain +separation schema.

+
source

pub fn verify_by_type( + &self, + signature_type: SignatureType, + context_or_hash: &[u8], + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify the signature of a message.

+
source

pub fn verify_batch_multisig( + context: &[u8], + message: &[u8], + public_keys: &[PublicKey], + signatures: &[Signature], +) -> Result<(), Error>

Verify a batch of signatures of the same message.

+

Trait Implementations§

source§

impl AsRef<[u8]> for PublicKey

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKey

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PublicKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for PublicKey

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<PublicKey> for PublicKey

source§

fn from(pk: CorePublicKey) -> Self

Converts to this type from the input type.
source§

impl Hash for PublicKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<PublicKey> for PublicKey

source§

fn eq(&self, other: &CorePublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl TryFrom<PublicKey> for PublicKey

§

type Error = &'static str

The type returned in the event of a conversion error.
source§

fn try_from(pk: PublicKey) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/enum.SignatureType.html b/rust/oasis_runtime_sdk/crypto/signature/enum.SignatureType.html new file mode 100644 index 0000000000..84572d36c5 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/enum.SignatureType.html @@ -0,0 +1,50 @@ +SignatureType in oasis_runtime_sdk::crypto::signature - Rust

Enum oasis_runtime_sdk::crypto::signature::SignatureType

source ·
pub enum SignatureType {
+    Ed25519_Oasis,
+    Ed25519_Pure,
+    Ed25519_PrehashedSha512,
+    Secp256k1_Oasis,
+    Secp256k1_PrehashedKeccak256,
+    Secp256k1_PrehashedSha256,
+    Sr25519,
+    Secp256r1_PrehashedSha256,
+    Secp384r1_PrehashedSha384,
+}
Expand description

A specific combination of signature and hash.

+

Variants§

§

Ed25519_Oasis

§

Ed25519_Pure

§

Ed25519_PrehashedSha512

§

Secp256k1_Oasis

§

Secp256k1_PrehashedKeccak256

§

Secp256k1_PrehashedSha256

§

Sr25519

§

Secp256r1_PrehashedSha256

§

Secp384r1_PrehashedSha384

Implementations§

Trait Implementations§

source§

impl Clone for SignatureType

source§

fn clone(&self) -> SignatureType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SignatureType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignatureType

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for SignatureType

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for SignatureType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for SignatureType

source§

fn cmp(&self, other: &SignatureType) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for SignatureType

source§

fn eq(&self, other: &SignatureType) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for SignatureType

source§

fn partial_cmp(&self, other: &SignatureType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl TryFrom<u8> for SignatureType

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for SignatureType

source§

impl Eq for SignatureType

source§

impl StructuralPartialEq for SignatureType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/index.html b/rust/oasis_runtime_sdk/crypto/signature/index.html new file mode 100644 index 0000000000..1dc49bbb58 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto::signature - Rust

Module oasis_runtime_sdk::crypto::signature

source ·
Expand description

Cryptographic signatures.

+

Modules§

Structs§

Enums§

Traits§

  • Common trait for memory signers.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp256k1/index.html b/rust/oasis_runtime_sdk/crypto/signature/secp256k1/index.html new file mode 100644 index 0000000000..599f8fa84f --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp256k1/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto::signature::secp256k1 - Rust

Module oasis_runtime_sdk::crypto::signature::secp256k1

source ·
Expand description

Secp256k1 signatures.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp256k1/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/signature/secp256k1/sidebar-items.js new file mode 100644 index 0000000000..ab566cf397 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp256k1/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["MemorySigner","PublicKey"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp256k1/struct.MemorySigner.html b/rust/oasis_runtime_sdk/crypto/signature/secp256k1/struct.MemorySigner.html new file mode 100644 index 0000000000..24366c2de2 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp256k1/struct.MemorySigner.html @@ -0,0 +1,22 @@ +MemorySigner in oasis_runtime_sdk::crypto::signature::secp256k1 - Rust
pub struct MemorySigner { /* private fields */ }
Expand description

A memory-backed signer for Secp256k1.

+

Implementations§

source§

impl MemorySigner

source

pub fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
where + D: Digest + FixedOutput<OutputSize = U32>,

Trait Implementations§

source§

impl Signer for MemorySigner

source§

fn random(rng: &mut impl RngCore) -> Result<Self, Error>

Create a new random signer.
source§

fn new_from_seed(seed: &[u8]) -> Result<Self, Error>

Create a new signer from the given seed.
source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Recreate signer from a byte serialization.
source§

fn to_bytes(&self) -> Vec<u8>

Serialize the signer into bytes.
source§

fn public_key(&self) -> PublicKey

Return the public key counterpart to the signer’s secret key.
source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

Generate a signature over the context and message.
source§

fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>

Generate a signature over the message.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp256k1/struct.PublicKey.html b/rust/oasis_runtime_sdk/crypto/signature/secp256k1/struct.PublicKey.html new file mode 100644 index 0000000000..2bfaccf451 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp256k1/struct.PublicKey.html @@ -0,0 +1,60 @@ +PublicKey in oasis_runtime_sdk::crypto::signature::secp256k1 - Rust

Struct oasis_runtime_sdk::crypto::signature::secp256k1::PublicKey

source ·
pub struct PublicKey(/* private fields */);
Expand description

A Secp256k1 public key (in compressed form).

+

Implementations§

source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8]

Return a byte representation of this public key.

+
source

pub fn to_uncompressed_untagged_bytes(&self) -> Vec<u8>

Return an alternative byte representation used in deriving Ethereum-compatible addresses.

+
source

pub fn to_eth_address(&self) -> Vec<u8>

Derive an Ethereum-compatible address.

+
source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Construct a public key from a slice of bytes.

+
source

pub fn verify( + &self, + context: &[u8], + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify a signature.

+
source

pub fn verify_raw( + &self, + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify signature without using any domain separation scheme.

+
source

pub fn verify_digest<D>( + &self, + digest: D, + signature: &Signature, +) -> Result<(), Error>
where + D: Digest + FixedOutput<OutputSize = U32>,

Verify signature of a pre-hashed message.

+

Trait Implementations§

source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKey

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PublicKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&'static str> for PublicKey

source§

fn from(s: &'static str) -> PublicKey

Converts to this type from the input type.
source§

impl Hash for PublicKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp256r1/index.html b/rust/oasis_runtime_sdk/crypto/signature/secp256r1/index.html new file mode 100644 index 0000000000..48c253d5a3 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp256r1/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto::signature::secp256r1 - Rust

Module oasis_runtime_sdk::crypto::signature::secp256r1

source ·
Expand description

Secp256r1 signatures.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp256r1/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/signature/secp256r1/sidebar-items.js new file mode 100644 index 0000000000..ab566cf397 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp256r1/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["MemorySigner","PublicKey"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp256r1/struct.MemorySigner.html b/rust/oasis_runtime_sdk/crypto/signature/secp256r1/struct.MemorySigner.html new file mode 100644 index 0000000000..68543c3b4f --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp256r1/struct.MemorySigner.html @@ -0,0 +1,22 @@ +MemorySigner in oasis_runtime_sdk::crypto::signature::secp256r1 - Rust
pub struct MemorySigner { /* private fields */ }
Expand description

A memory-backed signer for Secp256r1.

+

Implementations§

source§

impl MemorySigner

source

pub fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
where + D: Digest + FixedOutput<OutputSize = U32> + BlockSizeUser + FixedOutputReset,

Trait Implementations§

source§

impl Signer for MemorySigner

source§

fn random(rng: &mut impl RngCore) -> Result<Self, Error>

Create a new random signer.
source§

fn new_from_seed(seed: &[u8]) -> Result<Self, Error>

Create a new signer from the given seed.
source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Recreate signer from a byte serialization.
source§

fn to_bytes(&self) -> Vec<u8>

Serialize the signer into bytes.
source§

fn public_key(&self) -> PublicKey

Return the public key counterpart to the signer’s secret key.
source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

Generate a signature over the context and message.
source§

fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>

Generate a signature over the message.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp256r1/struct.PublicKey.html b/rust/oasis_runtime_sdk/crypto/signature/secp256r1/struct.PublicKey.html new file mode 100644 index 0000000000..f349bd3cf2 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp256r1/struct.PublicKey.html @@ -0,0 +1,58 @@ +PublicKey in oasis_runtime_sdk::crypto::signature::secp256r1 - Rust

Struct oasis_runtime_sdk::crypto::signature::secp256r1::PublicKey

source ·
pub struct PublicKey(/* private fields */);
Expand description

A Secp256r1 public key (in compressed form).

+

Implementations§

source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8]

Return a byte representation of this public key.

+
source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Construct a public key from a slice of bytes.

+
source

pub fn verify( + &self, + context: &[u8], + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify a signature.

+
source

pub fn verify_raw( + &self, + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify signature without using any domain separation scheme.

+
source

pub fn verify_digest<D>( + &self, + digest: D, + signature: &Signature, +) -> Result<(), Error>
where + D: Digest + FixedOutput<OutputSize = U32>,

Verify signature of a pre-hashed message.

+

Trait Implementations§

source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKey

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PublicKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&'static str> for PublicKey

source§

fn from(s: &'static str) -> PublicKey

Converts to this type from the input type.
source§

impl Hash for PublicKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp384r1/index.html b/rust/oasis_runtime_sdk/crypto/signature/secp384r1/index.html new file mode 100644 index 0000000000..b71a00e83c --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp384r1/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto::signature::secp384r1 - Rust

Module oasis_runtime_sdk::crypto::signature::secp384r1

source ·
Expand description

Secp384r1 signatures.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp384r1/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/signature/secp384r1/sidebar-items.js new file mode 100644 index 0000000000..ab566cf397 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp384r1/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["MemorySigner","PublicKey"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp384r1/struct.MemorySigner.html b/rust/oasis_runtime_sdk/crypto/signature/secp384r1/struct.MemorySigner.html new file mode 100644 index 0000000000..2fb2c8cf90 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp384r1/struct.MemorySigner.html @@ -0,0 +1,22 @@ +MemorySigner in oasis_runtime_sdk::crypto::signature::secp384r1 - Rust
pub struct MemorySigner { /* private fields */ }
Expand description

A memory-backed signer for Secp384r1.

+

Implementations§

source§

impl MemorySigner

source

pub fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
where + D: Digest + FixedOutput<OutputSize = U48> + BlockSizeUser + FixedOutputReset,

Trait Implementations§

source§

impl Signer for MemorySigner

source§

fn random(rng: &mut impl RngCore) -> Result<Self, Error>

Create a new random signer.
source§

fn new_from_seed(seed: &[u8]) -> Result<Self, Error>

Create a new signer from the given seed.
source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Recreate signer from a byte serialization.
source§

fn to_bytes(&self) -> Vec<u8>

Serialize the signer into bytes.
source§

fn public_key(&self) -> PublicKey

Return the public key counterpart to the signer’s secret key.
source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

Generate a signature over the context and message.
source§

fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>

Generate a signature over the message.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/secp384r1/struct.PublicKey.html b/rust/oasis_runtime_sdk/crypto/signature/secp384r1/struct.PublicKey.html new file mode 100644 index 0000000000..659865eb6f --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/secp384r1/struct.PublicKey.html @@ -0,0 +1,58 @@ +PublicKey in oasis_runtime_sdk::crypto::signature::secp384r1 - Rust

Struct oasis_runtime_sdk::crypto::signature::secp384r1::PublicKey

source ·
pub struct PublicKey(/* private fields */);
Expand description

A Secp384r1 public key (in compressed form).

+

Implementations§

source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8]

Return a byte representation of this public key.

+
source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Construct a public key from a slice of bytes.

+
source

pub fn verify( + &self, + context: &[u8], + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify a signature.

+
source

pub fn verify_raw( + &self, + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify signature without using any domain separation scheme.

+
source

pub fn verify_digest<D>( + &self, + digest: D, + signature: &Signature, +) -> Result<(), Error>
where + D: Digest + FixedOutput<OutputSize = U48>,

Verify signature of a pre-hashed message.

+

Trait Implementations§

source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKey

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PublicKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&'static str> for PublicKey

source§

fn from(s: &'static str) -> PublicKey

Converts to this type from the input type.
source§

impl Hash for PublicKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/signature/sidebar-items.js new file mode 100644 index 0000000000..d1b11ffeee --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","MemorySigner","PublicKey","SignatureType"],"mod":["context","ed25519","secp256k1","secp256r1","secp384r1","sr25519"],"struct":["Signature"],"trait":["Signer"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/sr25519/index.html b/rust/oasis_runtime_sdk/crypto/signature/sr25519/index.html new file mode 100644 index 0000000000..44f53b063e --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/sr25519/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::crypto::signature::sr25519 - Rust

Module oasis_runtime_sdk::crypto::signature::sr25519

source ·
Expand description

Sr25519 signatures.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/sr25519/sidebar-items.js b/rust/oasis_runtime_sdk/crypto/signature/sr25519/sidebar-items.js new file mode 100644 index 0000000000..32f9945db1 --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/sr25519/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["PublicKey"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/sr25519/struct.PublicKey.html b/rust/oasis_runtime_sdk/crypto/signature/sr25519/struct.PublicKey.html new file mode 100644 index 0000000000..ae0eadd39e --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/sr25519/struct.PublicKey.html @@ -0,0 +1,47 @@ +PublicKey in oasis_runtime_sdk::crypto::signature::sr25519 - Rust

Struct oasis_runtime_sdk::crypto::signature::sr25519::PublicKey

source ·
pub struct PublicKey(/* private fields */);
Expand description

A Sr25519 public key.

+

Implementations§

source§

impl PublicKey

source

pub fn as_bytes(&self) -> &[u8]

Return a byte representation of this public key.

+
source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Construct a public key from a slice of bytes.

+
source

pub fn verify( + &self, + context: &[u8], + message: &[u8], + signature: &Signature, +) -> Result<(), Error>

Verify a signature.

+

Trait Implementations§

source§

impl Clone for PublicKey

source§

fn clone(&self) -> PublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKey

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PublicKey

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&'static str> for PublicKey

source§

fn from(s: &'static str) -> PublicKey

Converts to this type from the input type.
source§

impl Hash for PublicKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for PublicKey

source§

fn cmp(&self, other: &PublicKey) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PublicKey

source§

fn eq(&self, other: &PublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PublicKey

source§

fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for PublicKey

source§

impl StructuralPartialEq for PublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/struct.Signature.html b/rust/oasis_runtime_sdk/crypto/signature/struct.Signature.html new file mode 100644 index 0000000000..ae993de06c --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/struct.Signature.html @@ -0,0 +1,34 @@ +Signature in oasis_runtime_sdk::crypto::signature - Rust

Struct oasis_runtime_sdk::crypto::signature::Signature

source ·
pub struct Signature(/* private fields */);
Expand description

Variable-length opaque signature.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Signature

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Signature

source§

fn clone(&self) -> Signature

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Signature

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Signature

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Signature

source§

fn default() -> Signature

Returns the “default value” for a type. Read more
source§

impl Encode for Signature

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<Signature> for Vec<u8>

source§

fn from(s: Signature) -> Vec<u8>

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Signature

source§

fn from(v: Vec<u8>) -> Signature

Converts to this type from the input type.
source§

impl PartialEq for Signature

source§

fn eq(&self, other: &Signature) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Signature

source§

impl StructuralPartialEq for Signature

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/crypto/signature/trait.Signer.html b/rust/oasis_runtime_sdk/crypto/signature/trait.Signer.html new file mode 100644 index 0000000000..4884411b5e --- /dev/null +++ b/rust/oasis_runtime_sdk/crypto/signature/trait.Signer.html @@ -0,0 +1,30 @@ +Signer in oasis_runtime_sdk::crypto::signature - Rust

Trait oasis_runtime_sdk::crypto::signature::Signer

source ·
pub trait Signer: Send + Sync {
+    // Required methods
+    fn random(rng: &mut impl RngCore) -> Result<Self, Error>
+       where Self: Sized;
+    fn new_from_seed(seed: &[u8]) -> Result<Self, Error>
+       where Self: Sized;
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
+       where Self: Sized;
+    fn to_bytes(&self) -> Vec<u8> ;
+    fn public_key(&self) -> PublicKey;
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>;
+    fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>;
+}
Expand description

Common trait for memory signers.

+

Required Methods§

source

fn random(rng: &mut impl RngCore) -> Result<Self, Error>
where + Self: Sized,

Create a new random signer.

+
source

fn new_from_seed(seed: &[u8]) -> Result<Self, Error>
where + Self: Sized,

Create a new signer from the given seed.

+
source

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
where + Self: Sized,

Recreate signer from a byte serialization.

+
source

fn to_bytes(&self) -> Vec<u8>

Serialize the signer into bytes.

+
source

fn public_key(&self) -> PublicKey

Return the public key counterpart to the signer’s secret key.

+
source

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

Generate a signature over the context and message.

+
source

fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>

Generate a signature over the message.

+

Implementations on Foreign Types§

source§

impl Signer for Identity

source§

fn random(_rng: &mut impl RngCore) -> Result<Self, Error>
where + Self: Sized,

source§

fn new_from_seed(_seed: &[u8]) -> Result<Self, Error>
where + Self: Sized,

source§

fn from_bytes(_bytes: &[u8]) -> Result<Self, Error>
where + Self: Sized,

source§

fn to_bytes(&self) -> Vec<u8>

source§

fn public_key(&self) -> PublicKey

source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

source§

fn sign_raw(&self, _message: &[u8]) -> Result<Signature, Error>

source§

impl<T: CoreSigner> Signer for &T

source§

fn random(_rng: &mut impl RngCore) -> Result<Self, Error>
where + Self: Sized,

source§

fn new_from_seed(_seed: &[u8]) -> Result<Self, Error>
where + Self: Sized,

source§

fn from_bytes(_bytes: &[u8]) -> Result<Self, Error>
where + Self: Sized,

source§

fn to_bytes(&self) -> Vec<u8>

source§

fn public_key(&self) -> PublicKey

source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

source§

fn sign_raw(&self, _message: &[u8]) -> Result<Signature, Error>

Implementors§

source§

impl Signer for oasis_runtime_sdk::crypto::signature::ed25519::MemorySigner

source§

impl Signer for oasis_runtime_sdk::crypto::signature::secp256k1::MemorySigner

source§

impl Signer for oasis_runtime_sdk::crypto::signature::secp256r1::MemorySigner

source§

impl Signer for oasis_runtime_sdk::crypto::signature::secp384r1::MemorySigner

source§

impl<T: Signer + ?Sized> Signer for Arc<T>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/derive.Error.html b/rust/oasis_runtime_sdk/derive.Error.html new file mode 100644 index 0000000000..43539f9f33 --- /dev/null +++ b/rust/oasis_runtime_sdk/derive.Error.html @@ -0,0 +1,9 @@ +Error in oasis_runtime_sdk - Rust

Derive Macro oasis_runtime_sdk::Error

#[derive(Error)]
+{
+    // Attributes available to this derive:
+    #[sdk_error]
+    #[source]
+    #[from]
+}
+
Expand description

Derives the Error trait on an enum.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/derive.Event.html b/rust/oasis_runtime_sdk/derive.Event.html new file mode 100644 index 0000000000..5c32ddd26e --- /dev/null +++ b/rust/oasis_runtime_sdk/derive.Event.html @@ -0,0 +1,7 @@ +Event in oasis_runtime_sdk - Rust

Derive Macro oasis_runtime_sdk::Event

#[derive(Event)]
+{
+    // Attributes available to this derive:
+    #[sdk_event]
+}
+
Expand description

Derives the Event trait on an enum.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/dispatcher/enum.Error.html b/rust/oasis_runtime_sdk/dispatcher/enum.Error.html new file mode 100644 index 0000000000..968dfe33b5 --- /dev/null +++ b/rust/oasis_runtime_sdk/dispatcher/enum.Error.html @@ -0,0 +1,31 @@ +Error in oasis_runtime_sdk::dispatcher - Rust

Enum oasis_runtime_sdk::dispatcher::Error

source ·
pub enum Error {
+    Aborted,
+    MalformedTransactionInBatch(Error),
+    QueryAborted(String),
+    KeyManagerFailure(KeyManagerError),
+    BatchOutOfGas,
+}
Expand description

Error emitted by the dispatch process. Note that this indicates an error in the dispatch +process itself and should not be used for any transaction-related errors.

+

Variants§

§

Aborted

§

MalformedTransactionInBatch(Error)

§

QueryAborted(String)

§

KeyManagerFailure(KeyManagerError)

§

BatchOutOfGas

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<KeyManagerError> for Error

source§

fn from(source: KeyManagerError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/dispatcher/index.html b/rust/oasis_runtime_sdk/dispatcher/index.html new file mode 100644 index 0000000000..63ca7dac7f --- /dev/null +++ b/rust/oasis_runtime_sdk/dispatcher/index.html @@ -0,0 +1,3 @@ +oasis_runtime_sdk::dispatcher - Rust

Module oasis_runtime_sdk::dispatcher

source ·
Expand description

Transaction dispatcher.

+

Structs§

Enums§

  • Error emitted by the dispatch process. Note that this indicates an error in the dispatch +process itself and should not be used for any transaction-related errors.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/dispatcher/sidebar-items.js b/rust/oasis_runtime_sdk/dispatcher/sidebar-items.js new file mode 100644 index 0000000000..00f6655fce --- /dev/null +++ b/rust/oasis_runtime_sdk/dispatcher/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["DispatchOptions","DispatchResult","Dispatcher"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/dispatcher/struct.DispatchOptions.html b/rust/oasis_runtime_sdk/dispatcher/struct.DispatchOptions.html new file mode 100644 index 0000000000..6a01892628 --- /dev/null +++ b/rust/oasis_runtime_sdk/dispatcher/struct.DispatchOptions.html @@ -0,0 +1,31 @@ +DispatchOptions in oasis_runtime_sdk::dispatcher - Rust

Struct oasis_runtime_sdk::dispatcher::DispatchOptions

source ·
pub struct DispatchOptions<'a> {
+    pub tx_size: u32,
+    pub tx_index: usize,
+    pub tx_hash: Hash,
+    pub method_authorizer: Option<&'a dyn Fn(&str) -> bool>,
+    pub skip_authentication: bool,
+}
Expand description

Additional options for dispatch operations.

+

Fields§

§tx_size: u32

Transaction size.

+
§tx_index: usize

Transaction index within the batch.

+
§tx_hash: Hash

Transaction hash.

+
§method_authorizer: Option<&'a dyn Fn(&str) -> bool>

Optionally only allow methods for which the provided authorizer closure returns true.

+
§skip_authentication: bool

Optionally skip authentication.

+

Trait Implementations§

source§

impl<'a> Default for DispatchOptions<'a>

source§

fn default() -> DispatchOptions<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DispatchOptions<'a>

§

impl<'a> !RefUnwindSafe for DispatchOptions<'a>

§

impl<'a> !Send for DispatchOptions<'a>

§

impl<'a> !Sync for DispatchOptions<'a>

§

impl<'a> Unpin for DispatchOptions<'a>

§

impl<'a> !UnwindSafe for DispatchOptions<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/dispatcher/struct.DispatchResult.html b/rust/oasis_runtime_sdk/dispatcher/struct.DispatchResult.html new file mode 100644 index 0000000000..ebea271108 --- /dev/null +++ b/rust/oasis_runtime_sdk/dispatcher/struct.DispatchResult.html @@ -0,0 +1,32 @@ +DispatchResult in oasis_runtime_sdk::dispatcher - Rust

Struct oasis_runtime_sdk::dispatcher::DispatchResult

source ·
pub struct DispatchResult {
+    pub result: CallResult,
+    pub tags: Tags,
+    pub priority: u64,
+    pub sender_metadata: SenderMeta,
+    pub call_format_metadata: Metadata,
+}
Expand description

Result of dispatching a transaction.

+

Fields§

§result: CallResult

Transaction call result.

+
§tags: Tags

Transaction tags.

+
§priority: u64

Transaction priority.

+
§sender_metadata: SenderMeta

Transaction sender metadata.

+
§call_format_metadata: Metadata

Call format metadata.

+

Trait Implementations§

source§

impl Debug for DispatchResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<CallResult> for DispatchResult

source§

fn from(result: CallResult) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/dispatcher/struct.Dispatcher.html b/rust/oasis_runtime_sdk/dispatcher/struct.Dispatcher.html new file mode 100644 index 0000000000..6bf784c505 --- /dev/null +++ b/rust/oasis_runtime_sdk/dispatcher/struct.Dispatcher.html @@ -0,0 +1,89 @@ +Dispatcher in oasis_runtime_sdk::dispatcher - Rust

Struct oasis_runtime_sdk::dispatcher::Dispatcher

source ·
pub struct Dispatcher<R: Runtime> { /* private fields */ }
Expand description

The runtime dispatcher.

+

Implementations§

source§

impl<R: Runtime> Dispatcher<R>

source

pub fn decode_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<Transaction, Error>

Decode a runtime transaction.

+
source

pub fn dispatch_tx_call<C: Context>( + ctx: &C, + call: Call, + opts: &DispatchOptions<'_>, +) -> (CallResult, Metadata)

Run the dispatch steps inside a transaction context. This includes the before call hooks, +the call itself and after call hooks. The after call hooks are called regardless if the call +succeeds or not.

+
source

pub fn dispatch_tx_opts<C: Context>( + ctx: &C, + tx: Transaction, + opts: &DispatchOptions<'_>, +) -> Result<DispatchResult, Error>

Dispatch a runtime transaction in the given context with the provided options.

+
source

pub fn dispatch_tx<C: Context>( + ctx: &C, + tx_size: u32, + tx: Transaction, + tx_index: usize, +) -> Result<DispatchResult, Error>

Dispatch a runtime transaction in the given context.

+
source

pub fn check_tx<C: Context>( + ctx: &C, + tx_size: u32, + tx: Transaction, +) -> Result<CheckTxResult, Error>

Check whether the given transaction is valid.

+
source

pub fn execute_tx_opts<C: Context>( + ctx: &C, + tx: Transaction, + opts: &DispatchOptions<'_>, +) -> Result<(CallResult, Tags), Error>

Execute the given transaction, returning unserialized results.

+
source

pub fn execute_tx<C: Context>( + ctx: &C, + tx_size: u32, + tx_hash: Hash, + tx: Transaction, + tx_index: usize, +) -> Result<ExecuteTxResult, Error>

Execute the given transaction.

+
source

pub fn prefetch_tx( + prefixes: &mut BTreeSet<Prefix>, + tx: Transaction, +) -> Result<(), RuntimeError>

Prefetch prefixes for the given transaction.

+
source

pub fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Vec<u8>, +) -> Result<Vec<u8>, RuntimeError>

Process the given runtime query.

+
source

pub fn register_enclaverpc(&self, rpc: &mut RpcDispatcher)
where + R: Runtime + Send + Sync + 'static,

Register EnclaveRPC methods.

+

Trait Implementations§

source§

impl<R: Runtime + Send + Sync> Dispatcher for Dispatcher<R>

source§

fn execute_batch( + &self, + rt_ctx: Context<'_>, + batch: &TxnBatch, + _in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

Execute the transactions in the given batch. Read more
source§

fn schedule_and_execute_batch( + &self, + rt_ctx: Context<'_>, + batch: &mut TxnBatch, + _in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, RuntimeError>

Schedule and execute transactions in the given batch. Read more
source§

fn check_batch( + &self, + rt_ctx: Context<'_>, + batch: &TxnBatch, +) -> Result<Vec<CheckTxResult>, RuntimeError>

Check the transactions in the given batch for validity. Read more
source§

fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>)

Configure abort batch flag.
source§

fn query( + &self, + rt_ctx: Context<'_>, + method: &str, + args: Vec<u8>, +) -> Result<Vec<u8>, RuntimeError>

Process a query. Read more
source§

fn is_supported(&self) -> bool

Whether dispatch is supported by this dispatcher.
source§

fn finalize(&self, _new_storage_root: Hash)

Invoke the finalizer (if any).

Auto Trait Implementations§

§

impl<R> Freeze for Dispatcher<R>

§

impl<R> !RefUnwindSafe for Dispatcher<R>

§

impl<R> Send for Dispatcher<R>
where + R: Send,

§

impl<R> Sync for Dispatcher<R>
where + R: Sync,

§

impl<R> Unpin for Dispatcher<R>
where + R: Unpin,

§

impl<R> !UnwindSafe for Dispatcher<R>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/enclave_rpc/constant.METHOD_QUERY.html b/rust/oasis_runtime_sdk/enclave_rpc/constant.METHOD_QUERY.html new file mode 100644 index 0000000000..21ebe52e64 --- /dev/null +++ b/rust/oasis_runtime_sdk/enclave_rpc/constant.METHOD_QUERY.html @@ -0,0 +1,2 @@ +METHOD_QUERY in oasis_runtime_sdk::enclave_rpc - Rust

Constant oasis_runtime_sdk::enclave_rpc::METHOD_QUERY

source ·
pub const METHOD_QUERY: &str = "runtime-sdk/query";
Expand description

Name of the query method.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/enclave_rpc/index.html b/rust/oasis_runtime_sdk/enclave_rpc/index.html new file mode 100644 index 0000000000..9837b18e57 --- /dev/null +++ b/rust/oasis_runtime_sdk/enclave_rpc/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::enclave_rpc - Rust

Module oasis_runtime_sdk::enclave_rpc

source ·
Expand description

Exposed EnclaveRPC methods.

+

Structs§

Constants§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/enclave_rpc/sidebar-items.js b/rust/oasis_runtime_sdk/enclave_rpc/sidebar-items.js new file mode 100644 index 0000000000..43e8b03383 --- /dev/null +++ b/rust/oasis_runtime_sdk/enclave_rpc/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["METHOD_QUERY"],"struct":["QueryRequest"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/enclave_rpc/struct.QueryRequest.html b/rust/oasis_runtime_sdk/enclave_rpc/struct.QueryRequest.html new file mode 100644 index 0000000000..a5049d684d --- /dev/null +++ b/rust/oasis_runtime_sdk/enclave_rpc/struct.QueryRequest.html @@ -0,0 +1,31 @@ +QueryRequest in oasis_runtime_sdk::enclave_rpc - Rust

Struct oasis_runtime_sdk::enclave_rpc::QueryRequest

source ·
pub struct QueryRequest {
+    pub round: u64,
+    pub method: String,
+    pub args: Vec<u8>,
+}
Expand description

Arguments for the query method.

+

Fields§

§round: u64§method: String§args: Vec<u8>

Trait Implementations§

source§

impl Clone for QueryRequest

source§

fn clone(&self) -> QueryRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for QueryRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for QueryRequest

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for QueryRequest

source§

fn default() -> QueryRequest

Returns the “default value” for a type. Read more
source§

impl Encode for QueryRequest

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for QueryRequest

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/error/index.html b/rust/oasis_runtime_sdk/error/index.html new file mode 100644 index 0000000000..14d39258f3 --- /dev/null +++ b/rust/oasis_runtime_sdk/error/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::error - Rust

Module oasis_runtime_sdk::error

source ·
Expand description

Error types for runtimes.

+

Structs§

Traits§

  • A runtime error that gets propagated to the caller.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/error/sidebar-items.js b/rust/oasis_runtime_sdk/error/sidebar-items.js new file mode 100644 index 0000000000..64a0d4d337 --- /dev/null +++ b/rust/oasis_runtime_sdk/error/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["RuntimeError"],"trait":["Error"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/error/struct.RuntimeError.html b/rust/oasis_runtime_sdk/error/struct.RuntimeError.html new file mode 100644 index 0000000000..bdfa1dcc88 --- /dev/null +++ b/rust/oasis_runtime_sdk/error/struct.RuntimeError.html @@ -0,0 +1,33 @@ +RuntimeError in oasis_runtime_sdk::error - Rust

Struct oasis_runtime_sdk::error::RuntimeError

source ·
pub struct RuntimeError {
+    pub module: String,
+    pub code: u32,
+    pub message: String,
+}
Expand description

A serializable error.

+

Fields§

§module: String§code: u32§message: String

Implementations§

source§

impl Error

source

pub fn new(module: &str, code: u32, msg: &str) -> Error

Create a new error.

+

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Decode for Error

source§

fn try_default() -> Result<Error, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Error, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Error

source§

fn default() -> Error

Returns the “default value” for a type. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Encode for Error

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Error

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(err: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<JoinError> for Error

source§

fn from(e: JoinError) -> Error

Converts to this type from the input type.
source§

impl From<ProtocolError> for Error

source§

fn from(err: ProtocolError) -> Error

Converts to this type from the input type.
source§

impl From<StateError> for Error

source§

fn from(e: StateError) -> Error

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/error/trait.Error.html b/rust/oasis_runtime_sdk/error/trait.Error.html new file mode 100644 index 0000000000..a783fdf678 --- /dev/null +++ b/rust/oasis_runtime_sdk/error/trait.Error.html @@ -0,0 +1,34 @@ +Error in oasis_runtime_sdk::error - Rust

Trait oasis_runtime_sdk::error::Error

source ·
pub trait Error: Error {
+    // Required methods
+    fn module_name(&self) -> &str;
+    fn code(&self) -> u32;
+
+    // Provided methods
+    fn into_call_result(self) -> CallResult
+       where Self: Sized { ... }
+    fn into_abort(self) -> Result<Error, Self>
+       where Self: Sized { ... }
+}
Expand description

A runtime error that gets propagated to the caller.

+

It extends std::error::Error with module name and error code so that errors can be easily +serialized and transferred between different processes.

+

This trait can be derived:

+ +
const MODULE_NAME: &str = "my-module";
+#[derive(Clone, Debug, Error, thiserror::Error)]
+#[sdk_error(autonumber)] // `module_name` meta is required if `MODULE_NAME` isn't in scope
+enum Error {
+   #[error("invalid argument")]
+   InvalidArgument,          // autonumbered to 0
+
+   #[error("forbidden")]
+   #[sdk_error(code = 401)]  // manually numbered to 403 (`code` or autonumbering is required)
+   Forbidden,
+}
+

Required Methods§

source

fn module_name(&self) -> &str

Name of the module that emitted the error.

+
source

fn code(&self) -> u32

Error code uniquely identifying the error.

+

Provided Methods§

source

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.

+
source

fn into_abort(self) -> Result<Error, Self>
where + Self: Sized,

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.

+

Implementations on Foreign Types§

source§

impl Error for Infallible

source§

fn module_name(&self) -> &str

source§

fn code(&self) -> u32

Implementors§

source§

impl Error for oasis_runtime_sdk::dispatcher::Error

source§

impl Error for oasis_runtime_sdk::history::Error

source§

impl Error for oasis_runtime_sdk::modules::access::Error

source§

impl Error for oasis_runtime_sdk::modules::accounts::Error

source§

impl Error for oasis_runtime_sdk::modules::consensus::Error

source§

impl Error for oasis_runtime_sdk::modules::consensus_accounts::Error

source§

impl Error for oasis_runtime_sdk::modules::core::Error

source§

impl Error for oasis_runtime_sdk::modules::rewards::Error

source§

impl Error for oasis_runtime_sdk::modules::rofl::Error

source§

impl Error for oasis_runtime_sdk::schedule_control::Error

source§

impl Error for TxSimulationFailure

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/event/fn.etag_for_event.html b/rust/oasis_runtime_sdk/event/fn.etag_for_event.html new file mode 100644 index 0000000000..25e3740860 --- /dev/null +++ b/rust/oasis_runtime_sdk/event/fn.etag_for_event.html @@ -0,0 +1,2 @@ +etag_for_event in oasis_runtime_sdk::event - Rust

Function oasis_runtime_sdk::event::etag_for_event

source ·
pub fn etag_for_event(module_name: &str, code: u32, value: Value) -> EventTag
Expand description

Generate an EventTag corresponding to the passed event triple.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/event/index.html b/rust/oasis_runtime_sdk/event/index.html new file mode 100644 index 0000000000..04a3c72c6b --- /dev/null +++ b/rust/oasis_runtime_sdk/event/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::event - Rust

Module oasis_runtime_sdk::event

source ·
Expand description

Event types for runtimes.

+

Structs§

  • A key-value pair representing an emitted event that will be emitted as a tag.

Traits§

  • An event emitted by the runtime.
  • Provides method for converting event tags into events.

Functions§

  • Generate an EventTag corresponding to the passed event triple.

Type Aliases§

  • Event tags with values accumulated by key.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/event/sidebar-items.js b/rust/oasis_runtime_sdk/event/sidebar-items.js new file mode 100644 index 0000000000..cf274f2a71 --- /dev/null +++ b/rust/oasis_runtime_sdk/event/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["etag_for_event"],"struct":["EventTag"],"trait":["Event","IntoTags"],"type":["EventTags"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/event/struct.EventTag.html b/rust/oasis_runtime_sdk/event/struct.EventTag.html new file mode 100644 index 0000000000..9553823061 --- /dev/null +++ b/rust/oasis_runtime_sdk/event/struct.EventTag.html @@ -0,0 +1,26 @@ +EventTag in oasis_runtime_sdk::event - Rust

Struct oasis_runtime_sdk::event::EventTag

source ·
pub struct EventTag {
+    pub key: Vec<u8>,
+    pub value: Value,
+}
Expand description

A key-value pair representing an emitted event that will be emitted as a tag.

+

Fields§

§key: Vec<u8>§value: Value

Trait Implementations§

source§

impl Clone for EventTag

source§

fn clone(&self) -> EventTag

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EventTag

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/event/trait.Event.html b/rust/oasis_runtime_sdk/event/trait.Event.html new file mode 100644 index 0000000000..d83ed6571c --- /dev/null +++ b/rust/oasis_runtime_sdk/event/trait.Event.html @@ -0,0 +1,29 @@ +Event in oasis_runtime_sdk::event - Rust

Trait oasis_runtime_sdk::event::Event

source ·
pub trait Event: Sized + Encode {
+    // Required methods
+    fn module_name() -> &'static str;
+    fn code(&self) -> u32;
+
+    // Provided method
+    fn into_event_tag(self) -> EventTag { ... }
+}
Expand description

An event emitted by the runtime.

+

This trait can be derived:

+ +
const MODULE_NAME: &str = "my-module";
+#[derive(Clone, Debug, cbor::Encode, Event)]
+#[cbor(untagged)]
+#[sdk_event(autonumber)] // `module_name` meta is required if `MODULE_NAME` isn't in scope
+enum MyEvent {
+   Greeting(String),      // autonumbered to 0
+   #[sdk_event(code = 2)] // manually numbered to 2 (`code` is required if not autonumbering)
+   DontPanic,
+   Salutation {           // autonumbered to 1
+       plural: bool,
+   }
+}
+

Required Methods§

source

fn module_name() -> &'static str

Name of the module that emitted the event.

+
source

fn code(&self) -> u32

Code uniquely identifying the event.

+

Provided Methods§

source

fn into_event_tag(self) -> EventTag

Converts an event into an event tag.

+
§Key
<module (variable size bytes)> <code (big-endian u32)>
+
§Value
+

CBOR-serialized event value.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Event for ()

source§

fn module_name() -> &'static str

source§

fn code(&self) -> u32

Implementors§

source§

impl Event for oasis_runtime_sdk::modules::accounts::Event

source§

impl Event for oasis_runtime_sdk::modules::consensus::Event

source§

impl Event for oasis_runtime_sdk::modules::consensus_accounts::Event

source§

impl Event for oasis_runtime_sdk::modules::core::Event

source§

impl Event for oasis_runtime_sdk::modules::rofl::Event

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/event/trait.IntoTags.html b/rust/oasis_runtime_sdk/event/trait.IntoTags.html new file mode 100644 index 0000000000..236d094187 --- /dev/null +++ b/rust/oasis_runtime_sdk/event/trait.IntoTags.html @@ -0,0 +1,5 @@ +IntoTags in oasis_runtime_sdk::event - Rust

Trait oasis_runtime_sdk::event::IntoTags

source ·
pub trait IntoTags {
+    // Required method
+    fn into_tags(self) -> Tags;
+}
Expand description

Provides method for converting event tags into events.

+

Required Methods§

source

fn into_tags(self) -> Tags

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/event/type.EventTags.html b/rust/oasis_runtime_sdk/event/type.EventTags.html new file mode 100644 index 0000000000..ca4448982c --- /dev/null +++ b/rust/oasis_runtime_sdk/event/type.EventTags.html @@ -0,0 +1,2 @@ +EventTags in oasis_runtime_sdk::event - Rust

Type Alias oasis_runtime_sdk::event::EventTags

source ·
pub type EventTags = BTreeMap<Vec<u8>, Vec<Value>>;
Expand description

Event tags with values accumulated by key.

+

Aliased Type§

struct EventTags { /* private fields */ }

Trait Implementations§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/history/enum.Error.html b/rust/oasis_runtime_sdk/history/enum.Error.html new file mode 100644 index 0000000000..9bd2d8240a --- /dev/null +++ b/rust/oasis_runtime_sdk/history/enum.Error.html @@ -0,0 +1,27 @@ +Error in oasis_runtime_sdk::history - Rust

Enum oasis_runtime_sdk::history::Error

source ·
pub enum Error {
+    FailedToFetchBlock,
+    FailedToFetchEvents,
+}
Expand description

History host errors.

+

Variants§

§

FailedToFetchBlock

§

FailedToFetchEvents

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/history/index.html b/rust/oasis_runtime_sdk/history/index.html new file mode 100644 index 0000000000..7e5299957e --- /dev/null +++ b/rust/oasis_runtime_sdk/history/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::history - Rust

Module oasis_runtime_sdk::history

source ·
Expand description

Historic state access.

+

Enums§

  • History host errors.

Traits§

  • Interface to the runtime host to fetch historic information.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/history/sidebar-items.js b/rust/oasis_runtime_sdk/history/sidebar-items.js new file mode 100644 index 0000000000..b79fe0abe8 --- /dev/null +++ b/rust/oasis_runtime_sdk/history/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"trait":["HistoryHost"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/history/trait.HistoryHost.html b/rust/oasis_runtime_sdk/history/trait.HistoryHost.html new file mode 100644 index 0000000000..5d11406b4f --- /dev/null +++ b/rust/oasis_runtime_sdk/history/trait.HistoryHost.html @@ -0,0 +1,24 @@ +HistoryHost in oasis_runtime_sdk::history - Rust

Trait oasis_runtime_sdk::history::HistoryHost

source ·
pub trait HistoryHost {
+    // Required methods
+    fn consensus_state_at(&self, height: u64) -> Result<ConsensusState, Error>;
+    fn consensus_events_at(
+        &self,
+        height: u64,
+        kind: EventKind,
+    ) -> Result<Vec<Event>, Error>;
+}
Expand description

Interface to the runtime host to fetch historic information.

+

Required Methods§

source

fn consensus_state_at(&self, height: u64) -> Result<ConsensusState, Error>

Fetch historic consensus state after executing the block at given height.

+
source

fn consensus_events_at( + &self, + height: u64, + kind: EventKind, +) -> Result<Vec<Event>, Error>

Fetch events emitted during execution of the block at given height.

+

Trait Implementations§

source§

impl HistoryHost for Box<dyn HistoryHost>

source§

fn consensus_state_at(&self, height: u64) -> Result<ConsensusState, Error>

Fetch historic consensus state after executing the block at given height.
source§

fn consensus_events_at( + &self, + height: u64, + kind: EventKind, +) -> Result<Vec<Event>, Error>

Fetch events emitted during execution of the block at given height.

Implementations on Foreign Types§

source§

impl HistoryHost for Box<dyn HistoryHost>

source§

fn consensus_state_at(&self, height: u64) -> Result<ConsensusState, Error>

source§

fn consensus_events_at( + &self, + height: u64, + kind: EventKind, +) -> Result<Vec<Event>, Error>

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/index.html b/rust/oasis_runtime_sdk/index.html new file mode 100644 index 0000000000..c4efdf46e5 --- /dev/null +++ b/rust/oasis_runtime_sdk/index.html @@ -0,0 +1,5 @@ +oasis_runtime_sdk - Rust

Crate oasis_runtime_sdk

source ·
Expand description

Oasis runtime SDK.

+

Re-exports§

Modules§

Macros§

  • Constructs an oasis_sdk::core::common::version::Version from the Cargo.toml version.

Structs§

  • A protocol or runtime version.

Attribute Macros§

  • A helper attribute for #[sdk_derive(...)]. It doesn’t do anyting on its own; +it only marks functions that represent a paratime method handler. +The permitted forms are:
  • A helper attribute for #[sdk_derive(...)]. It doesn’t do anything on its own; +it only marks functions that represent a module state migration.
  • Derives traits from a non-trait impl block (rather than from a struct).

Derive Macros§

  • Derives the Error trait on an enum.
  • Derives the Event trait on an enum.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/constant.KEY_PAIR_ID_CONTEXT.html b/rust/oasis_runtime_sdk/keymanager/constant.KEY_PAIR_ID_CONTEXT.html new file mode 100644 index 0000000000..b179dcfbda --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/constant.KEY_PAIR_ID_CONTEXT.html @@ -0,0 +1,2 @@ +KEY_PAIR_ID_CONTEXT in oasis_runtime_sdk::keymanager - Rust

Constant oasis_runtime_sdk::keymanager::KEY_PAIR_ID_CONTEXT

source ·
pub const KEY_PAIR_ID_CONTEXT: &[u8] = b"oasis-runtime-sdk/keymanager: key pair id";
Expand description

Key pair ID domain separation context.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/enum.KeyManagerError.html b/rust/oasis_runtime_sdk/keymanager/enum.KeyManagerError.html new file mode 100644 index 0000000000..0475391533 --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/enum.KeyManagerError.html @@ -0,0 +1,56 @@ +KeyManagerError in oasis_runtime_sdk::keymanager - Rust

Enum oasis_runtime_sdk::keymanager::KeyManagerError

pub enum KeyManagerError {
+
Show 33 variants NotAuthenticated, + NotAuthorized, + InvalidEpoch(u64, u64), + InvalidGeneration(u64, u64), + GenerationFromFuture(u64, u64), + HeightNotFresh, + NotInitialized, + StateCorrupted, + StorageCorrupted, + PolicyRequired, + PolicyRollback, + PolicyChanged, + PolicyInvalidRuntime, + InsufficientKeyShares, + InsufficientSignatures, + RSKMissing, + REKNotPublished, + InvalidSignature(Error), + MasterSecretChecksumMismatch, + MasterSecretNotFound(u64), + MasterSecretNotReplicated(u64), + MasterSecretNotPublished, + EphemeralSecretNotFound(u64), + EphemeralSecretNotReplicated(u64), + EphemeralSecretNotPublished, + EphemeralSecretChecksumMismatch, + InvalidCiphertext, + StatusNotFound, + RuntimeMismatch, + ActiveDeploymentNotFound, + StateError(StateError), + VerificationError(Error), + Other(Error), +
}
Expand description

Key manager error.

+

Variants§

§

NotAuthenticated

§

NotAuthorized

§

InvalidEpoch(u64, u64)

§

InvalidGeneration(u64, u64)

§

GenerationFromFuture(u64, u64)

§

HeightNotFresh

§

NotInitialized

§

StateCorrupted

§

StorageCorrupted

§

PolicyRequired

§

PolicyRollback

§

PolicyChanged

§

PolicyInvalidRuntime

§

InsufficientKeyShares

§

InsufficientSignatures

§

RSKMissing

§

REKNotPublished

§

InvalidSignature(Error)

§

MasterSecretChecksumMismatch

§

MasterSecretNotFound(u64)

§

MasterSecretNotReplicated(u64)

§

MasterSecretNotPublished

§

EphemeralSecretNotFound(u64)

§

EphemeralSecretNotReplicated(u64)

§

EphemeralSecretNotPublished

§

EphemeralSecretChecksumMismatch

§

InvalidCiphertext

§

StatusNotFound

§

RuntimeMismatch

§

ActiveDeploymentNotFound

§

StateError(StateError)

§

VerificationError(Error)

§

Other(Error)

Trait Implementations§

§

impl Debug for KeyManagerError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for KeyManagerError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for KeyManagerError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<Error> for KeyManagerError

§

fn from(source: Error) -> KeyManagerError

Converts to this type from the input type.
§

impl From<Error> for KeyManagerError

§

fn from(source: Error) -> KeyManagerError

Converts to this type from the input type.
source§

impl From<KeyManagerError> for Error

source§

fn from(source: KeyManagerError) -> Self

Converts to this type from the input type.
§

impl From<StateError> for KeyManagerError

§

fn from(source: StateError) -> KeyManagerError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/fn.get_key_pair_id.html b/rust/oasis_runtime_sdk/keymanager/fn.get_key_pair_id.html new file mode 100644 index 0000000000..8bad713ef2 --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/fn.get_key_pair_id.html @@ -0,0 +1,3 @@ +get_key_pair_id in oasis_runtime_sdk::keymanager - Rust

Function oasis_runtime_sdk::keymanager::get_key_pair_id

source ·
pub fn get_key_pair_id<'a, C>(context: C) -> KeyPairId
where + C: IntoIterator<Item = &'a [u8]> + 'a,
Expand description

Derive a KeyPairId for use with the key manager functions.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/index.html b/rust/oasis_runtime_sdk/keymanager/index.html new file mode 100644 index 0000000000..0ba9bc141e --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/index.html @@ -0,0 +1,3 @@ +oasis_runtime_sdk::keymanager - Rust

Module oasis_runtime_sdk::keymanager

source ·
Expand description

Keymanager interface.

+

Structs§

Enums§

Constants§

Traits§

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/sidebar-items.js b/rust/oasis_runtime_sdk/keymanager/sidebar-items.js new file mode 100644 index 0000000000..b3f690fcab --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["KEY_PAIR_ID_CONTEXT"],"enum":["KeyManagerError"],"fn":["get_key_pair_id"],"struct":["KeyManagerClientWithContext","KeyPair","KeyPairId","SignedPublicKey","StateKey","TrustedSigners"],"trait":["KeyManager"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/struct.KeyManagerClientWithContext.html b/rust/oasis_runtime_sdk/keymanager/struct.KeyManagerClientWithContext.html new file mode 100644 index 0000000000..557c50ca1a --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/struct.KeyManagerClientWithContext.html @@ -0,0 +1,38 @@ +KeyManagerClientWithContext in oasis_runtime_sdk::keymanager - Rust
pub struct KeyManagerClientWithContext { /* private fields */ }
Expand description

Convenience wrapper around an existing KeyManagerClient instance which uses +a default io context for all calls.

+

Trait Implementations§

source§

impl Clone for KeyManagerClientWithContext

source§

fn clone(&self) -> KeyManagerClientWithContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl KeyManager for KeyManagerClientWithContext

source§

fn runtime_id(&self) -> Option<Namespace>

Key manager runtime identifier this client is connected to. It may be None in case the +identifier is not known yet (e.g. the client has not yet been initialized). Read more
source§

fn runtime_signing_key(&self) -> Option<PublicKey>

Key manager runtime signing key used to sign messages from the key manager. Read more
source§

fn clear_cache(&self)

Clear local key cache. Read more
source§

fn get_or_create_keys( + &self, + key_pair_id: KeyPairId, +) -> Result<KeyPair, KeyManagerError>

Get or create named key pair. Read more
source§

fn get_public_key( + &self, + key_pair_id: KeyPairId, +) -> Result<SignedPublicKey, KeyManagerError>

Get public key for a key pair id. Read more
source§

fn get_or_create_ephemeral_keys( + &self, + key_pair_id: KeyPairId, + epoch: EpochTime, +) -> Result<KeyPair, KeyManagerError>

Get or create named ephemeral key pair for given epoch. Read more
source§

fn get_public_ephemeral_key( + &self, + key_pair_id: KeyPairId, + epoch: EpochTime, +) -> Result<SignedPublicKey, KeyManagerError>

Get ephemeral public key for an epoch and a key pair id. Read more
source§

fn box_clone(&self) -> Box<dyn KeyManager>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/struct.KeyPair.html b/rust/oasis_runtime_sdk/keymanager/struct.KeyPair.html new file mode 100644 index 0000000000..47a947cbc1 --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/struct.KeyPair.html @@ -0,0 +1,42 @@ +KeyPair in oasis_runtime_sdk::keymanager - Rust

Struct oasis_runtime_sdk::keymanager::KeyPair

pub struct KeyPair {
+    pub input_keypair: InputKeyPair,
+    pub state_key: StateKey,
+    pub checksum: Vec<u8>,
+}
Expand description

A key pair managed by the key manager.

+

Fields§

§input_keypair: InputKeyPair

Input key pair (pk, sk)

+
§state_key: StateKey

State encryption key

+
§checksum: Vec<u8>

Checksum of the key manager state.

+

Implementations§

§

impl KeyPair

pub fn generate_mock() -> KeyPair

Generate a new random key (for testing).

+

pub fn new( + pk: PublicKey, + sk: PrivateKey, + state_key: StateKey, + checksum: Vec<u8>, +) -> KeyPair

Create a KeyPair.

+

pub fn from_public_key(pk: PublicKey, checksum: Vec<u8>) -> KeyPair

Create a KeyPair with only the public key.

+

Trait Implementations§

§

impl Clone for KeyPair

§

fn clone(&self) -> KeyPair

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Decode for KeyPair

§

fn try_default() -> Result<KeyPair, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<KeyPair, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for KeyPair

§

fn default() -> KeyPair

Returns the “default value” for a type. Read more
§

impl Encode for KeyPair

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl EncodeAsMap for KeyPair

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/struct.KeyPairId.html b/rust/oasis_runtime_sdk/keymanager/struct.KeyPairId.html new file mode 100644 index 0000000000..daa393e6b4 --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/struct.KeyPairId.html @@ -0,0 +1,48 @@ +KeyPairId in oasis_runtime_sdk::keymanager - Rust

Struct oasis_runtime_sdk::keymanager::KeyPairId

pub struct KeyPairId(pub [u8; 32]);
Expand description

A 256-bit key pair identifier.

+

Tuple Fields§

§0: [u8; 32]

Implementations§

§

impl KeyPairId

pub const fn len() -> usize

Size of this object in bytes.

+

Trait Implementations§

§

impl AsRef<[u8]> for KeyPairId

§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for KeyPairId

§

fn clone(&self) -> KeyPairId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for KeyPairId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for KeyPairId

§

fn try_default() -> Result<KeyPairId, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<KeyPairId, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for KeyPairId

§

fn default() -> KeyPairId

Returns the “default value” for a type. Read more
§

impl Display for KeyPairId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Encode for KeyPairId

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl From<&[u8]> for KeyPairId

§

fn from(b: &[u8]) -> KeyPairId

Converts to this type from the input type.
§

impl From<&'static str> for KeyPairId

§

fn from(s: &'static str) -> KeyPairId

Converts to this type from the input type.
§

impl From<KeyPairId> for [u8; 32]

§

fn from(b: KeyPairId) -> [u8; 32]

Converts to this type from the input type.
§

impl From<Vec<u8>> for KeyPairId

§

fn from(v: Vec<u8>) -> KeyPairId

Converts to this type from the input type.
§

impl FromStr for KeyPairId

§

type Err = FromHexError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<KeyPairId, FromHexError>

Parses a string s to return a value of this type. Read more
§

impl Hash for KeyPairId

§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl LowerHex for KeyPairId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Ord for KeyPairId

§

fn cmp(&self, other: &KeyPairId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for KeyPairId

§

fn eq(&self, other: &KeyPairId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for KeyPairId

§

fn partial_cmp(&self, other: &KeyPairId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl Zeroize for KeyPairId

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
§

impl Copy for KeyPairId

§

impl Eq for KeyPairId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/struct.SignedPublicKey.html b/rust/oasis_runtime_sdk/keymanager/struct.SignedPublicKey.html new file mode 100644 index 0000000000..5cc5c6655f --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/struct.SignedPublicKey.html @@ -0,0 +1,57 @@ +SignedPublicKey in oasis_runtime_sdk::keymanager - Rust

Struct oasis_runtime_sdk::keymanager::SignedPublicKey

pub struct SignedPublicKey {
+    pub key: PublicKey,
+    pub checksum: Vec<u8>,
+    pub signature: Signature,
+    pub expiration: Option<u64>,
+}
Expand description

Signed public key.

+

Fields§

§key: PublicKey

Public key.

+
§checksum: Vec<u8>

Checksum of the key manager state.

+
§signature: Signature

Sign(sk, (key || checksum || runtime id || key pair id || epoch || expiration epoch)) from +the key manager.

+
§expiration: Option<u64>

Expiration epoch.

+

Implementations§

§

impl SignedPublicKey

pub fn new( + key: PublicKey, + checksum: Vec<u8>, + runtime_id: Namespace, + key_pair_id: KeyPairId, + epoch: Option<u64>, + signer: &Arc<dyn Signer>, +) -> Result<SignedPublicKey, Error>

Create a new signed public key.

+

pub fn verify( + &self, + runtime_id: Namespace, + key_pair_id: KeyPairId, + epoch: Option<u64>, + now: Option<u64>, + pk: &PublicKey, +) -> Result<(), Error>

Verify the signature.

+

Trait Implementations§

§

impl Clone for SignedPublicKey

§

fn clone(&self) -> SignedPublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for SignedPublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for SignedPublicKey

§

fn try_default() -> Result<SignedPublicKey, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<SignedPublicKey, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for SignedPublicKey

§

fn default() -> SignedPublicKey

Returns the “default value” for a type. Read more
§

impl Encode for SignedPublicKey

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl EncodeAsMap for SignedPublicKey

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
§

impl PartialEq for SignedPublicKey

§

fn eq(&self, other: &SignedPublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for SignedPublicKey

§

impl StructuralPartialEq for SignedPublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/struct.StateKey.html b/rust/oasis_runtime_sdk/keymanager/struct.StateKey.html new file mode 100644 index 0000000000..1444ff4900 --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/struct.StateKey.html @@ -0,0 +1,31 @@ +StateKey in oasis_runtime_sdk::keymanager - Rust

Struct oasis_runtime_sdk::keymanager::StateKey

pub struct StateKey(pub [u8; 32]);
Expand description

A state encryption key.

+

Tuple Fields§

§0: [u8; 32]

Trait Implementations§

§

impl AsRef<[u8]> for StateKey

§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for StateKey

§

fn clone(&self) -> StateKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Decode for StateKey

§

fn try_default() -> Result<StateKey, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<StateKey, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for StateKey

§

fn default() -> StateKey

Returns the “default value” for a type. Read more
§

impl Drop for StateKey

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl Encode for StateKey

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl Zeroize for StateKey

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/struct.TrustedSigners.html b/rust/oasis_runtime_sdk/keymanager/struct.TrustedSigners.html new file mode 100644 index 0000000000..ea8946cce3 --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/struct.TrustedSigners.html @@ -0,0 +1,37 @@ +TrustedSigners in oasis_runtime_sdk::keymanager - Rust

Struct oasis_runtime_sdk::keymanager::TrustedSigners

pub struct TrustedSigners {
+    pub signers: HashSet<PublicKey>,
+    pub threshold: u64,
+}
Expand description

Set of trusted key manager signing keys.

+

Fields§

§signers: HashSet<PublicKey>

Set of trusted signers.

+
§threshold: u64

Threshold for determining if enough valid signatures are present.

+

Implementations§

§

impl TrustedSigners

pub fn verify<'a, P>( + &self, + signed_data: &'a impl SignedData<P>, +) -> Result<&'a P, Error>

Verifies that signed data has valid signatures and that enough of them +are from trusted signers.

+

Trait Implementations§

§

impl Clone for TrustedSigners

§

fn clone(&self) -> TrustedSigners

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for TrustedSigners

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for TrustedSigners

§

fn try_default() -> Result<TrustedSigners, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<TrustedSigners, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for TrustedSigners

§

fn default() -> TrustedSigners

Returns the “default value” for a type. Read more
§

impl Encode for TrustedSigners

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl EncodeAsMap for TrustedSigners

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/keymanager/trait.KeyManager.html b/rust/oasis_runtime_sdk/keymanager/trait.KeyManager.html new file mode 100644 index 0000000000..187a9960c5 --- /dev/null +++ b/rust/oasis_runtime_sdk/keymanager/trait.KeyManager.html @@ -0,0 +1,59 @@ +KeyManager in oasis_runtime_sdk::keymanager - Rust

Trait oasis_runtime_sdk::keymanager::KeyManager

source ·
pub trait KeyManager {
+    // Required methods
+    fn runtime_id(&self) -> Option<Namespace>;
+    fn runtime_signing_key(&self) -> Option<PublicKey>;
+    fn clear_cache(&self);
+    fn get_or_create_keys(
+        &self,
+        key_pair_id: KeyPairId,
+    ) -> Result<KeyPair, KeyManagerError>;
+    fn get_public_key(
+        &self,
+        key_pair_id: KeyPairId,
+    ) -> Result<SignedPublicKey, KeyManagerError>;
+    fn get_or_create_ephemeral_keys(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<KeyPair, KeyManagerError>;
+    fn get_public_ephemeral_key(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<SignedPublicKey, KeyManagerError>;
+    fn box_clone(&self) -> Box<dyn KeyManager>;
+}
Expand description

Key manager interface.

+

Required Methods§

source

fn runtime_id(&self) -> Option<Namespace>

Key manager runtime identifier this client is connected to. It may be None in case the +identifier is not known yet (e.g. the client has not yet been initialized).

+

See the oasis-core documentation for details.

+
source

fn runtime_signing_key(&self) -> Option<PublicKey>

Key manager runtime signing key used to sign messages from the key manager.

+

See the oasis-core documentation for details.

+
source

fn clear_cache(&self)

Clear local key cache.

+

See the oasis-core documentation for details.

+
source

fn get_or_create_keys( + &self, + key_pair_id: KeyPairId, +) -> Result<KeyPair, KeyManagerError>

Get or create named key pair.

+

See the oasis-core documentation for details. This variant of the method +synchronously blocks for the result.

+
source

fn get_public_key( + &self, + key_pair_id: KeyPairId, +) -> Result<SignedPublicKey, KeyManagerError>

Get public key for a key pair id.

+

See the oasis-core documentation for details. This variant of the method +synchronously blocks for the result.

+
source

fn get_or_create_ephemeral_keys( + &self, + key_pair_id: KeyPairId, + epoch: EpochTime, +) -> Result<KeyPair, KeyManagerError>

Get or create named ephemeral key pair for given epoch.

+

See the oasis-core documentation for details. This variant of the method +synchronously blocks for the result.

+
source

fn get_public_ephemeral_key( + &self, + key_pair_id: KeyPairId, + epoch: EpochTime, +) -> Result<SignedPublicKey, KeyManagerError>

Get ephemeral public key for an epoch and a key pair id.

+

See the oasis-core documentation for details. This variant of the method +synchronously blocks for the result.

+
source

fn box_clone(&self) -> Box<dyn KeyManager>

Trait Implementations§

source§

impl Clone for Box<dyn KeyManager>

source§

fn clone(&self) -> Box<dyn KeyManager>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/macro.version_from_cargo!.html b/rust/oasis_runtime_sdk/macro.version_from_cargo!.html new file mode 100644 index 0000000000..c5e9f7f133 --- /dev/null +++ b/rust/oasis_runtime_sdk/macro.version_from_cargo!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.version_from_cargo.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/macro.version_from_cargo.html b/rust/oasis_runtime_sdk/macro.version_from_cargo.html new file mode 100644 index 0000000000..40d6dff71f --- /dev/null +++ b/rust/oasis_runtime_sdk/macro.version_from_cargo.html @@ -0,0 +1,2 @@ +version_from_cargo in oasis_runtime_sdk - Rust

Macro oasis_runtime_sdk::version_from_cargo

version_from_cargo!() { /* proc-macro */ }
Expand description

Constructs an oasis_sdk::core::common::version::Version from the Cargo.toml version.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/enum.AuthDecision.html b/rust/oasis_runtime_sdk/module/enum.AuthDecision.html new file mode 100644 index 0000000000..f2cf16ee90 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/enum.AuthDecision.html @@ -0,0 +1,28 @@ +AuthDecision in oasis_runtime_sdk::module - Rust

Enum oasis_runtime_sdk::module::AuthDecision

source ·
pub enum AuthDecision {
+    Continue,
+    Stop,
+}
Expand description

An authentication decision for cases where multiple handlers are available.

+

Variants§

§

Continue

Authentication passed, continue with the next authentication handler.

+
§

Stop

Authentication passed, no further authentication handlers should be called.

+

Trait Implementations§

source§

impl Clone for AuthDecision

source§

fn clone(&self) -> AuthDecision

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AuthDecision

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/enum.CallResult.html b/rust/oasis_runtime_sdk/module/enum.CallResult.html new file mode 100644 index 0000000000..3d42c204cf --- /dev/null +++ b/rust/oasis_runtime_sdk/module/enum.CallResult.html @@ -0,0 +1,35 @@ +CallResult in oasis_runtime_sdk::module - Rust

Enum oasis_runtime_sdk::module::CallResult

source ·
pub enum CallResult {
+    Ok(Value),
+    Failed {
+        module: String,
+        code: u32,
+        message: String,
+    },
+    Aborted(Error),
+}
Expand description

A variant of types::transaction::CallResult but used for dispatch purposes so the dispatch +process can use a different representation.

+

Specifically, this type is not serializable.

+

Variants§

§

Ok(Value)

Call has completed successfully.

+
§

Failed

Call has completed with failure.

+

Fields

§module: String
§code: u32
§message: String
§

Aborted(Error)

A fatal error has occurred and the batch must be aborted.

+

Implementations§

source§

impl CallResult

source

pub fn is_success(&self) -> bool

Check whether the call result indicates a successful operation or not.

+

Trait Implementations§

source§

impl Debug for CallResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<CallResult> for CallResult

source§

fn from(v: CallResult) -> Self

Converts to this type from the input type.
source§

impl From<CallResult> for DispatchResult

source§

fn from(result: CallResult) -> Self

Converts to this type from the input type.
source§

impl TryFrom<CallResult> for TxSimulationFailure

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: CallResult) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/enum.DispatchResult.html b/rust/oasis_runtime_sdk/module/enum.DispatchResult.html new file mode 100644 index 0000000000..d2372bba06 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/enum.DispatchResult.html @@ -0,0 +1,40 @@ +DispatchResult in oasis_runtime_sdk::module - Rust

Enum oasis_runtime_sdk::module::DispatchResult

source ·
pub enum DispatchResult<B, R> {
+    Handled(R),
+    Unhandled(B),
+}
Expand description

Result of invoking the method handler.

+

Variants§

§

Handled(R)

§

Unhandled(B)

Implementations§

source§

impl<B, R> DispatchResult<B, R>

source

pub fn ok_or<E>(self, err: E) -> Result<R, E>

Transforms DispatchResult<B, R> into Result<R, E>, mapping Handled(r) to Ok(r) and +Unhandled(_) to Err(err).

+
source

pub fn ok_or_else<E, F: FnOnce() -> E>(self, errf: F) -> Result<R, E>

Transforms DispatchResult<B, R> into Result<R, E>, mapping Handled(r) to Ok(r) and +Unhandled(_) to Err(err) using the provided function.

+

Auto Trait Implementations§

§

impl<B, R> Freeze for DispatchResult<B, R>
where + R: Freeze, + B: Freeze,

§

impl<B, R> RefUnwindSafe for DispatchResult<B, R>
where + R: RefUnwindSafe, + B: RefUnwindSafe,

§

impl<B, R> Send for DispatchResult<B, R>
where + R: Send, + B: Send,

§

impl<B, R> Sync for DispatchResult<B, R>
where + R: Sync, + B: Sync,

§

impl<B, R> Unpin for DispatchResult<B, R>
where + R: Unpin, + B: Unpin,

§

impl<B, R> UnwindSafe for DispatchResult<B, R>
where + R: UnwindSafe, + B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/fn.dispatch_call.html b/rust/oasis_runtime_sdk/module/fn.dispatch_call.html new file mode 100644 index 0000000000..8b49955b77 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/fn.dispatch_call.html @@ -0,0 +1,11 @@ +dispatch_call in oasis_runtime_sdk::module - Rust

Function oasis_runtime_sdk::module::dispatch_call

source ·
pub fn dispatch_call<C, B, R, E, F>(
+    ctx: &C,
+    body: Value,
+    f: F,
+) -> DispatchResult<Value, CallResult>
where + C: Context, + B: Decode, + R: Encode, + E: Error, + F: FnOnce(&C, B) -> Result<R, E>,
Expand description

A convenience function for dispatching method calls.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/fn.dispatch_query.html b/rust/oasis_runtime_sdk/module/fn.dispatch_query.html new file mode 100644 index 0000000000..c7540e700a --- /dev/null +++ b/rust/oasis_runtime_sdk/module/fn.dispatch_query.html @@ -0,0 +1,12 @@ +dispatch_query in oasis_runtime_sdk::module - Rust

Function oasis_runtime_sdk::module::dispatch_query

source ·
pub fn dispatch_query<C, B, R, E, F>(
+    ctx: &C,
+    body: Value,
+    f: F,
+) -> DispatchResult<Value, Result<Value, RuntimeError>>
where + C: Context, + B: Decode, + R: Encode, + E: Error, + RuntimeError: From<E>, + F: FnOnce(&C, B) -> Result<R, E>,
Expand description

A convenience function for dispatching queries.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/index.html b/rust/oasis_runtime_sdk/module/index.html new file mode 100644 index 0000000000..f50ae3ef50 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/index.html @@ -0,0 +1,3 @@ +oasis_runtime_sdk::module - Rust

Module oasis_runtime_sdk::module

source ·
Expand description

Runtime modules.

+

Enums§

  • An authentication decision for cases where multiple handlers are available.
  • A variant of types::transaction::CallResult but used for dispatch purposes so the dispatch +process can use a different representation.
  • Result of invoking the method handler.

Traits§

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/sidebar-items.js b/rust/oasis_runtime_sdk/module/sidebar-items.js new file mode 100644 index 0000000000..a0fc29f1b7 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AuthDecision","CallResult","DispatchResult"],"fn":["dispatch_call","dispatch_query"],"trait":["BlockHandler","FeeProxyHandler","InvariantHandler","MethodHandler","MigrationHandler","Module","ModuleInfoHandler","Parameters","TransactionHandler"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.BlockHandler.html b/rust/oasis_runtime_sdk/module/trait.BlockHandler.html new file mode 100644 index 0000000000..0adff4cd9c --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.BlockHandler.html @@ -0,0 +1,10 @@ +BlockHandler in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::BlockHandler

source ·
pub trait BlockHandler {
+    // Provided methods
+    fn begin_block<C: Context>(_ctx: &C) { ... }
+    fn end_block<C: Context>(_ctx: &C) { ... }
+}
Expand description

Block handler.

+

Provided Methods§

source

fn begin_block<C: Context>(_ctx: &C)

Perform any common actions at the start of the block (before any transactions have been +executed).

+
source

fn end_block<C: Context>(_ctx: &C)

Perform any common actions at the end of the block (after all transactions have been +executed).

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BlockHandler for ()

source§

impl<TupleElement0: BlockHandler> BlockHandler for (TupleElement0,)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler> BlockHandler for (TupleElement0, TupleElement1)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler, TupleElement22: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler, TupleElement22: BlockHandler, TupleElement23: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler, TupleElement22: BlockHandler, TupleElement23: BlockHandler, TupleElement24: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler, TupleElement22: BlockHandler, TupleElement23: BlockHandler, TupleElement24: BlockHandler, TupleElement25: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler, TupleElement22: BlockHandler, TupleElement23: BlockHandler, TupleElement24: BlockHandler, TupleElement25: BlockHandler, TupleElement26: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler, TupleElement22: BlockHandler, TupleElement23: BlockHandler, TupleElement24: BlockHandler, TupleElement25: BlockHandler, TupleElement26: BlockHandler, TupleElement27: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler, TupleElement22: BlockHandler, TupleElement23: BlockHandler, TupleElement24: BlockHandler, TupleElement25: BlockHandler, TupleElement26: BlockHandler, TupleElement27: BlockHandler, TupleElement28: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28)

source§

impl<TupleElement0: BlockHandler, TupleElement1: BlockHandler, TupleElement2: BlockHandler, TupleElement3: BlockHandler, TupleElement4: BlockHandler, TupleElement5: BlockHandler, TupleElement6: BlockHandler, TupleElement7: BlockHandler, TupleElement8: BlockHandler, TupleElement9: BlockHandler, TupleElement10: BlockHandler, TupleElement11: BlockHandler, TupleElement12: BlockHandler, TupleElement13: BlockHandler, TupleElement14: BlockHandler, TupleElement15: BlockHandler, TupleElement16: BlockHandler, TupleElement17: BlockHandler, TupleElement18: BlockHandler, TupleElement19: BlockHandler, TupleElement20: BlockHandler, TupleElement21: BlockHandler, TupleElement22: BlockHandler, TupleElement23: BlockHandler, TupleElement24: BlockHandler, TupleElement25: BlockHandler, TupleElement26: BlockHandler, TupleElement27: BlockHandler, TupleElement28: BlockHandler, TupleElement29: BlockHandler> BlockHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28, TupleElement29)

Implementors§

source§

impl BlockHandler for oasis_runtime_sdk::modules::accounts::Module

source§

impl BlockHandler for oasis_runtime_sdk::modules::consensus::Module

source§

impl BlockHandler for oasis_runtime_sdk::modules::rewards::Module

source§

impl<Cfg: Config> BlockHandler for oasis_runtime_sdk::modules::access::Module<Cfg>

source§

impl<Cfg: Config> BlockHandler for oasis_runtime_sdk::modules::core::Module<Cfg>

source§

impl<Cfg: Config> BlockHandler for oasis_runtime_sdk::modules::rofl::Module<Cfg>

source§

impl<Consensus: API> BlockHandler for oasis_runtime_sdk::modules::consensus_accounts::Module<Consensus>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.FeeProxyHandler.html b/rust/oasis_runtime_sdk/module/trait.FeeProxyHandler.html new file mode 100644 index 0000000000..d8510a9860 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.FeeProxyHandler.html @@ -0,0 +1,106 @@ +FeeProxyHandler in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::FeeProxyHandler

source ·
pub trait FeeProxyHandler {
+    // Required method
+    fn resolve_payer<C: Context>(
+        ctx: &C,
+        tx: &Transaction,
+    ) -> Result<Option<Address>, Error>;
+}
Expand description

Fee proxy handler.

+

Required Methods§

source

fn resolve_payer<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<Option<Address>, Error>

Resolve the proxy payer for the given transaction. If no payer could be resolved, None +should be returned.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FeeProxyHandler for ()

source§

impl<TupleElement0: FeeProxyHandler> FeeProxyHandler for (TupleElement0,)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler, TupleElement22: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler, TupleElement22: FeeProxyHandler, TupleElement23: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler, TupleElement22: FeeProxyHandler, TupleElement23: FeeProxyHandler, TupleElement24: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler, TupleElement22: FeeProxyHandler, TupleElement23: FeeProxyHandler, TupleElement24: FeeProxyHandler, TupleElement25: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler, TupleElement22: FeeProxyHandler, TupleElement23: FeeProxyHandler, TupleElement24: FeeProxyHandler, TupleElement25: FeeProxyHandler, TupleElement26: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler, TupleElement22: FeeProxyHandler, TupleElement23: FeeProxyHandler, TupleElement24: FeeProxyHandler, TupleElement25: FeeProxyHandler, TupleElement26: FeeProxyHandler, TupleElement27: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler, TupleElement22: FeeProxyHandler, TupleElement23: FeeProxyHandler, TupleElement24: FeeProxyHandler, TupleElement25: FeeProxyHandler, TupleElement26: FeeProxyHandler, TupleElement27: FeeProxyHandler, TupleElement28: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28)

source§

impl<TupleElement0: FeeProxyHandler, TupleElement1: FeeProxyHandler, TupleElement2: FeeProxyHandler, TupleElement3: FeeProxyHandler, TupleElement4: FeeProxyHandler, TupleElement5: FeeProxyHandler, TupleElement6: FeeProxyHandler, TupleElement7: FeeProxyHandler, TupleElement8: FeeProxyHandler, TupleElement9: FeeProxyHandler, TupleElement10: FeeProxyHandler, TupleElement11: FeeProxyHandler, TupleElement12: FeeProxyHandler, TupleElement13: FeeProxyHandler, TupleElement14: FeeProxyHandler, TupleElement15: FeeProxyHandler, TupleElement16: FeeProxyHandler, TupleElement17: FeeProxyHandler, TupleElement18: FeeProxyHandler, TupleElement19: FeeProxyHandler, TupleElement20: FeeProxyHandler, TupleElement21: FeeProxyHandler, TupleElement22: FeeProxyHandler, TupleElement23: FeeProxyHandler, TupleElement24: FeeProxyHandler, TupleElement25: FeeProxyHandler, TupleElement26: FeeProxyHandler, TupleElement27: FeeProxyHandler, TupleElement28: FeeProxyHandler, TupleElement29: FeeProxyHandler> FeeProxyHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28, TupleElement29)

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.InvariantHandler.html b/rust/oasis_runtime_sdk/module/trait.InvariantHandler.html new file mode 100644 index 0000000000..14e688ec40 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.InvariantHandler.html @@ -0,0 +1,37 @@ +InvariantHandler in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::InvariantHandler

source ·
pub trait InvariantHandler {
+    // Provided method
+    fn check_invariants<C: Context>(_ctx: &C) -> Result<(), Error> { ... }
+}
Expand description

Invariant handler.

+

Provided Methods§

source

fn check_invariants<C: Context>(_ctx: &C) -> Result<(), Error>

Check invariants.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl InvariantHandler for ()

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler> InvariantHandler for (TupleElement0,)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler, TupleElement22: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler, TupleElement22: InvariantHandler, TupleElement23: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler, TupleElement22: InvariantHandler, TupleElement23: InvariantHandler, TupleElement24: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler, TupleElement22: InvariantHandler, TupleElement23: InvariantHandler, TupleElement24: InvariantHandler, TupleElement25: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler, TupleElement22: InvariantHandler, TupleElement23: InvariantHandler, TupleElement24: InvariantHandler, TupleElement25: InvariantHandler, TupleElement26: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler, TupleElement22: InvariantHandler, TupleElement23: InvariantHandler, TupleElement24: InvariantHandler, TupleElement25: InvariantHandler, TupleElement26: InvariantHandler, TupleElement27: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler, TupleElement22: InvariantHandler, TupleElement23: InvariantHandler, TupleElement24: InvariantHandler, TupleElement25: InvariantHandler, TupleElement26: InvariantHandler, TupleElement27: InvariantHandler, TupleElement28: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+
source§

impl<TupleElement0: InvariantHandler, TupleElement1: InvariantHandler, TupleElement2: InvariantHandler, TupleElement3: InvariantHandler, TupleElement4: InvariantHandler, TupleElement5: InvariantHandler, TupleElement6: InvariantHandler, TupleElement7: InvariantHandler, TupleElement8: InvariantHandler, TupleElement9: InvariantHandler, TupleElement10: InvariantHandler, TupleElement11: InvariantHandler, TupleElement12: InvariantHandler, TupleElement13: InvariantHandler, TupleElement14: InvariantHandler, TupleElement15: InvariantHandler, TupleElement16: InvariantHandler, TupleElement17: InvariantHandler, TupleElement18: InvariantHandler, TupleElement19: InvariantHandler, TupleElement20: InvariantHandler, TupleElement21: InvariantHandler, TupleElement22: InvariantHandler, TupleElement23: InvariantHandler, TupleElement24: InvariantHandler, TupleElement25: InvariantHandler, TupleElement26: InvariantHandler, TupleElement27: InvariantHandler, TupleElement28: InvariantHandler, TupleElement29: InvariantHandler> InvariantHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28, TupleElement29)

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), Error>

Check the invariants in all modules in the tuple.

+

Implementors§

source§

impl InvariantHandler for oasis_runtime_sdk::modules::accounts::Module

source§

impl InvariantHandler for oasis_runtime_sdk::modules::consensus::Module

source§

impl InvariantHandler for oasis_runtime_sdk::modules::rewards::Module

source§

impl<Cfg: Config> InvariantHandler for oasis_runtime_sdk::modules::access::Module<Cfg>

source§

impl<Cfg: Config> InvariantHandler for oasis_runtime_sdk::modules::core::Module<Cfg>

source§

impl<Cfg: Config> InvariantHandler for oasis_runtime_sdk::modules::rofl::Module<Cfg>

source§

impl<Consensus: API> InvariantHandler for oasis_runtime_sdk::modules::consensus_accounts::Module<Consensus>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.MethodHandler.html b/rust/oasis_runtime_sdk/module/trait.MethodHandler.html new file mode 100644 index 0000000000..da5195bbab --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.MethodHandler.html @@ -0,0 +1,584 @@ +MethodHandler in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::MethodHandler

source ·
pub trait MethodHandler {
+    // Provided methods
+    fn prefetch(
+        _prefixes: &mut BTreeSet<Prefix>,
+        _method: &str,
+        body: Value,
+        _auth_info: &AuthInfo,
+    ) -> DispatchResult<Value, Result<(), RuntimeError>> { ... }
+    fn dispatch_call<C: Context>(
+        _ctx: &C,
+        _method: &str,
+        body: Value,
+    ) -> DispatchResult<Value, CallResult> { ... }
+    fn dispatch_query<C: Context>(
+        _ctx: &C,
+        _method: &str,
+        args: Value,
+    ) -> DispatchResult<Value, Result<Value, RuntimeError>> { ... }
+    fn dispatch_message_result<C: Context>(
+        _ctx: &C,
+        _handler_name: &str,
+        result: MessageResult,
+    ) -> DispatchResult<MessageResult, ()> { ... }
+    fn supported_methods() -> Vec<MethodHandlerInfo> { ... }
+    fn is_expensive_query(_method: &str) -> bool { ... }
+    fn is_allowed_private_km_query(_method: &str) -> bool { ... }
+    fn is_allowed_interactive_call(_method: &str) -> bool { ... }
+}
Expand description

Method handler.

+

Provided Methods§

source

fn prefetch( + _prefixes: &mut BTreeSet<Prefix>, + _method: &str, + body: Value, + _auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

Add storage prefixes to prefetch.

+
source

fn dispatch_call<C: Context>( + _ctx: &C, + _method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.

+
source

fn dispatch_query<C: Context>( + _ctx: &C, + _method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.

+
source

fn dispatch_message_result<C: Context>( + _ctx: &C, + _handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

Dispatch a message result.

+
source

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.

+
source

fn is_expensive_query(_method: &str) -> bool

Checks whether the given query method is tagged as expensive.

+
source

fn is_allowed_private_km_query(_method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.

+
source

fn is_allowed_interactive_call(_method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MethodHandler for ()

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler> MethodHandler for (TupleElement0,)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler> MethodHandler for (TupleElement0, TupleElement1)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler, TupleElement22: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler, TupleElement22: MethodHandler, TupleElement23: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler, TupleElement22: MethodHandler, TupleElement23: MethodHandler, TupleElement24: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler, TupleElement22: MethodHandler, TupleElement23: MethodHandler, TupleElement24: MethodHandler, TupleElement25: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler, TupleElement22: MethodHandler, TupleElement23: MethodHandler, TupleElement24: MethodHandler, TupleElement25: MethodHandler, TupleElement26: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler, TupleElement22: MethodHandler, TupleElement23: MethodHandler, TupleElement24: MethodHandler, TupleElement25: MethodHandler, TupleElement26: MethodHandler, TupleElement27: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler, TupleElement22: MethodHandler, TupleElement23: MethodHandler, TupleElement24: MethodHandler, TupleElement25: MethodHandler, TupleElement26: MethodHandler, TupleElement27: MethodHandler, TupleElement28: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

source§

impl<TupleElement0: MethodHandler, TupleElement1: MethodHandler, TupleElement2: MethodHandler, TupleElement3: MethodHandler, TupleElement4: MethodHandler, TupleElement5: MethodHandler, TupleElement6: MethodHandler, TupleElement7: MethodHandler, TupleElement8: MethodHandler, TupleElement9: MethodHandler, TupleElement10: MethodHandler, TupleElement11: MethodHandler, TupleElement12: MethodHandler, TupleElement13: MethodHandler, TupleElement14: MethodHandler, TupleElement15: MethodHandler, TupleElement16: MethodHandler, TupleElement17: MethodHandler, TupleElement18: MethodHandler, TupleElement19: MethodHandler, TupleElement20: MethodHandler, TupleElement21: MethodHandler, TupleElement22: MethodHandler, TupleElement23: MethodHandler, TupleElement24: MethodHandler, TupleElement25: MethodHandler, TupleElement26: MethodHandler, TupleElement27: MethodHandler, TupleElement28: MethodHandler, TupleElement29: MethodHandler> MethodHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28, TupleElement29)

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

source§

fn is_expensive_query(method: &str) -> bool

source§

fn is_allowed_private_km_query(method: &str) -> bool

source§

fn is_allowed_interactive_call(method: &str) -> bool

Implementors§

source§

impl MethodHandler for oasis_runtime_sdk::modules::accounts::Module

source§

impl MethodHandler for oasis_runtime_sdk::modules::consensus::Module

source§

impl MethodHandler for oasis_runtime_sdk::modules::rewards::Module

source§

impl<Cfg: Config> MethodHandler for oasis_runtime_sdk::modules::access::Module<Cfg>

source§

impl<Cfg: Config> MethodHandler for oasis_runtime_sdk::modules::core::Module<Cfg>

source§

impl<Cfg: Config> MethodHandler for oasis_runtime_sdk::modules::rofl::Module<Cfg>

source§

impl<Consensus: API> MethodHandler for oasis_runtime_sdk::modules::consensus_accounts::Module<Consensus>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.MigrationHandler.html b/rust/oasis_runtime_sdk/module/trait.MigrationHandler.html new file mode 100644 index 0000000000..13e9bb85fe --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.MigrationHandler.html @@ -0,0 +1,144 @@ +MigrationHandler in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::MigrationHandler

source ·
pub trait MigrationHandler {
+    type Genesis;
+
+    // Provided method
+    fn init_or_migrate<C: Context>(
+        _ctx: &C,
+        _meta: &mut Metadata,
+        _genesis: Self::Genesis,
+    ) -> bool { ... }
+}
Expand description

Migration handler.

+

Required Associated Types§

source

type Genesis

Genesis state type.

+

If this state is expensive to compute and not often updated, prefer +to make the genesis type something like once_cell::unsync::Lazy<T>.

+

Provided Methods§

source

fn init_or_migrate<C: Context>( + _ctx: &C, + _meta: &mut Metadata, + _genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration.

+

Should return true in case metadata has been changed.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MigrationHandler for ()

§

type Genesis = ()

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler> MigrationHandler for (TupleElement0,)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis,)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler, TupleElement22: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis, <TupleElement22 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler, TupleElement22: MigrationHandler, TupleElement23: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis, <TupleElement22 as MigrationHandler>::Genesis, <TupleElement23 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler, TupleElement22: MigrationHandler, TupleElement23: MigrationHandler, TupleElement24: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis, <TupleElement22 as MigrationHandler>::Genesis, <TupleElement23 as MigrationHandler>::Genesis, <TupleElement24 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler, TupleElement22: MigrationHandler, TupleElement23: MigrationHandler, TupleElement24: MigrationHandler, TupleElement25: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis, <TupleElement22 as MigrationHandler>::Genesis, <TupleElement23 as MigrationHandler>::Genesis, <TupleElement24 as MigrationHandler>::Genesis, <TupleElement25 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler, TupleElement22: MigrationHandler, TupleElement23: MigrationHandler, TupleElement24: MigrationHandler, TupleElement25: MigrationHandler, TupleElement26: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis, <TupleElement22 as MigrationHandler>::Genesis, <TupleElement23 as MigrationHandler>::Genesis, <TupleElement24 as MigrationHandler>::Genesis, <TupleElement25 as MigrationHandler>::Genesis, <TupleElement26 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler, TupleElement22: MigrationHandler, TupleElement23: MigrationHandler, TupleElement24: MigrationHandler, TupleElement25: MigrationHandler, TupleElement26: MigrationHandler, TupleElement27: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis, <TupleElement22 as MigrationHandler>::Genesis, <TupleElement23 as MigrationHandler>::Genesis, <TupleElement24 as MigrationHandler>::Genesis, <TupleElement25 as MigrationHandler>::Genesis, <TupleElement26 as MigrationHandler>::Genesis, <TupleElement27 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler, TupleElement22: MigrationHandler, TupleElement23: MigrationHandler, TupleElement24: MigrationHandler, TupleElement25: MigrationHandler, TupleElement26: MigrationHandler, TupleElement27: MigrationHandler, TupleElement28: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis, <TupleElement22 as MigrationHandler>::Genesis, <TupleElement23 as MigrationHandler>::Genesis, <TupleElement24 as MigrationHandler>::Genesis, <TupleElement25 as MigrationHandler>::Genesis, <TupleElement26 as MigrationHandler>::Genesis, <TupleElement27 as MigrationHandler>::Genesis, <TupleElement28 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

source§

impl<TupleElement0: MigrationHandler, TupleElement1: MigrationHandler, TupleElement2: MigrationHandler, TupleElement3: MigrationHandler, TupleElement4: MigrationHandler, TupleElement5: MigrationHandler, TupleElement6: MigrationHandler, TupleElement7: MigrationHandler, TupleElement8: MigrationHandler, TupleElement9: MigrationHandler, TupleElement10: MigrationHandler, TupleElement11: MigrationHandler, TupleElement12: MigrationHandler, TupleElement13: MigrationHandler, TupleElement14: MigrationHandler, TupleElement15: MigrationHandler, TupleElement16: MigrationHandler, TupleElement17: MigrationHandler, TupleElement18: MigrationHandler, TupleElement19: MigrationHandler, TupleElement20: MigrationHandler, TupleElement21: MigrationHandler, TupleElement22: MigrationHandler, TupleElement23: MigrationHandler, TupleElement24: MigrationHandler, TupleElement25: MigrationHandler, TupleElement26: MigrationHandler, TupleElement27: MigrationHandler, TupleElement28: MigrationHandler, TupleElement29: MigrationHandler> MigrationHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28, TupleElement29)

§

type Genesis = (<TupleElement0 as MigrationHandler>::Genesis, <TupleElement1 as MigrationHandler>::Genesis, <TupleElement2 as MigrationHandler>::Genesis, <TupleElement3 as MigrationHandler>::Genesis, <TupleElement4 as MigrationHandler>::Genesis, <TupleElement5 as MigrationHandler>::Genesis, <TupleElement6 as MigrationHandler>::Genesis, <TupleElement7 as MigrationHandler>::Genesis, <TupleElement8 as MigrationHandler>::Genesis, <TupleElement9 as MigrationHandler>::Genesis, <TupleElement10 as MigrationHandler>::Genesis, <TupleElement11 as MigrationHandler>::Genesis, <TupleElement12 as MigrationHandler>::Genesis, <TupleElement13 as MigrationHandler>::Genesis, <TupleElement14 as MigrationHandler>::Genesis, <TupleElement15 as MigrationHandler>::Genesis, <TupleElement16 as MigrationHandler>::Genesis, <TupleElement17 as MigrationHandler>::Genesis, <TupleElement18 as MigrationHandler>::Genesis, <TupleElement19 as MigrationHandler>::Genesis, <TupleElement20 as MigrationHandler>::Genesis, <TupleElement21 as MigrationHandler>::Genesis, <TupleElement22 as MigrationHandler>::Genesis, <TupleElement23 as MigrationHandler>::Genesis, <TupleElement24 as MigrationHandler>::Genesis, <TupleElement25 as MigrationHandler>::Genesis, <TupleElement26 as MigrationHandler>::Genesis, <TupleElement27 as MigrationHandler>::Genesis, <TupleElement28 as MigrationHandler>::Genesis, <TupleElement29 as MigrationHandler>::Genesis)

source§

fn init_or_migrate<C: Context>( + ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Implementors§

source§

impl MigrationHandler for oasis_runtime_sdk::modules::accounts::Module

source§

impl MigrationHandler for oasis_runtime_sdk::modules::consensus::Module

source§

impl MigrationHandler for oasis_runtime_sdk::modules::rewards::Module

source§

impl<Cfg: Config> MigrationHandler for oasis_runtime_sdk::modules::access::Module<Cfg>

§

type Genesis = ()

source§

impl<Cfg: Config> MigrationHandler for oasis_runtime_sdk::modules::core::Module<Cfg>

source§

impl<Cfg: Config> MigrationHandler for oasis_runtime_sdk::modules::rofl::Module<Cfg>

source§

impl<Consensus: API> MigrationHandler for oasis_runtime_sdk::modules::consensus_accounts::Module<Consensus>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.Module.html b/rust/oasis_runtime_sdk/module/trait.Module.html new file mode 100644 index 0000000000..2708bbce86 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.Module.html @@ -0,0 +1,20 @@ +Module in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::Module

source ·
pub trait Module {
+    type Error: Error + 'static;
+    type Event: Event + 'static;
+    type Parameters: Parameters + 'static;
+
+    const NAME: &'static str;
+    const VERSION: u32 = 1u32;
+
+    // Provided methods
+    fn params() -> Self::Parameters { ... }
+    fn set_params(params: Self::Parameters) { ... }
+}
Expand description

A runtime module.

+

Required Associated Types§

source

type Error: Error + 'static

Module error type.

+
source

type Event: Event + 'static

Module event type.

+
source

type Parameters: Parameters + 'static

Module parameters.

+

Required Associated Constants§

source

const NAME: &'static str

Module name.

+

Provided Associated Constants§

source

const VERSION: u32 = 1u32

Module version.

+

Provided Methods§

source

fn params() -> Self::Parameters

Return the module’s parameters.

+
source

fn set_params(params: Self::Parameters)

Set the module’s parameters.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Module for oasis_runtime_sdk::modules::accounts::Module

source§

const NAME: &'static str = MODULE_NAME

§

type Error = Error

§

type Event = Event

§

type Parameters = Parameters

source§

impl Module for oasis_runtime_sdk::modules::consensus::Module

source§

const NAME: &'static str = MODULE_NAME

source§

const VERSION: u32 = 1u32

§

type Error = Error

§

type Event = Event

§

type Parameters = Parameters

source§

impl Module for oasis_runtime_sdk::modules::rewards::Module

source§

const NAME: &'static str = MODULE_NAME

source§

const VERSION: u32 = 2u32

§

type Error = Error

§

type Event = ()

§

type Parameters = Parameters

source§

impl<Cfg: Config> Module for oasis_runtime_sdk::modules::access::Module<Cfg>

source§

const NAME: &'static str = MODULE_NAME

source§

const VERSION: u32 = 1u32

§

type Error = Error

§

type Event = ()

§

type Parameters = ()

source§

impl<Cfg: Config> Module for oasis_runtime_sdk::modules::core::Module<Cfg>

source§

const NAME: &'static str = MODULE_NAME

§

type Error = Error

§

type Event = Event

§

type Parameters = Parameters

source§

impl<Cfg: Config> Module for oasis_runtime_sdk::modules::rofl::Module<Cfg>

source§

const NAME: &'static str = MODULE_NAME

§

type Error = Error

§

type Event = Event

§

type Parameters = Parameters

source§

impl<Consensus: API> Module for oasis_runtime_sdk::modules::consensus_accounts::Module<Consensus>

source§

const NAME: &'static str = MODULE_NAME

source§

const VERSION: u32 = 1u32

§

type Error = Error

§

type Event = Event

§

type Parameters = Parameters

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.ModuleInfoHandler.html b/rust/oasis_runtime_sdk/module/trait.ModuleInfoHandler.html new file mode 100644 index 0000000000..558a8adbd2 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.ModuleInfoHandler.html @@ -0,0 +1,6 @@ +ModuleInfoHandler in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::ModuleInfoHandler

source ·
pub trait ModuleInfoHandler {
+    // Required method
+    fn module_info<C: Context>(_ctx: &C) -> BTreeMap<String, ModuleInfo>;
+}
Expand description

Info handler.

+

Required Methods§

source

fn module_info<C: Context>(_ctx: &C) -> BTreeMap<String, ModuleInfo>

Reports info about the module (or modules, if Self is a tuple).

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ModuleInfoHandler for ()

source§

impl<TupleElement0: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0,)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler, TupleElement22: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler, TupleElement22: ModuleInfoHandler, TupleElement23: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler, TupleElement22: ModuleInfoHandler, TupleElement23: ModuleInfoHandler, TupleElement24: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler, TupleElement22: ModuleInfoHandler, TupleElement23: ModuleInfoHandler, TupleElement24: ModuleInfoHandler, TupleElement25: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler, TupleElement22: ModuleInfoHandler, TupleElement23: ModuleInfoHandler, TupleElement24: ModuleInfoHandler, TupleElement25: ModuleInfoHandler, TupleElement26: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler, TupleElement22: ModuleInfoHandler, TupleElement23: ModuleInfoHandler, TupleElement24: ModuleInfoHandler, TupleElement25: ModuleInfoHandler, TupleElement26: ModuleInfoHandler, TupleElement27: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler, TupleElement22: ModuleInfoHandler, TupleElement23: ModuleInfoHandler, TupleElement24: ModuleInfoHandler, TupleElement25: ModuleInfoHandler, TupleElement26: ModuleInfoHandler, TupleElement27: ModuleInfoHandler, TupleElement28: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28)

source§

impl<TupleElement0: ModuleInfoHandler, TupleElement1: ModuleInfoHandler, TupleElement2: ModuleInfoHandler, TupleElement3: ModuleInfoHandler, TupleElement4: ModuleInfoHandler, TupleElement5: ModuleInfoHandler, TupleElement6: ModuleInfoHandler, TupleElement7: ModuleInfoHandler, TupleElement8: ModuleInfoHandler, TupleElement9: ModuleInfoHandler, TupleElement10: ModuleInfoHandler, TupleElement11: ModuleInfoHandler, TupleElement12: ModuleInfoHandler, TupleElement13: ModuleInfoHandler, TupleElement14: ModuleInfoHandler, TupleElement15: ModuleInfoHandler, TupleElement16: ModuleInfoHandler, TupleElement17: ModuleInfoHandler, TupleElement18: ModuleInfoHandler, TupleElement19: ModuleInfoHandler, TupleElement20: ModuleInfoHandler, TupleElement21: ModuleInfoHandler, TupleElement22: ModuleInfoHandler, TupleElement23: ModuleInfoHandler, TupleElement24: ModuleInfoHandler, TupleElement25: ModuleInfoHandler, TupleElement26: ModuleInfoHandler, TupleElement27: ModuleInfoHandler, TupleElement28: ModuleInfoHandler, TupleElement29: ModuleInfoHandler> ModuleInfoHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28, TupleElement29)

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.Parameters.html b/rust/oasis_runtime_sdk/module/trait.Parameters.html new file mode 100644 index 0000000000..a3d9490377 --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.Parameters.html @@ -0,0 +1,11 @@ +Parameters in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::Parameters

source ·
pub trait Parameters: Debug + Default + Encode + Decode {
+    type Error;
+
+    const STORE_KEY: &'static [u8] = _;
+
+    // Provided method
+    fn validate_basic(&self) -> Result<(), Self::Error> { ... }
+}
Expand description

Parameters for a runtime module.

+

Required Associated Types§

Provided Associated Constants§

source

const STORE_KEY: &'static [u8] = _

Store key used for storing parameters.

+

Provided Methods§

source

fn validate_basic(&self) -> Result<(), Self::Error>

Perform basic parameter validation.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Parameters for ()

Implementors§

source§

impl Parameters for oasis_runtime_sdk::modules::accounts::Parameters

source§

impl Parameters for oasis_runtime_sdk::modules::consensus::Parameters

source§

impl Parameters for oasis_runtime_sdk::modules::consensus_accounts::Parameters

§

type Error = ()

source§

impl Parameters for oasis_runtime_sdk::modules::core::Parameters

source§

impl Parameters for oasis_runtime_sdk::modules::rewards::Parameters

source§

impl Parameters for oasis_runtime_sdk::modules::rofl::Parameters

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/module/trait.TransactionHandler.html b/rust/oasis_runtime_sdk/module/trait.TransactionHandler.html new file mode 100644 index 0000000000..40305b191f --- /dev/null +++ b/rust/oasis_runtime_sdk/module/trait.TransactionHandler.html @@ -0,0 +1,695 @@ +TransactionHandler in oasis_runtime_sdk::module - Rust

Trait oasis_runtime_sdk::module::TransactionHandler

source ·
pub trait TransactionHandler {
+    // Provided methods
+    fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error> { ... }
+    fn approve_unverified_tx<C: Context>(
+        _ctx: &C,
+        _utx: &UnverifiedTransaction,
+    ) -> Result<(), Error> { ... }
+    fn decode_tx<C: Context>(
+        _ctx: &C,
+        _scheme: &str,
+        _body: &[u8],
+    ) -> Result<Option<Transaction>, Error> { ... }
+    fn authenticate_tx<C: Context>(
+        _ctx: &C,
+        _tx: &Transaction,
+    ) -> Result<AuthDecision, Error> { ... }
+    fn before_handle_call<C: Context>(
+        _ctx: &C,
+        _call: &Call,
+    ) -> Result<(), Error> { ... }
+    fn before_authorized_call_dispatch<C: Context>(
+        _ctx: &C,
+        _call: &Call,
+    ) -> Result<(), Error> { ... }
+    fn after_handle_call<C: Context>(
+        _ctx: &C,
+        result: CallResult,
+    ) -> Result<CallResult, Error> { ... }
+    fn after_dispatch_tx<C: Context>(
+        _ctx: &C,
+        _tx_auth_info: &AuthInfo,
+        _result: &CallResult,
+    ) { ... }
+}
Expand description

Transaction handler.

+

Provided Methods§

source

fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.

+
source

fn approve_unverified_tx<C: Context>( + _ctx: &C, + _utx: &UnverifiedTransaction, +) -> Result<(), Error>

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.

+
source

fn decode_tx<C: Context>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>

Decode a transaction that was sent with module-controlled decoding and verify any +signatures.

+

Postcondition: if returning a Transaction, that transaction must pass validate_basic.

+

Returns Ok(Some(_)) if the module is in charge of the encoding scheme identified by _scheme +or Ok(None) otherwise.

+
source

fn authenticate_tx<C: Context>( + _ctx: &C, + _tx: &Transaction, +) -> Result<AuthDecision, Error>

Authenticate a transaction.

+

Note that any signatures have already been verified.

+
source

fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>

Perform any action after authentication, within the transaction context.

+

At this point call format has not yet been decoded so peeking into the call may not be +possible in case the call is encrypted.

+
source

fn before_authorized_call_dispatch<C: Context>( + _ctx: &C, + _call: &Call, +) -> Result<(), Error>

Perform any action after authentication and decoding, within the transaction context.

+

At this point, the call has been decoded according to the call format, +and method authorizers have run.

+
source

fn after_handle_call<C: Context>( + _ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

Perform any action after call, within the transaction context.

+

If an error is returned the transaction call fails and updates are rolled back.

+
source

fn after_dispatch_tx<C: Context>( + _ctx: &C, + _tx_auth_info: &AuthInfo, + _result: &CallResult, +)

Perform any action after dispatching the transaction, in batch context.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TransactionHandler for ()

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler> TransactionHandler for (TupleElement0,)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler, TupleElement22: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler, TupleElement22: TransactionHandler, TupleElement23: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler, TupleElement22: TransactionHandler, TupleElement23: TransactionHandler, TupleElement24: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler, TupleElement22: TransactionHandler, TupleElement23: TransactionHandler, TupleElement24: TransactionHandler, TupleElement25: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler, TupleElement22: TransactionHandler, TupleElement23: TransactionHandler, TupleElement24: TransactionHandler, TupleElement25: TransactionHandler, TupleElement26: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler, TupleElement22: TransactionHandler, TupleElement23: TransactionHandler, TupleElement24: TransactionHandler, TupleElement25: TransactionHandler, TupleElement26: TransactionHandler, TupleElement27: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler, TupleElement22: TransactionHandler, TupleElement23: TransactionHandler, TupleElement24: TransactionHandler, TupleElement25: TransactionHandler, TupleElement26: TransactionHandler, TupleElement27: TransactionHandler, TupleElement28: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

source§

impl<TupleElement0: TransactionHandler, TupleElement1: TransactionHandler, TupleElement2: TransactionHandler, TupleElement3: TransactionHandler, TupleElement4: TransactionHandler, TupleElement5: TransactionHandler, TupleElement6: TransactionHandler, TupleElement7: TransactionHandler, TupleElement8: TransactionHandler, TupleElement9: TransactionHandler, TupleElement10: TransactionHandler, TupleElement11: TransactionHandler, TupleElement12: TransactionHandler, TupleElement13: TransactionHandler, TupleElement14: TransactionHandler, TupleElement15: TransactionHandler, TupleElement16: TransactionHandler, TupleElement17: TransactionHandler, TupleElement18: TransactionHandler, TupleElement19: TransactionHandler, TupleElement20: TransactionHandler, TupleElement21: TransactionHandler, TupleElement22: TransactionHandler, TupleElement23: TransactionHandler, TupleElement24: TransactionHandler, TupleElement25: TransactionHandler, TupleElement26: TransactionHandler, TupleElement27: TransactionHandler, TupleElement28: TransactionHandler, TupleElement29: TransactionHandler> TransactionHandler for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9, TupleElement10, TupleElement11, TupleElement12, TupleElement13, TupleElement14, TupleElement15, TupleElement16, TupleElement17, TupleElement18, TupleElement19, TupleElement20, TupleElement21, TupleElement22, TupleElement23, TupleElement24, TupleElement25, TupleElement26, TupleElement27, TupleElement28, TupleElement29)

source§

fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), Error>

source§

fn approve_unverified_tx<C: Context>( + ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

source§

fn decode_tx<C: Context>( + ctx: &C, + scheme: &str, + body: &[u8], +) -> Result<Option<Transaction>, Error>

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

source§

fn before_authorized_call_dispatch<C: Context>( + ctx: &C, + call: &Call, +) -> Result<(), Error>

source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

Implementors§

source§

impl TransactionHandler for oasis_runtime_sdk::modules::accounts::Module

source§

impl TransactionHandler for oasis_runtime_sdk::modules::consensus::Module

source§

impl TransactionHandler for oasis_runtime_sdk::modules::rewards::Module

source§

impl<Cfg: Config> TransactionHandler for oasis_runtime_sdk::modules::access::Module<Cfg>

source§

impl<Cfg: Config> TransactionHandler for oasis_runtime_sdk::modules::core::Module<Cfg>

source§

impl<Cfg: Config> TransactionHandler for oasis_runtime_sdk::modules::rofl::Module<Cfg>

source§

impl<Consensus: API> TransactionHandler for oasis_runtime_sdk::modules::consensus_accounts::Module<Consensus>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/enum.Error.html b/rust/oasis_runtime_sdk/modules/access/enum.Error.html new file mode 100644 index 0000000000..109d891d6d --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/enum.Error.html @@ -0,0 +1,26 @@ +Error in oasis_runtime_sdk::modules::access - Rust

Enum oasis_runtime_sdk::modules::access::Error

source ·
pub enum Error {
+    NotAuthorized,
+}
Expand description

Errors emitted by the access module.

+

Variants§

§

NotAuthorized

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/index.html b/rust/oasis_runtime_sdk/modules/access/index.html new file mode 100644 index 0000000000..f9a12ba87e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::access - Rust

Module oasis_runtime_sdk::modules::access

source ·
Expand description

Method access control module.

+

Modules§

  • Method access control module types.

Structs§

  • The method access control module.

Enums§

  • Errors emitted by the access module.

Traits§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/sidebar-items.js b/rust/oasis_runtime_sdk/modules/access/sidebar-items.js new file mode 100644 index 0000000000..9a0b510bef --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"mod":["types"],"struct":["Module"],"trait":["Config"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/struct.Module.html b/rust/oasis_runtime_sdk/modules/access/struct.Module.html new file mode 100644 index 0000000000..fc3a8d80d4 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/struct.Module.html @@ -0,0 +1,77 @@ +Module in oasis_runtime_sdk::modules::access - Rust

Struct oasis_runtime_sdk::modules::access::Module

source ·
pub struct Module<Cfg: Config> { /* private fields */ }
Expand description

The method access control module.

+

Trait Implementations§

source§

impl<Cfg: Config> BlockHandler for Module<Cfg>

source§

fn begin_block<C: Context>(_ctx: &C)

Perform any common actions at the start of the block (before any transactions have been +executed).
source§

fn end_block<C: Context>(_ctx: &C)

Perform any common actions at the end of the block (after all transactions have been +executed).
source§

impl<Cfg: Config> InvariantHandler for Module<Cfg>

source§

fn check_invariants<C: Context>(_ctx: &C) -> Result<(), Error>

Check invariants.
source§

impl<Cfg: Config> MethodHandler for Module<Cfg>

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.
source§

fn prefetch( + _prefixes: &mut BTreeSet<Prefix>, + _method: &str, + body: Value, + _auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

Add storage prefixes to prefetch.
source§

fn dispatch_call<C: Context>( + _ctx: &C, + _method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.
source§

fn dispatch_message_result<C: Context>( + _ctx: &C, + _handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

Dispatch a message result.
source§

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.
source§

fn is_expensive_query(_method: &str) -> bool

Checks whether the given query method is tagged as expensive.
source§

fn is_allowed_private_km_query(_method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.
source§

fn is_allowed_interactive_call(_method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.
source§

impl<Cfg: Config> MigrationHandler for Module<Cfg>

§

type Genesis = ()

Genesis state type. Read more
source§

fn init_or_migrate<C: Context>( + _ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration. Read more
source§

impl<Cfg: Config> Module for Module<Cfg>

source§

const NAME: &'static str = MODULE_NAME

Module name.
source§

const VERSION: u32 = 1u32

Module version.
§

type Error = Error

Module error type.
§

type Event = ()

Module event type.
§

type Parameters = ()

Module parameters.
source§

fn params() -> Self::Parameters

Return the module’s parameters.
source§

fn set_params(params: Self::Parameters)

Set the module’s parameters.
source§

impl<Cfg: Config> TransactionHandler for Module<Cfg>

source§

fn before_authorized_call_dispatch<C: Context>( + _ctx: &C, + call: &Call, +) -> Result<(), Error>

Perform any action after authentication and decoding, within the transaction context. Read more
source§

fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.
source§

fn approve_unverified_tx<C: Context>( + _ctx: &C, + _utx: &UnverifiedTransaction, +) -> Result<(), Error>

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.
source§

fn decode_tx<C: Context>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>

Decode a transaction that was sent with module-controlled decoding and verify any +signatures. Read more
source§

fn authenticate_tx<C: Context>( + _ctx: &C, + _tx: &Transaction, +) -> Result<AuthDecision, Error>

Authenticate a transaction. Read more
source§

fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>

Perform any action after authentication, within the transaction context. Read more
source§

fn after_handle_call<C: Context>( + _ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

Perform any action after call, within the transaction context. Read more
source§

fn after_dispatch_tx<C: Context>( + _ctx: &C, + _tx_auth_info: &AuthInfo, + _result: &CallResult, +)

Perform any action after dispatching the transaction, in batch context.

Auto Trait Implementations§

§

impl<Cfg> Freeze for Module<Cfg>

§

impl<Cfg> RefUnwindSafe for Module<Cfg>
where + Cfg: RefUnwindSafe,

§

impl<Cfg> Send for Module<Cfg>
where + Cfg: Send,

§

impl<Cfg> Sync for Module<Cfg>
where + Cfg: Sync,

§

impl<Cfg> Unpin for Module<Cfg>
where + Cfg: Unpin,

§

impl<Cfg> UnwindSafe for Module<Cfg>
where + Cfg: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<M> ModuleInfoHandler for M
where + M: Module + MethodHandler,

source§

fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>
where + C: Context,

Reports info about the module (or modules, if Self is a tuple).
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/trait.Config.html b/rust/oasis_runtime_sdk/modules/access/trait.Config.html new file mode 100644 index 0000000000..32ae181c15 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/trait.Config.html @@ -0,0 +1,6 @@ +Config in oasis_runtime_sdk::modules::access - Rust

Trait oasis_runtime_sdk::modules::access::Config

source ·
pub trait Config: 'static {
+    const METHOD_AUTHORIZATIONS: Lazy<Authorization> = _;
+}
Expand description

Module configuration.

+

Provided Associated Constants§

source

const METHOD_AUTHORIZATIONS: Lazy<Authorization> = _

To filter methods by caller address, add them to this mapping.

+

If the mapping is empty, no method is filtered.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/types/enum.Authorization.html b/rust/oasis_runtime_sdk/modules/access/types/enum.Authorization.html new file mode 100644 index 0000000000..31c48d334b --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/types/enum.Authorization.html @@ -0,0 +1,29 @@ +Authorization in oasis_runtime_sdk::modules::access::types - Rust

Enum oasis_runtime_sdk::modules::access::types::Authorization

source ·
pub enum Authorization {
+    FilterOnly(Methods),
+}
Expand description

A specific kind of access control.

+

Variants§

§

FilterOnly(Methods)

Control a statically configured set of methods, each with a +statically configured set of addresses that are allowed to call it.

+

Implementations§

source§

impl Authorization

source

pub fn new() -> Self

Return a new access control configuration.

+
source

pub fn with_filtered_methods<S, I>(it: I) -> Self
where + S: AsRef<str>, + I: IntoIterator<Item = (S, MethodAuthorization)>,

Helper for creating a static access control configuration.

+

Trait Implementations§

source§

impl Default for Authorization

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/types/enum.MethodAuthorization.html b/rust/oasis_runtime_sdk/modules/access/types/enum.MethodAuthorization.html new file mode 100644 index 0000000000..5893ce9a09 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/types/enum.MethodAuthorization.html @@ -0,0 +1,27 @@ +MethodAuthorization in oasis_runtime_sdk::modules::access::types - Rust
pub enum MethodAuthorization {
+    AllowFrom(Addresses),
+}
Expand description

A specific kind of method authorization.

+

Variants§

§

AllowFrom(Addresses)

Only allow method calls from these addresses; +for other callers, the method call will fail.

+

Implementations§

source§

impl MethodAuthorization

source

pub fn allow_from<I: IntoIterator<Item = Address>>(it: I) -> Self

Helper for creating a method authorization type that +only allows callers with the given addresses.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/types/index.html b/rust/oasis_runtime_sdk/modules/access/types/index.html new file mode 100644 index 0000000000..587ec454c2 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/types/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::access::types - Rust

Module oasis_runtime_sdk::modules::access::types

source ·
Expand description

Method access control module types.

+

Enums§

Type Aliases§

  • A set of addresses that can be used to define access control for a particular method.
  • A set of methods that are subject to access control.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/types/sidebar-items.js b/rust/oasis_runtime_sdk/modules/access/types/sidebar-items.js new file mode 100644 index 0000000000..f443fe9698 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Authorization","MethodAuthorization"],"type":["Addresses","Methods"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/types/type.Addresses.html b/rust/oasis_runtime_sdk/modules/access/types/type.Addresses.html new file mode 100644 index 0000000000..4fea5ef7f5 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/types/type.Addresses.html @@ -0,0 +1,2 @@ +Addresses in oasis_runtime_sdk::modules::access::types - Rust

Type Alias oasis_runtime_sdk::modules::access::types::Addresses

source ·
pub type Addresses = BTreeSet<Address>;
Expand description

A set of addresses that can be used to define access control for a particular method.

+

Aliased Type§

struct Addresses { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/access/types/type.Methods.html b/rust/oasis_runtime_sdk/modules/access/types/type.Methods.html new file mode 100644 index 0000000000..01ebfb1529 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/access/types/type.Methods.html @@ -0,0 +1,2 @@ +Methods in oasis_runtime_sdk::modules::access::types - Rust

Type Alias oasis_runtime_sdk::modules::access::types::Methods

source ·
pub type Methods = BTreeMap<String, MethodAuthorization>;
Expand description

A set of methods that are subject to access control.

+

Aliased Type§

struct Methods { /* private fields */ }
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/enum.Error.html b/rust/oasis_runtime_sdk/modules/accounts/enum.Error.html new file mode 100644 index 0000000000..741b03dc7c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/enum.Error.html @@ -0,0 +1,30 @@ +Error in oasis_runtime_sdk::modules::accounts - Rust

Enum oasis_runtime_sdk::modules::accounts::Error

source ·
pub enum Error {
+    InvalidArgument,
+    InsufficientBalance,
+    Forbidden,
+    NotFound,
+    Core(Error),
+}
Expand description

Errors emitted by the accounts module.

+

Variants§

§

InvalidArgument

§

InsufficientBalance

§

Forbidden

§

NotFound

§

Core(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/enum.Event.html b/rust/oasis_runtime_sdk/modules/accounts/enum.Event.html new file mode 100644 index 0000000000..3b1a66b8c2 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/enum.Event.html @@ -0,0 +1,35 @@ +Event in oasis_runtime_sdk::modules::accounts - Rust

Enum oasis_runtime_sdk::modules::accounts::Event

source ·
pub enum Event {
+    Transfer {
+        from: Address,
+        to: Address,
+        amount: BaseUnits,
+    },
+    Burn {
+        owner: Address,
+        amount: BaseUnits,
+    },
+    Mint {
+        owner: Address,
+        amount: BaseUnits,
+    },
+}
Expand description

Events emitted by the accounts module.

+

Variants§

§

Transfer

Fields

§from: Address
§amount: BaseUnits
§

Burn

Fields

§owner: Address
§amount: BaseUnits
§

Mint

Fields

§owner: Address
§amount: BaseUnits

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Event for Event

source§

fn module_name() -> &'static str

Name of the module that emitted the event.
source§

fn code(&self) -> u32

Code uniquely identifying the event.
source§

fn into_event_tag(self) -> EventTag

Converts an event into an event tag. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/enum.ParameterValidationError.html b/rust/oasis_runtime_sdk/modules/accounts/enum.ParameterValidationError.html new file mode 100644 index 0000000000..711a5375e6 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/enum.ParameterValidationError.html @@ -0,0 +1,24 @@ +ParameterValidationError in oasis_runtime_sdk::modules::accounts - Rust
pub enum ParameterValidationError {
+    DebugOptionUsed(String),
+}
Expand description

Errors emitted during rewards parameter validation.

+

Variants§

§

DebugOptionUsed(String)

Trait Implementations§

source§

impl Debug for ParameterValidationError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ParameterValidationError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ParameterValidationError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/fee/index.html b/rust/oasis_runtime_sdk/modules/accounts/fee/index.html new file mode 100644 index 0000000000..e209b05ee0 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/fee/index.html @@ -0,0 +1,3 @@ +oasis_runtime_sdk::modules::accounts::fee - Rust

Module oasis_runtime_sdk::modules::accounts::fee

source ·
Expand description

Fee manager.

+

Structs§

  • The per-block fee manager that records what fees have been charged by the current transaction, +how much should be refunded and what were all of the fee payments in the current block.
  • Fee updates to apply to state after commit_tx.
  • Information about fees charged for the current transaction.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/fee/sidebar-items.js b/rust/oasis_runtime_sdk/modules/accounts/fee/sidebar-items.js new file mode 100644 index 0000000000..aab93206d4 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/fee/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["FeeManager","FeeUpdates","TransactionFee"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/fee/struct.FeeManager.html b/rust/oasis_runtime_sdk/modules/accounts/fee/struct.FeeManager.html new file mode 100644 index 0000000000..be8c54c2c8 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/fee/struct.FeeManager.html @@ -0,0 +1,38 @@ +FeeManager in oasis_runtime_sdk::modules::accounts::fee - Rust

Struct oasis_runtime_sdk::modules::accounts::fee::FeeManager

source ·
pub struct FeeManager { /* private fields */ }
Expand description

The per-block fee manager that records what fees have been charged by the current transaction, +how much should be refunded and what were all of the fee payments in the current block.

+

Note that the fee manager does not perform any state modifications by itself.

+

Implementations§

source§

impl FeeManager

source

pub fn new() -> Self

Create a new per-block fee manager.

+
source

pub fn tx_fee(&self) -> Option<&TransactionFee>

Fees charged for the current transaction.

+
source

pub fn record_fee(&mut self, payer: Address, amount: &BaseUnits)

Record that a transaction fee has been charged.

+

This method should only be called after the charged fee has been subtracted from the payer’s +account (e.g. reflected in state).

+
source

pub fn record_refund(&mut self, amount: u128)

Record that a portion of the previously charged transaction fee should be refunded.

+
source

pub fn commit_tx(&mut self) -> FeeUpdates

Commit the currently open transaction fee by moving the final recorded amount into the fees +charged for the current block.

+

Note that this does not perform any state modifications and the caller is assumed to apply +any updates after calling this method.

+
source

pub fn commit_block(self) -> BTreeMap<Denomination, u128>

Commit the fees accumulated for the current block, returning the resulting map.

+

Note that this does not perform any state modifications and the caller is assumed to apply +any updates after calling this method.

+

Trait Implementations§

source§

impl Clone for FeeManager

source§

fn clone(&self) -> FeeManager

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FeeManager

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for FeeManager

source§

fn default() -> FeeManager

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/fee/struct.FeeUpdates.html b/rust/oasis_runtime_sdk/modules/accounts/fee/struct.FeeUpdates.html new file mode 100644 index 0000000000..d013cb99e6 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/fee/struct.FeeUpdates.html @@ -0,0 +1,28 @@ +FeeUpdates in oasis_runtime_sdk::modules::accounts::fee - Rust

Struct oasis_runtime_sdk::modules::accounts::fee::FeeUpdates

source ·
pub struct FeeUpdates {
+    pub payer: Address,
+    pub refund: BaseUnits,
+}
Expand description

Fee updates to apply to state after commit_tx.

+

This assumes that the initial fee charge has already happened, see the description of +FeeManager::record_fee for details.

+

Fields§

§payer: Address

Fee payer.

+
§refund: BaseUnits

Amount that should be refunded to fee payer.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/fee/struct.TransactionFee.html b/rust/oasis_runtime_sdk/modules/accounts/fee/struct.TransactionFee.html new file mode 100644 index 0000000000..e3680f7d80 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/fee/struct.TransactionFee.html @@ -0,0 +1,26 @@ +TransactionFee in oasis_runtime_sdk::modules::accounts::fee - Rust

Struct oasis_runtime_sdk::modules::accounts::fee::TransactionFee

source ·
pub struct TransactionFee { /* private fields */ }
Expand description

Information about fees charged for the current transaction.

+

Implementations§

source§

impl TransactionFee

source

pub fn denomination(&self) -> Denomination

Denomination of the transaction fee.

+
source

pub fn amount(&self) -> u128

Transaction fee amount.

+
source

pub fn payer(&self) -> Address

Transaction fee payer address.

+

Trait Implementations§

source§

impl Clone for TransactionFee

source§

fn clone(&self) -> TransactionFee

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TransactionFee

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TransactionFee

source§

fn default() -> TransactionFee

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/index.html b/rust/oasis_runtime_sdk/modules/accounts/index.html new file mode 100644 index 0000000000..f62435a812 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::accounts - Rust

Module oasis_runtime_sdk::modules::accounts

source ·
Expand description

Accounts module.

+

Modules§

  • Fee manager.
  • State schema constants.
  • Account module types.

Structs§

Enums§

Statics§

Traits§

  • Interface that can be called from other modules.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/sidebar-items.js b/rust/oasis_runtime_sdk/modules/accounts/sidebar-items.js new file mode 100644 index 0000000000..1d675d545b --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","Event","ParameterValidationError"],"mod":["fee","state","types"],"static":["ADDRESS_COMMON_POOL","ADDRESS_FEE_ACCUMULATOR"],"struct":["GasCosts","Genesis","Module","Parameters"],"trait":["API"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/state/constant.ACCOUNTS.html b/rust/oasis_runtime_sdk/modules/accounts/state/constant.ACCOUNTS.html new file mode 100644 index 0000000000..db25ca52a3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/state/constant.ACCOUNTS.html @@ -0,0 +1,2 @@ +ACCOUNTS in oasis_runtime_sdk::modules::accounts::state - Rust

Constant oasis_runtime_sdk::modules::accounts::state::ACCOUNTS

source ·
pub const ACCOUNTS: &[u8];
Expand description

Map of account addresses to account metadata.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/state/constant.BALANCES.html b/rust/oasis_runtime_sdk/modules/accounts/state/constant.BALANCES.html new file mode 100644 index 0000000000..248fb0a45d --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/state/constant.BALANCES.html @@ -0,0 +1,2 @@ +BALANCES in oasis_runtime_sdk::modules::accounts::state - Rust

Constant oasis_runtime_sdk::modules::accounts::state::BALANCES

source ·
pub const BALANCES: &[u8];
Expand description

Map of account addresses to map of denominations to balances.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/state/constant.TOTAL_SUPPLY.html b/rust/oasis_runtime_sdk/modules/accounts/state/constant.TOTAL_SUPPLY.html new file mode 100644 index 0000000000..80b12f2c7e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/state/constant.TOTAL_SUPPLY.html @@ -0,0 +1,2 @@ +TOTAL_SUPPLY in oasis_runtime_sdk::modules::accounts::state - Rust

Constant oasis_runtime_sdk::modules::accounts::state::TOTAL_SUPPLY

source ·
pub const TOTAL_SUPPLY: &[u8];
Expand description

Map of total supplies (per denomination).

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/state/index.html b/rust/oasis_runtime_sdk/modules/accounts/state/index.html new file mode 100644 index 0000000000..8ba3a5fce6 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/state/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::accounts::state - Rust

Module oasis_runtime_sdk::modules::accounts::state

source ·
Expand description

State schema constants.

+

Constants§

  • Map of account addresses to account metadata.
  • Map of account addresses to map of denominations to balances.
  • Map of total supplies (per denomination).
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/state/sidebar-items.js b/rust/oasis_runtime_sdk/modules/accounts/state/sidebar-items.js new file mode 100644 index 0000000000..f06a7e6c5d --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/state/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["ACCOUNTS","BALANCES","TOTAL_SUPPLY"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/static.ADDRESS_COMMON_POOL.html b/rust/oasis_runtime_sdk/modules/accounts/static.ADDRESS_COMMON_POOL.html new file mode 100644 index 0000000000..f084d15f94 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/static.ADDRESS_COMMON_POOL.html @@ -0,0 +1,3 @@ +ADDRESS_COMMON_POOL in oasis_runtime_sdk::modules::accounts - Rust
pub static ADDRESS_COMMON_POOL: Lazy<Address>
Expand description

Module’s address that has the common pool.

+

oasis1qz78phkdan64g040cvqvqpwkplfqf6tj6uwcsh30

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/static.ADDRESS_FEE_ACCUMULATOR.html b/rust/oasis_runtime_sdk/modules/accounts/static.ADDRESS_FEE_ACCUMULATOR.html new file mode 100644 index 0000000000..90cc3c49e4 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/static.ADDRESS_FEE_ACCUMULATOR.html @@ -0,0 +1,3 @@ +ADDRESS_FEE_ACCUMULATOR in oasis_runtime_sdk::modules::accounts - Rust
pub static ADDRESS_FEE_ACCUMULATOR: Lazy<Address>
Expand description

Module’s address that has the fee accumulator.

+

oasis1qp3r8hgsnphajmfzfuaa8fhjag7e0yt35cjxq0u4

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/struct.GasCosts.html b/rust/oasis_runtime_sdk/modules/accounts/struct.GasCosts.html new file mode 100644 index 0000000000..14d0fbcbc6 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/struct.GasCosts.html @@ -0,0 +1,29 @@ +GasCosts in oasis_runtime_sdk::modules::accounts - Rust

Struct oasis_runtime_sdk::modules::accounts::GasCosts

source ·
pub struct GasCosts {
+    pub tx_transfer: u64,
+}
Expand description

Gas costs.

+

Fields§

§tx_transfer: u64

Trait Implementations§

source§

impl Clone for GasCosts

source§

fn clone(&self) -> GasCosts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GasCosts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GasCosts

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for GasCosts

source§

fn default() -> GasCosts

Returns the “default value” for a type. Read more
source§

impl Encode for GasCosts

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GasCosts

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/struct.Genesis.html b/rust/oasis_runtime_sdk/modules/accounts/struct.Genesis.html new file mode 100644 index 0000000000..7899fc64c3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/struct.Genesis.html @@ -0,0 +1,32 @@ +Genesis in oasis_runtime_sdk::modules::accounts - Rust

Struct oasis_runtime_sdk::modules::accounts::Genesis

source ·
pub struct Genesis {
+    pub parameters: Parameters,
+    pub accounts: BTreeMap<Address, Account>,
+    pub balances: BTreeMap<Address, BTreeMap<Denomination, u128>>,
+    pub total_supplies: BTreeMap<Denomination, u128>,
+}
Expand description

Genesis state for the accounts module.

+

Fields§

§parameters: Parameters§accounts: BTreeMap<Address, Account>§balances: BTreeMap<Address, BTreeMap<Denomination, u128>>§total_supplies: BTreeMap<Denomination, u128>

Trait Implementations§

source§

impl Clone for Genesis

source§

fn clone(&self) -> Genesis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Genesis

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Genesis

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Genesis

source§

fn default() -> Genesis

Returns the “default value” for a type. Read more
source§

impl Encode for Genesis

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Genesis

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/struct.Module.html b/rust/oasis_runtime_sdk/modules/accounts/struct.Module.html new file mode 100644 index 0000000000..97dbb0c422 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/struct.Module.html @@ -0,0 +1,90 @@ +Module in oasis_runtime_sdk::modules::accounts - Rust

Struct oasis_runtime_sdk::modules::accounts::Module

source ·
pub struct Module;

Implementations§

source§

impl Module

source

pub fn init(genesis: Genesis)

Trait Implementations§

source§

impl API for Module

source§

fn transfer(from: Address, to: Address, amount: &BaseUnits) -> Result<(), Error>

Transfer an amount from one account to the other.
source§

fn transfer_silent( + from: Address, + to: Address, + amount: &BaseUnits, +) -> Result<(), Error>

Transfer an amount from one account to the other without emitting an event.
source§

fn mint(to: Address, amount: &BaseUnits) -> Result<(), Error>

Mint new tokens, increasing the total supply.
source§

fn burn(from: Address, amount: &BaseUnits) -> Result<(), Error>

Burn existing tokens, decreasing the total supply.
source§

fn set_nonce(address: Address, nonce: u64)

Sets an account’s nonce.
source§

fn get_nonce(address: Address) -> Result<u64, Error>

Fetch an account’s current nonce.
source§

fn inc_nonce(address: Address)

Increments an account’s nonce.
source§

fn set_balance(address: Address, amount: &BaseUnits)

Sets an account’s balance of the given denomination. Read more
source§

fn get_balance( + address: Address, + denomination: Denomination, +) -> Result<u128, Error>

Fetch an account’s balance of the given denomination.
source§

fn get_balances(address: Address) -> Result<AccountBalances, Error>

Fetch an account’s current balances.
source§

fn get_addresses(denomination: Denomination) -> Result<Vec<Address>, Error>

Fetch addresses.
source§

fn get_total_supplies() -> Result<BTreeMap<Denomination, u128>, Error>

Fetch total supplies.
source§

fn set_total_supply(amount: &BaseUnits)

Sets the total supply for the given denomination. Read more
source§

fn get_denomination_info( + denomination: &Denomination, +) -> Result<DenominationInfo, Error>

Fetch information about a denomination.
source§

fn charge_tx_fee(from: Address, amount: &BaseUnits) -> Result<(), Error>

Moves the amount into the per-transaction fee accumulator.
source§

fn set_refund_unused_tx_fee(refund: bool)

Indicates that the unused portion of the transaction fee should be refunded after the +transaction completes (even in case it fails).
source§

fn take_refund_unused_tx_fee() -> bool

Take the flag indicating that the unused portion of the transaction fee should be refunded +after the transaction completes is set. Read more
source§

fn check_signer_nonces<C: Context>( + _ctx: &C, + auth_info: &AuthInfo, +) -> Result<Address, Error>

Check transaction signer account nonces. +Return payer address.
source§

fn update_signer_nonces<C: Context>( + _ctx: &C, + auth_info: &AuthInfo, +) -> Result<(), Error>

Update transaction signer account nonces.
source§

fn ensure_balance(address: Address, amount: &BaseUnits) -> Result<(), Error>

Ensures that the given account has at least the specified balance.
source§

impl BlockHandler for Module

source§

fn end_block<C: Context>(ctx: &C)

Perform any common actions at the end of the block (after all transactions have been +executed).
source§

fn begin_block<C: Context>(_ctx: &C)

Perform any common actions at the start of the block (before any transactions have been +executed).
source§

impl InvariantHandler for Module

source§

fn check_invariants<C: Context>(_ctx: &C) -> Result<(), CoreError>

Check invariants.

+
source§

impl MethodHandler for Module

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

Add storage prefixes to prefetch.
source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.
source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.
source§

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.
source§

fn is_expensive_query(method: &str) -> bool

Checks whether the given query method is tagged as expensive.
source§

fn dispatch_message_result<C: Context>( + _ctx: &C, + _handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

Dispatch a message result.
source§

fn is_allowed_private_km_query(_method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.
source§

fn is_allowed_interactive_call(_method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.
source§

impl MigrationHandler for Module

§

type Genesis = Genesis

Genesis state type. Read more
source§

fn init_or_migrate<C: Context>( + _ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration. Read more
source§

impl Module for Module

source§

const NAME: &'static str = MODULE_NAME

Module name.
§

type Error = Error

Module error type.
§

type Event = Event

Module event type.
§

type Parameters = Parameters

Module parameters.
source§

const VERSION: u32 = 1u32

Module version.
source§

fn params() -> Self::Parameters

Return the module’s parameters.
source§

fn set_params(params: Self::Parameters)

Set the module’s parameters.
source§

impl TransactionHandler for Module

source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

Authenticate a transaction. Read more
source§

fn after_handle_call<C: Context>( + _ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

Perform any action after call, within the transaction context. Read more
source§

fn after_dispatch_tx<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + result: &CallResult, +)

Perform any action after dispatching the transaction, in batch context.
source§

fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.
source§

fn approve_unverified_tx<C: Context>( + _ctx: &C, + _utx: &UnverifiedTransaction, +) -> Result<(), Error>

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.
source§

fn decode_tx<C: Context>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>

Decode a transaction that was sent with module-controlled decoding and verify any +signatures. Read more
source§

fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>

Perform any action after authentication, within the transaction context. Read more
source§

fn before_authorized_call_dispatch<C: Context>( + _ctx: &C, + _call: &Call, +) -> Result<(), Error>

Perform any action after authentication and decoding, within the transaction context. Read more

Auto Trait Implementations§

§

impl Freeze for Module

§

impl RefUnwindSafe for Module

§

impl Send for Module

§

impl Sync for Module

§

impl Unpin for Module

§

impl UnwindSafe for Module

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<M> ModuleInfoHandler for M
where + M: Module + MethodHandler,

source§

fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>
where + C: Context,

Reports info about the module (or modules, if Self is a tuple).
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/struct.Parameters.html b/rust/oasis_runtime_sdk/modules/accounts/struct.Parameters.html new file mode 100644 index 0000000000..73048d32cc --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/struct.Parameters.html @@ -0,0 +1,32 @@ +Parameters in oasis_runtime_sdk::modules::accounts - Rust

Struct oasis_runtime_sdk::modules::accounts::Parameters

source ·
pub struct Parameters {
+    pub transfers_disabled: bool,
+    pub gas_costs: GasCosts,
+    pub debug_disable_nonce_check: bool,
+    pub denomination_infos: BTreeMap<Denomination, DenominationInfo>,
+}
Expand description

Parameters for the accounts module.

+

Fields§

§transfers_disabled: bool§gas_costs: GasCosts§debug_disable_nonce_check: bool§denomination_infos: BTreeMap<Denomination, DenominationInfo>

Trait Implementations§

source§

impl Clone for Parameters

source§

fn clone(&self) -> Parameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Parameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Parameters

source§

fn default() -> Parameters

Returns the “default value” for a type. Read more
source§

impl Encode for Parameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Parameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Parameters for Parameters

§

type Error = ParameterValidationError

source§

fn validate_basic(&self) -> Result<(), Self::Error>

Perform basic parameter validation.
source§

const STORE_KEY: &'static [u8] = _

Store key used for storing parameters.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/trait.API.html b/rust/oasis_runtime_sdk/modules/accounts/trait.API.html new file mode 100644 index 0000000000..032951dfe9 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/trait.API.html @@ -0,0 +1,88 @@ +API in oasis_runtime_sdk::modules::accounts - Rust

Trait oasis_runtime_sdk::modules::accounts::API

source ·
pub trait API {
+
Show 20 methods // Required methods + fn transfer( + from: Address, + to: Address, + amount: &BaseUnits, + ) -> Result<(), Error>; + fn transfer_silent( + from: Address, + to: Address, + amount: &BaseUnits, + ) -> Result<(), Error>; + fn mint(to: Address, amount: &BaseUnits) -> Result<(), Error>; + fn burn(from: Address, amount: &BaseUnits) -> Result<(), Error>; + fn set_nonce(address: Address, nonce: u64); + fn get_nonce(address: Address) -> Result<u64, Error>; + fn inc_nonce(address: Address); + fn set_balance(address: Address, amount: &BaseUnits); + fn get_balance( + address: Address, + denomination: Denomination, + ) -> Result<u128, Error>; + fn get_balances(address: Address) -> Result<AccountBalances, Error>; + fn get_addresses(denomination: Denomination) -> Result<Vec<Address>, Error>; + fn get_total_supplies() -> Result<BTreeMap<Denomination, u128>, Error>; + fn set_total_supply(amount: &BaseUnits); + fn get_denomination_info( + denomination: &Denomination, + ) -> Result<DenominationInfo, Error>; + fn charge_tx_fee(from: Address, amount: &BaseUnits) -> Result<(), Error>; + fn set_refund_unused_tx_fee(refund: bool); + fn take_refund_unused_tx_fee() -> bool; + fn check_signer_nonces<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + ) -> Result<Address, Error>; + fn update_signer_nonces<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, + ) -> Result<(), Error>; + + // Provided method + fn ensure_balance(address: Address, amount: &BaseUnits) -> Result<(), Error> { ... } +
}
Expand description

Interface that can be called from other modules.

+

Required Methods§

source

fn transfer(from: Address, to: Address, amount: &BaseUnits) -> Result<(), Error>

Transfer an amount from one account to the other.

+
source

fn transfer_silent( + from: Address, + to: Address, + amount: &BaseUnits, +) -> Result<(), Error>

Transfer an amount from one account to the other without emitting an event.

+
source

fn mint(to: Address, amount: &BaseUnits) -> Result<(), Error>

Mint new tokens, increasing the total supply.

+
source

fn burn(from: Address, amount: &BaseUnits) -> Result<(), Error>

Burn existing tokens, decreasing the total supply.

+
source

fn set_nonce(address: Address, nonce: u64)

Sets an account’s nonce.

+
source

fn get_nonce(address: Address) -> Result<u64, Error>

Fetch an account’s current nonce.

+
source

fn inc_nonce(address: Address)

Increments an account’s nonce.

+
source

fn set_balance(address: Address, amount: &BaseUnits)

Sets an account’s balance of the given denomination.

+
§Warning
+

This method is dangerous as it can result in invariant violations.

+
source

fn get_balance( + address: Address, + denomination: Denomination, +) -> Result<u128, Error>

Fetch an account’s balance of the given denomination.

+
source

fn get_balances(address: Address) -> Result<AccountBalances, Error>

Fetch an account’s current balances.

+
source

fn get_addresses(denomination: Denomination) -> Result<Vec<Address>, Error>

Fetch addresses.

+
source

fn get_total_supplies() -> Result<BTreeMap<Denomination, u128>, Error>

Fetch total supplies.

+
source

fn set_total_supply(amount: &BaseUnits)

Sets the total supply for the given denomination.

+
§Warning
+

This method is dangerous as it can result in invariant violations.

+
source

fn get_denomination_info( + denomination: &Denomination, +) -> Result<DenominationInfo, Error>

Fetch information about a denomination.

+
source

fn charge_tx_fee(from: Address, amount: &BaseUnits) -> Result<(), Error>

Moves the amount into the per-transaction fee accumulator.

+
source

fn set_refund_unused_tx_fee(refund: bool)

Indicates that the unused portion of the transaction fee should be refunded after the +transaction completes (even in case it fails).

+
source

fn take_refund_unused_tx_fee() -> bool

Take the flag indicating that the unused portion of the transaction fee should be refunded +after the transaction completes is set.

+

After calling this method the flag is reset to false.

+
source

fn check_signer_nonces<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, +) -> Result<Address, Error>

Check transaction signer account nonces. +Return payer address.

+
source

fn update_signer_nonces<C: Context>( + ctx: &C, + tx_auth_info: &AuthInfo, +) -> Result<(), Error>

Update transaction signer account nonces.

+

Provided Methods§

source

fn ensure_balance(address: Address, amount: &BaseUnits) -> Result<(), Error>

Ensures that the given account has at least the specified balance.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/index.html b/rust/oasis_runtime_sdk/modules/accounts/types/index.html new file mode 100644 index 0000000000..03fa63ff01 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::accounts::types - Rust

Module oasis_runtime_sdk::modules::accounts::types

source ·
Expand description

Account module types.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/sidebar-items.js b/rust/oasis_runtime_sdk/modules/accounts/types/sidebar-items.js new file mode 100644 index 0000000000..8e20a04581 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Account","AccountBalances","AddressesQuery","BalancesQuery","DenominationInfo","DenominationInfoQuery","NonceQuery","Transfer"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/struct.Account.html b/rust/oasis_runtime_sdk/modules/accounts/types/struct.Account.html new file mode 100644 index 0000000000..fe7ad30717 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/struct.Account.html @@ -0,0 +1,29 @@ +Account in oasis_runtime_sdk::modules::accounts::types - Rust

Struct oasis_runtime_sdk::modules::accounts::types::Account

source ·
pub struct Account {
+    pub nonce: u64,
+}
Expand description

Account metadata.

+

Fields§

§nonce: u64

Trait Implementations§

source§

impl Clone for Account

source§

fn clone(&self) -> Account

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Account

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Account

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Account

source§

fn default() -> Account

Returns the “default value” for a type. Read more
source§

impl Encode for Account

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Account

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/struct.AccountBalances.html b/rust/oasis_runtime_sdk/modules/accounts/types/struct.AccountBalances.html new file mode 100644 index 0000000000..2c00d93a49 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/struct.AccountBalances.html @@ -0,0 +1,29 @@ +AccountBalances in oasis_runtime_sdk::modules::accounts::types - Rust
pub struct AccountBalances {
+    pub balances: BTreeMap<Denomination, u128>,
+}
Expand description

Balances in an account.

+

Fields§

§balances: BTreeMap<Denomination, u128>

Trait Implementations§

source§

impl Clone for AccountBalances

source§

fn clone(&self) -> AccountBalances

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AccountBalances

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AccountBalances

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AccountBalances

source§

fn default() -> AccountBalances

Returns the “default value” for a type. Read more
source§

impl Encode for AccountBalances

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AccountBalances

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/struct.AddressesQuery.html b/rust/oasis_runtime_sdk/modules/accounts/types/struct.AddressesQuery.html new file mode 100644 index 0000000000..fa99a19206 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/struct.AddressesQuery.html @@ -0,0 +1,29 @@ +AddressesQuery in oasis_runtime_sdk::modules::accounts::types - Rust

Struct oasis_runtime_sdk::modules::accounts::types::AddressesQuery

source ·
pub struct AddressesQuery {
+    pub denomination: Denomination,
+}
Expand description

Arguments for the Addresses query.

+

Fields§

§denomination: Denomination

Trait Implementations§

source§

impl Clone for AddressesQuery

source§

fn clone(&self) -> AddressesQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddressesQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AddressesQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AddressesQuery

source§

fn default() -> AddressesQuery

Returns the “default value” for a type. Read more
source§

impl Encode for AddressesQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AddressesQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/struct.BalancesQuery.html b/rust/oasis_runtime_sdk/modules/accounts/types/struct.BalancesQuery.html new file mode 100644 index 0000000000..6bd22af752 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/struct.BalancesQuery.html @@ -0,0 +1,29 @@ +BalancesQuery in oasis_runtime_sdk::modules::accounts::types - Rust

Struct oasis_runtime_sdk::modules::accounts::types::BalancesQuery

source ·
pub struct BalancesQuery {
+    pub address: Address,
+}
Expand description

Arguments for the Balances query.

+

Fields§

§address: Address

Trait Implementations§

source§

impl Clone for BalancesQuery

source§

fn clone(&self) -> BalancesQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BalancesQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for BalancesQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for BalancesQuery

source§

fn default() -> BalancesQuery

Returns the “default value” for a type. Read more
source§

impl Encode for BalancesQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for BalancesQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/struct.DenominationInfo.html b/rust/oasis_runtime_sdk/modules/accounts/types/struct.DenominationInfo.html new file mode 100644 index 0000000000..afdf4a2c4d --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/struct.DenominationInfo.html @@ -0,0 +1,30 @@ +DenominationInfo in oasis_runtime_sdk::modules::accounts::types - Rust
pub struct DenominationInfo {
+    pub decimals: u8,
+}
Expand description

Information about a denomination.

+

Fields§

§decimals: u8

Number of decimals that the denomination is using.

+

Trait Implementations§

source§

impl Clone for DenominationInfo

source§

fn clone(&self) -> DenominationInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DenominationInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for DenominationInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for DenominationInfo

source§

fn default() -> DenominationInfo

Returns the “default value” for a type. Read more
source§

impl Encode for DenominationInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for DenominationInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/struct.DenominationInfoQuery.html b/rust/oasis_runtime_sdk/modules/accounts/types/struct.DenominationInfoQuery.html new file mode 100644 index 0000000000..00cc4cf825 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/struct.DenominationInfoQuery.html @@ -0,0 +1,29 @@ +DenominationInfoQuery in oasis_runtime_sdk::modules::accounts::types - Rust
pub struct DenominationInfoQuery {
+    pub denomination: Denomination,
+}
Expand description

Arguments for the DenominationInfo query.

+

Fields§

§denomination: Denomination

Trait Implementations§

source§

impl Clone for DenominationInfoQuery

source§

fn clone(&self) -> DenominationInfoQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DenominationInfoQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for DenominationInfoQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for DenominationInfoQuery

source§

fn default() -> DenominationInfoQuery

Returns the “default value” for a type. Read more
source§

impl Encode for DenominationInfoQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for DenominationInfoQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/struct.NonceQuery.html b/rust/oasis_runtime_sdk/modules/accounts/types/struct.NonceQuery.html new file mode 100644 index 0000000000..5a188a16f9 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/struct.NonceQuery.html @@ -0,0 +1,29 @@ +NonceQuery in oasis_runtime_sdk::modules::accounts::types - Rust

Struct oasis_runtime_sdk::modules::accounts::types::NonceQuery

source ·
pub struct NonceQuery {
+    pub address: Address,
+}
Expand description

Arguments for the Nonce query.

+

Fields§

§address: Address

Trait Implementations§

source§

impl Clone for NonceQuery

source§

fn clone(&self) -> NonceQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NonceQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for NonceQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for NonceQuery

source§

fn default() -> NonceQuery

Returns the “default value” for a type. Read more
source§

impl Encode for NonceQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for NonceQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/accounts/types/struct.Transfer.html b/rust/oasis_runtime_sdk/modules/accounts/types/struct.Transfer.html new file mode 100644 index 0000000000..ad4b63a4e9 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/accounts/types/struct.Transfer.html @@ -0,0 +1,30 @@ +Transfer in oasis_runtime_sdk::modules::accounts::types - Rust

Struct oasis_runtime_sdk::modules::accounts::types::Transfer

source ·
pub struct Transfer {
+    pub to: Address,
+    pub amount: BaseUnits,
+}
Expand description

Transfer call.

+

Fields§

§to: Address§amount: BaseUnits

Trait Implementations§

source§

impl Clone for Transfer

source§

fn clone(&self) -> Transfer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Transfer

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Transfer

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Transfer

source§

fn default() -> Transfer

Returns the “default value” for a type. Read more
source§

impl Encode for Transfer

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Transfer

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/enum.Error.html b/rust/oasis_runtime_sdk/modules/consensus/enum.Error.html new file mode 100644 index 0000000000..072c6cd428 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/enum.Error.html @@ -0,0 +1,32 @@ +Error in oasis_runtime_sdk::modules::consensus - Rust

Enum oasis_runtime_sdk::modules::consensus::Error

source ·
pub enum Error {
+    InvalidArgument,
+    InvalidDenomination,
+    InternalStateError(StateError),
+    Core(Error),
+    ConsensusIncompatibleSigner,
+    AmountNotRepresentable,
+    UnderMinDelegationAmount,
+    History(Error),
+}

Variants§

§

InvalidArgument

§

InvalidDenomination

§

InternalStateError(StateError)

§

Core(Error)

§

ConsensusIncompatibleSigner

§

AmountNotRepresentable

§

UnderMinDelegationAmount

§

History(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<StateError> for Error

source§

fn from(source: StateError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/enum.Event.html b/rust/oasis_runtime_sdk/modules/consensus/enum.Event.html new file mode 100644 index 0000000000..007788be15 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/enum.Event.html @@ -0,0 +1,21 @@ +Event in oasis_runtime_sdk::modules::consensus - Rust

Enum oasis_runtime_sdk::modules::consensus::Event

source ·
pub enum Event {}
Expand description

Events emitted by the consensus module (none so far).

+

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Event for Event

source§

fn module_name() -> &'static str

Name of the module that emitted the event.
source§

fn code(&self) -> u32

Code uniquely identifying the event.
source§

fn into_event_tag(self) -> EventTag

Converts an event into an event tag. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/enum.ParameterValidationError.html b/rust/oasis_runtime_sdk/modules/consensus/enum.ParameterValidationError.html new file mode 100644 index 0000000000..2189e36b19 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/enum.ParameterValidationError.html @@ -0,0 +1,25 @@ +ParameterValidationError in oasis_runtime_sdk::modules::consensus - Rust
pub enum ParameterValidationError {
+    ZeroScalingFactor,
+    ScalingFactorNotPowerOf10,
+}
Expand description

Errors emitted during rewards parameter validation.

+

Variants§

§

ZeroScalingFactor

§

ScalingFactorNotPowerOf10

Trait Implementations§

source§

impl Debug for ParameterValidationError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ParameterValidationError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ParameterValidationError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/index.html b/rust/oasis_runtime_sdk/modules/consensus/index.html new file mode 100644 index 0000000000..5d163b2ca9 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/index.html @@ -0,0 +1,3 @@ +oasis_runtime_sdk::modules::consensus - Rust

Module oasis_runtime_sdk::modules::consensus

source ·
Expand description

Consensus module.

+

Low level consensus module for communicating with the consensus layer.

+

Modules§

Structs§

Enums§

Traits§

  • Interface that can be called from other modules.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/sidebar-items.js b/rust/oasis_runtime_sdk/modules/consensus/sidebar-items.js new file mode 100644 index 0000000000..6eb65ccaac --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","Event","ParameterValidationError"],"mod":["types"],"struct":["GasCosts","Genesis","Module","Parameters"],"trait":["API"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/struct.GasCosts.html b/rust/oasis_runtime_sdk/modules/consensus/struct.GasCosts.html new file mode 100644 index 0000000000..7d0ac3a341 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/struct.GasCosts.html @@ -0,0 +1,34 @@ +GasCosts in oasis_runtime_sdk::modules::consensus - Rust

Struct oasis_runtime_sdk::modules::consensus::GasCosts

source ·
pub struct GasCosts {
+    pub round_root: u64,
+}
Expand description

Gas costs.

+

Fields§

§round_root: u64

Cost of the internal round_root call.

+

Trait Implementations§

source§

impl Clone for GasCosts

source§

fn clone(&self) -> GasCosts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GasCosts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GasCosts

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for GasCosts

source§

fn default() -> GasCosts

Returns the “default value” for a type. Read more
source§

impl Encode for GasCosts

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GasCosts

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for GasCosts

source§

fn eq(&self, other: &GasCosts) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for GasCosts

source§

impl StructuralPartialEq for GasCosts

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/struct.Genesis.html b/rust/oasis_runtime_sdk/modules/consensus/struct.Genesis.html new file mode 100644 index 0000000000..0a9ea7236c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/struct.Genesis.html @@ -0,0 +1,29 @@ +Genesis in oasis_runtime_sdk::modules::consensus - Rust

Struct oasis_runtime_sdk::modules::consensus::Genesis

source ·
pub struct Genesis {
+    pub parameters: Parameters,
+}
Expand description

Genesis state for the consensus module.

+

Fields§

§parameters: Parameters

Trait Implementations§

source§

impl Clone for Genesis

source§

fn clone(&self) -> Genesis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Genesis

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Genesis

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Genesis

source§

fn default() -> Genesis

Returns the “default value” for a type. Read more
source§

impl Encode for Genesis

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Genesis

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/struct.Module.html b/rust/oasis_runtime_sdk/modules/consensus/struct.Module.html new file mode 100644 index 0000000000..3e889b77d0 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/struct.Module.html @@ -0,0 +1,109 @@ +Module in oasis_runtime_sdk::modules::consensus - Rust

Struct oasis_runtime_sdk::modules::consensus::Module

source ·
pub struct Module;

Implementations§

source§

impl Module

source

pub fn init(genesis: Genesis)

Trait Implementations§

source§

impl API for Module

source§

fn transfer<C: Context>( + ctx: &C, + to: Address, + amount: &BaseUnits, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Transfer an amount from the runtime account.
source§

fn withdraw<C: Context>( + ctx: &C, + from: Address, + amount: &BaseUnits, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Withdraw an amount into the runtime account.
source§

fn escrow<C: Context>( + ctx: &C, + to: Address, + amount: &BaseUnits, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Escrow an amount of the runtime account funds.
source§

fn reclaim_escrow<C: Context>( + ctx: &C, + from: Address, + shares: u128, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Reclaim an amount of runtime staked shares.
source§

fn consensus_denomination() -> Result<Denomination, Error>

Returns consensus token denomination.
source§

fn ensure_compatible_tx_signer() -> Result<(), Error>

Ensures transaction signer is consensus compatible.
source§

fn account<C: Context>( + ctx: &C, + addr: Address, +) -> Result<ConsensusAccount, Error>

Query consensus account info.
source§

fn delegation<C: Context>( + ctx: &C, + delegator_addr: Address, + escrow_addr: Address, +) -> Result<ConsensusDelegation, Error>

Query consensus delegation info.
source§

fn amount_from_consensus<C: Context>( + _ctx: &C, + amount: u128, +) -> Result<u128, Error>

Convert runtime amount to consensus amount, scaling as needed.
source§

fn amount_to_consensus<C: Context>( + _ctx: &C, + amount: u128, +) -> Result<u128, Error>

Convert consensus amount to runtime amount, scaling as needed.
source§

fn height_for_epoch<C: Context>(ctx: &C, epoch: EpochTime) -> Result<u64, Error>

Determine consensus height corresponding to the given epoch transition. This query may be +expensive in case the epoch is far back.
source§

fn round_roots<C: Context>( + ctx: &C, + runtime_id: Namespace, + round: u64, +) -> Result<Option<RoundRoots>, Error>

Round roots return the round roots for the given runtime ID and round.
source§

impl BlockHandler for Module

source§

fn begin_block<C: Context>(_ctx: &C)

Perform any common actions at the start of the block (before any transactions have been +executed).
source§

fn end_block<C: Context>(_ctx: &C)

Perform any common actions at the end of the block (after all transactions have been +executed).
source§

impl InvariantHandler for Module

source§

fn check_invariants<C: Context>(_ctx: &C) -> Result<(), Error>

Check invariants.
source§

impl MethodHandler for Module

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.
source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.
source§

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.
source§

fn prefetch( + _prefixes: &mut BTreeSet<Prefix>, + _method: &str, + body: Value, + _auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

Add storage prefixes to prefetch.
source§

fn dispatch_message_result<C: Context>( + _ctx: &C, + _handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

Dispatch a message result.
source§

fn is_expensive_query(_method: &str) -> bool

Checks whether the given query method is tagged as expensive.
source§

fn is_allowed_private_km_query(_method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.
source§

fn is_allowed_interactive_call(_method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.
source§

impl MigrationHandler for Module

§

type Genesis = Genesis

Genesis state type. Read more
source§

fn init_or_migrate<C: Context>( + _ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration. Read more
source§

impl Module for Module

source§

const NAME: &'static str = MODULE_NAME

Module name.
source§

const VERSION: u32 = 1u32

Module version.
§

type Error = Error

Module error type.
§

type Event = Event

Module event type.
§

type Parameters = Parameters

Module parameters.
source§

fn params() -> Self::Parameters

Return the module’s parameters.
source§

fn set_params(params: Self::Parameters)

Set the module’s parameters.
source§

impl TransactionHandler for Module

source§

fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.
source§

fn approve_unverified_tx<C: Context>( + _ctx: &C, + _utx: &UnverifiedTransaction, +) -> Result<(), Error>

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.
source§

fn decode_tx<C: Context>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>

Decode a transaction that was sent with module-controlled decoding and verify any +signatures. Read more
source§

fn authenticate_tx<C: Context>( + _ctx: &C, + _tx: &Transaction, +) -> Result<AuthDecision, Error>

Authenticate a transaction. Read more
source§

fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>

Perform any action after authentication, within the transaction context. Read more
source§

fn before_authorized_call_dispatch<C: Context>( + _ctx: &C, + _call: &Call, +) -> Result<(), Error>

Perform any action after authentication and decoding, within the transaction context. Read more
source§

fn after_handle_call<C: Context>( + _ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

Perform any action after call, within the transaction context. Read more
source§

fn after_dispatch_tx<C: Context>( + _ctx: &C, + _tx_auth_info: &AuthInfo, + _result: &CallResult, +)

Perform any action after dispatching the transaction, in batch context.

Auto Trait Implementations§

§

impl Freeze for Module

§

impl RefUnwindSafe for Module

§

impl Send for Module

§

impl Sync for Module

§

impl Unpin for Module

§

impl UnwindSafe for Module

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<M> ModuleInfoHandler for M
where + M: Module + MethodHandler,

source§

fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>
where + C: Context,

Reports info about the module (or modules, if Self is a tuple).
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/struct.Parameters.html b/rust/oasis_runtime_sdk/modules/consensus/struct.Parameters.html new file mode 100644 index 0000000000..c3ccd8d7d9 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/struct.Parameters.html @@ -0,0 +1,39 @@ +Parameters in oasis_runtime_sdk::modules::consensus - Rust

Struct oasis_runtime_sdk::modules::consensus::Parameters

source ·
pub struct Parameters {
+    pub gas_costs: GasCosts,
+    pub consensus_denomination: Denomination,
+    pub consensus_scaling_factor: u64,
+    pub min_delegate_amount: u128,
+}
Expand description

Parameters for the consensus module.

+

Fields§

§gas_costs: GasCosts§consensus_denomination: Denomination§consensus_scaling_factor: u64§min_delegate_amount: u128

Minimum amount that is allowed to be delegated. This should be greater than or equal to what +is configured in the consensus layer as the consensus layer will do its own checks.

+

The amount is in consensus units.

+

Trait Implementations§

source§

impl Clone for Parameters

source§

fn clone(&self) -> Parameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Parameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Parameters

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for Parameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Parameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Parameters for Parameters

§

type Error = ParameterValidationError

source§

fn validate_basic(&self) -> Result<(), Self::Error>

Perform basic parameter validation.
source§

const STORE_KEY: &'static [u8] = _

Store key used for storing parameters.
source§

impl PartialEq for Parameters

source§

fn eq(&self, other: &Parameters) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Parameters

source§

impl StructuralPartialEq for Parameters

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/trait.API.html b/rust/oasis_runtime_sdk/modules/consensus/trait.API.html new file mode 100644 index 0000000000..c5f4fed0b8 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/trait.API.html @@ -0,0 +1,103 @@ +API in oasis_runtime_sdk::modules::consensus - Rust

Trait oasis_runtime_sdk::modules::consensus::API

source ·
pub trait API {
+    // Required methods
+    fn transfer<C: Context>(
+        ctx: &C,
+        to: Address,
+        amount: &BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error>;
+    fn withdraw<C: Context>(
+        ctx: &C,
+        from: Address,
+        amount: &BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error>;
+    fn escrow<C: Context>(
+        ctx: &C,
+        to: Address,
+        amount: &BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error>;
+    fn reclaim_escrow<C: Context>(
+        ctx: &C,
+        from: Address,
+        amount: u128,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error>;
+    fn consensus_denomination() -> Result<Denomination, Error>;
+    fn ensure_compatible_tx_signer() -> Result<(), Error>;
+    fn account<C: Context>(
+        ctx: &C,
+        addr: Address,
+    ) -> Result<ConsensusAccount, Error>;
+    fn delegation<C: Context>(
+        ctx: &C,
+        delegator_addr: Address,
+        escrow_addr: Address,
+    ) -> Result<ConsensusDelegation, Error>;
+    fn amount_from_consensus<C: Context>(
+        ctx: &C,
+        amount: u128,
+    ) -> Result<u128, Error>;
+    fn amount_to_consensus<C: Context>(
+        ctx: &C,
+        amount: u128,
+    ) -> Result<u128, Error>;
+    fn height_for_epoch<C: Context>(
+        ctx: &C,
+        epoch: EpochTime,
+    ) -> Result<u64, Error>;
+    fn round_roots<C: Context>(
+        ctx: &C,
+        runtime_id: Namespace,
+        round: u64,
+    ) -> Result<Option<RoundRoots>, Error>;
+}
Expand description

Interface that can be called from other modules.

+

Required Methods§

source

fn transfer<C: Context>( + ctx: &C, + to: Address, + amount: &BaseUnits, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Transfer an amount from the runtime account.

+
source

fn withdraw<C: Context>( + ctx: &C, + from: Address, + amount: &BaseUnits, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Withdraw an amount into the runtime account.

+
source

fn escrow<C: Context>( + ctx: &C, + to: Address, + amount: &BaseUnits, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Escrow an amount of the runtime account funds.

+
source

fn reclaim_escrow<C: Context>( + ctx: &C, + from: Address, + amount: u128, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Reclaim an amount of runtime staked shares.

+
source

fn consensus_denomination() -> Result<Denomination, Error>

Returns consensus token denomination.

+
source

fn ensure_compatible_tx_signer() -> Result<(), Error>

Ensures transaction signer is consensus compatible.

+
source

fn account<C: Context>( + ctx: &C, + addr: Address, +) -> Result<ConsensusAccount, Error>

Query consensus account info.

+
source

fn delegation<C: Context>( + ctx: &C, + delegator_addr: Address, + escrow_addr: Address, +) -> Result<ConsensusDelegation, Error>

Query consensus delegation info.

+
source

fn amount_from_consensus<C: Context>( + ctx: &C, + amount: u128, +) -> Result<u128, Error>

Convert runtime amount to consensus amount, scaling as needed.

+
source

fn amount_to_consensus<C: Context>(ctx: &C, amount: u128) -> Result<u128, Error>

Convert consensus amount to runtime amount, scaling as needed.

+
source

fn height_for_epoch<C: Context>(ctx: &C, epoch: EpochTime) -> Result<u64, Error>

Determine consensus height corresponding to the given epoch transition. This query may be +expensive in case the epoch is far back.

+
source

fn round_roots<C: Context>( + ctx: &C, + runtime_id: Namespace, + round: u64, +) -> Result<Option<RoundRoots>, Error>

Round roots return the round roots for the given runtime ID and round.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/types/enum.RootKind.html b/rust/oasis_runtime_sdk/modules/consensus/types/enum.RootKind.html new file mode 100644 index 0000000000..d4c713f163 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/types/enum.RootKind.html @@ -0,0 +1,29 @@ +RootKind in oasis_runtime_sdk::modules::consensus::types - Rust

Enum oasis_runtime_sdk::modules::consensus::types::RootKind

source ·
#[repr(u8)]
pub enum RootKind { + State = 1, + IO = 2, +}
Expand description

Kind of root.

+

Variants§

§

State = 1

§

IO = 2

Trait Implementations§

source§

impl Clone for RootKind

source§

fn clone(&self) -> RootKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RootKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RootKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for RootKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/types/index.html b/rust/oasis_runtime_sdk/modules/consensus/types/index.html new file mode 100644 index 0000000000..e22cc6026e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/types/index.html @@ -0,0 +1 @@ +oasis_runtime_sdk::modules::consensus::types - Rust

Module oasis_runtime_sdk::modules::consensus::types

source ·

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/types/sidebar-items.js b/rust/oasis_runtime_sdk/modules/consensus/types/sidebar-items.js new file mode 100644 index 0000000000..ce8cc53450 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["RootKind"],"struct":["RoundRootBody"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus/types/struct.RoundRootBody.html b/rust/oasis_runtime_sdk/modules/consensus/types/struct.RoundRootBody.html new file mode 100644 index 0000000000..6fd72e0b55 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus/types/struct.RoundRootBody.html @@ -0,0 +1,32 @@ +RoundRootBody in oasis_runtime_sdk::modules::consensus::types - Rust

Struct oasis_runtime_sdk::modules::consensus::types::RoundRootBody

source ·
pub struct RoundRootBody {
+    pub runtime_id: Namespace,
+    pub round: u64,
+    pub kind: RootKind,
+}
Expand description

Internal round root call body.

+

Fields§

§runtime_id: Namespace§round: u64§kind: RootKind

Trait Implementations§

source§

impl Clone for RoundRootBody

source§

fn clone(&self) -> RoundRootBody

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RoundRootBody

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RoundRootBody

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for RoundRootBody

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RoundRootBody

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/enum.Error.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/enum.Error.html new file mode 100644 index 0000000000..c45fd56839 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/enum.Error.html @@ -0,0 +1,30 @@ +Error in oasis_runtime_sdk::modules::consensus_accounts - Rust
pub enum Error {
+    InvalidArgument,
+    InvalidDenomination,
+    InsufficientBalance,
+    Forbidden,
+    Consensus(Error),
+    Core(Error),
+}

Variants§

§

InvalidArgument

§

InvalidDenomination

§

InsufficientBalance

§

Forbidden

§

Consensus(Error)

§

Core(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/enum.Event.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/enum.Event.html new file mode 100644 index 0000000000..0d1ecd9a99 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/enum.Event.html @@ -0,0 +1,57 @@ +Event in oasis_runtime_sdk::modules::consensus_accounts - Rust
pub enum Event {
+    Deposit {
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: BaseUnits,
+        error: Option<ConsensusError>,
+    },
+    Withdraw {
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: BaseUnits,
+        error: Option<ConsensusError>,
+    },
+    Delegate {
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: BaseUnits,
+        error: Option<ConsensusError>,
+    },
+    UndelegateStart {
+        from: Address,
+        nonce: u64,
+        to: Address,
+        shares: u128,
+        debond_end_time: EpochTime,
+        error: Option<ConsensusError>,
+    },
+    UndelegateDone {
+        from: Address,
+        to: Address,
+        shares: u128,
+        amount: BaseUnits,
+    },
+}
Expand description

Events emitted by the consensus accounts module.

+

Variants§

§

Deposit

Fields

§from: Address
§nonce: u64
§amount: BaseUnits
§

Withdraw

Fields

§from: Address
§nonce: u64
§amount: BaseUnits
§

Delegate

Fields

§from: Address
§nonce: u64
§amount: BaseUnits
§

UndelegateStart

Fields

§from: Address
§nonce: u64
§shares: u128
§debond_end_time: EpochTime
§

UndelegateDone

Fields

§from: Address
§shares: u128
§amount: BaseUnits

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Event for Event

source§

fn module_name() -> &'static str

Name of the module that emitted the event.
source§

fn code(&self) -> u32

Code uniquely identifying the event.
source§

fn into_event_tag(self) -> EventTag

Converts an event into an event tag. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/index.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/index.html new file mode 100644 index 0000000000..74bf8fbf80 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/index.html @@ -0,0 +1,4 @@ +oasis_runtime_sdk::modules::consensus_accounts - Rust

Module oasis_runtime_sdk::modules::consensus_accounts

source ·
Expand description

Consensus accounts module.

+

This module allows consensus transfers in and out of the runtime account, +while keeping track of amount deposited per account.

+

Modules§

Structs§

Enums§

  • Events emitted by the consensus accounts module.

Statics§

Traits§

  • Interface that can be called from other modules.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/sidebar-items.js b/rust/oasis_runtime_sdk/modules/consensus_accounts/sidebar-items.js new file mode 100644 index 0000000000..108f4bc8ad --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","Event"],"mod":["state","types"],"static":["ADDRESS_PENDING_DELEGATION","ADDRESS_PENDING_WITHDRAWAL"],"struct":["GasCosts","Genesis","Module","Parameters"],"trait":["API"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.DELEGATIONS.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.DELEGATIONS.html new file mode 100644 index 0000000000..6472dc9e77 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.DELEGATIONS.html @@ -0,0 +1,2 @@ +DELEGATIONS in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub const DELEGATIONS: &[u8];
Expand description

Map of active delegations.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.RECEIPTS.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.RECEIPTS.html new file mode 100644 index 0000000000..427ec904cd --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.RECEIPTS.html @@ -0,0 +1,2 @@ +RECEIPTS in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub const RECEIPTS: &[u8];
Expand description

Receipts.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.UNDELEGATIONS.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.UNDELEGATIONS.html new file mode 100644 index 0000000000..2afe2adf52 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.UNDELEGATIONS.html @@ -0,0 +1,2 @@ +UNDELEGATIONS in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub const UNDELEGATIONS: &[u8];
Expand description

Map of undelegations.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.UNDELEGATION_QUEUE.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.UNDELEGATION_QUEUE.html new file mode 100644 index 0000000000..7107cdf689 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/constant.UNDELEGATION_QUEUE.html @@ -0,0 +1,2 @@ +UNDELEGATION_QUEUE in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub const UNDELEGATION_QUEUE: &[u8];
Expand description

An undelegation queue.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.add_delegation.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.add_delegation.html new file mode 100644 index 0000000000..2fc603118c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.add_delegation.html @@ -0,0 +1,8 @@ +add_delegation in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn add_delegation(
+    from: Address,
+    to: Address,
+    shares: u128,
+) -> Result<(), Error>
Expand description

Add delegation for a given (from, to) pair.

+

The given shares are added to any existing delegation that may exist for the same (from, to) +address pair. If no delegation exists a new one is created.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.add_undelegation.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.add_undelegation.html new file mode 100644 index 0000000000..520871c834 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.add_undelegation.html @@ -0,0 +1,12 @@ +add_undelegation in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn add_undelegation(
+    from: Address,
+    to: Address,
+    epoch: EpochTime,
+    shares: u128,
+    receipt: u64,
+) -> Result<u64, Error>
Expand description

Record new undelegation and add to undelegation queue.

+

In case an undelegation for the given (from, to, epoch) tuple already exists, the undelegation +entry is merged by adding shares. When a non-zero receipt identifier is passed, the identifier +is set in case the existing entry has no such identifier yet.

+

It returns the receipt identifier of the undelegation done receipt.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegation.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegation.html new file mode 100644 index 0000000000..5702c6f855 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegation.html @@ -0,0 +1,7 @@ +get_delegation in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn get_delegation(
+    from: Address,
+    to: Address,
+) -> Result<DelegationInfo, Error>
Expand description

Retrieve delegation metadata for a given (from, to) pair.

+

In case no delegation exists for the given (from, to) address pair, an all-zero delegation +metadata are returned.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegations.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegations.html new file mode 100644 index 0000000000..e150cfe078 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegations.html @@ -0,0 +1,4 @@ +get_delegations in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn get_delegations(
+    from: Address,
+) -> Result<Vec<ExtendedDelegationInfo>, Error>
Expand description

Retrieve all delegation metadata originating from a given address.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegations_by_destination.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegations_by_destination.html new file mode 100644 index 0000000000..ae2e351426 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_delegations_by_destination.html @@ -0,0 +1,2 @@ +get_delegations_by_destination in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn get_delegations_by_destination() -> Result<BTreeMap<Address, u128>, Error>
Expand description

Return the number of delegated shares for each destination escrow account.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_queued_undelegations.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_queued_undelegations.html new file mode 100644 index 0000000000..53e05ff082 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_queued_undelegations.html @@ -0,0 +1,4 @@ +get_queued_undelegations in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn get_queued_undelegations(
+    epoch: EpochTime,
+) -> Result<Vec<Undelegation>, Error>
Expand description

Retrieve all queued undelegations for epochs earlier than or equal to the passed epoch.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_undelegations.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_undelegations.html new file mode 100644 index 0000000000..46e7a904b3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.get_undelegations.html @@ -0,0 +1,2 @@ +get_undelegations in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn get_undelegations(to: Address) -> Result<Vec<UndelegationInfo>, Error>
Expand description

Retrieve all undelegation metadata to a given address.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.set_receipt.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.set_receipt.html new file mode 100644 index 0000000000..5850a5378a --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.set_receipt.html @@ -0,0 +1,2 @@ +set_receipt in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn set_receipt(owner: Address, kind: ReceiptKind, id: u64, receipt: Receipt)
Expand description

Store the given receipt.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.sub_delegation.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.sub_delegation.html new file mode 100644 index 0000000000..ee1fe5b4a6 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.sub_delegation.html @@ -0,0 +1,6 @@ +sub_delegation in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn sub_delegation(
+    from: Address,
+    to: Address,
+    shares: u128,
+) -> Result<(), Error>
Expand description

Subtract delegation from a given (from, to) pair.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.take_receipt.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.take_receipt.html new file mode 100644 index 0000000000..c46847b414 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.take_receipt.html @@ -0,0 +1,6 @@ +take_receipt in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn take_receipt(
+    owner: Address,
+    kind: ReceiptKind,
+    id: u64,
+) -> Option<Receipt>
Expand description

Remove the given receipt from storage if it exists and return it, otherwise return None.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.take_undelegation.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.take_undelegation.html new file mode 100644 index 0000000000..79b4d20d1c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/fn.take_undelegation.html @@ -0,0 +1,3 @@ +take_undelegation in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub fn take_undelegation(ud: &Undelegation) -> Result<DelegationInfo, Error>
Expand description

Remove an existing undelegation and return it.

+

In case the undelegation doesn’t exist, returns a default-constructed DelegationInfo.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/index.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/index.html new file mode 100644 index 0000000000..d1197180b8 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::consensus_accounts::state - Rust

Module oasis_runtime_sdk::modules::consensus_accounts::state

source ·
Expand description

State schema.

+

Structs§

Constants§

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/sidebar-items.js b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/sidebar-items.js new file mode 100644 index 0000000000..642e15f1f3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["DELEGATIONS","RECEIPTS","UNDELEGATIONS","UNDELEGATION_QUEUE"],"fn":["add_delegation","add_undelegation","get_delegation","get_delegations","get_delegations_by_destination","get_queued_undelegations","get_undelegations","set_receipt","sub_delegation","take_receipt","take_undelegation"],"struct":["Undelegation"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/state/struct.Undelegation.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/struct.Undelegation.html new file mode 100644 index 0000000000..2b19921af3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/state/struct.Undelegation.html @@ -0,0 +1,25 @@ +Undelegation in oasis_runtime_sdk::modules::consensus_accounts::state - Rust
pub struct Undelegation {
+    pub from: Address,
+    pub to: Address,
+    pub epoch: EpochTime,
+}
Expand description

Undelegation metadata.

+

Fields§

§from: Address§to: Address§epoch: EpochTime

Trait Implementations§

source§

impl<'a> TryFrom<&'a [u8]> for Undelegation

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a [u8]) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/static.ADDRESS_PENDING_DELEGATION.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/static.ADDRESS_PENDING_DELEGATION.html new file mode 100644 index 0000000000..3859f2a971 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/static.ADDRESS_PENDING_DELEGATION.html @@ -0,0 +1,3 @@ +ADDRESS_PENDING_DELEGATION in oasis_runtime_sdk::modules::consensus_accounts - Rust
pub static ADDRESS_PENDING_DELEGATION: Lazy<Address>
Expand description

Module’s address that has the tokens pending delegation.

+

oasis1qzcdegtf7aunxr5n5pw7n5xs3u7cmzlz9gwmq49r

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/static.ADDRESS_PENDING_WITHDRAWAL.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/static.ADDRESS_PENDING_WITHDRAWAL.html new file mode 100644 index 0000000000..5bae5c62db --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/static.ADDRESS_PENDING_WITHDRAWAL.html @@ -0,0 +1,3 @@ +ADDRESS_PENDING_WITHDRAWAL in oasis_runtime_sdk::modules::consensus_accounts - Rust
pub static ADDRESS_PENDING_WITHDRAWAL: Lazy<Address>
Expand description

Module’s address that has the tokens pending withdrawal.

+

oasis1qr677rv0dcnh7ys4yanlynysvnjtk9gnsyhvm6ln

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.GasCosts.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.GasCosts.html new file mode 100644 index 0000000000..d31da57e72 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.GasCosts.html @@ -0,0 +1,36 @@ +GasCosts in oasis_runtime_sdk::modules::consensus_accounts - Rust
pub struct GasCosts {
+    pub tx_deposit: u64,
+    pub tx_withdraw: u64,
+    pub tx_delegate: u64,
+    pub tx_undelegate: u64,
+    pub store_receipt: u64,
+    pub take_receipt: u64,
+}
Expand description

Gas costs.

+

Fields§

§tx_deposit: u64§tx_withdraw: u64§tx_delegate: u64§tx_undelegate: u64§store_receipt: u64

Cost of storing a delegation/undelegation receipt.

+
§take_receipt: u64

Cost of taking a delegation/undelegation receipt.

+

Trait Implementations§

source§

impl Clone for GasCosts

source§

fn clone(&self) -> GasCosts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GasCosts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GasCosts

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for GasCosts

source§

fn default() -> GasCosts

Returns the “default value” for a type. Read more
source§

impl Encode for GasCosts

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GasCosts

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Genesis.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Genesis.html new file mode 100644 index 0000000000..7672360799 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Genesis.html @@ -0,0 +1,29 @@ +Genesis in oasis_runtime_sdk::modules::consensus_accounts - Rust
pub struct Genesis {
+    pub parameters: Parameters,
+}
Expand description

Genesis state for the consensus module.

+

Fields§

§parameters: Parameters

Trait Implementations§

source§

impl Clone for Genesis

source§

fn clone(&self) -> Genesis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Genesis

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Genesis

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Genesis

source§

fn default() -> Genesis

Returns the “default value” for a type. Read more
source§

impl Encode for Genesis

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Genesis

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Module.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Module.html new file mode 100644 index 0000000000..b1f7ec75a7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Module.html @@ -0,0 +1,104 @@ +Module in oasis_runtime_sdk::modules::consensus_accounts - Rust

Struct oasis_runtime_sdk::modules::consensus_accounts::Module

source ·
pub struct Module<Consensus: API> { /* private fields */ }

Implementations§

source§

impl<Consensus: API> Module<Consensus>

source

pub fn init(genesis: Genesis)

Trait Implementations§

source§

impl<Consensus: API> API for Module<Consensus>

source§

fn deposit<C: Context>( + ctx: &C, + from: Address, + nonce: u64, + to: Address, + amount: BaseUnits, +) -> Result<(), Error>

Transfer from consensus staking account to runtime account. Read more
source§

fn withdraw<C: Context>( + ctx: &C, + from: Address, + nonce: u64, + to: Address, + amount: BaseUnits, +) -> Result<(), Error>

Transfer from runtime account to consensus staking account. Read more
source§

fn delegate<C: Context>( + ctx: &C, + from: Address, + nonce: u64, + to: Address, + amount: BaseUnits, + receipt: bool, +) -> Result<(), Error>

Delegate from runtime account to consensus staking account. Read more
source§

fn undelegate<C: Context>( + ctx: &C, + from: Address, + nonce: u64, + to: Address, + shares: u128, + receipt: bool, +) -> Result<(), Error>

Start the undelegation process of the given number of shares from consensus staking account +to runtime account. Read more
source§

impl<Consensus: API> BlockHandler for Module<Consensus>

source§

fn end_block<C: Context>(ctx: &C)

Perform any common actions at the end of the block (after all transactions have been +executed).
source§

fn begin_block<C: Context>(_ctx: &C)

Perform any common actions at the start of the block (before any transactions have been +executed).
source§

impl<Consensus: API> InvariantHandler for Module<Consensus>

source§

fn check_invariants<C: Context>(ctx: &C) -> Result<(), CoreError>

Check invariants.

+
source§

impl<Consensus: API> MethodHandler for Module<Consensus>

source§

fn prefetch( + prefixes: &mut BTreeSet<Prefix>, + method: &str, + body: Value, + auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

Add storage prefixes to prefetch.
source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.
source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.
source§

fn dispatch_message_result<C: Context>( + ctx: &C, + handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

Dispatch a message result.
source§

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.
source§

fn is_expensive_query(_method: &str) -> bool

Checks whether the given query method is tagged as expensive.
source§

fn is_allowed_private_km_query(_method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.
source§

fn is_allowed_interactive_call(_method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.
source§

impl<Consensus: API> MigrationHandler for Module<Consensus>

§

type Genesis = Genesis

Genesis state type. Read more
source§

fn init_or_migrate<C: Context>( + _ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration. Read more
source§

impl<Consensus: API> Module for Module<Consensus>

source§

const NAME: &'static str = MODULE_NAME

Module name.
source§

const VERSION: u32 = 1u32

Module version.
§

type Error = Error

Module error type.
§

type Event = Event

Module event type.
§

type Parameters = Parameters

Module parameters.
source§

fn params() -> Self::Parameters

Return the module’s parameters.
source§

fn set_params(params: Self::Parameters)

Set the module’s parameters.
source§

impl<Consensus: API> TransactionHandler for Module<Consensus>

source§

fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.
source§

fn approve_unverified_tx<C: Context>( + _ctx: &C, + _utx: &UnverifiedTransaction, +) -> Result<(), Error>

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.
source§

fn decode_tx<C: Context>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>

Decode a transaction that was sent with module-controlled decoding and verify any +signatures. Read more
source§

fn authenticate_tx<C: Context>( + _ctx: &C, + _tx: &Transaction, +) -> Result<AuthDecision, Error>

Authenticate a transaction. Read more
source§

fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>

Perform any action after authentication, within the transaction context. Read more
source§

fn before_authorized_call_dispatch<C: Context>( + _ctx: &C, + _call: &Call, +) -> Result<(), Error>

Perform any action after authentication and decoding, within the transaction context. Read more
source§

fn after_handle_call<C: Context>( + _ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

Perform any action after call, within the transaction context. Read more
source§

fn after_dispatch_tx<C: Context>( + _ctx: &C, + _tx_auth_info: &AuthInfo, + _result: &CallResult, +)

Perform any action after dispatching the transaction, in batch context.

Auto Trait Implementations§

§

impl<Consensus> Freeze for Module<Consensus>

§

impl<Consensus> RefUnwindSafe for Module<Consensus>
where + Consensus: RefUnwindSafe,

§

impl<Consensus> Send for Module<Consensus>
where + Consensus: Send,

§

impl<Consensus> Sync for Module<Consensus>
where + Consensus: Sync,

§

impl<Consensus> Unpin for Module<Consensus>
where + Consensus: Unpin,

§

impl<Consensus> UnwindSafe for Module<Consensus>
where + Consensus: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<M> ModuleInfoHandler for M
where + M: Module + MethodHandler,

source§

fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>
where + C: Context,

Reports info about the module (or modules, if Self is a tuple).
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Parameters.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Parameters.html new file mode 100644 index 0000000000..e51508c00f --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/struct.Parameters.html @@ -0,0 +1,37 @@ +Parameters in oasis_runtime_sdk::modules::consensus_accounts - Rust
pub struct Parameters {
+    pub gas_costs: GasCosts,
+    pub disable_delegate: bool,
+    pub disable_undelegate: bool,
+    pub disable_deposit: bool,
+    pub disable_withdraw: bool,
+}
Expand description

Parameters for the consensus module.

+

Fields§

§gas_costs: GasCosts§disable_delegate: bool

Whether delegate functionality should be disabled.

+
§disable_undelegate: bool

Whether undelegate functionality should be disabled.

+
§disable_deposit: bool

Whether deposit functionality should be disabled.

+
§disable_withdraw: bool

Whether withdraw functionality should be disabled.

+

Trait Implementations§

source§

impl Clone for Parameters

source§

fn clone(&self) -> Parameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Parameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Parameters

source§

fn default() -> Parameters

Returns the “default value” for a type. Read more
source§

impl Encode for Parameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Parameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Parameters for Parameters

§

type Error = ()

source§

const STORE_KEY: &'static [u8] = _

Store key used for storing parameters.
source§

fn validate_basic(&self) -> Result<(), Self::Error>

Perform basic parameter validation.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/trait.API.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/trait.API.html new file mode 100644 index 0000000000..024a5acc03 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/trait.API.html @@ -0,0 +1,85 @@ +API in oasis_runtime_sdk::modules::consensus_accounts - Rust

Trait oasis_runtime_sdk::modules::consensus_accounts::API

source ·
pub trait API {
+    // Required methods
+    fn deposit<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: BaseUnits,
+    ) -> Result<(), Error>;
+    fn withdraw<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: BaseUnits,
+    ) -> Result<(), Error>;
+    fn delegate<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: BaseUnits,
+        receipt: bool,
+    ) -> Result<(), Error>;
+    fn undelegate<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        shares: u128,
+        receipt: bool,
+    ) -> Result<(), Error>;
+}
Expand description

Interface that can be called from other modules.

+

Required Methods§

source

fn deposit<C: Context>( + ctx: &C, + from: Address, + nonce: u64, + to: Address, + amount: BaseUnits, +) -> Result<(), Error>

Transfer from consensus staking account to runtime account.

+
§Arguments
+
    +
  • nonce: A caller-provided sequence number that will help identify the success/fail events. +When called from a deposit transaction, we use the signer nonce.
  • +
+
source

fn withdraw<C: Context>( + ctx: &C, + from: Address, + nonce: u64, + to: Address, + amount: BaseUnits, +) -> Result<(), Error>

Transfer from runtime account to consensus staking account.

+
§Arguments
+
    +
  • nonce: A caller-provided sequence number that will help identify the success/fail events. +When called from a withdraw transaction, we use the signer nonce.
  • +
+
source

fn delegate<C: Context>( + ctx: &C, + from: Address, + nonce: u64, + to: Address, + amount: BaseUnits, + receipt: bool, +) -> Result<(), Error>

Delegate from runtime account to consensus staking account.

+
§Arguments
+
    +
  • nonce: A caller-provided sequence number that will help identify the success/fail events. +When called from a delegate transaction, we use the signer nonce.
  • +
+
source

fn undelegate<C: Context>( + ctx: &C, + from: Address, + nonce: u64, + to: Address, + shares: u128, + receipt: bool, +) -> Result<(), Error>

Start the undelegation process of the given number of shares from consensus staking account +to runtime account.

+
§Arguments
+
    +
  • nonce: A caller-provided sequence number that will help identify the success/fail events. +When called from an undelegate transaction, we use the signer nonce.
  • +
+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Consensus: API> API for Module<Consensus>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/enum.ReceiptKind.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/enum.ReceiptKind.html new file mode 100644 index 0000000000..d699b204e9 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/enum.ReceiptKind.html @@ -0,0 +1,32 @@ +ReceiptKind in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
#[repr(u8)]
pub enum ReceiptKind { + Invalid = 0, + Delegate = 1, + UndelegateStart = 2, + UndelegateDone = 3, +}
Expand description

Kind of receipt.

+

Variants§

§

Invalid = 0

§

Delegate = 1

§

UndelegateStart = 2

§

UndelegateDone = 3

Implementations§

source§

impl ReceiptKind

source

pub fn is_valid(&self) -> bool

Whether the receipt kind is valid.

+

Trait Implementations§

source§

impl Clone for ReceiptKind

source§

fn clone(&self) -> ReceiptKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ReceiptKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ReceiptKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ReceiptKind

source§

fn default() -> ReceiptKind

Returns the “default value” for a type. Read more
source§

impl Encode for ReceiptKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/index.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/index.html new file mode 100644 index 0000000000..042e069f8c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/index.html @@ -0,0 +1,7 @@ +oasis_runtime_sdk::modules::consensus_accounts::types - Rust

Module oasis_runtime_sdk::modules::consensus_accounts::types

source ·
Expand description

Consensus module types.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/sidebar-items.js b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/sidebar-items.js new file mode 100644 index 0000000000..c33d984238 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ReceiptKind"],"struct":["AccountBalance","BalanceQuery","ConsensusAccountQuery","ConsensusDelegateContext","ConsensusError","ConsensusTransferContext","ConsensusUndelegateContext","ConsensusWithdrawContext","Delegate","DelegationInfo","DelegationQuery","DelegationsQuery","Deposit","ExtendedDelegationInfo","Receipt","TakeReceipt","Undelegate","UndelegationInfo","UndelegationsQuery","Withdraw"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.AccountBalance.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.AccountBalance.html new file mode 100644 index 0000000000..d61aaf2704 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.AccountBalance.html @@ -0,0 +1,28 @@ +AccountBalance in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct AccountBalance {
+    pub balance: u128,
+}

Fields§

§balance: u128

Trait Implementations§

source§

impl Clone for AccountBalance

source§

fn clone(&self) -> AccountBalance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AccountBalance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AccountBalance

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AccountBalance

source§

fn default() -> AccountBalance

Returns the “default value” for a type. Read more
source§

impl Encode for AccountBalance

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AccountBalance

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.BalanceQuery.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.BalanceQuery.html new file mode 100644 index 0000000000..202d6f0c92 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.BalanceQuery.html @@ -0,0 +1,29 @@ +BalanceQuery in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct BalanceQuery {
+    pub address: Address,
+}
Expand description

Balance query.

+

Fields§

§address: Address

Trait Implementations§

source§

impl Clone for BalanceQuery

source§

fn clone(&self) -> BalanceQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BalanceQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for BalanceQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for BalanceQuery

source§

fn default() -> BalanceQuery

Returns the “default value” for a type. Read more
source§

impl Encode for BalanceQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for BalanceQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusAccountQuery.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusAccountQuery.html new file mode 100644 index 0000000000..99754929ed --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusAccountQuery.html @@ -0,0 +1,29 @@ +ConsensusAccountQuery in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct ConsensusAccountQuery {
+    pub address: Address,
+}
Expand description

Consensus account query.

+

Fields§

§address: Address

Trait Implementations§

source§

impl Clone for ConsensusAccountQuery

source§

fn clone(&self) -> ConsensusAccountQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusAccountQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusAccountQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusAccountQuery

source§

fn default() -> ConsensusAccountQuery

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusAccountQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusAccountQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusDelegateContext.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusDelegateContext.html new file mode 100644 index 0000000000..62df54b38f --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusDelegateContext.html @@ -0,0 +1,33 @@ +ConsensusDelegateContext in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct ConsensusDelegateContext {
+    pub from: Address,
+    pub nonce: u64,
+    pub to: Address,
+    pub amount: BaseUnits,
+    pub receipt: bool,
+}
Expand description

Context for consensus delegate message handler.

+

Fields§

§from: Address§nonce: u64§to: Address§amount: BaseUnits§receipt: bool

Trait Implementations§

source§

impl Clone for ConsensusDelegateContext

source§

fn clone(&self) -> ConsensusDelegateContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusDelegateContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusDelegateContext

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusDelegateContext

source§

fn default() -> ConsensusDelegateContext

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusDelegateContext

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusDelegateContext

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusError.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusError.html new file mode 100644 index 0000000000..696caa2461 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusError.html @@ -0,0 +1,34 @@ +ConsensusError in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct ConsensusError {
+    pub module: String,
+    pub code: u32,
+}
Expand description

Error details from the consensus layer.

+

Fields§

§module: String§code: u32

Trait Implementations§

source§

impl Clone for ConsensusError

source§

fn clone(&self) -> ConsensusError

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusError

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusError

source§

fn default() -> ConsensusError

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusError

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusError

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<MessageEvent> for ConsensusError

source§

fn from(me: MessageEvent) -> Self

Converts to this type from the input type.
source§

impl PartialEq for ConsensusError

source§

fn eq(&self, other: &ConsensusError) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for ConsensusError

source§

impl StructuralPartialEq for ConsensusError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusTransferContext.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusTransferContext.html new file mode 100644 index 0000000000..6ef13a4b04 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusTransferContext.html @@ -0,0 +1,32 @@ +ConsensusTransferContext in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct ConsensusTransferContext {
+    pub address: Address,
+    pub nonce: u64,
+    pub to: Address,
+    pub amount: BaseUnits,
+}
Expand description

Context for consensus transfer message handler.

+

Fields§

§address: Address§nonce: u64§to: Address§amount: BaseUnits

Trait Implementations§

source§

impl Clone for ConsensusTransferContext

source§

fn clone(&self) -> ConsensusTransferContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusTransferContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusTransferContext

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusTransferContext

source§

fn default() -> ConsensusTransferContext

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusTransferContext

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusTransferContext

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusUndelegateContext.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusUndelegateContext.html new file mode 100644 index 0000000000..92b8aa9061 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusUndelegateContext.html @@ -0,0 +1,33 @@ +ConsensusUndelegateContext in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct ConsensusUndelegateContext {
+    pub from: Address,
+    pub nonce: u64,
+    pub to: Address,
+    pub shares: u128,
+    pub receipt: bool,
+}
Expand description

Context for consensus undelegate message handler.

+

Fields§

§from: Address§nonce: u64§to: Address§shares: u128§receipt: bool

Trait Implementations§

source§

impl Clone for ConsensusUndelegateContext

source§

fn clone(&self) -> ConsensusUndelegateContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusUndelegateContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusUndelegateContext

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusUndelegateContext

source§

fn default() -> ConsensusUndelegateContext

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusUndelegateContext

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusUndelegateContext

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusWithdrawContext.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusWithdrawContext.html new file mode 100644 index 0000000000..1ae3df908b --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ConsensusWithdrawContext.html @@ -0,0 +1,32 @@ +ConsensusWithdrawContext in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct ConsensusWithdrawContext {
+    pub from: Address,
+    pub nonce: u64,
+    pub address: Address,
+    pub amount: BaseUnits,
+}
Expand description

Context for consensus withdraw message handler.

+

Fields§

§from: Address§nonce: u64§address: Address§amount: BaseUnits

Trait Implementations§

source§

impl Clone for ConsensusWithdrawContext

source§

fn clone(&self) -> ConsensusWithdrawContext

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ConsensusWithdrawContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ConsensusWithdrawContext

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ConsensusWithdrawContext

source§

fn default() -> ConsensusWithdrawContext

Returns the “default value” for a type. Read more
source§

impl Encode for ConsensusWithdrawContext

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ConsensusWithdrawContext

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Delegate.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Delegate.html new file mode 100644 index 0000000000..d391ab9aba --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Delegate.html @@ -0,0 +1,31 @@ +Delegate in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct Delegate {
+    pub to: Address,
+    pub amount: BaseUnits,
+    pub receipt: u64,
+}
Expand description

Delegate from runtime call.

+

Fields§

§to: Address§amount: BaseUnits§receipt: u64

Trait Implementations§

source§

impl Clone for Delegate

source§

fn clone(&self) -> Delegate

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Delegate

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Delegate

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Delegate

source§

fn default() -> Delegate

Returns the “default value” for a type. Read more
source§

impl Encode for Delegate

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Delegate

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationInfo.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationInfo.html new file mode 100644 index 0000000000..d0019ccb64 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationInfo.html @@ -0,0 +1,32 @@ +DelegationInfo in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct DelegationInfo {
+    pub shares: u128,
+    pub receipt: u64,
+}
Expand description

Information about a delegation.

+

Fields§

§shares: u128

The amount of owned shares.

+
§receipt: u64

Receipt identifier for this undelegation.

+

Trait Implementations§

source§

impl Clone for DelegationInfo

source§

fn clone(&self) -> DelegationInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DelegationInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for DelegationInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for DelegationInfo

source§

fn default() -> DelegationInfo

Returns the “default value” for a type. Read more
source§

impl Encode for DelegationInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for DelegationInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationQuery.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationQuery.html new file mode 100644 index 0000000000..5f920699f6 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationQuery.html @@ -0,0 +1,30 @@ +DelegationQuery in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct DelegationQuery {
+    pub from: Address,
+    pub to: Address,
+}
Expand description

Delegation query.

+

Fields§

§from: Address§to: Address

Trait Implementations§

source§

impl Clone for DelegationQuery

source§

fn clone(&self) -> DelegationQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DelegationQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for DelegationQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for DelegationQuery

source§

fn default() -> DelegationQuery

Returns the “default value” for a type. Read more
source§

impl Encode for DelegationQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for DelegationQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationsQuery.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationsQuery.html new file mode 100644 index 0000000000..6769f283ec --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.DelegationsQuery.html @@ -0,0 +1,29 @@ +DelegationsQuery in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct DelegationsQuery {
+    pub from: Address,
+}
Expand description

Delegations query.

+

Fields§

§from: Address

Trait Implementations§

source§

impl Clone for DelegationsQuery

source§

fn clone(&self) -> DelegationsQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DelegationsQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for DelegationsQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for DelegationsQuery

source§

fn default() -> DelegationsQuery

Returns the “default value” for a type. Read more
source§

impl Encode for DelegationsQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for DelegationsQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Deposit.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Deposit.html new file mode 100644 index 0000000000..be1805427c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Deposit.html @@ -0,0 +1,33 @@ +Deposit in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct Deposit {
+    pub to: Option<Address>,
+    pub amount: BaseUnits,
+}
Expand description

Deposit into runtime call. +Transfer from consensus staking to an account in this runtime. +The transaction signer has a consensus layer allowance benefiting this runtime’s staking +address. The to address runtime account gets the tokens.

+

Fields§

§to: Option<Address>§amount: BaseUnits

Trait Implementations§

source§

impl Clone for Deposit

source§

fn clone(&self) -> Deposit

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Deposit

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Deposit

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Deposit

source§

fn default() -> Deposit

Returns the “default value” for a type. Read more
source§

impl Encode for Deposit

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Deposit

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ExtendedDelegationInfo.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ExtendedDelegationInfo.html new file mode 100644 index 0000000000..7ec8a3a2cf --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.ExtendedDelegationInfo.html @@ -0,0 +1,32 @@ +ExtendedDelegationInfo in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct ExtendedDelegationInfo {
+    pub to: Address,
+    pub shares: u128,
+}
Expand description

Extended information about a delegation.

+

Fields§

§to: Address

Address delegated to.

+
§shares: u128

The amount of owned shares.

+

Trait Implementations§

source§

impl Clone for ExtendedDelegationInfo

source§

fn clone(&self) -> ExtendedDelegationInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExtendedDelegationInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExtendedDelegationInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExtendedDelegationInfo

source§

fn default() -> ExtendedDelegationInfo

Returns the “default value” for a type. Read more
source§

impl Encode for ExtendedDelegationInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExtendedDelegationInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Receipt.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Receipt.html new file mode 100644 index 0000000000..baa040daaa --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Receipt.html @@ -0,0 +1,38 @@ +Receipt in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct Receipt {
+    pub shares: u128,
+    pub epoch: EpochTime,
+    pub receipt: u64,
+    pub amount: u128,
+    pub error: Option<ConsensusError>,
+}
Expand description

A receipt.

+

Fields§

§shares: u128

Shares received (for delegations).

+
§epoch: EpochTime

Undelegate end epoch.

+
§receipt: u64

Undelegate end receipt.

+
§amount: u128

Amount of tokens received.

+
§error: Option<ConsensusError>

Consensus layer error.

+

Trait Implementations§

source§

impl Clone for Receipt

source§

fn clone(&self) -> Receipt

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Receipt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Receipt

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Receipt

source§

fn default() -> Receipt

Returns the “default value” for a type. Read more
source§

impl Encode for Receipt

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Receipt

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.TakeReceipt.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.TakeReceipt.html new file mode 100644 index 0000000000..a66d096b7a --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.TakeReceipt.html @@ -0,0 +1,30 @@ +TakeReceipt in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct TakeReceipt {
+    pub kind: ReceiptKind,
+    pub id: u64,
+}
Expand description

Take receipt internal runtime call.

+

Fields§

§kind: ReceiptKind§id: u64

Trait Implementations§

source§

impl Clone for TakeReceipt

source§

fn clone(&self) -> TakeReceipt

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TakeReceipt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for TakeReceipt

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TakeReceipt

source§

fn default() -> TakeReceipt

Returns the “default value” for a type. Read more
source§

impl Encode for TakeReceipt

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TakeReceipt

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Undelegate.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Undelegate.html new file mode 100644 index 0000000000..5998ac7313 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Undelegate.html @@ -0,0 +1,31 @@ +Undelegate in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct Undelegate {
+    pub from: Address,
+    pub shares: u128,
+    pub receipt: u64,
+}
Expand description

Undelegate into runtime call.

+

Fields§

§from: Address§shares: u128§receipt: u64

Trait Implementations§

source§

impl Clone for Undelegate

source§

fn clone(&self) -> Undelegate

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Undelegate

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Undelegate

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Undelegate

source§

fn default() -> Undelegate

Returns the “default value” for a type. Read more
source§

impl Encode for Undelegate

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Undelegate

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.UndelegationInfo.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.UndelegationInfo.html new file mode 100644 index 0000000000..e765c97144 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.UndelegationInfo.html @@ -0,0 +1,34 @@ +UndelegationInfo in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct UndelegationInfo {
+    pub from: Address,
+    pub epoch: EpochTime,
+    pub shares: u128,
+}
Expand description

Information about an undelegation.

+

Fields§

§from: Address

Address being undelegated from.

+
§epoch: EpochTime

Epoch when the undelegation will be complete.

+
§shares: u128

The amount of undelegated shares.

+

Trait Implementations§

source§

impl Clone for UndelegationInfo

source§

fn clone(&self) -> UndelegationInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UndelegationInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for UndelegationInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for UndelegationInfo

source§

fn default() -> UndelegationInfo

Returns the “default value” for a type. Read more
source§

impl Encode for UndelegationInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for UndelegationInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.UndelegationsQuery.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.UndelegationsQuery.html new file mode 100644 index 0000000000..ebb5d0108f --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.UndelegationsQuery.html @@ -0,0 +1,29 @@ +UndelegationsQuery in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct UndelegationsQuery {
+    pub to: Address,
+}
Expand description

Undelegations query.

+

Fields§

§to: Address

Trait Implementations§

source§

impl Clone for UndelegationsQuery

source§

fn clone(&self) -> UndelegationsQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UndelegationsQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for UndelegationsQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for UndelegationsQuery

source§

fn default() -> UndelegationsQuery

Returns the “default value” for a type. Read more
source§

impl Encode for UndelegationsQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for UndelegationsQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Withdraw.html b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Withdraw.html new file mode 100644 index 0000000000..fb5bc9f9c8 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/consensus_accounts/types/struct.Withdraw.html @@ -0,0 +1,32 @@ +Withdraw in oasis_runtime_sdk::modules::consensus_accounts::types - Rust
pub struct Withdraw {
+    pub to: Option<Address>,
+    pub amount: BaseUnits,
+}
Expand description

Withdraw from runtime call. +Transfer from an account in this runtime to consensus staking. +The to address consensus staking account gets the tokens.

+

Fields§

§to: Option<Address>§amount: BaseUnits

Trait Implementations§

source§

impl Clone for Withdraw

source§

fn clone(&self) -> Withdraw

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Withdraw

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Withdraw

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Withdraw

source§

fn default() -> Withdraw

Returns the “default value” for a type. Read more
source§

impl Encode for Withdraw

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Withdraw

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/constant.MODULE_NAME.html b/rust/oasis_runtime_sdk/modules/core/constant.MODULE_NAME.html new file mode 100644 index 0000000000..5968308e56 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/constant.MODULE_NAME.html @@ -0,0 +1,2 @@ +MODULE_NAME in oasis_runtime_sdk::modules::core - Rust

Constant oasis_runtime_sdk::modules::core::MODULE_NAME

source ·
pub const MODULE_NAME: &str = "core";
Expand description

Unique module name.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/enum.Error.html b/rust/oasis_runtime_sdk/modules/core/enum.Error.html new file mode 100644 index 0000000000..dd19244f5e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/enum.Error.html @@ -0,0 +1,53 @@ +Error in oasis_runtime_sdk::modules::core - Rust

Enum oasis_runtime_sdk::modules::core::Error

source ·
pub enum Error {
+
Show 26 variants MalformedTransaction(Error), + InvalidTransaction(Error), + InvalidMethod(String), + InvalidNonce, + InsufficientFeeBalance, + OutOfMessageSlots, + MessageHandlerNotInvoked, + MessageHandlerMissing(u32), + InvalidArgument(Error), + GasOverflow, + OutOfGas(u64, u64), + TooManyAuth, + MultisigTooManySigners, + InvariantViolation(String), + InvalidCallFormat(Error), + Abort(Error), + NotAuthenticated, + GasPriceTooLow, + ForbiddenInSecureBuild, + Forbidden, + OversizedTransaction, + ExpiredTransaction, + ReadOnlyTransaction, + FutureNonce, + CallDepthExceeded(u16, u16), + TxSimulationFailed(TxSimulationFailure), +
}
Expand description

Errors emitted by the core module.

+

Variants§

§

MalformedTransaction(Error)

§

InvalidTransaction(Error)

§

InvalidMethod(String)

§

InvalidNonce

§

InsufficientFeeBalance

§

OutOfMessageSlots

§

MessageHandlerNotInvoked

§

MessageHandlerMissing(u32)

§

InvalidArgument(Error)

§

GasOverflow

§

OutOfGas(u64, u64)

§

TooManyAuth

§

MultisigTooManySigners

§

InvariantViolation(String)

§

InvalidCallFormat(Error)

§

Abort(Error)

§

NotAuthenticated

§

GasPriceTooLow

§

ForbiddenInSecureBuild

§

Forbidden

§

OversizedTransaction

§

ExpiredTransaction

§

ReadOnlyTransaction

§

FutureNonce

§

CallDepthExceeded(u16, u16)

§

TxSimulationFailed(TxSimulationFailure)

Implementations§

source§

impl Error

source

pub fn out_of_gas<Cfg: Config>(limit: u64, wanted: u64) -> Self

Generate a proper OutOfGas error, depending on whether the module is configured to emit gas +use information or not.

+

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<TxSimulationFailure> for Error

source§

fn from(source: TxSimulationFailure) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/enum.Event.html b/rust/oasis_runtime_sdk/modules/core/enum.Event.html new file mode 100644 index 0000000000..aafb20b13e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/enum.Event.html @@ -0,0 +1,29 @@ +Event in oasis_runtime_sdk::modules::core - Rust

Enum oasis_runtime_sdk::modules::core::Event

source ·
pub enum Event {
+    GasUsed {
+        amount: u64,
+    },
+}
Expand description

Events emitted by the core module.

+

Variants§

§

GasUsed

Fields

§amount: u64

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Event for Event

source§

fn module_name() -> &'static str

Name of the module that emitted the event.
source§

fn code(&self) -> u32

Code uniquely identifying the event.
source§

fn into_event_tag(self) -> EventTag

Converts an event into an event tag. Read more
source§

impl PartialEq for Event

source§

fn eq(&self, other: &Event) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Event

source§

impl StructuralPartialEq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/enum.ParameterValidationError.html b/rust/oasis_runtime_sdk/modules/core/enum.ParameterValidationError.html new file mode 100644 index 0000000000..0c60ccb452 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/enum.ParameterValidationError.html @@ -0,0 +1,25 @@ +ParameterValidationError in oasis_runtime_sdk::modules::core - Rust
pub enum ParameterValidationError {
+    InvalidTargetBlockGasUsagePercentage,
+    InvalidMinPriceMaxChangeDenominator,
+}
Expand description

Errors emitted during core parameter validation.

+

Variants§

§

InvalidTargetBlockGasUsagePercentage

§

InvalidMinPriceMaxChangeDenominator

Trait Implementations§

source§

impl Debug for ParameterValidationError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ParameterValidationError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ParameterValidationError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/index.html b/rust/oasis_runtime_sdk/modules/core/index.html new file mode 100644 index 0000000000..745b526f9a --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::core - Rust

Module oasis_runtime_sdk::modules::core

source ·
Expand description

Core definitions module.

+

Modules§

Structs§

Enums§

Constants§

Traits§

  • Interface that can be called from other modules.
  • Module configuration.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/sidebar-items.js b/rust/oasis_runtime_sdk/modules/core/sidebar-items.js new file mode 100644 index 0000000000..4e7e00e6e4 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["MODULE_NAME"],"enum":["Error","Event","ParameterValidationError"],"mod":["state","types"],"struct":["DynamicMinGasPrice","GasCosts","Genesis","LocalConfig","Module","Parameters","TxSimulationFailure"],"trait":["API","Config"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/state/constant.DYNAMIC_MIN_GAS_PRICE.html b/rust/oasis_runtime_sdk/modules/core/state/constant.DYNAMIC_MIN_GAS_PRICE.html new file mode 100644 index 0000000000..8f8df66780 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/state/constant.DYNAMIC_MIN_GAS_PRICE.html @@ -0,0 +1,2 @@ +DYNAMIC_MIN_GAS_PRICE in oasis_runtime_sdk::modules::core::state - Rust

Constant oasis_runtime_sdk::modules::core::state::DYNAMIC_MIN_GAS_PRICE

source ·
pub const DYNAMIC_MIN_GAS_PRICE: &[u8];
Expand description

Dynamic min gas price.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/state/constant.LAST_EPOCH.html b/rust/oasis_runtime_sdk/modules/core/state/constant.LAST_EPOCH.html new file mode 100644 index 0000000000..ac956e4250 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/state/constant.LAST_EPOCH.html @@ -0,0 +1,2 @@ +LAST_EPOCH in oasis_runtime_sdk::modules::core::state - Rust

Constant oasis_runtime_sdk::modules::core::state::LAST_EPOCH

source ·
pub const LAST_EPOCH: &[u8];
Expand description

Last processed epoch for detecting epoch changes.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/state/constant.MESSAGE_HANDLERS.html b/rust/oasis_runtime_sdk/modules/core/state/constant.MESSAGE_HANDLERS.html new file mode 100644 index 0000000000..0fb930c1f3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/state/constant.MESSAGE_HANDLERS.html @@ -0,0 +1,2 @@ +MESSAGE_HANDLERS in oasis_runtime_sdk::modules::core::state - Rust

Constant oasis_runtime_sdk::modules::core::state::MESSAGE_HANDLERS

source ·
pub const MESSAGE_HANDLERS: &[u8];
Expand description

Map of message idx to message handlers for messages emitted in previous round.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/state/constant.METADATA.html b/rust/oasis_runtime_sdk/modules/core/state/constant.METADATA.html new file mode 100644 index 0000000000..a882f6e689 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/state/constant.METADATA.html @@ -0,0 +1,2 @@ +METADATA in oasis_runtime_sdk::modules::core::state - Rust

Constant oasis_runtime_sdk::modules::core::state::METADATA

source ·
pub const METADATA: &[u8];
Expand description

Runtime metadata.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/state/index.html b/rust/oasis_runtime_sdk/modules/core/state/index.html new file mode 100644 index 0000000000..c661f07687 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/state/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::core::state - Rust

Module oasis_runtime_sdk::modules::core::state

source ·
Expand description

State schema constants.

+

Constants§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/state/sidebar-items.js b/rust/oasis_runtime_sdk/modules/core/state/sidebar-items.js new file mode 100644 index 0000000000..ed46b55602 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/state/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["DYNAMIC_MIN_GAS_PRICE","LAST_EPOCH","MESSAGE_HANDLERS","METADATA"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/struct.DynamicMinGasPrice.html b/rust/oasis_runtime_sdk/modules/core/struct.DynamicMinGasPrice.html new file mode 100644 index 0000000000..6574ad6e30 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/struct.DynamicMinGasPrice.html @@ -0,0 +1,42 @@ +DynamicMinGasPrice in oasis_runtime_sdk::modules::core - Rust

Struct oasis_runtime_sdk::modules::core::DynamicMinGasPrice

source ·
pub struct DynamicMinGasPrice {
+    pub enabled: bool,
+    pub target_block_gas_usage_percentage: u8,
+    pub min_price_max_change_denominator: u8,
+}
Expand description

Dynamic min gas price parameters.

+

Fields§

§enabled: bool

Enables the dynamic min gas price feature which dynamically adjusts the minimum gas price +based on block fullness, inspired by EIP-1559.

+

Only takes effect if min_gas_price(s) are set.

+
§target_block_gas_usage_percentage: u8

Target block gas usage indicates the desired block gas usage as a percentage of the total +block gas limit.

+

The min gas price will adjust up or down depending on whether the actual gas usage is above +or below this target.

+
§min_price_max_change_denominator: u8

Represents a constant value used to limit the rate at which the min price can change +between blocks.

+

For example, if min_price_max_change_denominator is set to 8, the maximum change in +min price is 12.5% between blocks.

+

Trait Implementations§

source§

impl Clone for DynamicMinGasPrice

source§

fn clone(&self) -> DynamicMinGasPrice

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DynamicMinGasPrice

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for DynamicMinGasPrice

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for DynamicMinGasPrice

source§

fn default() -> DynamicMinGasPrice

Returns the “default value” for a type. Read more
source§

impl Encode for DynamicMinGasPrice

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for DynamicMinGasPrice

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/struct.GasCosts.html b/rust/oasis_runtime_sdk/modules/core/struct.GasCosts.html new file mode 100644 index 0000000000..83e9d618db --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/struct.GasCosts.html @@ -0,0 +1,33 @@ +GasCosts in oasis_runtime_sdk::modules::core - Rust

Struct oasis_runtime_sdk::modules::core::GasCosts

source ·
pub struct GasCosts {
+    pub tx_byte: u64,
+    pub storage_byte: u64,
+    pub auth_signature: u64,
+    pub auth_multisig_signer: u64,
+    pub callformat_x25519_deoxysii: u64,
+}
Expand description

Gas costs.

+

Fields§

§tx_byte: u64§storage_byte: u64§auth_signature: u64§auth_multisig_signer: u64§callformat_x25519_deoxysii: u64

Trait Implementations§

source§

impl Clone for GasCosts

source§

fn clone(&self) -> GasCosts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GasCosts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GasCosts

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for GasCosts

source§

fn default() -> GasCosts

Returns the “default value” for a type. Read more
source§

impl Encode for GasCosts

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GasCosts

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/struct.Genesis.html b/rust/oasis_runtime_sdk/modules/core/struct.Genesis.html new file mode 100644 index 0000000000..c8694bb5d3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/struct.Genesis.html @@ -0,0 +1,29 @@ +Genesis in oasis_runtime_sdk::modules::core - Rust

Struct oasis_runtime_sdk::modules::core::Genesis

source ·
pub struct Genesis {
+    pub parameters: Parameters,
+}
Expand description

Genesis state for the accounts module.

+

Fields§

§parameters: Parameters

Trait Implementations§

source§

impl Clone for Genesis

source§

fn clone(&self) -> Genesis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Genesis

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Genesis

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Genesis

source§

fn default() -> Genesis

Returns the “default value” for a type. Read more
source§

impl Encode for Genesis

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Genesis

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/struct.LocalConfig.html b/rust/oasis_runtime_sdk/modules/core/struct.LocalConfig.html new file mode 100644 index 0000000000..f9f514d627 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/struct.LocalConfig.html @@ -0,0 +1,41 @@ +LocalConfig in oasis_runtime_sdk::modules::core - Rust

Struct oasis_runtime_sdk::modules::core::LocalConfig

source ·
pub struct LocalConfig {
+    pub min_gas_price: BTreeMap<Denomination, u128>,
+    pub max_estimated_gas: u64,
+    pub estimate_gas_search_max_iters: u64,
+}
Expand description

Local configuration that can be provided by the node operator.

+

Fields§

§min_gas_price: BTreeMap<Denomination, u128>

Minimum gas price to accept.

+
§max_estimated_gas: u64

When estimating gas in core.EstimateGas, simulate the tx (and report) only up to this much +used gas. This limit is more likely to be relevant if estimate_gas_by_simulating_contracts is +enabled in the local config. The special value of 0 means that the maximum amount of gas in a +batch will be used.

+
§estimate_gas_search_max_iters: u64

The maximum number of iterations of the binary search to be done when simulating contracts for +gas estimation in core.EstimateGas. +The special value of 0 means that binary search won’t be performed, and the transaction will be +simulated using maximum possible gas, which might return an overestimation in some special cases. +This setting should likely be kept at 0, unless the runtime is using the EVM module.

+

Trait Implementations§

source§

impl Clone for LocalConfig

source§

fn clone(&self) -> LocalConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LocalConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for LocalConfig

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for LocalConfig

source§

fn default() -> LocalConfig

Returns the “default value” for a type. Read more
source§

impl Encode for LocalConfig

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for LocalConfig

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/struct.Module.html b/rust/oasis_runtime_sdk/modules/core/struct.Module.html new file mode 100644 index 0000000000..4c714db146 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/struct.Module.html @@ -0,0 +1,88 @@ +Module in oasis_runtime_sdk::modules::core - Rust

Struct oasis_runtime_sdk::modules::core::Module

source ·
pub struct Module<Cfg: Config> { /* private fields */ }

Implementations§

source§

impl<Cfg: Config> Module<Cfg>

source

pub fn init(genesis: Genesis)

source§

impl<Cfg: Config> Module<Cfg>

source

pub fn query_estimate_gas<C: Context>( + ctx: &C, + args: EstimateGasQuery, +) -> Result<u64, Error>

Run a transaction in simulation and return how much gas it uses. This looks up the method +in the context’s method registry. Transactions that fail still use gas, and this query will +estimate that and return successfully, so do not use this query to see if a transaction will +succeed.

+

Trait Implementations§

source§

impl<Cfg: Config> API for Module<Cfg>

§

type Config = Cfg

Module configuration.
source§

fn use_batch_gas(gas: u64) -> Result<(), Error>

Attempt to use gas. If the gas specified would cause either total used to exceed +its limit, fails with Error::OutOfGas or Error::BatchOutOfGas, and neither gas usage is +increased.
source§

fn use_tx_gas(gas: u64) -> Result<(), Error>

Attempt to use gas. If the gas specified would cause either total used to exceed +its limit, fails with Error::OutOfGas or Error::BatchOutOfGas, and neither gas usage is +increased.
source§

fn remaining_batch_gas() -> u64

Returns the remaining batch-wide gas.
source§

fn used_batch_gas() -> u64

Returns the total batch-wide gas used.
source§

fn remaining_tx_gas() -> u64

Return the remaining tx-wide gas.
source§

fn used_tx_gas() -> u64

Return the used tx-wide gas.
source§

fn max_batch_gas() -> u64

Configured maximum amount of gas that can be used in a batch.
source§

fn min_gas_price(denom: &Denomination) -> Option<u128>

Configured minimum gas price.
source§

fn set_priority(priority: u64)

Sets the transaction priority to the provided amount.
source§

fn take_priority() -> u64

Takes and returns the stored transaction priority.
source§

fn set_sender_meta(meta: SenderMeta)

Set transaction sender metadata.
source§

fn take_sender_meta() -> SenderMeta

Takes and returns the stored transaction sender metadata.
source§

fn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64

Returns the configured max iterations in the binary search for the estimate +gas.
source§

fn has_epoch_changed() -> bool

Check whether the epoch has changed since last processed block.
source§

impl<Cfg: Config> BlockHandler for Module<Cfg>

source§

fn begin_block<C: Context>(ctx: &C)

Perform any common actions at the start of the block (before any transactions have been +executed).
source§

fn end_block<C: Context>(_ctx: &C)

Perform any common actions at the end of the block (after all transactions have been +executed).
source§

impl<Cfg: Config> InvariantHandler for Module<Cfg>

source§

fn check_invariants<C: Context>(_ctx: &C) -> Result<(), Error>

Check invariants.
source§

impl<Cfg: Config> MethodHandler for Module<Cfg>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.
source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.
source§

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.
source§

fn is_expensive_query(method: &str) -> bool

Checks whether the given query method is tagged as expensive.
source§

fn is_allowed_private_km_query(method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.
source§

fn prefetch( + _prefixes: &mut BTreeSet<Prefix>, + _method: &str, + body: Value, + _auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

Add storage prefixes to prefetch.
source§

fn dispatch_message_result<C: Context>( + _ctx: &C, + _handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

Dispatch a message result.
source§

fn is_allowed_interactive_call(_method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.
source§

impl<Cfg: Config> MigrationHandler for Module<Cfg>

§

type Genesis = Genesis

Genesis state type. Read more
source§

fn init_or_migrate<C: Context>( + _ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration. Read more
source§

impl<Cfg: Config> Module for Module<Cfg>

source§

const NAME: &'static str = MODULE_NAME

Module name.
§

type Error = Error

Module error type.
§

type Event = Event

Module event type.
§

type Parameters = Parameters

Module parameters.
source§

const VERSION: u32 = 1u32

Module version.
source§

fn params() -> Self::Parameters

Return the module’s parameters.
source§

fn set_params(params: Self::Parameters)

Set the module’s parameters.
source§

impl<Cfg: Config> TransactionHandler for Module<Cfg>

source§

fn approve_raw_tx<C: Context>(_ctx: &C, tx: &[u8]) -> Result<(), Error>

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.
source§

fn approve_unverified_tx<C: Context>( + _ctx: &C, + utx: &UnverifiedTransaction, +) -> Result<(), Error>

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.
source§

fn authenticate_tx<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<AuthDecision, Error>

Authenticate a transaction. Read more
source§

fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error>

Perform any action after authentication, within the transaction context. Read more
source§

fn after_handle_call<C: Context>( + ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

Perform any action after call, within the transaction context. Read more
source§

fn decode_tx<C: Context>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>

Decode a transaction that was sent with module-controlled decoding and verify any +signatures. Read more
source§

fn before_authorized_call_dispatch<C: Context>( + _ctx: &C, + _call: &Call, +) -> Result<(), Error>

Perform any action after authentication and decoding, within the transaction context. Read more
source§

fn after_dispatch_tx<C: Context>( + _ctx: &C, + _tx_auth_info: &AuthInfo, + _result: &CallResult, +)

Perform any action after dispatching the transaction, in batch context.

Auto Trait Implementations§

§

impl<Cfg> Freeze for Module<Cfg>

§

impl<Cfg> RefUnwindSafe for Module<Cfg>
where + Cfg: RefUnwindSafe,

§

impl<Cfg> Send for Module<Cfg>
where + Cfg: Send,

§

impl<Cfg> Sync for Module<Cfg>
where + Cfg: Sync,

§

impl<Cfg> Unpin for Module<Cfg>
where + Cfg: Unpin,

§

impl<Cfg> UnwindSafe for Module<Cfg>
where + Cfg: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<M> ModuleInfoHandler for M
where + M: Module + MethodHandler,

source§

fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>
where + C: Context,

Reports info about the module (or modules, if Self is a tuple).
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/struct.Parameters.html b/rust/oasis_runtime_sdk/modules/core/struct.Parameters.html new file mode 100644 index 0000000000..9e1d1df552 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/struct.Parameters.html @@ -0,0 +1,35 @@ +Parameters in oasis_runtime_sdk::modules::core - Rust

Struct oasis_runtime_sdk::modules::core::Parameters

source ·
pub struct Parameters {
+    pub max_batch_gas: u64,
+    pub max_tx_size: u32,
+    pub max_tx_signers: u32,
+    pub max_multisig_signers: u32,
+    pub gas_costs: GasCosts,
+    pub min_gas_price: BTreeMap<Denomination, u128>,
+    pub dynamic_min_gas_price: DynamicMinGasPrice,
+}
Expand description

Parameters for the core module.

+

Fields§

§max_batch_gas: u64§max_tx_size: u32§max_tx_signers: u32§max_multisig_signers: u32§gas_costs: GasCosts§min_gas_price: BTreeMap<Denomination, u128>§dynamic_min_gas_price: DynamicMinGasPrice

Trait Implementations§

source§

impl Clone for Parameters

source§

fn clone(&self) -> Parameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Parameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Parameters

source§

fn default() -> Parameters

Returns the “default value” for a type. Read more
source§

impl Encode for Parameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Parameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Parameters for Parameters

§

type Error = ParameterValidationError

source§

fn validate_basic(&self) -> Result<(), Self::Error>

Perform basic parameter validation.
source§

const STORE_KEY: &'static [u8] = _

Store key used for storing parameters.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/struct.TxSimulationFailure.html b/rust/oasis_runtime_sdk/modules/core/struct.TxSimulationFailure.html new file mode 100644 index 0000000000..dfeb42bbe3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/struct.TxSimulationFailure.html @@ -0,0 +1,26 @@ +TxSimulationFailure in oasis_runtime_sdk::modules::core - Rust

Struct oasis_runtime_sdk::modules::core::TxSimulationFailure

source ·
pub struct TxSimulationFailure { /* private fields */ }
Expand description

Simulation failure error.

+

Implementations§

source§

impl TxSimulationFailure

source

pub fn is_error_core_out_of_gas(&self) -> bool

Returns true if the failure is “core::Error::OutOfGas”.

+

Trait Implementations§

source§

impl Debug for TxSimulationFailure

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for TxSimulationFailure

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for TxSimulationFailure

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

fn into_abort(self) -> Result<Error, Self>
where + Self: Sized,

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

impl Error for TxSimulationFailure

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<TxSimulationFailure> for Error

source§

fn from(source: TxSimulationFailure) -> Self

Converts to this type from the input type.
source§

impl TryFrom<CallResult> for TxSimulationFailure

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: CallResult) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/trait.API.html b/rust/oasis_runtime_sdk/modules/core/trait.API.html new file mode 100644 index 0000000000..43e614116e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/trait.API.html @@ -0,0 +1,40 @@ +API in oasis_runtime_sdk::modules::core - Rust

Trait oasis_runtime_sdk::modules::core::API

source ·
pub trait API {
+    type Config: Config;
+
+
Show 14 methods // Required methods + fn use_batch_gas(gas: u64) -> Result<(), Error>; + fn use_tx_gas(gas: u64) -> Result<(), Error>; + fn remaining_batch_gas() -> u64; + fn used_batch_gas() -> u64; + fn remaining_tx_gas() -> u64; + fn used_tx_gas() -> u64; + fn max_batch_gas() -> u64; + fn min_gas_price(denom: &Denomination) -> Option<u128>; + fn set_priority(priority: u64); + fn take_priority() -> u64; + fn set_sender_meta(meta: SenderMeta); + fn take_sender_meta() -> SenderMeta; + fn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64; + fn has_epoch_changed() -> bool; +
}
Expand description

Interface that can be called from other modules.

+

Required Associated Types§

source

type Config: Config

Module configuration.

+

Required Methods§

source

fn use_batch_gas(gas: u64) -> Result<(), Error>

Attempt to use gas. If the gas specified would cause either total used to exceed +its limit, fails with Error::OutOfGas or Error::BatchOutOfGas, and neither gas usage is +increased.

+
source

fn use_tx_gas(gas: u64) -> Result<(), Error>

Attempt to use gas. If the gas specified would cause either total used to exceed +its limit, fails with Error::OutOfGas or Error::BatchOutOfGas, and neither gas usage is +increased.

+
source

fn remaining_batch_gas() -> u64

Returns the remaining batch-wide gas.

+
source

fn used_batch_gas() -> u64

Returns the total batch-wide gas used.

+
source

fn remaining_tx_gas() -> u64

Return the remaining tx-wide gas.

+
source

fn used_tx_gas() -> u64

Return the used tx-wide gas.

+
source

fn max_batch_gas() -> u64

Configured maximum amount of gas that can be used in a batch.

+
source

fn min_gas_price(denom: &Denomination) -> Option<u128>

Configured minimum gas price.

+
source

fn set_priority(priority: u64)

Sets the transaction priority to the provided amount.

+
source

fn take_priority() -> u64

Takes and returns the stored transaction priority.

+
source

fn set_sender_meta(meta: SenderMeta)

Set transaction sender metadata.

+
source

fn take_sender_meta() -> SenderMeta

Takes and returns the stored transaction sender metadata.

+
source

fn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64

Returns the configured max iterations in the binary search for the estimate +gas.

+
source

fn has_epoch_changed() -> bool

Check whether the epoch has changed since last processed block.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Cfg: Config> API for Module<Cfg>

§

type Config = Cfg

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/trait.Config.html b/rust/oasis_runtime_sdk/modules/core/trait.Config.html new file mode 100644 index 0000000000..0ad9451a8e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/trait.Config.html @@ -0,0 +1,23 @@ +Config in oasis_runtime_sdk::modules::core - Rust

Trait oasis_runtime_sdk::modules::core::Config

source ·
pub trait Config: 'static {
+    const DEFAULT_LOCAL_MIN_GAS_PRICE: Lazy<BTreeMap<Denomination, u128>> = _;
+    const DEFAULT_LOCAL_ESTIMATE_GAS_SEARCH_MAX_ITERS: u64 = 0u64;
+    const ESTIMATE_GAS_EXTRA_FAIL: Lazy<BTreeMap<&'static str, u64>> = _;
+    const MIN_GAS_PRICE_EXEMPT_METHODS: Lazy<BTreeSet<&'static str>> = _;
+    const EMIT_GAS_USED_EVENTS: bool = true;
+    const ALLOW_INTERACTIVE_READ_ONLY_TRANSACTIONS: bool = false;
+    const GAS_COST_CALL_CALLDATA_PUBLIC_KEY: u64 = 20u64;
+    const GAS_COST_CALL_CURRENT_EPOCH: u64 = 10u64;
+}
Expand description

Module configuration.

+

Provided Associated Constants§

source

const DEFAULT_LOCAL_MIN_GAS_PRICE: Lazy<BTreeMap<Denomination, u128>> = _

Default local minimum gas price configuration that is used in case no overrides are set in +local per-node configuration.

+
source

const DEFAULT_LOCAL_ESTIMATE_GAS_SEARCH_MAX_ITERS: u64 = 0u64

Default local estimate gas max search iterations configuration that is used in case no overrides +are set in the local per-node configuration.

+
source

const ESTIMATE_GAS_EXTRA_FAIL: Lazy<BTreeMap<&'static str, u64>> = _

Estimated gas amount to be added to failed transaction simulations for selected methods.

+
source

const MIN_GAS_PRICE_EXEMPT_METHODS: Lazy<BTreeSet<&'static str>> = _

Methods which are exempt from minimum gas price requirements.

+
source

const EMIT_GAS_USED_EVENTS: bool = true

Whether gas used events should be emitted for every transaction.

+

Confidential runtimes may want to disable this as it is a possible side channel.

+
source

const ALLOW_INTERACTIVE_READ_ONLY_TRANSACTIONS: bool = false

Whether to allow submission of read-only transactions in an interactive way.

+

Note that execution of such transactions is allowed to access confidential state.

+
source

const GAS_COST_CALL_CALLDATA_PUBLIC_KEY: u64 = 20u64

The gas cost of the internal call to retrieve the current calldata public key.

+
source

const GAS_COST_CALL_CURRENT_EPOCH: u64 = 10u64

The gas cost of the internal call to retrieve the current epoch.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/constant.VERSION_GLOBAL_KEY.html b/rust/oasis_runtime_sdk/modules/core/types/constant.VERSION_GLOBAL_KEY.html new file mode 100644 index 0000000000..0ea497c978 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/constant.VERSION_GLOBAL_KEY.html @@ -0,0 +1,2 @@ +VERSION_GLOBAL_KEY in oasis_runtime_sdk::modules::core::types - Rust

Constant oasis_runtime_sdk::modules::core::types::VERSION_GLOBAL_KEY

source ·
pub const VERSION_GLOBAL_KEY: &str = "";
Expand description

Key in the versions map used for the global state version.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/enum.MethodHandlerKind.html b/rust/oasis_runtime_sdk/modules/core/types/enum.MethodHandlerKind.html new file mode 100644 index 0000000000..093ccd3b9d --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/enum.MethodHandlerKind.html @@ -0,0 +1,30 @@ +MethodHandlerKind in oasis_runtime_sdk::modules::core::types - Rust
pub enum MethodHandlerKind {
+    Call,
+    Query,
+    MessageResult,
+}

Variants§

§

Call

§

Query

§

MessageResult

Trait Implementations§

source§

impl Clone for MethodHandlerKind

source§

fn clone(&self) -> MethodHandlerKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MethodHandlerKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MethodHandlerKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for MethodHandlerKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Copy for MethodHandlerKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/index.html b/rust/oasis_runtime_sdk/modules/core/types/index.html new file mode 100644 index 0000000000..a78e04c9be --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/index.html @@ -0,0 +1 @@ +oasis_runtime_sdk::modules::core::types - Rust

Module oasis_runtime_sdk::modules::core::types

source ·

Structs§

Enums§

Constants§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/sidebar-items.js b/rust/oasis_runtime_sdk/modules/core/types/sidebar-items.js new file mode 100644 index 0000000000..c0c311ed41 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["VERSION_GLOBAL_KEY"],"enum":["MethodHandlerKind"],"struct":["CallDataPublicKeyQueryResponse","EstimateGasQuery","ExecuteReadOnlyTxQuery","ExecuteReadOnlyTxResponse","Metadata","MethodHandlerInfo","ModuleInfo","RuntimeInfoResponse"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/struct.CallDataPublicKeyQueryResponse.html b/rust/oasis_runtime_sdk/modules/core/types/struct.CallDataPublicKeyQueryResponse.html new file mode 100644 index 0000000000..38ad272162 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/struct.CallDataPublicKeyQueryResponse.html @@ -0,0 +1,32 @@ +CallDataPublicKeyQueryResponse in oasis_runtime_sdk::modules::core::types - Rust
pub struct CallDataPublicKeyQueryResponse {
+    pub public_key: SignedPublicKey,
+    pub epoch: u64,
+}
Expand description

Response to the call data public key query.

+

Fields§

§public_key: SignedPublicKey

Public key used for deriving the shared secret for encrypting call data.

+
§epoch: u64

Epoch of the ephemeral runtime key.

+

Trait Implementations§

source§

impl Clone for CallDataPublicKeyQueryResponse

source§

fn clone(&self) -> CallDataPublicKeyQueryResponse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallDataPublicKeyQueryResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CallDataPublicKeyQueryResponse

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CallDataPublicKeyQueryResponse

source§

fn default() -> CallDataPublicKeyQueryResponse

Returns the “default value” for a type. Read more
source§

impl Encode for CallDataPublicKeyQueryResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CallDataPublicKeyQueryResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/struct.EstimateGasQuery.html b/rust/oasis_runtime_sdk/modules/core/types/struct.EstimateGasQuery.html new file mode 100644 index 0000000000..199c0673b7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/struct.EstimateGasQuery.html @@ -0,0 +1,38 @@ +EstimateGasQuery in oasis_runtime_sdk::modules::core::types - Rust

Struct oasis_runtime_sdk::modules::core::types::EstimateGasQuery

source ·
pub struct EstimateGasQuery {
+    pub caller: Option<CallerAddress>,
+    pub tx: Transaction,
+    pub propagate_failures: bool,
+}
Expand description

Arguments for the EstimateGas query.

+

Fields§

§caller: Option<CallerAddress>

The address of the caller for which to do estimation. If not specified the authentication +information from the passed transaction is used.

+
§tx: Transaction

The unsigned transaction to estimate.

+
§propagate_failures: bool

If the estimate gas query should fail in case of transaction failures. +If true, the query will return the transaction error and not the gas estimation. +Defaults to false.

+

Trait Implementations§

source§

impl Clone for EstimateGasQuery

source§

fn clone(&self) -> EstimateGasQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EstimateGasQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EstimateGasQuery

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for EstimateGasQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EstimateGasQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/struct.ExecuteReadOnlyTxQuery.html b/rust/oasis_runtime_sdk/modules/core/types/struct.ExecuteReadOnlyTxQuery.html new file mode 100644 index 0000000000..eb323cde27 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/struct.ExecuteReadOnlyTxQuery.html @@ -0,0 +1,29 @@ +ExecuteReadOnlyTxQuery in oasis_runtime_sdk::modules::core::types - Rust
pub struct ExecuteReadOnlyTxQuery {
+    pub tx: Vec<u8>,
+}
Expand description

Arguments for the ExecuteReadOnlyTx query.

+

Fields§

§tx: Vec<u8>

Trait Implementations§

source§

impl Clone for ExecuteReadOnlyTxQuery

source§

fn clone(&self) -> ExecuteReadOnlyTxQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecuteReadOnlyTxQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecuteReadOnlyTxQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecuteReadOnlyTxQuery

source§

fn default() -> ExecuteReadOnlyTxQuery

Returns the “default value” for a type. Read more
source§

impl Encode for ExecuteReadOnlyTxQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExecuteReadOnlyTxQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/struct.ExecuteReadOnlyTxResponse.html b/rust/oasis_runtime_sdk/modules/core/types/struct.ExecuteReadOnlyTxResponse.html new file mode 100644 index 0000000000..1da8ac1257 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/struct.ExecuteReadOnlyTxResponse.html @@ -0,0 +1,29 @@ +ExecuteReadOnlyTxResponse in oasis_runtime_sdk::modules::core::types - Rust
pub struct ExecuteReadOnlyTxResponse {
+    pub result: CallResult,
+}
Expand description

Response to the ExecuteReadOnlyTx query.

+

Fields§

§result: CallResult

Trait Implementations§

source§

impl Clone for ExecuteReadOnlyTxResponse

source§

fn clone(&self) -> ExecuteReadOnlyTxResponse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExecuteReadOnlyTxResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ExecuteReadOnlyTxResponse

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ExecuteReadOnlyTxResponse

source§

fn default() -> ExecuteReadOnlyTxResponse

Returns the “default value” for a type. Read more
source§

impl Encode for ExecuteReadOnlyTxResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ExecuteReadOnlyTxResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/struct.Metadata.html b/rust/oasis_runtime_sdk/modules/core/types/struct.Metadata.html new file mode 100644 index 0000000000..f771a0287c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/struct.Metadata.html @@ -0,0 +1,30 @@ +Metadata in oasis_runtime_sdk::modules::core::types - Rust

Struct oasis_runtime_sdk::modules::core::types::Metadata

source ·
pub struct Metadata {
+    pub versions: BTreeMap<String, u32>,
+}
Expand description

Basic per-module metadata; tracked in core module’s state.

+

Fields§

§versions: BTreeMap<String, u32>

A set of state versions for all supported modules.

+

Trait Implementations§

source§

impl Clone for Metadata

source§

fn clone(&self) -> Metadata

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Metadata

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Metadata

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Metadata

source§

fn default() -> Metadata

Returns the “default value” for a type. Read more
source§

impl Encode for Metadata

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Metadata

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/struct.MethodHandlerInfo.html b/rust/oasis_runtime_sdk/modules/core/types/struct.MethodHandlerInfo.html new file mode 100644 index 0000000000..c75aa2ebc9 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/struct.MethodHandlerInfo.html @@ -0,0 +1,30 @@ +MethodHandlerInfo in oasis_runtime_sdk::modules::core::types - Rust

Struct oasis_runtime_sdk::modules::core::types::MethodHandlerInfo

source ·
pub struct MethodHandlerInfo {
+    pub kind: MethodHandlerKind,
+    pub name: String,
+}

Fields§

§kind: MethodHandlerKind§name: String

Trait Implementations§

source§

impl Clone for MethodHandlerInfo

source§

fn clone(&self) -> MethodHandlerInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MethodHandlerInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MethodHandlerInfo

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for MethodHandlerInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for MethodHandlerInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/struct.ModuleInfo.html b/rust/oasis_runtime_sdk/modules/core/types/struct.ModuleInfo.html new file mode 100644 index 0000000000..1cf6bde0bc --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/struct.ModuleInfo.html @@ -0,0 +1,32 @@ +ModuleInfo in oasis_runtime_sdk::modules::core::types - Rust

Struct oasis_runtime_sdk::modules::core::types::ModuleInfo

source ·
pub struct ModuleInfo {
+    pub version: u32,
+    pub params: Value,
+    pub methods: Vec<MethodHandlerInfo>,
+}
Expand description

Metadata for an individual module.

+

Fields§

§version: u32§params: Value§methods: Vec<MethodHandlerInfo>

Trait Implementations§

source§

impl Clone for ModuleInfo

source§

fn clone(&self) -> ModuleInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ModuleInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ModuleInfo

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for ModuleInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ModuleInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/core/types/struct.RuntimeInfoResponse.html b/rust/oasis_runtime_sdk/modules/core/types/struct.RuntimeInfoResponse.html new file mode 100644 index 0000000000..f7fec660cf --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/core/types/struct.RuntimeInfoResponse.html @@ -0,0 +1,32 @@ +RuntimeInfoResponse in oasis_runtime_sdk::modules::core::types - Rust
pub struct RuntimeInfoResponse {
+    pub runtime_version: Version,
+    pub state_version: u32,
+    pub modules: BTreeMap<String, ModuleInfo>,
+}
Expand description

Response to the RuntimeInfo query.

+

Fields§

§runtime_version: Version§state_version: u32§modules: BTreeMap<String, ModuleInfo>

Trait Implementations§

source§

impl Clone for RuntimeInfoResponse

source§

fn clone(&self) -> RuntimeInfoResponse

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RuntimeInfoResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RuntimeInfoResponse

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for RuntimeInfoResponse

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RuntimeInfoResponse

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/index.html b/rust/oasis_runtime_sdk/modules/index.html new file mode 100644 index 0000000000..fd1f46ec2f --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules - Rust

Module oasis_runtime_sdk::modules

source ·
Expand description

Runtime modules included with the SDK.

+

Modules§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/enum.Error.html b/rust/oasis_runtime_sdk/modules/rewards/enum.Error.html new file mode 100644 index 0000000000..ab4f7286f2 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/enum.Error.html @@ -0,0 +1,26 @@ +Error in oasis_runtime_sdk::modules::rewards - Rust

Enum oasis_runtime_sdk::modules::rewards::Error

source ·
pub enum Error {
+    InvalidArgument,
+}
Expand description

Errors emitted by the rewards module.

+

Variants§

§

InvalidArgument

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/enum.ParameterValidationError.html b/rust/oasis_runtime_sdk/modules/rewards/enum.ParameterValidationError.html new file mode 100644 index 0000000000..0228c0aff4 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/enum.ParameterValidationError.html @@ -0,0 +1,25 @@ +ParameterValidationError in oasis_runtime_sdk::modules::rewards - Rust
pub enum ParameterValidationError {
+    InvalidParticipationThreshold,
+    InvalidSchedule(RewardScheduleError),
+}
Expand description

Errors emitted during rewards parameter validation.

+

Variants§

§

InvalidParticipationThreshold

§

InvalidSchedule(RewardScheduleError)

Trait Implementations§

source§

impl Debug for ParameterValidationError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ParameterValidationError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ParameterValidationError

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<RewardScheduleError> for ParameterValidationError

source§

fn from(source: RewardScheduleError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/index.html b/rust/oasis_runtime_sdk/modules/rewards/index.html new file mode 100644 index 0000000000..86714a36b0 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::rewards - Rust

Module oasis_runtime_sdk::modules::rewards

source ·
Expand description

Rewards module.

+

Modules§

  • State schema constants.
  • Rewards module types.

Structs§

Enums§

Statics§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rewards/sidebar-items.js new file mode 100644 index 0000000000..0603de2cfd --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","ParameterValidationError"],"mod":["state","types"],"static":["ADDRESS_REWARD_POOL"],"struct":["Genesis","Module","Parameters"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/state/constant.REWARDS.html b/rust/oasis_runtime_sdk/modules/rewards/state/constant.REWARDS.html new file mode 100644 index 0000000000..c461435acf --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/state/constant.REWARDS.html @@ -0,0 +1,2 @@ +REWARDS in oasis_runtime_sdk::modules::rewards::state - Rust

Constant oasis_runtime_sdk::modules::rewards::state::REWARDS

source ·
pub const REWARDS: &[u8];
Expand description

Map of epochs to rewards pending distribution.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/state/index.html b/rust/oasis_runtime_sdk/modules/rewards/state/index.html new file mode 100644 index 0000000000..d62bb601e7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/state/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::rewards::state - Rust

Module oasis_runtime_sdk::modules::rewards::state

source ·
Expand description

State schema constants.

+

Constants§

  • Map of epochs to rewards pending distribution.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/state/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rewards/state/sidebar-items.js new file mode 100644 index 0000000000..ade63e758b --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/state/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["REWARDS"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/static.ADDRESS_REWARD_POOL.html b/rust/oasis_runtime_sdk/modules/rewards/static.ADDRESS_REWARD_POOL.html new file mode 100644 index 0000000000..f1539bfb0e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/static.ADDRESS_REWARD_POOL.html @@ -0,0 +1,3 @@ +ADDRESS_REWARD_POOL in oasis_runtime_sdk::modules::rewards - Rust
pub static ADDRESS_REWARD_POOL: Lazy<Address>
Expand description

Module’s address that has the reward pool.

+

oasis1qp7x0q9qahahhjas0xde8w0v04ctp4pqzu5mhjav

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/struct.Genesis.html b/rust/oasis_runtime_sdk/modules/rewards/struct.Genesis.html new file mode 100644 index 0000000000..43664832c7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/struct.Genesis.html @@ -0,0 +1,29 @@ +Genesis in oasis_runtime_sdk::modules::rewards - Rust

Struct oasis_runtime_sdk::modules::rewards::Genesis

source ·
pub struct Genesis {
+    pub parameters: Parameters,
+}
Expand description

Genesis state for the rewards module.

+

Fields§

§parameters: Parameters

Trait Implementations§

source§

impl Clone for Genesis

source§

fn clone(&self) -> Genesis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Genesis

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Genesis

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Genesis

source§

fn default() -> Genesis

Returns the “default value” for a type. Read more
source§

impl Encode for Genesis

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Genesis

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/struct.Module.html b/rust/oasis_runtime_sdk/modules/rewards/struct.Module.html new file mode 100644 index 0000000000..b135ba700e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/struct.Module.html @@ -0,0 +1,72 @@ +Module in oasis_runtime_sdk::modules::rewards - Rust

Struct oasis_runtime_sdk::modules::rewards::Module

source ·
pub struct Module;
Expand description

Rewards module.

+

Trait Implementations§

source§

impl BlockHandler for Module

source§

fn end_block<C: Context>(ctx: &C)

Perform any common actions at the end of the block (after all transactions have been +executed).
source§

fn begin_block<C: Context>(_ctx: &C)

Perform any common actions at the start of the block (before any transactions have been +executed).
source§

impl InvariantHandler for Module

source§

fn check_invariants<C: Context>(_ctx: &C) -> Result<(), Error>

Check invariants.
source§

impl MethodHandler for Module

source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.
source§

fn prefetch( + _prefixes: &mut BTreeSet<Prefix>, + _method: &str, + body: Value, + _auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

Add storage prefixes to prefetch.
source§

fn dispatch_call<C: Context>( + _ctx: &C, + _method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.
source§

fn dispatch_message_result<C: Context>( + _ctx: &C, + _handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

Dispatch a message result.
source§

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.
source§

fn is_expensive_query(_method: &str) -> bool

Checks whether the given query method is tagged as expensive.
source§

fn is_allowed_private_km_query(_method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.
source§

fn is_allowed_interactive_call(_method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.
source§

impl MigrationHandler for Module

§

type Genesis = Genesis

Genesis state type. Read more
source§

fn init_or_migrate<C: Context>( + _ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration. Read more
source§

impl Module for Module

source§

const NAME: &'static str = MODULE_NAME

Module name.
source§

const VERSION: u32 = 2u32

Module version.
§

type Error = Error

Module error type.
§

type Event = ()

Module event type.
§

type Parameters = Parameters

Module parameters.
source§

fn params() -> Self::Parameters

Return the module’s parameters.
source§

fn set_params(params: Self::Parameters)

Set the module’s parameters.
source§

impl TransactionHandler for Module

source§

fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.
source§

fn approve_unverified_tx<C: Context>( + _ctx: &C, + _utx: &UnverifiedTransaction, +) -> Result<(), Error>

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.
source§

fn decode_tx<C: Context>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>

Decode a transaction that was sent with module-controlled decoding and verify any +signatures. Read more
source§

fn authenticate_tx<C: Context>( + _ctx: &C, + _tx: &Transaction, +) -> Result<AuthDecision, Error>

Authenticate a transaction. Read more
source§

fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>

Perform any action after authentication, within the transaction context. Read more
source§

fn before_authorized_call_dispatch<C: Context>( + _ctx: &C, + _call: &Call, +) -> Result<(), Error>

Perform any action after authentication and decoding, within the transaction context. Read more
source§

fn after_handle_call<C: Context>( + _ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

Perform any action after call, within the transaction context. Read more
source§

fn after_dispatch_tx<C: Context>( + _ctx: &C, + _tx_auth_info: &AuthInfo, + _result: &CallResult, +)

Perform any action after dispatching the transaction, in batch context.

Auto Trait Implementations§

§

impl Freeze for Module

§

impl RefUnwindSafe for Module

§

impl Send for Module

§

impl Sync for Module

§

impl Unpin for Module

§

impl UnwindSafe for Module

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<M> ModuleInfoHandler for M
where + M: Module + MethodHandler,

source§

fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>
where + C: Context,

Reports info about the module (or modules, if Self is a tuple).
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/struct.Parameters.html b/rust/oasis_runtime_sdk/modules/rewards/struct.Parameters.html new file mode 100644 index 0000000000..0746e93594 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/struct.Parameters.html @@ -0,0 +1,31 @@ +Parameters in oasis_runtime_sdk::modules::rewards - Rust

Struct oasis_runtime_sdk::modules::rewards::Parameters

source ·
pub struct Parameters {
+    pub schedule: RewardSchedule,
+    pub participation_threshold_numerator: u64,
+    pub participation_threshold_denominator: u64,
+}
Expand description

Parameters for the rewards module.

+

Fields§

§schedule: RewardSchedule§participation_threshold_numerator: u64§participation_threshold_denominator: u64

Trait Implementations§

source§

impl Clone for Parameters

source§

fn clone(&self) -> Parameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Parameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Parameters

source§

fn default() -> Parameters

Returns the “default value” for a type. Read more
source§

impl Encode for Parameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Parameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Parameters for Parameters

§

type Error = ParameterValidationError

source§

fn validate_basic(&self) -> Result<(), Self::Error>

Perform basic parameter validation.
source§

const STORE_KEY: &'static [u8] = _

Store key used for storing parameters.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/types/enum.RewardAction.html b/rust/oasis_runtime_sdk/modules/rewards/types/enum.RewardAction.html new file mode 100644 index 0000000000..5f6195539d --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/types/enum.RewardAction.html @@ -0,0 +1,36 @@ +RewardAction in oasis_runtime_sdk::modules::rewards::types - Rust

Enum oasis_runtime_sdk::modules::rewards::types::RewardAction

source ·
pub enum RewardAction {
+    Reward(u64),
+    NoReward,
+}
Expand description

Action that should be taken for a given address when disbursing rewards.

+

Variants§

§

Reward(u64)

§

NoReward

Implementations§

source§

impl RewardAction

source

pub fn increment(&mut self)

Increment the reward counter associated with the reward.

+

In case the action is NoReward nothing is changed.

+
source

pub fn forbid(&mut self)

Forbids any rewards from accumulating.

+
source

pub fn value(&self) -> u64

Value of the reward counter.

+

Trait Implementations§

source§

impl Clone for RewardAction

source§

fn clone(&self) -> RewardAction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RewardAction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RewardAction

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RewardAction

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for RewardAction

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for RewardAction

source§

fn eq(&self, other: &RewardAction) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for RewardAction

source§

impl StructuralPartialEq for RewardAction

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/types/enum.RewardScheduleError.html b/rust/oasis_runtime_sdk/modules/rewards/types/enum.RewardScheduleError.html new file mode 100644 index 0000000000..9176b49bdf --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/types/enum.RewardScheduleError.html @@ -0,0 +1,24 @@ +RewardScheduleError in oasis_runtime_sdk::modules::rewards::types - Rust
pub enum RewardScheduleError {
+    StepsNotSorted,
+}
Expand description

Errors emitted during reward schedule validation.

+

Variants§

§

StepsNotSorted

Trait Implementations§

source§

impl Debug for RewardScheduleError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for RewardScheduleError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for RewardScheduleError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<RewardScheduleError> for ParameterValidationError

source§

fn from(source: RewardScheduleError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/types/index.html b/rust/oasis_runtime_sdk/modules/rewards/types/index.html new file mode 100644 index 0000000000..700843dfdf --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/types/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::rewards::types - Rust

Module oasis_runtime_sdk::modules::rewards::types

source ·
Expand description

Rewards module types.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/types/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rewards/types/sidebar-items.js new file mode 100644 index 0000000000..c7da86056a --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["RewardAction","RewardScheduleError"],"struct":["EpochRewards","RewardSchedule","RewardStep"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/types/struct.EpochRewards.html b/rust/oasis_runtime_sdk/modules/rewards/types/struct.EpochRewards.html new file mode 100644 index 0000000000..56cfb4ae4a --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/types/struct.EpochRewards.html @@ -0,0 +1,34 @@ +EpochRewards in oasis_runtime_sdk::modules::rewards::types - Rust

Struct oasis_runtime_sdk::modules::rewards::types::EpochRewards

source ·
pub struct EpochRewards {
+    pub pending: BTreeMap<Address, RewardAction>,
+}
Expand description

Rewards for the epoch.

+

Fields§

§pending: BTreeMap<Address, RewardAction>

Implementations§

source§

impl EpochRewards

source

pub fn for_disbursement( + &self, + threshold_numerator: u64, + threshold_denominator: u64, +) -> impl Iterator<Item = Address> + '_

Returns an iterator over addresses that should be rewarded.

+

Trait Implementations§

source§

impl Clone for EpochRewards

source§

fn clone(&self) -> EpochRewards

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EpochRewards

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for EpochRewards

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for EpochRewards

source§

fn default() -> EpochRewards

Returns the “default value” for a type. Read more
source§

impl Encode for EpochRewards

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for EpochRewards

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/types/struct.RewardSchedule.html b/rust/oasis_runtime_sdk/modules/rewards/types/struct.RewardSchedule.html new file mode 100644 index 0000000000..13b4bdaa55 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/types/struct.RewardSchedule.html @@ -0,0 +1,31 @@ +RewardSchedule in oasis_runtime_sdk::modules::rewards::types - Rust

Struct oasis_runtime_sdk::modules::rewards::types::RewardSchedule

source ·
pub struct RewardSchedule {
+    pub steps: Vec<RewardStep>,
+}
Expand description

A reward schedule.

+

Fields§

§steps: Vec<RewardStep>

Implementations§

source§

impl RewardSchedule

source

pub fn validate_basic(&self) -> Result<(), RewardScheduleError>

Perform basic reward schedule validation.

+
source

pub fn for_epoch(&self, epoch: EpochTime) -> BaseUnits

Compute the per-entity reward amount for the given epoch based on the schedule.

+

Trait Implementations§

source§

impl Clone for RewardSchedule

source§

fn clone(&self) -> RewardSchedule

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RewardSchedule

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RewardSchedule

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RewardSchedule

source§

fn default() -> RewardSchedule

Returns the “default value” for a type. Read more
source§

impl Encode for RewardSchedule

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RewardSchedule

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rewards/types/struct.RewardStep.html b/rust/oasis_runtime_sdk/modules/rewards/types/struct.RewardStep.html new file mode 100644 index 0000000000..1f788611a7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rewards/types/struct.RewardStep.html @@ -0,0 +1,30 @@ +RewardStep in oasis_runtime_sdk::modules::rewards::types - Rust

Struct oasis_runtime_sdk::modules::rewards::types::RewardStep

source ·
pub struct RewardStep {
+    pub until: EpochTime,
+    pub amount: BaseUnits,
+}
Expand description

One of the time periods in the reward schedule.

+

Fields§

§until: EpochTime§amount: BaseUnits

Trait Implementations§

source§

impl Clone for RewardStep

source§

fn clone(&self) -> RewardStep

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RewardStep

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for RewardStep

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for RewardStep

source§

fn default() -> RewardStep

Returns the “default value” for a type. Read more
source§

impl Encode for RewardStep

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for RewardStep

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/client/struct.Client.html b/rust/oasis_runtime_sdk/modules/rofl/app/client/struct.Client.html new file mode 100644 index 0000000000..eb4a12999e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/client/struct.Client.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_runtime_sdk/modules/rofl/app/struct.Client.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/env/struct.Environment.html b/rust/oasis_runtime_sdk/modules/rofl/app/env/struct.Environment.html new file mode 100644 index 0000000000..7f86ec5ce1 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/env/struct.Environment.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../oasis_runtime_sdk/modules/rofl/app/struct.Environment.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/index.html b/rust/oasis_runtime_sdk/modules/rofl/app/index.html new file mode 100644 index 0000000000..762c00f16a --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::rofl::app - Rust

Module oasis_runtime_sdk::modules::rofl::app

source ·
Expand description

Wrapper to make development of ROFL components easier.

+

Re-exports§

  • pub use crate::modules::rofl::app_id::AppId;

Modules§

  • Prelude for ROFL applications.

Structs§

  • A runtime client meant for use within runtimes.
  • Application environment.

Traits§

  • ROFL component application.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/prelude/attr.async_trait.html b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/attr.async_trait.html new file mode 100644 index 0000000000..eaec3968b0 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/attr.async_trait.html @@ -0,0 +1 @@ +async_trait in oasis_runtime_sdk::modules::rofl::app::prelude - Rust

Attribute Macro oasis_runtime_sdk::modules::rofl::app::prelude::async_trait

source ·
#[async_trait]
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/prelude/index.html b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/index.html new file mode 100644 index 0000000000..784e7136d0 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/index.html @@ -0,0 +1,3 @@ +oasis_runtime_sdk::modules::rofl::app::prelude - Rust

Module oasis_runtime_sdk::modules::rofl::app::prelude

source ·
Expand description

Prelude for ROFL applications.

+

Re-exports§

Structs§

  • A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically +Reference Counted’.
  • Consensus layer trust root.
  • A protocol or runtime version.

Type Aliases§

Attribute Macros§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/prelude/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/sidebar-items.js new file mode 100644 index 0000000000..90a8793e75 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"attr":["async_trait"],"struct":["Arc","TrustRoot","Version"],"type":["Result"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.Arc.html b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.Arc.html new file mode 100644 index 0000000000..90554600fd --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.Arc.html @@ -0,0 +1,1590 @@ +Arc in oasis_runtime_sdk::modules::rofl::app::prelude - Rust

Struct oasis_runtime_sdk::modules::rofl::app::prelude::Arc

1.0.0 · source ·
pub struct Arc<T, A = Global>
where + A: Allocator, + T: ?Sized,
{ /* private fields */ }
Expand description

A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically +Reference Counted’.

+

The type Arc<T> provides shared ownership of a value of type T, +allocated in the heap. Invoking clone on Arc produces +a new Arc instance, which points to the same allocation on the heap as the +source Arc, while increasing a reference count. When the last Arc +pointer to a given allocation is destroyed, the value stored in that allocation (often +referred to as “inner value”) is also dropped.

+

Shared references in Rust disallow mutation by default, and Arc is no +exception: you cannot generally obtain a mutable reference to something +inside an Arc. If you need to mutate through an Arc, use +Mutex, RwLock, or one of the Atomic +types.

+

Note: This type is only available on platforms that support atomic +loads and stores of pointers, which includes all platforms that support +the std crate but not all those which only support alloc. +This may be detected at compile time using #[cfg(target_has_atomic = "ptr")].

+

§Thread Safety

+

Unlike Rc<T>, Arc<T> uses atomic operations for its reference +counting. This means that it is thread-safe. The disadvantage is that +atomic operations are more expensive than ordinary memory accesses. If you +are not sharing reference-counted allocations between threads, consider using +Rc<T> for lower overhead. Rc<T> is a safe default, because the +compiler will catch any attempt to send an Rc<T> between threads. +However, a library might choose Arc<T> in order to give library consumers +more flexibility.

+

Arc<T> will implement Send and Sync as long as the T implements +Send and Sync. Why can’t you put a non-thread-safe type T in an +Arc<T> to make it thread-safe? This may be a bit counter-intuitive at +first: after all, isn’t the point of Arc<T> thread safety? The key is +this: Arc<T> makes it thread safe to have multiple ownership of the same +data, but it doesn’t add thread safety to its data. Consider +Arc<RefCell<T>>. RefCell<T> isn’t Sync, and if Arc<T> was always +Send, Arc<RefCell<T>> would be as well. But then we’d have a problem: +RefCell<T> is not thread safe; it keeps track of the borrowing count using +non-atomic operations.

+

In the end, this means that you may need to pair Arc<T> with some sort of +std::sync type, usually Mutex<T>.

+

§Breaking cycles with Weak

+

The downgrade method can be used to create a non-owning +Weak pointer. A Weak pointer can be upgraded +to an Arc, but this will return None if the value stored in the allocation has +already been dropped. In other words, Weak pointers do not keep the value +inside the allocation alive; however, they do keep the allocation +(the backing store for the value) alive.

+

A cycle between Arc pointers will never be deallocated. For this reason, +Weak is used to break cycles. For example, a tree could have +strong Arc pointers from parent nodes to children, and Weak +pointers from children back to their parents.

+

§Cloning references

+

Creating a new reference from an existing reference-counted pointer is done using the +Clone trait implemented for Arc<T> and Weak<T>.

+ +
use std::sync::Arc;
+let foo = Arc::new(vec![1.0, 2.0, 3.0]);
+// The two syntaxes below are equivalent.
+let a = foo.clone();
+let b = Arc::clone(&foo);
+// a, b, and foo are all Arcs that point to the same memory location
+

§Deref behavior

+

Arc<T> automatically dereferences to T (via the Deref trait), +so you can call T’s methods on a value of type Arc<T>. To avoid name +clashes with T’s methods, the methods of Arc<T> itself are associated +functions, called using fully qualified syntax:

+ +
use std::sync::Arc;
+
+let my_arc = Arc::new(());
+let my_weak = Arc::downgrade(&my_arc);
+

Arc<T>’s implementations of traits like Clone may also be called using +fully qualified syntax. Some people prefer to use fully qualified syntax, +while others prefer using method-call syntax.

+ +
use std::sync::Arc;
+
+let arc = Arc::new(());
+// Method-call syntax
+let arc2 = arc.clone();
+// Fully qualified syntax
+let arc3 = Arc::clone(&arc);
+

Weak<T> does not auto-dereference to T, because the inner value may have +already been dropped.

+

§Examples

+

Sharing some immutable data between threads:

+ +
use std::sync::Arc;
+use std::thread;
+
+let five = Arc::new(5);
+
+for _ in 0..10 {
+    let five = Arc::clone(&five);
+
+    thread::spawn(move || {
+        println!("{five:?}");
+    });
+}
+

Sharing a mutable AtomicUsize:

+ +
use std::sync::Arc;
+use std::sync::atomic::{AtomicUsize, Ordering};
+use std::thread;
+
+let val = Arc::new(AtomicUsize::new(5));
+
+for _ in 0..10 {
+    let val = Arc::clone(&val);
+
+    thread::spawn(move || {
+        let v = val.fetch_add(1, Ordering::Relaxed);
+        println!("{v:?}");
+    });
+}
+

See the rc documentation for more examples of reference +counting in general.

+

Implementations§

source§

impl<T> Arc<T>

1.0.0 · source

pub fn new(data: T) -> Arc<T>

Constructs a new Arc<T>.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
1.60.0 · source

pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
where + F: FnOnce(&Weak<T>) -> T,

Constructs a new Arc<T> while giving you a Weak<T> to the allocation, +to allow you to construct a T which holds a weak pointer to itself.

+

Generally, a structure circularly referencing itself, either directly or +indirectly, should not hold a strong reference to itself to prevent a memory leak. +Using this function, you get access to the weak pointer during the +initialization of T, before the Arc<T> is created, such that you can +clone and store it inside the T.

+

new_cyclic first allocates the managed allocation for the Arc<T>, +then calls your closure, giving it a Weak<T> to this allocation, +and only afterwards completes the construction of the Arc<T> by placing +the T returned from your closure into the allocation.

+

Since the new Arc<T> is not fully-constructed until Arc<T>::new_cyclic +returns, calling upgrade on the weak reference inside your closure will +fail and result in a None value.

+
§Panics
+

If data_fn panics, the panic is propagated to the caller, and the +temporary Weak<T> is dropped normally.

+
§Example
+
use std::sync::{Arc, Weak};
+
+struct Gadget {
+    me: Weak<Gadget>,
+}
+
+impl Gadget {
+    /// Construct a reference counted Gadget.
+    fn new() -> Arc<Self> {
+        // `me` is a `Weak<Gadget>` pointing at the new allocation of the
+        // `Arc` we're constructing.
+        Arc::new_cyclic(|me| {
+            // Create the actual struct here.
+            Gadget { me: me.clone() }
+        })
+    }
+
+    /// Return a reference counted pointer to Self.
+    fn me(&self) -> Arc<Self> {
+        self.me.upgrade().unwrap()
+    }
+}
+
source

pub fn new_uninit() -> Arc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Arc with uninitialized contents.

+
§Examples
+
#![feature(new_uninit)]
+#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+
+let mut five = Arc::<u32>::new_uninit();
+
+// Deferred initialization:
+Arc::get_mut(&mut five).unwrap().write(5);
+
+let five = unsafe { five.assume_init() };
+
+assert_eq!(*five, 5)
+
source

pub fn new_zeroed() -> Arc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Arc with uninitialized contents, with the memory +being filled with 0 bytes.

+

See MaybeUninit::zeroed for examples of correct and incorrect usage +of this method.

+
§Examples
+
#![feature(new_uninit)]
+
+use std::sync::Arc;
+
+let zero = Arc::<u32>::new_zeroed();
+let zero = unsafe { zero.assume_init() };
+
+assert_eq!(*zero, 0)
+
1.33.0 · source

pub fn pin(data: T) -> Pin<Arc<T>>

Constructs a new Pin<Arc<T>>. If T does not implement Unpin, then +data will be pinned in memory and unable to be moved.

+
source

pub fn try_pin(data: T) -> Result<Pin<Arc<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T>>, return an error if allocation fails.

+
source

pub fn try_new(data: T) -> Result<Arc<T>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T>, returning an error if allocation fails.

+
§Examples
+
#![feature(allocator_api)]
+use std::sync::Arc;
+
+let five = Arc::try_new(5)?;
+
source

pub fn try_new_uninit() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, returning an error +if allocation fails.

+
§Examples
+
#![feature(new_uninit, allocator_api)]
+#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+
+let mut five = Arc::<u32>::try_new_uninit()?;
+
+// Deferred initialization:
+Arc::get_mut(&mut five).unwrap().write(5);
+
+let five = unsafe { five.assume_init() };
+
+assert_eq!(*five, 5);
+
source

pub fn try_new_zeroed() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory +being filled with 0 bytes, returning an error if allocation fails.

+

See MaybeUninit::zeroed for examples of correct and incorrect usage +of this method.

+
§Examples
+
#![feature(new_uninit, allocator_api)]
+
+use std::sync::Arc;
+
+let zero = Arc::<u32>::try_new_zeroed()?;
+let zero = unsafe { zero.assume_init() };
+
+assert_eq!(*zero, 0);
+
source§

impl<T, A> Arc<T, A>
where + A: Allocator,

source

pub fn allocator(this: &Arc<T, A>) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

+

Note: this is an associated function, which means that you have +to call it as Arc::allocator(&a) instead of a.allocator(). This +is so that there is no conflict with a method on the inner type.

+
source

pub fn new_in(data: T, alloc: A) -> Arc<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T> in the provided allocator.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let five = Arc::new_in(5, System);
+
source

pub fn new_uninit_in(alloc: A) -> Arc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents in the provided allocator.

+
§Examples
+
#![feature(new_uninit)]
+#![feature(get_mut_unchecked)]
+#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let mut five = Arc::<u32, _>::new_uninit_in(System);
+
+let five = unsafe {
+    // Deferred initialization:
+    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);
+
+    five.assume_init()
+};
+
+assert_eq!(*five, 5)
+
source

pub fn new_zeroed_in(alloc: A) -> Arc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory +being filled with 0 bytes, in the provided allocator.

+

See MaybeUninit::zeroed for examples of correct and incorrect usage +of this method.

+
§Examples
+
#![feature(new_uninit)]
+#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let zero = Arc::<u32, _>::new_zeroed_in(System);
+let zero = unsafe { zero.assume_init() };
+
+assert_eq!(*zero, 0)
+
source

pub fn pin_in(data: T, alloc: A) -> Pin<Arc<T, A>>
where + A: 'static,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T, A>> in the provided allocator. If T does not implement Unpin, +then data will be pinned in memory and unable to be moved.

+
source

pub fn try_pin_in(data: T, alloc: A) -> Result<Pin<Arc<T, A>>, AllocError>
where + A: 'static,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T, A>> in the provided allocator, return an error if allocation +fails.

+
source

pub fn try_new_in(data: T, alloc: A) -> Result<Arc<T, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T, A> in the provided allocator, returning an error if allocation fails.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let five = Arc::try_new_in(5, System)?;
+
source

pub fn try_new_uninit_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, in the provided allocator, returning an +error if allocation fails.

+
§Examples
+
#![feature(new_uninit, allocator_api)]
+#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let mut five = Arc::<u32, _>::try_new_uninit_in(System)?;
+
+let five = unsafe {
+    // Deferred initialization:
+    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);
+
+    five.assume_init()
+};
+
+assert_eq!(*five, 5);
+
source

pub fn try_new_zeroed_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory +being filled with 0 bytes, in the provided allocator, returning an error if allocation +fails.

+

See MaybeUninit::zeroed for examples of correct and incorrect usage +of this method.

+
§Examples
+
#![feature(new_uninit, allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let zero = Arc::<u32, _>::try_new_zeroed_in(System)?;
+let zero = unsafe { zero.assume_init() };
+
+assert_eq!(*zero, 0);
+
1.4.0 · source

pub fn try_unwrap(this: Arc<T, A>) -> Result<T, Arc<T, A>>

Returns the inner value, if the Arc has exactly one strong reference.

+

Otherwise, an Err is returned with the same Arc that was +passed in.

+

This will succeed even if there are outstanding weak references.

+

It is strongly recommended to use Arc::into_inner instead if you don’t +keep the Arc in the Err case. +Immediately dropping the Err-value, as the expression +Arc::try_unwrap(this).ok() does, can cause the strong count to +drop to zero and the inner value of the Arc to be dropped. +For instance, if two threads execute such an expression in parallel, +there is a race condition without the possibility of unsafety: +The threads could first both check whether they own the last instance +in Arc::try_unwrap, determine that they both do not, and then both +discard and drop their instance in the call to ok. +In this scenario, the value inside the Arc is safely destroyed +by exactly one of the threads, but neither thread will ever be able +to use the value.

+
§Examples
+
use std::sync::Arc;
+
+let x = Arc::new(3);
+assert_eq!(Arc::try_unwrap(x), Ok(3));
+
+let x = Arc::new(4);
+let _y = Arc::clone(&x);
+assert_eq!(*Arc::try_unwrap(x).unwrap_err(), 4);
+
1.70.0 · source

pub fn into_inner(this: Arc<T, A>) -> Option<T>

Returns the inner value, if the Arc has exactly one strong reference.

+

Otherwise, None is returned and the Arc is dropped.

+

This will succeed even if there are outstanding weak references.

+

If Arc::into_inner is called on every clone of this Arc, +it is guaranteed that exactly one of the calls returns the inner value. +This means in particular that the inner value is not dropped.

+

Arc::try_unwrap is conceptually similar to Arc::into_inner, but it +is meant for different use-cases. If used as a direct replacement +for Arc::into_inner anyway, such as with the expression +Arc::try_unwrap(this).ok(), then it does +not give the same guarantee as described in the previous paragraph. +For more information, see the examples below and read the documentation +of Arc::try_unwrap.

+
§Examples
+

Minimal example demonstrating the guarantee that Arc::into_inner gives.

+ +
use std::sync::Arc;
+
+let x = Arc::new(3);
+let y = Arc::clone(&x);
+
+// Two threads calling `Arc::into_inner` on both clones of an `Arc`:
+let x_thread = std::thread::spawn(|| Arc::into_inner(x));
+let y_thread = std::thread::spawn(|| Arc::into_inner(y));
+
+let x_inner_value = x_thread.join().unwrap();
+let y_inner_value = y_thread.join().unwrap();
+
+// One of the threads is guaranteed to receive the inner value:
+assert!(matches!(
+    (x_inner_value, y_inner_value),
+    (None, Some(3)) | (Some(3), None)
+));
+// The result could also be `(None, None)` if the threads called
+// `Arc::try_unwrap(x).ok()` and `Arc::try_unwrap(y).ok()` instead.
+

A more practical example demonstrating the need for Arc::into_inner:

+ +
use std::sync::Arc;
+
+// Definition of a simple singly linked list using `Arc`:
+#[derive(Clone)]
+struct LinkedList<T>(Option<Arc<Node<T>>>);
+struct Node<T>(T, Option<Arc<Node<T>>>);
+
+// Dropping a long `LinkedList<T>` relying on the destructor of `Arc`
+// can cause a stack overflow. To prevent this, we can provide a
+// manual `Drop` implementation that does the destruction in a loop:
+impl<T> Drop for LinkedList<T> {
+    fn drop(&mut self) {
+        let mut link = self.0.take();
+        while let Some(arc_node) = link.take() {
+            if let Some(Node(_value, next)) = Arc::into_inner(arc_node) {
+                link = next;
+            }
+        }
+    }
+}
+
+// Implementation of `new` and `push` omitted
+impl<T> LinkedList<T> {
+    /* ... */
+}
+
+// The following code could have still caused a stack overflow
+// despite the manual `Drop` impl if that `Drop` impl had used
+// `Arc::try_unwrap(arc).ok()` instead of `Arc::into_inner(arc)`.
+
+// Create a long list and clone it
+let mut x = LinkedList::new();
+let size = 100000;
+for i in 0..size {
+    x.push(i); // Adds i to the front of x
+}
+let y = x.clone();
+
+// Drop the clones in parallel
+let x_thread = std::thread::spawn(|| drop(x));
+let y_thread = std::thread::spawn(|| drop(y));
+x_thread.join().unwrap();
+y_thread.join().unwrap();
+
source§

impl<T> Arc<[T]>

source

pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new atomically reference-counted slice with uninitialized contents.

+
§Examples
+
#![feature(new_uninit)]
+#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+
+let mut values = Arc::<[u32]>::new_uninit_slice(3);
+
+// Deferred initialization:
+let data = Arc::get_mut(&mut values).unwrap();
+data[0].write(1);
+data[1].write(2);
+data[2].write(3);
+
+let values = unsafe { values.assume_init() };
+
+assert_eq!(*values, [1, 2, 3])
+
source

pub fn new_zeroed_slice(len: usize) -> Arc<[MaybeUninit<T>]>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new atomically reference-counted slice with uninitialized contents, with the memory being +filled with 0 bytes.

+

See MaybeUninit::zeroed for examples of correct and +incorrect usage of this method.

+
§Examples
+
#![feature(new_uninit)]
+
+use std::sync::Arc;
+
+let values = Arc::<[u32]>::new_zeroed_slice(3);
+let values = unsafe { values.assume_init() };
+
+assert_eq!(*values, [0, 0, 0])
+
source§

impl<T, A> Arc<[T], A>
where + A: Allocator,

source

pub fn new_uninit_slice_in(len: usize, alloc: A) -> Arc<[MaybeUninit<T>], A>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new atomically reference-counted slice with uninitialized contents in the +provided allocator.

+
§Examples
+
#![feature(new_uninit)]
+#![feature(get_mut_unchecked)]
+#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let mut values = Arc::<[u32], _>::new_uninit_slice_in(3, System);
+
+let values = unsafe {
+    // Deferred initialization:
+    Arc::get_mut_unchecked(&mut values)[0].as_mut_ptr().write(1);
+    Arc::get_mut_unchecked(&mut values)[1].as_mut_ptr().write(2);
+    Arc::get_mut_unchecked(&mut values)[2].as_mut_ptr().write(3);
+
+    values.assume_init()
+};
+
+assert_eq!(*values, [1, 2, 3])
+
source

pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Arc<[MaybeUninit<T>], A>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new atomically reference-counted slice with uninitialized contents, with the memory being +filled with 0 bytes, in the provided allocator.

+

See MaybeUninit::zeroed for examples of correct and +incorrect usage of this method.

+
§Examples
+
#![feature(new_uninit)]
+#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let values = Arc::<[u32], _>::new_zeroed_slice_in(3, System);
+let values = unsafe { values.assume_init() };
+
+assert_eq!(*values, [0, 0, 0])
+
source§

impl<T, A> Arc<MaybeUninit<T>, A>
where + A: Allocator,

source

pub unsafe fn assume_init(self) -> Arc<T, A>

🔬This is a nightly-only experimental API. (new_uninit)

Converts to Arc<T>.

+
§Safety
+

As with MaybeUninit::assume_init, +it is up to the caller to guarantee that the inner value +really is in an initialized state. +Calling this when the content is not yet fully initialized +causes immediate undefined behavior.

+
§Examples
+
#![feature(new_uninit)]
+#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+
+let mut five = Arc::<u32>::new_uninit();
+
+// Deferred initialization:
+Arc::get_mut(&mut five).unwrap().write(5);
+
+let five = unsafe { five.assume_init() };
+
+assert_eq!(*five, 5)
+
source§

impl<T, A> Arc<[MaybeUninit<T>], A>
where + A: Allocator,

source

pub unsafe fn assume_init(self) -> Arc<[T], A>

🔬This is a nightly-only experimental API. (new_uninit)

Converts to Arc<[T]>.

+
§Safety
+

As with MaybeUninit::assume_init, +it is up to the caller to guarantee that the inner value +really is in an initialized state. +Calling this when the content is not yet fully initialized +causes immediate undefined behavior.

+
§Examples
+
#![feature(new_uninit)]
+#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+
+let mut values = Arc::<[u32]>::new_uninit_slice(3);
+
+// Deferred initialization:
+let data = Arc::get_mut(&mut values).unwrap();
+data[0].write(1);
+data[1].write(2);
+data[2].write(3);
+
+let values = unsafe { values.assume_init() };
+
+assert_eq!(*values, [1, 2, 3])
+
source§

impl<T> Arc<T>
where + T: ?Sized,

1.17.0 · source

pub unsafe fn from_raw(ptr: *const T) -> Arc<T>

Constructs an Arc<T> from a raw pointer.

+

The raw pointer must have been previously returned by a call to +Arc<U>::into_raw with the following requirements:

+
    +
  • If U is sized, it must have the same size and alignment as T. This +is trivially true if U is T.
  • +
  • If U is unsized, its data pointer must have the same size and +alignment as T. This is trivially true if Arc<U> was constructed +through Arc<T> and then converted to Arc<U> through an unsized +coercion.
  • +
+

Note that if U or U’s data pointer is not T but has the same size +and alignment, this is basically like transmuting references of +different types. See mem::transmute for more information +on what restrictions apply in this case.

+

The user of from_raw has to make sure a specific value of T is only +dropped once.

+

This function is unsafe because improper use may lead to memory unsafety, +even if the returned Arc<T> is never accessed.

+
§Examples
+
use std::sync::Arc;
+
+let x = Arc::new("hello".to_owned());
+let x_ptr = Arc::into_raw(x);
+
+unsafe {
+    // Convert back to an `Arc` to prevent leak.
+    let x = Arc::from_raw(x_ptr);
+    assert_eq!(&*x, "hello");
+
+    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.
+}
+
+// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
+

Convert a slice back into its original array:

+ +
use std::sync::Arc;
+
+let x: Arc<[u32]> = Arc::new([1, 2, 3]);
+let x_ptr: *const [u32] = Arc::into_raw(x);
+
+unsafe {
+    let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>());
+    assert_eq!(&*x, &[1, 2, 3]);
+}
+
1.51.0 · source

pub unsafe fn increment_strong_count(ptr: *const T)

Increments the strong reference count on the Arc<T> associated with the +provided pointer by one.

+
§Safety
+

The pointer must have been obtained through Arc::into_raw, and the +associated Arc instance must be valid (i.e. the strong count must be at +least 1) for the duration of this method.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+unsafe {
+    let ptr = Arc::into_raw(five);
+    Arc::increment_strong_count(ptr);
+
+    // This assertion is deterministic because we haven't shared
+    // the `Arc` between threads.
+    let five = Arc::from_raw(ptr);
+    assert_eq!(2, Arc::strong_count(&five));
+}
+
1.51.0 · source

pub unsafe fn decrement_strong_count(ptr: *const T)

Decrements the strong reference count on the Arc<T> associated with the +provided pointer by one.

+
§Safety
+

The pointer must have been obtained through Arc::into_raw, and the +associated Arc instance must be valid (i.e. the strong count must be at +least 1) when invoking this method. This method can be used to release the final +Arc and backing storage, but should not be called after the final Arc has been +released.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+unsafe {
+    let ptr = Arc::into_raw(five);
+    Arc::increment_strong_count(ptr);
+
+    // Those assertions are deterministic because we haven't shared
+    // the `Arc` between threads.
+    let five = Arc::from_raw(ptr);
+    assert_eq!(2, Arc::strong_count(&five));
+    Arc::decrement_strong_count(ptr);
+    assert_eq!(1, Arc::strong_count(&five));
+}
+
source§

impl<T, A> Arc<T, A>
where + A: Allocator, + T: ?Sized,

1.17.0 · source

pub fn into_raw(this: Arc<T, A>) -> *const T

Consumes the Arc, returning the wrapped pointer.

+

To avoid a memory leak the pointer must be converted back to an Arc using +Arc::from_raw.

+
§Examples
+
use std::sync::Arc;
+
+let x = Arc::new("hello".to_owned());
+let x_ptr = Arc::into_raw(x);
+assert_eq!(unsafe { &*x_ptr }, "hello");
+
source

pub fn into_raw_with_allocator(this: Arc<T, A>) -> (*const T, A)

🔬This is a nightly-only experimental API. (allocator_api)

Consumes the Arc, returning the wrapped pointer and allocator.

+

To avoid a memory leak the pointer must be converted back to an Arc using +Arc::from_raw_in.

+
§Examples
+
#![feature(allocator_api)]
+use std::sync::Arc;
+use std::alloc::System;
+
+let x = Arc::new_in("hello".to_owned(), System);
+let (ptr, alloc) = Arc::into_raw_with_allocator(x);
+assert_eq!(unsafe { &*ptr }, "hello");
+let x = unsafe { Arc::from_raw_in(ptr, alloc) };
+assert_eq!(&*x, "hello");
+
1.45.0 · source

pub fn as_ptr(this: &Arc<T, A>) -> *const T

Provides a raw pointer to the data.

+

The counts are not affected in any way and the Arc is not consumed. The pointer is valid for +as long as there are strong counts in the Arc.

+
§Examples
+
use std::sync::Arc;
+
+let x = Arc::new("hello".to_owned());
+let y = Arc::clone(&x);
+let x_ptr = Arc::as_ptr(&x);
+assert_eq!(x_ptr, Arc::as_ptr(&y));
+assert_eq!(unsafe { &*x_ptr }, "hello");
+
source

pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Arc<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs an Arc<T, A> from a raw pointer.

+

The raw pointer must have been previously returned by a call to Arc<U, A>::into_raw with the following requirements:

+
    +
  • If U is sized, it must have the same size and alignment as T. This +is trivially true if U is T.
  • +
  • If U is unsized, its data pointer must have the same size and +alignment as T. This is trivially true if Arc<U> was constructed +through Arc<T> and then converted to Arc<U> through an unsized +coercion.
  • +
+

Note that if U or U’s data pointer is not T but has the same size +and alignment, this is basically like transmuting references of +different types. See mem::transmute for more information +on what restrictions apply in this case.

+

The raw pointer must point to a block of memory allocated by alloc

+

The user of from_raw has to make sure a specific value of T is only +dropped once.

+

This function is unsafe because improper use may lead to memory unsafety, +even if the returned Arc<T> is never accessed.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let x = Arc::new_in("hello".to_owned(), System);
+let x_ptr = Arc::into_raw(x);
+
+unsafe {
+    // Convert back to an `Arc` to prevent leak.
+    let x = Arc::from_raw_in(x_ptr, System);
+    assert_eq!(&*x, "hello");
+
+    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.
+}
+
+// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
+

Convert a slice back into its original array:

+ +
#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System);
+let x_ptr: *const [u32] = Arc::into_raw(x);
+
+unsafe {
+    let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);
+    assert_eq!(&*x, &[1, 2, 3]);
+}
+
1.4.0 · source

pub fn downgrade(this: &Arc<T, A>) -> Weak<T, A>
where + A: Clone,

Creates a new Weak pointer to this allocation.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+let weak_five = Arc::downgrade(&five);
+
1.15.0 · source

pub fn weak_count(this: &Arc<T, A>) -> usize

Gets the number of Weak pointers to this allocation.

+
§Safety
+

This method by itself is safe, but using it correctly requires extra care. +Another thread can change the weak count at any time, +including potentially between calling this method and acting on the result.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+let _weak_five = Arc::downgrade(&five);
+
+// This assertion is deterministic because we haven't shared
+// the `Arc` or `Weak` between threads.
+assert_eq!(1, Arc::weak_count(&five));
+
1.15.0 · source

pub fn strong_count(this: &Arc<T, A>) -> usize

Gets the number of strong (Arc) pointers to this allocation.

+
§Safety
+

This method by itself is safe, but using it correctly requires extra care. +Another thread can change the strong count at any time, +including potentially between calling this method and acting on the result.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+let _also_five = Arc::clone(&five);
+
+// This assertion is deterministic because we haven't shared
+// the `Arc` between threads.
+assert_eq!(2, Arc::strong_count(&five));
+
source

pub unsafe fn increment_strong_count_in(ptr: *const T, alloc: A)
where + A: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Increments the strong reference count on the Arc<T> associated with the +provided pointer by one.

+
§Safety
+

The pointer must have been obtained through Arc::into_raw, and the +associated Arc instance must be valid (i.e. the strong count must be at +least 1) for the duration of this method,, and ptr must point to a block of memory +allocated by alloc.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let five = Arc::new_in(5, System);
+
+unsafe {
+    let ptr = Arc::into_raw(five);
+    Arc::increment_strong_count_in(ptr, System);
+
+    // This assertion is deterministic because we haven't shared
+    // the `Arc` between threads.
+    let five = Arc::from_raw_in(ptr, System);
+    assert_eq!(2, Arc::strong_count(&five));
+}
+
source

pub unsafe fn decrement_strong_count_in(ptr: *const T, alloc: A)

🔬This is a nightly-only experimental API. (allocator_api)

Decrements the strong reference count on the Arc<T> associated with the +provided pointer by one.

+
§Safety
+

The pointer must have been obtained through Arc::into_raw, the +associated Arc instance must be valid (i.e. the strong count must be at +least 1) when invoking this method, and ptr must point to a block of memory +allocated by alloc. This method can be used to release the final +Arc and backing storage, but should not be called after the final Arc has been +released.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::sync::Arc;
+use std::alloc::System;
+
+let five = Arc::new_in(5, System);
+
+unsafe {
+    let ptr = Arc::into_raw(five);
+    Arc::increment_strong_count_in(ptr, System);
+
+    // Those assertions are deterministic because we haven't shared
+    // the `Arc` between threads.
+    let five = Arc::from_raw_in(ptr, System);
+    assert_eq!(2, Arc::strong_count(&five));
+    Arc::decrement_strong_count_in(ptr, System);
+    assert_eq!(1, Arc::strong_count(&five));
+}
+
1.17.0 · source

pub fn ptr_eq(this: &Arc<T, A>, other: &Arc<T, A>) -> bool

Returns true if the two Arcs point to the same allocation in a vein similar to +ptr::eq. This function ignores the metadata of dyn Trait pointers.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+let same_five = Arc::clone(&five);
+let other_five = Arc::new(5);
+
+assert!(Arc::ptr_eq(&five, &same_five));
+assert!(!Arc::ptr_eq(&five, &other_five));
+
source§

impl<T, A> Arc<T, A>
where + T: CloneToUninit + ?Sized, + A: Allocator + Clone,

1.4.0 · source

pub fn make_mut(this: &mut Arc<T, A>) -> &mut T

Makes a mutable reference into the given Arc.

+

If there are other Arc pointers to the same allocation, then make_mut will +clone the inner value to a new allocation to ensure unique ownership. This is also +referred to as clone-on-write.

+

However, if there are no other Arc pointers to this allocation, but some Weak +pointers, then the Weak pointers will be dissociated and the inner value will not +be cloned.

+

See also get_mut, which will fail rather than cloning the inner value +or dissociating Weak pointers.

+
§Examples
+
use std::sync::Arc;
+
+let mut data = Arc::new(5);
+
+*Arc::make_mut(&mut data) += 1;         // Won't clone anything
+let mut other_data = Arc::clone(&data); // Won't clone inner data
+*Arc::make_mut(&mut data) += 1;         // Clones inner data
+*Arc::make_mut(&mut data) += 1;         // Won't clone anything
+*Arc::make_mut(&mut other_data) *= 2;   // Won't clone anything
+
+// Now `data` and `other_data` point to different allocations.
+assert_eq!(*data, 8);
+assert_eq!(*other_data, 12);
+

Weak pointers will be dissociated:

+ +
use std::sync::Arc;
+
+let mut data = Arc::new(75);
+let weak = Arc::downgrade(&data);
+
+assert!(75 == *data);
+assert!(75 == *weak.upgrade().unwrap());
+
+*Arc::make_mut(&mut data) += 1;
+
+assert!(76 == *data);
+assert!(weak.upgrade().is_none());
+
source§

impl<T, A> Arc<T, A>
where + T: Clone, + A: Allocator,

1.76.0 · source

pub fn unwrap_or_clone(this: Arc<T, A>) -> T

If we have the only reference to T then unwrap it. Otherwise, clone T and return the +clone.

+

Assuming arc_t is of type Arc<T>, this function is functionally equivalent to +(*arc_t).clone(), but will avoid cloning the inner value where possible.

+
§Examples
+
let inner = String::from("test");
+let ptr = inner.as_ptr();
+
+let arc = Arc::new(inner);
+let inner = Arc::unwrap_or_clone(arc);
+// The inner value was not cloned
+assert!(ptr::eq(ptr, inner.as_ptr()));
+
+let arc = Arc::new(inner);
+let arc2 = arc.clone();
+let inner = Arc::unwrap_or_clone(arc);
+// Because there were 2 references, we had to clone the inner value.
+assert!(!ptr::eq(ptr, inner.as_ptr()));
+// `arc2` is the last reference, so when we unwrap it we get back
+// the original `String`.
+let inner = Arc::unwrap_or_clone(arc2);
+assert!(ptr::eq(ptr, inner.as_ptr()));
+
source§

impl<T, A> Arc<T, A>
where + A: Allocator, + T: ?Sized,

1.4.0 · source

pub fn get_mut(this: &mut Arc<T, A>) -> Option<&mut T>

Returns a mutable reference into the given Arc, if there are +no other Arc or Weak pointers to the same allocation.

+

Returns None otherwise, because it is not safe to +mutate a shared value.

+

See also make_mut, which will clone +the inner value when there are other Arc pointers.

+
§Examples
+
use std::sync::Arc;
+
+let mut x = Arc::new(3);
+*Arc::get_mut(&mut x).unwrap() = 4;
+assert_eq!(*x, 4);
+
+let _y = Arc::clone(&x);
+assert!(Arc::get_mut(&mut x).is_none());
+
source

pub unsafe fn get_mut_unchecked(this: &mut Arc<T, A>) -> &mut T

🔬This is a nightly-only experimental API. (get_mut_unchecked)

Returns a mutable reference into the given Arc, +without any check.

+

See also get_mut, which is safe and does appropriate checks.

+
§Safety
+

If any other Arc or Weak pointers to the same allocation exist, then +they must not be dereferenced or have active borrows for the duration +of the returned borrow, and their inner type must be exactly the same as the +inner type of this Rc (including lifetimes). This is trivially the case if no +such pointers exist, for example immediately after Arc::new.

+
§Examples
+
#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+
+let mut x = Arc::new(String::new());
+unsafe {
+    Arc::get_mut_unchecked(&mut x).push_str("foo")
+}
+assert_eq!(*x, "foo");
+

Other Arc pointers to the same allocation must be to the same type.

+ +
#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+
+let x: Arc<str> = Arc::from("Hello, world!");
+let mut y: Arc<[u8]> = x.clone().into();
+unsafe {
+    // this is Undefined Behavior, because x's inner type is str, not [u8]
+    Arc::get_mut_unchecked(&mut y).fill(0xff); // 0xff is invalid in UTF-8
+}
+println!("{}", &*x); // Invalid UTF-8 in a str
+

Other Arc pointers to the same allocation must be to the exact same type, including lifetimes.

+ +
#![feature(get_mut_unchecked)]
+
+use std::sync::Arc;
+
+let x: Arc<&str> = Arc::new("Hello, world!");
+{
+    let s = String::from("Oh, no!");
+    let mut y: Arc<&str> = x.clone().into();
+    unsafe {
+        // this is Undefined Behavior, because x's inner type
+        // is &'long str, not &'short str
+        *Arc::get_mut_unchecked(&mut y) = &s;
+    }
+}
+println!("{}", &*x); // Use-after-free
+
source§

impl<A> Arc<dyn Any + Send + Sync, A>
where + A: Allocator,

1.29.0 · source

pub fn downcast<T>(self) -> Result<Arc<T, A>, Arc<dyn Any + Send + Sync, A>>
where + T: Any + Send + Sync,

Attempt to downcast the Arc<dyn Any + Send + Sync> to a concrete type.

+
§Examples
+
use std::any::Any;
+use std::sync::Arc;
+
+fn print_if_string(value: Arc<dyn Any + Send + Sync>) {
+    if let Ok(string) = value.downcast::<String>() {
+        println!("String ({}): {}", string.len(), string);
+    }
+}
+
+let my_string = "Hello World".to_string();
+print_if_string(Arc::new(my_string));
+print_if_string(Arc::new(0i8));
+
source

pub unsafe fn downcast_unchecked<T>(self) -> Arc<T, A>
where + T: Any + Send + Sync,

🔬This is a nightly-only experimental API. (downcast_unchecked)

Downcasts the Arc<dyn Any + Send + Sync> to a concrete type.

+

For a safe alternative see downcast.

+
§Examples
+
#![feature(downcast_unchecked)]
+
+use std::any::Any;
+use std::sync::Arc;
+
+let x: Arc<dyn Any + Send + Sync> = Arc::new(1_usize);
+
+unsafe {
+    assert_eq!(*x.downcast_unchecked::<usize>(), 1);
+}
+
§Safety
+

The contained value must be of type T. Calling this method +with the incorrect type is undefined behavior.

+

Trait Implementations§

§

impl<'a, A> Arbitrary<'a> for Arc<[A]>
where + A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Arc<[A]>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Arc<[A]>, Error>

Generate an arbitrary value of Self from the entirety of the given +unstructured data. Read more
§

fn size_hint(_depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type +needs to construct itself. Read more
§

impl<'a, A> Arbitrary<'a> for Arc<A>
where + A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Arc<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type +needs to construct itself. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given +unstructured data. Read more
§

impl<'a> Arbitrary<'a> for Arc<str>

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Arc<str>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type +needs to construct itself. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given +unstructured data. Read more
1.64.0 · source§

impl<T> AsFd for Arc<T>
where + T: AsFd + ?Sized,

This impl allows implementing traits that require AsFd on Arc.

+ +
use std::net::UdpSocket;
+use std::sync::Arc;
+
+trait MyTrait: AsFd {}
+impl MyTrait for Arc<UdpSocket> {}
+impl MyTrait for Box<UdpSocket> {}
+
source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
1.63.0 · source§

impl<T> AsRawFd for Arc<T>
where + T: AsRawFd,

This impl allows implementing traits that require AsRawFd on Arc.

+ +
use std::net::UdpSocket;
+use std::sync::Arc;
+trait MyTrait: AsRawFd {
+}
+impl MyTrait for Arc<UdpSocket> {}
+impl MyTrait for Box<UdpSocket> {}
+
source§

fn as_raw_fd(&self) -> i32

Extracts the raw file descriptor. Read more
1.5.0 · source§

impl<T, A> AsRef<T> for Arc<T, A>
where + A: Allocator, + T: ?Sized,

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
1.0.0 · source§

impl<T, A> Borrow<T> for Arc<T, A>
where + A: Allocator, + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
1.0.0 · source§

impl<T, A> Clone for Arc<T, A>
where + A: Allocator + Clone, + T: ?Sized,

source§

fn clone(&self) -> Arc<T, A>

Makes a clone of the Arc pointer.

+

This creates another pointer to the same allocation, increasing the +strong reference count.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+let _ = Arc::clone(&five);
+
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
1.0.0 · source§

impl<T, A> Debug for Arc<T, A>
where + T: Debug + ?Sized, + A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
1.80.0 · source§

impl<T> Default for Arc<[T]>

source§

fn default() -> Arc<[T]>

Creates an empty [T] inside an Arc

+

This may or may not share an allocation with other Arcs.

+
1.80.0 · source§

impl Default for Arc<CStr>

source§

fn default() -> Arc<CStr>

Creates an empty CStr inside an Arc

+

This may or may not share an allocation with other Arcs.

+
1.0.0 · source§

impl<T> Default for Arc<T>
where + T: Default,

source§

fn default() -> Arc<T>

Creates a new Arc<T>, with the Default value for T.

+
§Examples
+
use std::sync::Arc;
+
+let x: Arc<i32> = Default::default();
+assert_eq!(*x, 0);
+
1.80.0 · source§

impl Default for Arc<str>

source§

fn default() -> Arc<str>

Creates an empty str inside an Arc

+

This may or may not share an allocation with other Arcs.

+
1.0.0 · source§

impl<T, A> Deref for Arc<T, A>
where + A: Allocator, + T: ?Sized,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
1.0.0 · source§

impl<T, A> Display for Arc<T, A>
where + T: Display + ?Sized, + A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<D> Drain for Arc<D>
where + D: Drain + ?Sized,

§

type Ok = <D as Drain>::Ok

Type returned by this drain Read more
§

type Err = <D as Drain>::Err

Type of potential errors that can be returned by this Drain
§

fn log( + &self, + record: &Record<'_>, + o: &OwnedKVList, +) -> Result<<Arc<D> as Drain>::Ok, <D as Drain>::Err>

Handle one logging statement (Record) Read more
§

fn is_enabled(&self, level: Level) -> bool

Avoid: Check if messages at the specified log level are maybe +enabled for this logger. Read more
§

fn is_critical_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_error_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_warning_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_info_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_debug_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_trace_enabled(&self) -> bool

Avoid: See is_enabled
§

fn map<F, R>(self, f: F) -> R
where + Self: Sized, + F: FnOnce(Self) -> R,

Pass Drain through a closure, eg. to wrap +into another Drain. Read more
§

fn filter<F>(self, f: F) -> Filter<Self, F>
where + Self: Sized, + F: FilterFn,

Filter logging records passed to Drain Read more
§

fn filter_level(self, level: Level) -> LevelFilter<Self>
where + Self: Sized,

Filter logging records passed to Drain (by level) Read more
§

fn map_err<F, E>(self, f: F) -> MapError<Self, E>
where + Self: Sized, + F: MapErrFn<Self::Err, E>,

Map logging errors returned by this drain Read more
§

fn ignore_res(self) -> IgnoreResult<Self>
where + Self: Sized,

Ignore results returned by this drain Read more
1.0.0 · source§

impl<T, A> Drop for Arc<T, A>
where + A: Allocator, + T: ?Sized,

source§

fn drop(&mut self)

Drops the Arc.

+

This will decrement the strong reference count. If the strong reference +count reaches zero then the only other references (if any) are +Weak, so we drop the inner value.

+
§Examples
+
use std::sync::Arc;
+
+struct Foo;
+
+impl Drop for Foo {
+    fn drop(&mut self) {
+        println!("dropped!");
+    }
+}
+
+let foo  = Arc::new(Foo);
+let foo2 = Arc::clone(&foo);
+
+drop(foo);    // Doesn't print anything
+drop(foo2);   // Prints "dropped!"
+
1.52.0 · source§

impl<T> Error for Arc<T>
where + T: Error + ?Sized,

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn provide<'a>(&'a self, req: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
1.21.0 · source§

impl<T> From<&[T]> for Arc<[T]>
where + T: Clone,

source§

fn from(v: &[T]) -> Arc<[T]>

Allocate a reference-counted slice and fill it by cloning v’s items.

+
§Example
+
let original: &[i32] = &[1, 2, 3];
+let shared: Arc<[i32]> = Arc::from(original);
+assert_eq!(&[1, 2, 3], &shared[..]);
+
1.24.0 · source§

impl From<&CStr> for Arc<CStr>

source§

fn from(s: &CStr) -> Arc<CStr>

Converts a &CStr into a Arc<CStr>, +by copying the contents into a newly allocated Arc.

+
1.24.0 · source§

impl From<&OsStr> for Arc<OsStr>

source§

fn from(s: &OsStr) -> Arc<OsStr>

Copies the string into a newly allocated Arc<OsStr>.

+
1.24.0 · source§

impl From<&Path> for Arc<Path>

source§

fn from(s: &Path) -> Arc<Path>

Converts a Path into an Arc by copying the Path data into a new Arc buffer.

+
1.21.0 · source§

impl From<&str> for Arc<str>

source§

fn from(v: &str) -> Arc<str>

Allocate a reference-counted str and copy v into it.

+
§Example
+
let shared: Arc<str> = Arc::from("eggplant");
+assert_eq!("eggplant", &shared[..]);
+
1.74.0 · source§

impl<T, const N: usize> From<[T; N]> for Arc<[T]>

source§

fn from(v: [T; N]) -> Arc<[T]>

Converts a [T; N] into an Arc<[T]>.

+

The conversion moves the array into a newly allocated Arc.

+
§Example
+
let original: [i32; 3] = [1, 2, 3];
+let shared: Arc<[i32]> = Arc::from(original);
+assert_eq!(&[1, 2, 3], &shared[..]);
+
1.51.0 · source§

impl<W> From<Arc<W>> for Waker
where + W: Wake + Send + Sync + 'static,

source§

fn from(waker: Arc<W>) -> Waker

Use a Wake-able type as a Waker.

+

No heap allocations or atomic operations are used for this conversion.

+
1.62.0 · source§

impl From<Arc<str>> for Arc<[u8]>

source§

fn from(rc: Arc<str>) -> Arc<[u8]>

Converts an atomically reference-counted string slice into a byte slice.

+
§Example
+
let string: Arc<str> = Arc::from("eggplant");
+let bytes: Arc<[u8]> = Arc::from(string);
+assert_eq!("eggplant".as_bytes(), bytes.as_ref());
+
1.21.0 · source§

impl<T, A> From<Box<T, A>> for Arc<T, A>
where + A: Allocator, + T: ?Sized,

source§

fn from(v: Box<T, A>) -> Arc<T, A>

Move a boxed object to a new, reference-counted allocation.

+
§Example
+
let unique: Box<str> = Box::from("eggplant");
+let shared: Arc<str> = Arc::from(unique);
+assert_eq!("eggplant", &shared[..]);
+
1.24.0 · source§

impl From<CString> for Arc<CStr>

source§

fn from(s: CString) -> Arc<CStr>

Converts a CString into an Arc<CStr> by moving the CString +data into a new Arc buffer.

+
1.45.0 · source§

impl<'a, B> From<Cow<'a, B>> for Arc<B>
where + B: ToOwned + ?Sized, + Arc<B>: From<&'a B> + From<<B as ToOwned>::Owned>,

source§

fn from(cow: Cow<'a, B>) -> Arc<B>

Create an atomically reference-counted pointer from +a clone-on-write pointer by copying its content.

+
§Example
+
let cow: Cow<'_, str> = Cow::Borrowed("eggplant");
+let shared: Arc<str> = Arc::from(cow);
+assert_eq!("eggplant", &shared[..]);
+
1.24.0 · source§

impl From<OsString> for Arc<OsStr>

source§

fn from(s: OsString) -> Arc<OsStr>

Converts an OsString into an Arc<OsStr> by moving the OsString +data into a new Arc buffer.

+
1.24.0 · source§

impl From<PathBuf> for Arc<Path>

source§

fn from(s: PathBuf) -> Arc<Path>

Converts a PathBuf into an Arc<Path> by moving the PathBuf data +into a new Arc buffer.

+
1.21.0 · source§

impl From<String> for Arc<str>

source§

fn from(v: String) -> Arc<str>

Allocate a reference-counted str and copy v into it.

+
§Example
+
let unique: String = "eggplant".to_owned();
+let shared: Arc<str> = Arc::from(unique);
+assert_eq!("eggplant", &shared[..]);
+
1.6.0 · source§

impl<T> From<T> for Arc<T>

source§

fn from(t: T) -> Arc<T>

Converts a T into an Arc<T>

+

The conversion moves the value into a +newly allocated Arc. It is equivalent to +calling Arc::new(t).

+
§Example
+
let x = 5;
+let arc = Arc::new(5);
+
+assert_eq!(Arc::from(x), arc);
+
1.21.0 · source§

impl<T, A> From<Vec<T, A>> for Arc<[T], A>
where + A: Allocator + Clone,

source§

fn from(v: Vec<T, A>) -> Arc<[T], A>

Allocate a reference-counted slice and move v’s items into it.

+
§Example
+
let unique: Vec<i32> = vec![1, 2, 3];
+let shared: Arc<[i32]> = Arc::from(unique);
+assert_eq!(&[1, 2, 3], &shared[..]);
+
1.37.0 · source§

impl<T> FromIterator<T> for Arc<[T]>

source§

fn from_iter<I>(iter: I) -> Arc<[T]>
where + I: IntoIterator<Item = T>,

Takes each element in the Iterator and collects it into an Arc<[T]>.

+
§Performance characteristics
§The general case
+

In the general case, collecting into Arc<[T]> is done by first +collecting into a Vec<T>. That is, when writing the following:

+ +
let evens: Arc<[u8]> = (0..10).filter(|&x| x % 2 == 0).collect();
+

this behaves as if we wrote:

+ +
let evens: Arc<[u8]> = (0..10).filter(|&x| x % 2 == 0)
+    .collect::<Vec<_>>() // The first set of allocations happens here.
+    .into(); // A second allocation for `Arc<[T]>` happens here.
+

This will allocate as many times as needed for constructing the Vec<T> +and then it will allocate once for turning the Vec<T> into the Arc<[T]>.

+
§Iterators of known length
+

When your Iterator implements TrustedLen and is of an exact size, +a single allocation will be made for the Arc<[T]>. For example:

+ +
let evens: Arc<[u8]> = (0..10).collect(); // Just a single allocation happens here.
+
1.0.0 · source§

impl<T, A> Hash for Arc<T, A>
where + T: Hash + ?Sized, + A: Allocator,

source§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<T> KV for Arc<T>
where + T: KV + ?Sized,

§

fn serialize( + &self, + record: &Record<'_>, + serializer: &mut dyn Serializer, +) -> Result<(), Error>

Serialize self into Serializer Read more
§

impl<T> KeyManagerClient for Arc<T>
where + T: KeyManagerClient + ?Sized,

§

fn runtime_id(&self) -> Option<Namespace>

Key manager runtime identifier this client is connected to. It may be None in case the +identifier is not known yet (e.g. the client has not yet been initialized).
§

fn runtime_signing_key(&self) -> Option<PublicKey>

Key manager runtime signing key used to sign messages from the key manager.
§

fn clear_cache(&self)

Clear local key cache. Read more
§

fn get_or_create_keys<'life0, 'async_trait>( + &'life0 self, + key_pair_id: KeyPairId, + generation: u64, +) -> Pin<Box<dyn Future<Output = Result<KeyPair, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Get or create named long-term key pair. Read more
§

fn get_public_key<'life0, 'async_trait>( + &'life0 self, + key_pair_id: KeyPairId, + generation: u64, +) -> Pin<Box<dyn Future<Output = Result<SignedPublicKey, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Get long-term public key for a key pair id.
§

fn get_or_create_ephemeral_keys<'life0, 'async_trait>( + &'life0 self, + key_pair_id: KeyPairId, + epoch: u64, +) -> Pin<Box<dyn Future<Output = Result<KeyPair, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Get or create named ephemeral key pair for given epoch. Read more
§

fn get_public_ephemeral_key<'life0, 'async_trait>( + &'life0 self, + key_pair_id: KeyPairId, + epoch: u64, +) -> Pin<Box<dyn Future<Output = Result<SignedPublicKey, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Get ephemeral public key for an epoch and a key pair id.
§

fn replicate_master_secret<'life0, 'async_trait>( + &'life0 self, + generation: u64, + nodes: Vec<PublicKey>, +) -> Pin<Box<dyn Future<Output = Result<VerifiableSecret, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Get a copy of the master secret for replication.
§

fn replicate_ephemeral_secret<'life0, 'async_trait>( + &'life0 self, + epoch: u64, + nodes: Vec<PublicKey>, +) -> Pin<Box<dyn Future<Output = Result<Secret, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Get a copy of the ephemeral secret for replication.
§

fn churp_verification_matrix<'life0, 'async_trait>( + &'life0 self, + churp_id: u8, + epoch: u64, + nodes: Vec<PublicKey>, +) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Returns the verification matrix for the given handoff.
§

fn churp_share_reduction_point<'life0, 'async_trait>( + &'life0 self, + churp_id: u8, + epoch: u64, + node_id: PublicKey, + nodes: Vec<PublicKey>, +) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Returns a switch point for the share reduction phase +of the given handoff.
§

fn churp_share_distribution_point<'life0, 'async_trait>( + &'life0 self, + churp_id: u8, + epoch: u64, + node_id: PublicKey, + nodes: Vec<PublicKey>, +) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Returns a switch point for the share distribution phase +of the given handoff.
§

fn churp_bivariate_share<'life0, 'async_trait>( + &'life0 self, + churp_id: u8, + epoch: u64, + node_id: PublicKey, + nodes: Vec<PublicKey>, +) -> Pin<Box<dyn Future<Output = Result<EncodedVerifiableSecretShare, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Returns a bivariate share for the given handoff.
§

fn churp_state_key<'life0, 'async_trait>( + &'life0 self, + churp_id: u8, + key_id: KeyPairId, +) -> Pin<Box<dyn Future<Output = Result<StateKey, KeyManagerError>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Returns state key.
source§

impl<T> KeyValue for Arc<T>
where + T: KeyValue + ?Sized,

source§

fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>

Fetch the value for a specific key.
source§

fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>

Store a specific key/value into storage.
§

impl<Sp> LocalSpawn for Arc<Sp>
where + Sp: LocalSpawn + ?Sized,

§

fn spawn_local_obj( + &self, + future: LocalFutureObj<'static, ()>, +) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status_local(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
source§

impl<T> Log for Arc<T>
where + T: Log + ?Sized,

source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be +logged. Read more
source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
source§

fn flush(&self)

Flushes any buffered records. Read more
1.0.0 · source§

impl<T, A> Ord for Arc<T, A>
where + T: Ord + ?Sized, + A: Allocator,

source§

fn cmp(&self, other: &Arc<T, A>) -> Ordering

Comparison for two Arcs.

+

The two are compared by calling cmp() on their inner values.

+
§Examples
+
use std::sync::Arc;
+use std::cmp::Ordering;
+
+let five = Arc::new(5);
+
+assert_eq!(Ordering::Less, five.cmp(&Arc::new(6)));
+
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
1.0.0 · source§

impl<T, A> PartialEq for Arc<T, A>
where + T: PartialEq + ?Sized, + A: Allocator,

source§

fn eq(&self, other: &Arc<T, A>) -> bool

Equality for two Arcs.

+

Two Arcs are equal if their inner values are equal, even if they are +stored in different allocation.

+

If T also implements Eq (implying reflexivity of equality), +two Arcs that point to the same allocation are always equal.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+assert!(five == Arc::new(5));
+
source§

fn ne(&self, other: &Arc<T, A>) -> bool

Inequality for two Arcs.

+

Two Arcs are not equal if their inner values are not equal.

+

If T also implements Eq (implying reflexivity of equality), +two Arcs that point to the same value are always equal.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+assert!(five != Arc::new(6));
+
1.0.0 · source§

impl<T, A> PartialOrd for Arc<T, A>
where + T: PartialOrd + ?Sized, + A: Allocator,

source§

fn partial_cmp(&self, other: &Arc<T, A>) -> Option<Ordering>

Partial comparison for two Arcs.

+

The two are compared by calling partial_cmp() on their inner values.

+
§Examples
+
use std::sync::Arc;
+use std::cmp::Ordering;
+
+let five = Arc::new(5);
+
+assert_eq!(Some(Ordering::Less), five.partial_cmp(&Arc::new(6)));
+
source§

fn lt(&self, other: &Arc<T, A>) -> bool

Less-than comparison for two Arcs.

+

The two are compared by calling < on their inner values.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+assert!(five < Arc::new(6));
+
source§

fn le(&self, other: &Arc<T, A>) -> bool

‘Less than or equal to’ comparison for two Arcs.

+

The two are compared by calling <= on their inner values.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+assert!(five <= Arc::new(5));
+
source§

fn gt(&self, other: &Arc<T, A>) -> bool

Greater-than comparison for two Arcs.

+

The two are compared by calling > on their inner values.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+assert!(five > Arc::new(4));
+
source§

fn ge(&self, other: &Arc<T, A>) -> bool

‘Greater than or equal to’ comparison for two Arcs.

+

The two are compared by calling >= on their inner values.

+
§Examples
+
use std::sync::Arc;
+
+let five = Arc::new(5);
+
+assert!(five >= Arc::new(5));
+
1.0.0 · source§

impl<T, A> Pointer for Arc<T, A>
where + A: Allocator, + T: ?Sized,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
1.73.0 · source§

impl Read for Arc<File>

source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>

Pull some bytes from this source into the specified buffer, returning +how many bytes were read. Read more
source§

fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>

Like read, except that it reads into a slice of buffers. Read more
source§

fn read_buf(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
source§

fn is_read_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored +implementation. Read more
source§

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>

Read all bytes until EOF in this source, placing them into buf. Read more
source§

fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>

Read all bytes until EOF in this source, appending them to buf. Read more
1.6.0 · source§

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>

Read the exact number of bytes required to fill buf. Read more
source§

fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>

🔬This is a nightly-only experimental API. (read_buf)
Read the exact number of bytes required to fill cursor. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Creates a “by reference” adaptor for this instance of Read. Read more
1.0.0 · source§

fn bytes(self) -> Bytes<Self>
where + Self: Sized,

Transforms this Read instance to an Iterator over its bytes. Read more
1.0.0 · source§

fn chain<R>(self, next: R) -> Chain<Self, R>
where + R: Read, + Self: Sized,

Creates an adapter which will chain this stream with another. Read more
1.0.0 · source§

fn take(self, limit: u64) -> Take<Self>
where + Self: Sized,

Creates an adapter which will read at most limit bytes from it. Read more
§

impl<T> RefCnt for Arc<T>

§

type Base = T

The base type the pointer points to.
§

fn into_ptr(me: Arc<T>) -> *mut T

Converts the smart pointer into a raw pointer, without affecting the reference count. Read more
§

fn as_ptr(me: &Arc<T>) -> *mut T

Provides a view into the smart pointer as a raw pointer. Read more
§

unsafe fn from_ptr(ptr: *const T) -> Arc<T>

Converts a raw pointer back into the smart pointer, without affecting the reference count. Read more
§

fn inc(me: &Self) -> *mut Self::Base

Increments the reference count by one. Read more
§

unsafe fn dec(ptr: *const Self::Base)

Decrements the reference count by one. Read more
1.73.0 · source§

impl Seek for Arc<File>

source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Seek to an offset, in bytes, in a stream. Read more
1.55.0 · source§

fn rewind(&mut self) -> Result<(), Error>

Rewind to the beginning of a stream. Read more
source§

fn stream_len(&mut self) -> Result<u64, Error>

🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
1.51.0 · source§

fn stream_position(&mut self) -> Result<u64, Error>

Returns the current seek position from the start of the stream. Read more
1.80.0 · source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Error>

Seeks relative to the current position. Read more
source§

impl<T: Signer + ?Sized> Signer for Arc<T>

source§

fn random(_rng: &mut impl RngCore) -> Result<Self, Error>
where + Self: Sized,

Create a new random signer.
source§

fn new_from_seed(_seed: &[u8]) -> Result<Self, Error>
where + Self: Sized,

Create a new signer from the given seed.
source§

fn from_bytes(_bytes: &[u8]) -> Result<Self, Error>
where + Self: Sized,

Recreate signer from a byte serialization.
source§

fn to_bytes(&self) -> Vec<u8>

Serialize the signer into bytes.
source§

fn public_key(&self) -> PublicKey

Return the public key counterpart to the signer’s secret key.
source§

fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>

Generate a signature over the context and message.
source§

fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>

Generate a signature over the message.
§

impl<Sp> Spawn for Arc<Sp>
where + Sp: Spawn + ?Sized,

§

fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
1.43.0 · source§

impl<T, A, const N: usize> TryFrom<Arc<[T], A>> for Arc<[T; N], A>
where + A: Allocator,

§

type Error = Arc<[T], A>

The type returned in the event of a conversion error.
source§

fn try_from( + boxed_slice: Arc<[T], A>, +) -> Result<Arc<[T; N], A>, <Arc<[T; N], A> as TryFrom<Arc<[T], A>>>::Error>

Performs the conversion.
source§

impl<T> Dispatcher for Arc<T>
where + T: Dispatcher + ?Sized,

source§

fn execute_batch( + &self, + ctx: Context<'_>, + batch: &TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, Error>

Execute the transactions in the given batch. Read more
source§

fn schedule_and_execute_batch( + &self, + ctx: Context<'_>, + initial_batch: &mut TxnBatch, + in_msgs: &[IncomingMessage], +) -> Result<ExecuteBatchResult, Error>

Schedule and execute transactions in the given batch. Read more
source§

fn check_batch( + &self, + ctx: Context<'_>, + batch: &TxnBatch, +) -> Result<Vec<CheckTxResult>, Error>

Check the transactions in the given batch for validity. Read more
source§

fn finalize(&self, new_storage_root: Hash)

Invoke the finalizer (if any).
source§

fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>)

Configure abort batch flag.
source§

fn query( + &self, + ctx: Context<'_>, + method: &str, + args: Vec<u8>, +) -> Result<Vec<u8>, Error>

Process a query. Read more
source§

fn is_supported(&self) -> bool

Whether dispatch is supported by this dispatcher.
§

impl<T> Value for Arc<T>
where + T: Value + ?Sized,

§

fn serialize( + &self, + record: &Record<'_>, + key: &'static str, + serializer: &mut dyn Serializer, +) -> Result<(), Error>

Serialize self into Serializer Read more
source§

impl<T> Verifier for Arc<T>
where + T: Verifier + ?Sized,

source§

fn sync<'life0, 'async_trait>( + &'life0 self, + height: u64, +) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Synchronize the verifier state up to including the passed consensus height.
source§

fn verify<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, + runtime_header: Header, + epoch: u64, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Verify that the given runtime header is valid at the given consensus layer block and return +the consensus layer state accessor for that block. Read more
source§

fn verify_for_query<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, + runtime_header: Header, + epoch: u64, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Verify that the given runtime header is valid at the given consensus layer block and return +the consensus layer state accessor for that block. Read more
source§

fn unverified_state<'life0, 'async_trait>( + &'life0 self, + consensus_block: LightBlock, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Return the consensus layer state accessor for the given consensus layer block WITHOUT +performing any verification. This method should only be used for operations that do not +require integrity guarantees.
source§

fn latest_state<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Return the latest verified consensus layer state. Read more
source§

fn state_at<'life0, 'async_trait>( + &'life0 self, + height: u64, +) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Return the verified consensus layer state for a given height. Read more
source§

fn events_at<'life0, 'async_trait>( + &'life0 self, + height: u64, + kind: EventKind, +) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, Error>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Return the consensus layer events at the given height. Read more
source§

fn latest_height<'life0, 'async_trait>( + &'life0 self, +) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where + 'life0: 'async_trait, + Arc<T>: 'async_trait,

Return the latest known consensus layer height.
1.73.0 · source§

impl Write for Arc<File>

source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Error>

Write a buffer into this writer, returning how many bytes were written. Read more
source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored +implementation. Read more
source§

fn flush(&mut self) -> Result<(), Error>

Flush this output stream, ensuring that all intermediately buffered +contents reach their destination. Read more
1.0.0 · source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error +encountered. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
source§

impl<T, U, A> CoerceUnsized<Arc<U, A>> for Arc<T, A>
where + T: Unsize<U> + ?Sized, + A: Allocator, + U: ?Sized,

source§

impl<T, A> DerefPure for Arc<T, A>
where + A: Allocator, + T: ?Sized,

source§

impl<T, U> DispatchFromDyn<Arc<U>> for Arc<T>
where + T: Unsize<U> + ?Sized, + U: ?Sized,

1.0.0 · source§

impl<T, A> Eq for Arc<T, A>
where + T: Eq + ?Sized, + A: Allocator,

1.0.0 · source§

impl<T, A> Send for Arc<T, A>
where + T: Sync + Send + ?Sized, + A: Allocator + Send,

1.0.0 · source§

impl<T, A> Sync for Arc<T, A>
where + T: Sync + Send + ?Sized, + A: Allocator + Sync,

1.33.0 · source§

impl<T, A> Unpin for Arc<T, A>
where + A: Allocator, + T: ?Sized,

1.9.0 · source§

impl<T, A> UnwindSafe for Arc<T, A>
where + T: RefUnwindSafe + ?Sized, + A: Allocator + UnwindSafe,

Auto Trait Implementations§

§

impl<T, A> Freeze for Arc<T, A>
where + A: Freeze, + T: ?Sized,

§

impl<T, A> RefUnwindSafe for Arc<T, A>
where + A: RefUnwindSafe, + T: RefUnwindSafe + ?Sized,

Blanket Implementations§

§

impl<T, A, P> Access<T> for P
where + A: Access<T> + ?Sized, + P: Deref<Target = A>,

§

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more
§

fn load(&self) -> <P as Access<T>>::Guard

The loading method. Read more
source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T, A> DynAccess<T> for A
where + A: Access<T>, + <A as Access<T>>::Guard: 'static,

§

fn load(&self) -> DynGuard<T>

The equivalent of [Access::load].
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<V> HistoryHost for V
where + V: Verifier,

source§

fn consensus_state_at(&self, height: u64) -> Result<ConsensusState, Error>

Fetch historic consensus state after executing the block at given height.
source§

fn consensus_events_at( + &self, + height: u64, + kind: EventKind, +) -> Result<Vec<Event>, Error>

Fetch events emitted during execution of the block at given height.
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<Sp> LocalSpawnExt for Sp
where + Sp: LocalSpawn + ?Sized,

§

fn spawn_local<Fut>(&self, future: Fut) -> Result<(), SpawnError>
where + Fut: Future<Output = ()> + 'static,

Spawns a task that polls the given future with output () to +completion. Read more
§

fn spawn_local_with_handle<Fut>( + &self, + future: Fut, +) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>
where + Fut: Future + 'static,

Spawns a task that polls the given future to completion and returns a +future that resolves to the spawned future’s output. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<R> ReadBytesExt for R
where + R: Read + ?Sized,

§

fn read_u8(&mut self) -> Result<u8, Error>

Reads an unsigned 8 bit integer from the underlying reader. Read more
§

fn read_i8(&mut self) -> Result<i8, Error>

Reads a signed 8 bit integer from the underlying reader. Read more
§

fn read_u16<T>(&mut self) -> Result<u16, Error>
where + T: ByteOrder,

Reads an unsigned 16 bit integer from the underlying reader. Read more
§

fn read_i16<T>(&mut self) -> Result<i16, Error>
where + T: ByteOrder,

Reads a signed 16 bit integer from the underlying reader. Read more
§

fn read_u24<T>(&mut self) -> Result<u32, Error>
where + T: ByteOrder,

Reads an unsigned 24 bit integer from the underlying reader. Read more
§

fn read_i24<T>(&mut self) -> Result<i32, Error>
where + T: ByteOrder,

Reads a signed 24 bit integer from the underlying reader. Read more
§

fn read_u32<T>(&mut self) -> Result<u32, Error>
where + T: ByteOrder,

Reads an unsigned 32 bit integer from the underlying reader. Read more
§

fn read_i32<T>(&mut self) -> Result<i32, Error>
where + T: ByteOrder,

Reads a signed 32 bit integer from the underlying reader. Read more
§

fn read_u48<T>(&mut self) -> Result<u64, Error>
where + T: ByteOrder,

Reads an unsigned 48 bit integer from the underlying reader. Read more
§

fn read_i48<T>(&mut self) -> Result<i64, Error>
where + T: ByteOrder,

Reads a signed 48 bit integer from the underlying reader. Read more
§

fn read_u64<T>(&mut self) -> Result<u64, Error>
where + T: ByteOrder,

Reads an unsigned 64 bit integer from the underlying reader. Read more
§

fn read_i64<T>(&mut self) -> Result<i64, Error>
where + T: ByteOrder,

Reads a signed 64 bit integer from the underlying reader. Read more
§

fn read_u128<T>(&mut self) -> Result<u128, Error>
where + T: ByteOrder,

Reads an unsigned 128 bit integer from the underlying reader. Read more
§

fn read_i128<T>(&mut self) -> Result<i128, Error>
where + T: ByteOrder,

Reads a signed 128 bit integer from the underlying reader. Read more
§

fn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error>
where + T: ByteOrder,

Reads an unsigned n-bytes integer from the underlying reader. Read more
§

fn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error>
where + T: ByteOrder,

Reads a signed n-bytes integer from the underlying reader. Read more
§

fn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error>
where + T: ByteOrder,

Reads an unsigned n-bytes integer from the underlying reader.
§

fn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error>
where + T: ByteOrder,

Reads a signed n-bytes integer from the underlying reader.
§

fn read_f32<T>(&mut self) -> Result<f32, Error>
where + T: ByteOrder,

Reads a IEEE754 single-precision (4 bytes) floating point number from +the underlying reader. Read more
§

fn read_f64<T>(&mut self) -> Result<f64, Error>
where + T: ByteOrder,

Reads a IEEE754 double-precision (8 bytes) floating point number from +the underlying reader. Read more
§

fn read_u16_into<T>(&mut self, dst: &mut [u16]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of unsigned 16 bit integers from the underlying +reader. Read more
§

fn read_u32_into<T>(&mut self, dst: &mut [u32]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of unsigned 32 bit integers from the underlying +reader. Read more
§

fn read_u64_into<T>(&mut self, dst: &mut [u64]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of unsigned 64 bit integers from the underlying +reader. Read more
§

fn read_u128_into<T>(&mut self, dst: &mut [u128]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of unsigned 128 bit integers from the underlying +reader. Read more
§

fn read_i8_into(&mut self, dst: &mut [i8]) -> Result<(), Error>

Reads a sequence of signed 8 bit integers from the underlying reader. Read more
§

fn read_i16_into<T>(&mut self, dst: &mut [i16]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of signed 16 bit integers from the underlying +reader. Read more
§

fn read_i32_into<T>(&mut self, dst: &mut [i32]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of signed 32 bit integers from the underlying +reader. Read more
§

fn read_i64_into<T>(&mut self, dst: &mut [i64]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of signed 64 bit integers from the underlying +reader. Read more
§

fn read_i128_into<T>(&mut self, dst: &mut [i128]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of signed 128 bit integers from the underlying +reader. Read more
§

fn read_f32_into<T>(&mut self, dst: &mut [f32]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of IEEE754 single-precision (4 bytes) floating +point numbers from the underlying reader. Read more
§

fn read_f32_into_unchecked<T>(&mut self, dst: &mut [f32]) -> Result<(), Error>
where + T: ByteOrder,

👎Deprecated since 1.2.0: please use read_f32_into instead
DEPRECATED. Read more
§

fn read_f64_into<T>(&mut self, dst: &mut [f64]) -> Result<(), Error>
where + T: ByteOrder,

Reads a sequence of IEEE754 double-precision (8 bytes) floating +point numbers from the underlying reader. Read more
§

fn read_f64_into_unchecked<T>(&mut self, dst: &mut [f64]) -> Result<(), Error>
where + T: ByteOrder,

👎Deprecated since 1.2.0: please use read_f64_into instead
DEPRECATED. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<Sp> SpawnExt for Sp
where + Sp: Spawn + ?Sized,

§

fn spawn<Fut>(&self, future: Fut) -> Result<(), SpawnError>
where + Fut: Future<Output = ()> + Send + 'static,

Spawns a task that polls the given future with output () to +completion. Read more
§

fn spawn_with_handle<Fut>( + &self, + future: Fut, +) -> Result<RemoteHandle<<Fut as Future>::Output>, SpawnError>
where + Fut: Future + Send + 'static, + <Fut as Future>::Output: Send,

Spawns a task that polls the given future to completion and returns a +future that resolves to the spawned future’s output. Read more
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<W> WriteBytesExt for W
where + W: Write + ?Sized,

§

fn write_u8(&mut self, n: u8) -> Result<(), Error>

Writes an unsigned 8 bit integer to the underlying writer. Read more
§

fn write_i8(&mut self, n: i8) -> Result<(), Error>

Writes a signed 8 bit integer to the underlying writer. Read more
§

fn write_u16<T>(&mut self, n: u16) -> Result<(), Error>
where + T: ByteOrder,

Writes an unsigned 16 bit integer to the underlying writer. Read more
§

fn write_i16<T>(&mut self, n: i16) -> Result<(), Error>
where + T: ByteOrder,

Writes a signed 16 bit integer to the underlying writer. Read more
§

fn write_u24<T>(&mut self, n: u32) -> Result<(), Error>
where + T: ByteOrder,

Writes an unsigned 24 bit integer to the underlying writer. Read more
§

fn write_i24<T>(&mut self, n: i32) -> Result<(), Error>
where + T: ByteOrder,

Writes a signed 24 bit integer to the underlying writer. Read more
§

fn write_u32<T>(&mut self, n: u32) -> Result<(), Error>
where + T: ByteOrder,

Writes an unsigned 32 bit integer to the underlying writer. Read more
§

fn write_i32<T>(&mut self, n: i32) -> Result<(), Error>
where + T: ByteOrder,

Writes a signed 32 bit integer to the underlying writer. Read more
§

fn write_u48<T>(&mut self, n: u64) -> Result<(), Error>
where + T: ByteOrder,

Writes an unsigned 48 bit integer to the underlying writer. Read more
§

fn write_i48<T>(&mut self, n: i64) -> Result<(), Error>
where + T: ByteOrder,

Writes a signed 48 bit integer to the underlying writer. Read more
§

fn write_u64<T>(&mut self, n: u64) -> Result<(), Error>
where + T: ByteOrder,

Writes an unsigned 64 bit integer to the underlying writer. Read more
§

fn write_i64<T>(&mut self, n: i64) -> Result<(), Error>
where + T: ByteOrder,

Writes a signed 64 bit integer to the underlying writer. Read more
§

fn write_u128<T>(&mut self, n: u128) -> Result<(), Error>
where + T: ByteOrder,

Writes an unsigned 128 bit integer to the underlying writer.
§

fn write_i128<T>(&mut self, n: i128) -> Result<(), Error>
where + T: ByteOrder,

Writes a signed 128 bit integer to the underlying writer.
§

fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error>
where + T: ByteOrder,

Writes an unsigned n-bytes integer to the underlying writer. Read more
§

fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error>
where + T: ByteOrder,

Writes a signed n-bytes integer to the underlying writer. Read more
§

fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error>
where + T: ByteOrder,

Writes an unsigned n-bytes integer to the underlying writer. Read more
§

fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error>
where + T: ByteOrder,

Writes a signed n-bytes integer to the underlying writer. Read more
§

fn write_f32<T>(&mut self, n: f32) -> Result<(), Error>
where + T: ByteOrder,

Writes a IEEE754 single-precision (4 bytes) floating point number to +the underlying writer. Read more
§

fn write_f64<T>(&mut self, n: f64) -> Result<(), Error>
where + T: ByteOrder,

Writes a IEEE754 double-precision (8 bytes) floating point number to +the underlying writer. Read more
§

impl<W> Writer for W
where + W: Write,

§

fn write(&mut self, slice: &[u8]) -> Result<(), Error>

Write the given DER-encoded bytes as output.
§

fn write_byte(&mut self, byte: u8) -> Result<(), Error>

Write a single byte.
§

impl<T> Formattable for T
where + T: Deref, + <T as Deref>::Target: Formattable,

§

impl<T> Parsable for T
where + T: Deref, + <T as Deref>::Target: Parsable,

§

impl<T> SendRefUnwindSafeDrain for T
where + T: Drain + Send + RefUnwindSafe + ?Sized,

§

impl<T> SendSyncRefUnwindSafeDrain for T
where + T: Drain + Send + Sync + RefUnwindSafe + ?Sized,

§

impl<T> SendSyncRefUnwindSafeKV for T
where + T: KV + Send + Sync + RefUnwindSafe + ?Sized,

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

§

impl<T> SendSyncUnwindSafeDrain for T
where + T: Drain + Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.TrustRoot.html b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.TrustRoot.html new file mode 100644 index 0000000000..64148b86de --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.TrustRoot.html @@ -0,0 +1,40 @@ +TrustRoot in oasis_runtime_sdk::modules::rofl::app::prelude - Rust

Struct oasis_runtime_sdk::modules::rofl::app::prelude::TrustRoot

source ·
pub struct TrustRoot {
+    pub height: u64,
+    pub hash: String,
+    pub runtime_id: Namespace,
+    pub chain_context: String,
+}
Expand description

Consensus layer trust root.

+

Fields§

§height: u64

Known trusted height.

+
§hash: String

Known hex-encoded trusted consensus layer header hash.

+
§runtime_id: Namespace

Known runtime identifier.

+
§chain_context: String

Known consensus chain context.

+

Trait Implementations§

source§

impl Clone for TrustRoot

source§

fn clone(&self) -> TrustRoot

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TrustRoot

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Decode for TrustRoot

source§

fn try_default() -> Result<TrustRoot, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<TrustRoot, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for TrustRoot

source§

fn default() -> TrustRoot

Returns the “default value” for a type. Read more
source§

impl Encode for TrustRoot

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for TrustRoot

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for TrustRoot

source§

fn eq(&self, other: &TrustRoot) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for TrustRoot

source§

impl StructuralPartialEq for TrustRoot

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.Version.html b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.Version.html new file mode 100644 index 0000000000..dd6ae10c37 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/struct.Version.html @@ -0,0 +1,41 @@ +Version in oasis_runtime_sdk::modules::rofl::app::prelude - Rust

Struct oasis_runtime_sdk::modules::rofl::app::prelude::Version

source ·
pub struct Version {
+    pub major: u16,
+    pub minor: u16,
+    pub patch: u16,
+}
Expand description

A protocol or runtime version.

+

Fields§

§major: u16§minor: u16§patch: u16

Implementations§

source§

impl Version

source

pub const fn new(major: u16, minor: u16, patch: u16) -> Version

Creates a new version with given major, minor, and patch segments.

+
source

pub fn is_compatible_with(&self, other: &Version) -> bool

Checks if two versions are compatible.

+

Trait Implementations§

source§

impl Clone for Version

source§

fn clone(&self) -> Version

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Version

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Decode for Version

source§

fn try_default() -> Result<Version, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Version, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Version

source§

fn default() -> Version

Returns the “default value” for a type. Read more
source§

impl Encode for Version

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Version

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<u64> for Version

source§

fn from(v: u64) -> Version

Converts to this type from the input type.
source§

impl Hash for Version

source§

fn hash<__H>(&self, state: &mut __H)
where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Version

source§

fn eq(&self, other: &Version) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Version

source§

impl Eq for Version

source§

impl StructuralPartialEq for Version

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/prelude/type.Result.html b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/type.Result.html new file mode 100644 index 0000000000..bb6e5927e1 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/prelude/type.Result.html @@ -0,0 +1,28 @@ +Result in oasis_runtime_sdk::modules::rofl::app::prelude - Rust

Type Alias oasis_runtime_sdk::modules::rofl::app::prelude::Result

source ·
pub type Result<T, E = Error> = Result<T, E>;
Expand description

Result<T, Error>

+

This is a reasonable return type to use throughout your application but also +for fn main; if you do, failures will be printed along with any +context and a backtrace if one was captured.

+

anyhow::Result may be used with one or two type parameters.

+ +
use anyhow::Result;
+
+fn demo1() -> Result<T> {...}
+           // ^ equivalent to std::result::Result<T, anyhow::Error>
+
+fn demo2() -> Result<T, OtherError> {...}
+           // ^ equivalent to std::result::Result<T, OtherError>
+

§Example

+
use anyhow::Result;
+
+fn main() -> Result<()> {
+    let config = std::fs::read_to_string("cluster.json")?;
+    let map: ClusterMap = serde_json::from_str(&config)?;
+    println!("cluster info: {:#?}", map);
+    Ok(())
+}
+

Aliased Type§

enum Result<T, E = Error> {
+    Ok(T),
+    Err(E),
+}

Variants§

§1.0.0

Ok(T)

Contains the success value

+
§1.0.0

Err(E)

Contains the error value

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rofl/app/sidebar-items.js new file mode 100644 index 0000000000..e87faa0c67 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["prelude"],"struct":["Client","Environment"],"trait":["App"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/struct.Client.html b/rust/oasis_runtime_sdk/modules/rofl/app/struct.Client.html new file mode 100644 index 0000000000..6d53d262bb --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/struct.Client.html @@ -0,0 +1,58 @@ +Client in oasis_runtime_sdk::modules::rofl::app - Rust

Struct oasis_runtime_sdk::modules::rofl::app::Client

source ·
pub struct Client<A: App> { /* private fields */ }
Expand description

A runtime client meant for use within runtimes.

+

Implementations§

source§

impl<A> Client<A>
where + A: App,

source

pub async fn latest_round(&self) -> Result<u64>

Retrieve the latest known runtime round.

+
source

pub async fn account_nonce(&self, round: u64, address: Address) -> Result<u64>

Retrieve the nonce for the given account.

+
source

pub async fn gas_price(&self, round: u64, denom: &Denomination) -> Result<u128>

Retrieve the gas price in the given denomination.

+
source

pub async fn query<Rq, Rs>( + &self, + round: u64, + method: &str, + args: Rq, +) -> Result<Rs>
where + Rq: Encode, + Rs: Decode + Send + 'static,

Securely query the on-chain runtime component.

+
source

pub async fn estimate_gas(&self, req: EstimateGasQuery) -> Result<u64>

Securely perform gas estimation.

+
source

pub async fn multi_sign_and_submit_tx( + &self, + signers: &[Arc<dyn Signer>], + tx: Transaction, +) -> Result<CallResult>

Sign a given transaction, submit it and wait for block inclusion.

+

This method supports multiple transaction signers.

+
source

pub async fn multi_sign_and_submit_tx_opts( + &self, + signers: &[Arc<dyn Signer>], + tx: Transaction, + opts: SubmitTxOpts, +) -> Result<CallResult>

Sign a given transaction, submit it and wait for block inclusion.

+

This method supports multiple transaction signers.

+
source

pub async fn sign_and_submit_tx( + &self, + signer: Arc<dyn Signer>, + tx: Transaction, +) -> Result<CallResult>

Sign a given transaction, submit it and wait for block inclusion.

+
source

pub async fn with_store_for_round<F, R>(&self, round: u64, f: F) -> Result<R>
where + F: FnOnce() -> Result<R> + Send + 'static, + R: Send + 'static,

Run a closure inside a CurrentState context with store for the given round.

+
source

pub async fn store_for_round(&self, round: u64) -> Result<HostStore>

Return a store corresponding to the given round.

+

Trait Implementations§

source§

impl<A> Clone for Client<A>
where + A: App,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<A> Freeze for Client<A>

§

impl<A> !RefUnwindSafe for Client<A>

§

impl<A> Send for Client<A>

§

impl<A> Sync for Client<A>

§

impl<A> Unpin for Client<A>

§

impl<A> !UnwindSafe for Client<A>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/struct.Environment.html b/rust/oasis_runtime_sdk/modules/rofl/app/struct.Environment.html new file mode 100644 index 0000000000..cfd11b4205 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/struct.Environment.html @@ -0,0 +1,26 @@ +Environment in oasis_runtime_sdk::modules::rofl::app - Rust

Struct oasis_runtime_sdk::modules::rofl::app::Environment

source ·
pub struct Environment<A: App> { /* private fields */ }
Expand description

Application environment.

+

Implementations§

source§

impl<A> Environment<A>
where + A: App,

source

pub fn client(&self) -> &Client<A>

Runtime client.

+
source

pub fn signer(&self) -> Arc<dyn Signer>

Transaction signer.

+

Trait Implementations§

source§

impl<A> Clone for Environment<A>
where + A: App,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<A> Freeze for Environment<A>

§

impl<A> !RefUnwindSafe for Environment<A>

§

impl<A> Send for Environment<A>

§

impl<A> Sync for Environment<A>

§

impl<A> Unpin for Environment<A>

§

impl<A> !UnwindSafe for Environment<A>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/trait.App.html b/rust/oasis_runtime_sdk/modules/rofl/app/trait.App.html new file mode 100644 index 0000000000..6c69ae6df1 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app/trait.App.html @@ -0,0 +1,44 @@ +App in oasis_runtime_sdk::modules::rofl::app - Rust

Trait oasis_runtime_sdk::modules::rofl::app::App

source ·
pub trait App: Send + Sync + 'static {
+    const VERSION: Version;
+
+    // Required methods
+    fn id() -> AppId;
+    fn consensus_trust_root() -> Option<TrustRoot>;
+
+    // Provided methods
+    fn new_transaction<B>(&self, method: &str, body: B) -> Transaction
+       where B: Encode { ... }
+    fn run<'async_trait>(
+        self: Arc<Self>,
+        env: Environment<Self>,
+    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
+       where Self: Sized + 'async_trait { ... }
+    fn on_runtime_block<'async_trait>(
+        self: Arc<Self>,
+        env: Environment<Self>,
+        round: u64,
+    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
+       where Self: Sized + 'async_trait { ... }
+    fn start(self)
+       where Self: Sized { ... }
+}
Expand description

ROFL component application.

+

Required Associated Constants§

source

const VERSION: Version

ROFL application version.

+

Required Methods§

source

fn id() -> AppId

Identifier of the application (used for registrations).

+
source

fn consensus_trust_root() -> Option<TrustRoot>

Return the consensus layer trust root for this runtime; if None, consensus layer integrity +verification will not be performed.

+

Provided Methods§

source

fn new_transaction<B>(&self, method: &str, body: B) -> Transaction
where + B: Encode,

Create a new unsigned transaction.

+
source

fn run<'async_trait>( + self: Arc<Self>, + env: Environment<Self>, +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where + Self: Sized + 'async_trait,

Main application processing loop.

+
source

fn on_runtime_block<'async_trait>( + self: Arc<Self>, + env: Environment<Self>, + round: u64, +) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where + Self: Sized + 'async_trait,

Logic that runs on each runtime block. Only one of these will run concurrently.

+
source

fn start(self)
where + Self: Sized,

Start the application.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app_id/constant.APP_ID_BECH32_HRP.html b/rust/oasis_runtime_sdk/modules/rofl/app_id/constant.APP_ID_BECH32_HRP.html new file mode 100644 index 0000000000..f474061817 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app_id/constant.APP_ID_BECH32_HRP.html @@ -0,0 +1,2 @@ +APP_ID_BECH32_HRP in oasis_runtime_sdk::modules::rofl::app_id - Rust

Constant oasis_runtime_sdk::modules::rofl::app_id::APP_ID_BECH32_HRP

source ·
pub const APP_ID_BECH32_HRP: Hrp;
Expand description

Human readable part for Bech32-encoded application identifier.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app_id/enum.Error.html b/rust/oasis_runtime_sdk/modules/rofl/app_id/enum.Error.html new file mode 100644 index 0000000000..d137a6994a --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app_id/enum.Error.html @@ -0,0 +1,24 @@ +Error in oasis_runtime_sdk::modules::rofl::app_id - Rust

Enum oasis_runtime_sdk::modules::rofl::app_id::Error

source ·
pub enum Error {
+    MalformedIdentifier,
+}
Expand description

Error.

+

Variants§

§

MalformedIdentifier

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app_id/index.html b/rust/oasis_runtime_sdk/modules/rofl/app_id/index.html new file mode 100644 index 0000000000..da6c7a1eb1 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app_id/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::rofl::app_id - Rust

Module oasis_runtime_sdk::modules::rofl::app_id

source ·
Expand description

ROFL application identifier.

+

Structs§

  • ROFL application identifier.

Enums§

Constants§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app_id/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rofl/app_id/sidebar-items.js new file mode 100644 index 0000000000..1d0920ffc0 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app_id/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["APP_ID_BECH32_HRP"],"enum":["Error"],"struct":["AppId"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app_id/struct.AppId.html b/rust/oasis_runtime_sdk/modules/rofl/app_id/struct.AppId.html new file mode 100644 index 0000000000..2a87920679 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/app_id/struct.AppId.html @@ -0,0 +1,64 @@ +AppId in oasis_runtime_sdk::modules::rofl::app_id - Rust

Struct oasis_runtime_sdk::modules::rofl::app_id::AppId

source ·
pub struct AppId(/* private fields */);
Expand description

ROFL application identifier.

+

The application identifier is similar to an address, but using its own separate namespace and +derivation scheme as it is not meant to be used as an address.

+

Implementations§

source§

impl AppId

source

pub const SIZE: usize = 21usize

Size of an application identifier in bytes.

+
source

pub fn from_global_name(name: &str) -> Self

Creates a new v0 application identifier from a global name.

+
source

pub fn from_creator_round_index( + creator: Address, + round: u64, + index: u32, +) -> Self

Creates a new v0 application identifier from creator/round/index tuple.

+
source

pub fn from_creator_nonce(creator: Address, nonce: u64) -> Self

Creates a new v0 application identifier from creator/nonce tuple.

+
source

pub fn from_bytes(data: &[u8]) -> Result<Self, Error>

Tries to create a new identifier from raw bytes.

+
source

pub fn into_bytes(self) -> [u8; 21]

Convert the identifier into raw bytes.

+
source

pub fn from_bech32(data: &str) -> Result<Self, Error>

Tries to create a new identifier from Bech32-encoded string.

+
source

pub fn to_bech32(self) -> String

Converts an identifier to Bech32 representation.

+

Trait Implementations§

source§

impl AsRef<[u8]> for AppId

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for AppId

source§

fn clone(&self) -> AppId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AppId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AppId

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AppId

source§

fn default() -> AppId

Returns the “default value” for a type. Read more
source§

impl Display for AppId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for AppId

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&'static str> for AppId

source§

fn from(s: &'static str) -> AppId

Converts to this type from the input type.
source§

impl Hash for AppId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for AppId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for AppId

source§

fn cmp(&self, other: &AppId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for AppId

source§

fn eq(&self, other: &AppId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for AppId

source§

fn partial_cmp(&self, other: &AppId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl TryFrom<&[u8]> for AppId

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Value for AppId

source§

fn serialize( + &self, + _record: &Record<'_>, + key: Key, + serializer: &mut dyn Serializer, +) -> Result

Serialize self into Serializer Read more
source§

impl Copy for AppId

source§

impl Eq for AppId

source§

impl StructuralPartialEq for AppId

Auto Trait Implementations§

§

impl Freeze for AppId

§

impl RefUnwindSafe for AppId

§

impl Send for AppId

§

impl Sync for AppId

§

impl Unpin for AppId

§

impl UnwindSafe for AppId

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/config/trait.Config.html b/rust/oasis_runtime_sdk/modules/rofl/config/trait.Config.html new file mode 100644 index 0000000000..780b552468 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/config/trait.Config.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_runtime_sdk/modules/rofl/trait.Config.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/enum.Error.html b/rust/oasis_runtime_sdk/modules/rofl/enum.Error.html new file mode 100644 index 0000000000..9f5545b88f --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/enum.Error.html @@ -0,0 +1,39 @@ +Error in oasis_runtime_sdk::modules::rofl - Rust

Enum oasis_runtime_sdk::modules::rofl::Error

source ·
pub enum Error {
+
Show 14 variants InvalidArgument, + UnknownApp, + NotSignedByRAK, + NotSignedByExtraKey, + UnknownEnclave, + UnknownNode, + NodeNotAllowed, + RegistrationExpired, + ExtraKeyUpdateNotAllowed, + AppAlreadyExists, + Forbidden, + UnknownInstance, + Core(Error), + Accounts(Error), +
}
Expand description

Errors emitted by the module.

+

Variants§

§

InvalidArgument

§

UnknownApp

§

NotSignedByRAK

§

NotSignedByExtraKey

§

UnknownEnclave

§

UnknownNode

§

NodeNotAllowed

§

RegistrationExpired

§

ExtraKeyUpdateNotAllowed

§

AppAlreadyExists

§

Forbidden

§

UnknownInstance

§

Core(Error)

§

Accounts(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/enum.Event.html b/rust/oasis_runtime_sdk/modules/rofl/enum.Event.html new file mode 100644 index 0000000000..699bf6ad20 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/enum.Event.html @@ -0,0 +1,31 @@ +Event in oasis_runtime_sdk::modules::rofl - Rust

Enum oasis_runtime_sdk::modules::rofl::Event

source ·
pub enum Event {
+    AppCreated {
+        id: AppId,
+    },
+    AppUpdated {
+        id: AppId,
+    },
+    AppRemoved {
+        id: AppId,
+    },
+}
Expand description

Events emitted by the ROFL module.

+

Variants§

§

AppCreated

Fields

§

AppUpdated

Fields

§

AppRemoved

Fields

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Event for Event

source§

fn module_name() -> &'static str

Name of the module that emitted the event.
source§

fn code(&self) -> u32

Code uniquely identifying the event.
source§

fn into_event_tag(self) -> EventTag

Converts an event into an event tag. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/enum.ParameterValidationError.html b/rust/oasis_runtime_sdk/modules/rofl/enum.ParameterValidationError.html new file mode 100644 index 0000000000..4f240816dc --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/enum.ParameterValidationError.html @@ -0,0 +1,22 @@ +ParameterValidationError in oasis_runtime_sdk::modules::rofl - Rust
pub enum ParameterValidationError {}
Expand description

Errors emitted during parameter validation.

+

Trait Implementations§

source§

impl Debug for ParameterValidationError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ParameterValidationError

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for ParameterValidationError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/error/enum.Error.html b/rust/oasis_runtime_sdk/modules/rofl/error/enum.Error.html new file mode 100644 index 0000000000..04c6b45b34 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/error/enum.Error.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_runtime_sdk/modules/rofl/enum.Error.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/event/enum.Event.html b/rust/oasis_runtime_sdk/modules/rofl/event/enum.Event.html new file mode 100644 index 0000000000..6ba4e5cbcc --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/event/enum.Event.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../oasis_runtime_sdk/modules/rofl/enum.Event.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/index.html b/rust/oasis_runtime_sdk/modules/rofl/index.html new file mode 100644 index 0000000000..5532fa0c8b --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::modules::rofl - Rust

Module oasis_runtime_sdk::modules::rofl

source ·
Expand description

On-chain coordination for ROFL components.

+

Modules§

Structs§

Enums§

Statics§

Traits§

  • Interface that can be called from other modules.
  • Module configuration.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/policy/enum.AllowedEndorsement.html b/rust/oasis_runtime_sdk/modules/rofl/policy/enum.AllowedEndorsement.html new file mode 100644 index 0000000000..333137e061 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/policy/enum.AllowedEndorsement.html @@ -0,0 +1,43 @@ +AllowedEndorsement in oasis_runtime_sdk::modules::rofl::policy - Rust
pub enum AllowedEndorsement {
+    Any,
+    ComputeRole,
+    ObserverRole,
+    Entity(PublicKey),
+    Node(PublicKey),
+}
Expand description

An allowed endorsement policy.

+

Variants§

§

Any

Any node can endorse the enclave.

+
§

ComputeRole

Compute node for the current runtime can endorse the enclave.

+
§

ObserverRole

Observer node for the current runtime can endorse the enclave.

+
§

Entity(PublicKey)

Registered node from a specific entity can endorse the enclave.

+
§

Node(PublicKey)

Specific node can endorse the enclave.

+

Trait Implementations§

source§

impl Clone for AllowedEndorsement

source§

fn clone(&self) -> AllowedEndorsement

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AllowedEndorsement

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AllowedEndorsement

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for AllowedEndorsement

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AllowedEndorsement

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for AllowedEndorsement

source§

fn eq(&self, other: &AllowedEndorsement) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for AllowedEndorsement

source§

impl StructuralPartialEq for AllowedEndorsement

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/policy/enum.FeePolicy.html b/rust/oasis_runtime_sdk/modules/rofl/policy/enum.FeePolicy.html new file mode 100644 index 0000000000..fda6ef2ad7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/policy/enum.FeePolicy.html @@ -0,0 +1,35 @@ +FeePolicy in oasis_runtime_sdk::modules::rofl::policy - Rust

Enum oasis_runtime_sdk::modules::rofl::policy::FeePolicy

source ·
#[repr(u8)]
pub enum FeePolicy { + InstancePays = 1, + EndorsingNodePays = 2, +}
Expand description

Gas fee payment policy.

+

Variants§

§

InstancePays = 1

Application enclave pays the gas fees.

+
§

EndorsingNodePays = 2

Endorsing node pays the gas fees.

+

Trait Implementations§

source§

impl Clone for FeePolicy

source§

fn clone(&self) -> FeePolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FeePolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for FeePolicy

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for FeePolicy

source§

fn default() -> FeePolicy

Returns the “default value” for a type. Read more
source§

impl Encode for FeePolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for FeePolicy

source§

fn eq(&self, other: &FeePolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for FeePolicy

source§

impl StructuralPartialEq for FeePolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/policy/index.html b/rust/oasis_runtime_sdk/modules/rofl/policy/index.html new file mode 100644 index 0000000000..95a53c12d3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/policy/index.html @@ -0,0 +1 @@ +oasis_runtime_sdk::modules::rofl::policy - Rust

Module oasis_runtime_sdk::modules::rofl::policy

source ·

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/policy/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rofl/policy/sidebar-items.js new file mode 100644 index 0000000000..0814281ed0 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/policy/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AllowedEndorsement","FeePolicy"],"struct":["AppAuthPolicy"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/policy/struct.AppAuthPolicy.html b/rust/oasis_runtime_sdk/modules/rofl/policy/struct.AppAuthPolicy.html new file mode 100644 index 0000000000..afca6441b3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/policy/struct.AppAuthPolicy.html @@ -0,0 +1,42 @@ +AppAuthPolicy in oasis_runtime_sdk::modules::rofl::policy - Rust

Struct oasis_runtime_sdk::modules::rofl::policy::AppAuthPolicy

source ·
pub struct AppAuthPolicy {
+    pub quotes: QuotePolicy,
+    pub enclaves: Vec<EnclaveIdentity>,
+    pub endorsements: Vec<AllowedEndorsement>,
+    pub fees: FeePolicy,
+    pub max_expiration: EpochTime,
+}
Expand description

Per-application ROFL policy.

+

Fields§

§quotes: QuotePolicy

Quote policy.

+
§enclaves: Vec<EnclaveIdentity>

The set of allowed enclave identities.

+
§endorsements: Vec<AllowedEndorsement>

The set of allowed endorsements.

+
§fees: FeePolicy

Gas fee payment policy.

+
§max_expiration: EpochTime

Maximum number of future epochs for which one can register.

+

Trait Implementations§

source§

impl Clone for AppAuthPolicy

source§

fn clone(&self) -> AppAuthPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AppAuthPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AppAuthPolicy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AppAuthPolicy

source§

fn default() -> AppAuthPolicy

Returns the “default value” for a type. Read more
source§

impl Encode for AppAuthPolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AppAuthPolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for AppAuthPolicy

source§

fn eq(&self, other: &AppAuthPolicy) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for AppAuthPolicy

source§

impl StructuralPartialEq for AppAuthPolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rofl/sidebar-items.js new file mode 100644 index 0000000000..2dc91fdc88 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","Event","ParameterValidationError"],"mod":["app","app_id","policy","state","types"],"static":["ADDRESS_APP_STAKE_POOL"],"struct":["Genesis","Module","Parameters"],"trait":["API","Config"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.expire_registrations.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.expire_registrations.html new file mode 100644 index 0000000000..1ecdf08fae --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.expire_registrations.html @@ -0,0 +1,3 @@ +expire_registrations in oasis_runtime_sdk::modules::rofl::state - Rust

Function oasis_runtime_sdk::modules::rofl::state::expire_registrations

source ·
pub fn expire_registrations(epoch: EpochTime, limit: usize)
Expand description

Removes all expired registrations, e.g. those that expire in epochs earlier than or equal to the +passed epoch.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_app.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_app.html new file mode 100644 index 0000000000..6c64eb8af0 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_app.html @@ -0,0 +1,2 @@ +get_app in oasis_runtime_sdk::modules::rofl::state - Rust

Function oasis_runtime_sdk::modules::rofl::state::get_app

source ·
pub fn get_app(app_id: AppId) -> Option<AppConfig>
Expand description

Retrieves an application configuration.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_endorser.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_endorser.html new file mode 100644 index 0000000000..8bc210f3e3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_endorser.html @@ -0,0 +1,2 @@ +get_endorser in oasis_runtime_sdk::modules::rofl::state - Rust

Function oasis_runtime_sdk::modules::rofl::state::get_endorser

source ·
pub fn get_endorser(pk: &PublicKey) -> Option<KeyEndorsementInfo>
Expand description

Retrieves endorser of the given ROFL enclave. In case enclave is not registered, returns None.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_registration.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_registration.html new file mode 100644 index 0000000000..8c87c23712 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_registration.html @@ -0,0 +1,3 @@ +get_registration in oasis_runtime_sdk::modules::rofl::state - Rust

Function oasis_runtime_sdk::modules::rofl::state::get_registration

source ·
pub fn get_registration(app_id: AppId, rak: &PublicKey) -> Option<Registration>
Expand description

Retrieves registration of the given ROFL enclave. In case enclave is not registered, returns +None.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_registrations_for_app.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_registrations_for_app.html new file mode 100644 index 0000000000..5b178a45f4 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.get_registrations_for_app.html @@ -0,0 +1,2 @@ +get_registrations_for_app in oasis_runtime_sdk::modules::rofl::state - Rust
pub fn get_registrations_for_app(app_id: AppId) -> Vec<Registration>
Expand description

Retrieves all registrations for the given ROFL application.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.remove_app.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.remove_app.html new file mode 100644 index 0000000000..4aa920f9c2 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.remove_app.html @@ -0,0 +1,2 @@ +remove_app in oasis_runtime_sdk::modules::rofl::state - Rust

Function oasis_runtime_sdk::modules::rofl::state::remove_app

source ·
pub fn remove_app(app_id: AppId)
Expand description

Removes an application configuration.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.remove_registration.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.remove_registration.html new file mode 100644 index 0000000000..e22eaa8b92 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.remove_registration.html @@ -0,0 +1,2 @@ +remove_registration in oasis_runtime_sdk::modules::rofl::state - Rust

Function oasis_runtime_sdk::modules::rofl::state::remove_registration

source ·
pub fn remove_registration(app_id: AppId, rak: &PublicKey)
Expand description

Removes an existing registration of the given ROFL enclave.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.set_app.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.set_app.html new file mode 100644 index 0000000000..f83415c745 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.set_app.html @@ -0,0 +1,2 @@ +set_app in oasis_runtime_sdk::modules::rofl::state - Rust

Function oasis_runtime_sdk::modules::rofl::state::set_app

source ·
pub fn set_app(cfg: AppConfig)
Expand description

Updates an application configuration.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/fn.update_registration.html b/rust/oasis_runtime_sdk/modules/rofl/state/fn.update_registration.html new file mode 100644 index 0000000000..3a831fa3e7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/fn.update_registration.html @@ -0,0 +1,2 @@ +update_registration in oasis_runtime_sdk::modules::rofl::state - Rust

Function oasis_runtime_sdk::modules::rofl::state::update_registration

source ·
pub fn update_registration(registration: Registration) -> Result<(), Error>
Expand description

Updates registration of the given ROFL enclave.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/index.html b/rust/oasis_runtime_sdk/modules/rofl/state/index.html new file mode 100644 index 0000000000..d000bb1902 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/index.html @@ -0,0 +1,3 @@ +oasis_runtime_sdk::modules::rofl::state - Rust

Module oasis_runtime_sdk::modules::rofl::state

source ·

Structs§

Functions§

  • Removes all expired registrations, e.g. those that expire in epochs earlier than or equal to the +passed epoch.
  • Retrieves an application configuration.
  • Retrieves endorser of the given ROFL enclave. In case enclave is not registered, returns None.
  • Retrieves registration of the given ROFL enclave. In case enclave is not registered, returns +None.
  • Retrieves all registrations for the given ROFL application.
  • Removes an application configuration.
  • Removes an existing registration of the given ROFL enclave.
  • Updates an application configuration.
  • Updates registration of the given ROFL enclave.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rofl/state/sidebar-items.js new file mode 100644 index 0000000000..fae33458d3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["expire_registrations","get_app","get_endorser","get_registration","get_registrations_for_app","remove_app","remove_registration","set_app","update_registration"],"struct":["KeyEndorsementInfo"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/state/struct.KeyEndorsementInfo.html b/rust/oasis_runtime_sdk/modules/rofl/state/struct.KeyEndorsementInfo.html new file mode 100644 index 0000000000..0c38d8857e --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/state/struct.KeyEndorsementInfo.html @@ -0,0 +1,36 @@ +KeyEndorsementInfo in oasis_runtime_sdk::modules::rofl::state - Rust

Struct oasis_runtime_sdk::modules::rofl::state::KeyEndorsementInfo

source ·
pub struct KeyEndorsementInfo {
+    pub node_id: PublicKey,
+    pub rak: Option<PublicKey>,
+}
Expand description

Information about an endorsed key.

+

Fields§

§node_id: PublicKey

Identifier of node that endorsed the enclave.

+
§rak: Option<PublicKey>

RAK of the enclave that endorsed the key. This is only set for endorsements of extra keys.

+

Implementations§

source§

impl KeyEndorsementInfo

source

pub fn for_rak(node_id: CorePublicKey) -> Self

Create a new key endorsement information for RAK endorsed by given node directly.

+
source

pub fn for_extra_key(node_id: CorePublicKey, rak: CorePublicKey) -> Self

Create a new key endorsement information for extra key endorsed by RAK.

+

Trait Implementations§

source§

impl Clone for KeyEndorsementInfo

source§

fn clone(&self) -> KeyEndorsementInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for KeyEndorsementInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for KeyEndorsementInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for KeyEndorsementInfo

source§

fn default() -> KeyEndorsementInfo

Returns the “default value” for a type. Read more
source§

impl Encode for KeyEndorsementInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for KeyEndorsementInfo

source§

fn eq(&self, other: &KeyEndorsementInfo) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for KeyEndorsementInfo

source§

impl StructuralPartialEq for KeyEndorsementInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/static.ADDRESS_APP_STAKE_POOL.html b/rust/oasis_runtime_sdk/modules/rofl/static.ADDRESS_APP_STAKE_POOL.html new file mode 100644 index 0000000000..ddbdeba451 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/static.ADDRESS_APP_STAKE_POOL.html @@ -0,0 +1,3 @@ +ADDRESS_APP_STAKE_POOL in oasis_runtime_sdk::modules::rofl - Rust
pub static ADDRESS_APP_STAKE_POOL: Lazy<Address>
Expand description

Module’s address that has the application stake pool.

+

oasis1qza6sddnalgzexk3ct30gqfvntgth5m4hsyywmff

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/struct.Genesis.html b/rust/oasis_runtime_sdk/modules/rofl/struct.Genesis.html new file mode 100644 index 0000000000..b3967dab05 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/struct.Genesis.html @@ -0,0 +1,31 @@ +Genesis in oasis_runtime_sdk::modules::rofl - Rust

Struct oasis_runtime_sdk::modules::rofl::Genesis

source ·
pub struct Genesis {
+    pub parameters: Parameters,
+    pub apps: Vec<AppConfig>,
+}
Expand description

Genesis state for the module.

+

Fields§

§parameters: Parameters§apps: Vec<AppConfig>

Application configurations.

+

Trait Implementations§

source§

impl Clone for Genesis

source§

fn clone(&self) -> Genesis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Genesis

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Genesis

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Genesis

source§

fn default() -> Genesis

Returns the “default value” for a type. Read more
source§

impl Encode for Genesis

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Genesis

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/struct.Module.html b/rust/oasis_runtime_sdk/modules/rofl/struct.Module.html new file mode 100644 index 0000000000..5ff8aba6ec --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/struct.Module.html @@ -0,0 +1,83 @@ +Module in oasis_runtime_sdk::modules::rofl - Rust

Struct oasis_runtime_sdk::modules::rofl::Module

source ·
pub struct Module<Cfg: Config> { /* private fields */ }

Trait Implementations§

source§

impl<Cfg: Config> API for Module<Cfg>

source§

fn get_origin_rak() -> Option<PublicKey>

Get the Runtime Attestation Key of the ROFL app instance in case the origin transaction is +signed by a ROFL instance. Otherwise None is returned. Read more
source§

fn get_origin_registration(app: AppId) -> Option<Registration>

Get the registration descriptor of the ROFL app instance in case the origin transaction is +signed by a ROFL instance of the specified app. Otherwise None is returned. Read more
source§

fn is_authorized_origin(app: AppId) -> bool

Verify whether the origin transaction is signed by an authorized ROFL instance for the given +application. Read more
source§

fn get_registration(app: AppId, rak: PublicKey) -> Result<Registration, Error>

Get a specific registered instance for an application.
source§

fn get_app(id: AppId) -> Result<AppConfig, Error>

Get an application’s configuration.
source§

fn get_instances(id: AppId) -> Result<Vec<Registration>, Error>

Get all registered instances for an application.
source§

impl<Cfg: Config> BlockHandler for Module<Cfg>

source§

fn end_block<C: Context>(ctx: &C)

Perform any common actions at the end of the block (after all transactions have been +executed).
source§

fn begin_block<C: Context>(_ctx: &C)

Perform any common actions at the start of the block (before any transactions have been +executed).
source§

impl<Cfg: Config> FeeProxyHandler for Module<Cfg>

source§

fn resolve_payer<C: Context>( + ctx: &C, + tx: &Transaction, +) -> Result<Option<Address>, Error>

Resolve the proxy payer for the given transaction. If no payer could be resolved, None +should be returned.
source§

impl<Cfg: Config> InvariantHandler for Module<Cfg>

source§

fn check_invariants<C: Context>(_ctx: &C) -> Result<(), Error>

Check invariants.
source§

impl<Cfg: Config> MethodHandler for Module<Cfg>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.
source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.
source§

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.
source§

fn is_expensive_query(method: &str) -> bool

Checks whether the given query method is tagged as expensive.
source§

fn prefetch( + _prefixes: &mut BTreeSet<Prefix>, + _method: &str, + body: Value, + _auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), RuntimeError>>

Add storage prefixes to prefetch.
source§

fn dispatch_message_result<C: Context>( + _ctx: &C, + _handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>

Dispatch a message result.
source§

fn is_allowed_private_km_query(_method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.
source§

fn is_allowed_interactive_call(_method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.
source§

impl<Cfg: Config> MigrationHandler for Module<Cfg>

§

type Genesis = Genesis

Genesis state type. Read more
source§

fn init_or_migrate<C: Context>( + _ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration. Read more
source§

impl<Cfg: Config> Module for Module<Cfg>

source§

const NAME: &'static str = MODULE_NAME

Module name.
§

type Error = Error

Module error type.
§

type Event = Event

Module event type.
§

type Parameters = Parameters

Module parameters.
source§

const VERSION: u32 = 1u32

Module version.
source§

fn params() -> Self::Parameters

Return the module’s parameters.
source§

fn set_params(params: Self::Parameters)

Set the module’s parameters.
source§

impl<Cfg: Config> TransactionHandler for Module<Cfg>

source§

fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.
source§

fn approve_unverified_tx<C: Context>( + _ctx: &C, + _utx: &UnverifiedTransaction, +) -> Result<(), Error>

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.
source§

fn decode_tx<C: Context>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>

Decode a transaction that was sent with module-controlled decoding and verify any +signatures. Read more
source§

fn authenticate_tx<C: Context>( + _ctx: &C, + _tx: &Transaction, +) -> Result<AuthDecision, Error>

Authenticate a transaction. Read more
source§

fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>

Perform any action after authentication, within the transaction context. Read more
source§

fn before_authorized_call_dispatch<C: Context>( + _ctx: &C, + _call: &Call, +) -> Result<(), Error>

Perform any action after authentication and decoding, within the transaction context. Read more
source§

fn after_handle_call<C: Context>( + _ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>

Perform any action after call, within the transaction context. Read more
source§

fn after_dispatch_tx<C: Context>( + _ctx: &C, + _tx_auth_info: &AuthInfo, + _result: &CallResult, +)

Perform any action after dispatching the transaction, in batch context.

Auto Trait Implementations§

§

impl<Cfg> Freeze for Module<Cfg>

§

impl<Cfg> RefUnwindSafe for Module<Cfg>
where + Cfg: RefUnwindSafe,

§

impl<Cfg> Send for Module<Cfg>
where + Cfg: Send,

§

impl<Cfg> Sync for Module<Cfg>
where + Cfg: Sync,

§

impl<Cfg> Unpin for Module<Cfg>
where + Cfg: Unpin,

§

impl<Cfg> UnwindSafe for Module<Cfg>
where + Cfg: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<M> ModuleInfoHandler for M
where + M: Module + MethodHandler,

source§

fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>
where + C: Context,

Reports info about the module (or modules, if Self is a tuple).
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/struct.Parameters.html b/rust/oasis_runtime_sdk/modules/rofl/struct.Parameters.html new file mode 100644 index 0000000000..c9b1c631f7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/struct.Parameters.html @@ -0,0 +1,27 @@ +Parameters in oasis_runtime_sdk::modules::rofl - Rust

Struct oasis_runtime_sdk::modules::rofl::Parameters

source ·
pub struct Parameters {}
Expand description

Parameters for the module.

+

Trait Implementations§

source§

impl Clone for Parameters

source§

fn clone(&self) -> Parameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Parameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Parameters

source§

fn default() -> Parameters

Returns the “default value” for a type. Read more
source§

impl Encode for Parameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Parameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Parameters for Parameters

§

type Error = ParameterValidationError

source§

fn validate_basic(&self) -> Result<(), Self::Error>

Perform basic parameter validation.
source§

const STORE_KEY: &'static [u8] = _

Store key used for storing parameters.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/trait.API.html b/rust/oasis_runtime_sdk/modules/rofl/trait.API.html new file mode 100644 index 0000000000..a19ff0ed58 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/trait.API.html @@ -0,0 +1,28 @@ +API in oasis_runtime_sdk::modules::rofl - Rust

Trait oasis_runtime_sdk::modules::rofl::API

source ·
pub trait API {
+    // Required methods
+    fn get_origin_rak() -> Option<PublicKey>;
+    fn get_origin_registration(app: AppId) -> Option<Registration>;
+    fn is_authorized_origin(app: AppId) -> bool;
+    fn get_registration(
+        app: AppId,
+        rak: PublicKey,
+    ) -> Result<Registration, Error>;
+    fn get_app(id: AppId) -> Result<AppConfig, Error>;
+    fn get_instances(id: AppId) -> Result<Vec<Registration>, Error>;
+}
Expand description

Interface that can be called from other modules.

+

Required Methods§

source

fn get_origin_rak() -> Option<PublicKey>

Get the Runtime Attestation Key of the ROFL app instance in case the origin transaction is +signed by a ROFL instance. Otherwise None is returned.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

fn get_origin_registration(app: AppId) -> Option<Registration>

Get the registration descriptor of the ROFL app instance in case the origin transaction is +signed by a ROFL instance of the specified app. Otherwise None is returned.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

fn is_authorized_origin(app: AppId) -> bool

Verify whether the origin transaction is signed by an authorized ROFL instance for the given +application.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

fn get_registration(app: AppId, rak: PublicKey) -> Result<Registration, Error>

Get a specific registered instance for an application.

+
source

fn get_app(id: AppId) -> Result<AppConfig, Error>

Get an application’s configuration.

+
source

fn get_instances(id: AppId) -> Result<Vec<Registration>, Error>

Get all registered instances for an application.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Cfg: Config> API for Module<Cfg>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/trait.Config.html b/rust/oasis_runtime_sdk/modules/rofl/trait.Config.html new file mode 100644 index 0000000000..cdd5233fa7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/trait.Config.html @@ -0,0 +1,23 @@ +Config in oasis_runtime_sdk::modules::rofl - Rust

Trait oasis_runtime_sdk::modules::rofl::Config

source ·
pub trait Config: 'static {
+    const GAS_COST_CALL_CREATE: u64 = 100_000u64;
+    const GAS_COST_CALL_UPDATE: u64 = 100_000u64;
+    const GAS_COST_CALL_REMOVE: u64 = 10_000u64;
+    const GAS_COST_CALL_REGISTER: u64 = 100_000u64;
+    const GAS_COST_CALL_IS_AUTHORIZED_ORIGIN: u64 = 1_000u64;
+    const GAS_COST_CALL_AUTHORIZED_ORIGIN_NODE: u64 = 2_000u64;
+    const GAS_COST_CALL_AUTHORIZED_ORIGIN_ENTITY: u64 = 2_000u64;
+    const GAS_COST_CALL_STAKE_THRESHOLDS: u64 = 10u64;
+    const STAKE_APP_CREATE: BaseUnits = _;
+}
Expand description

Module configuration.

+

Provided Associated Constants§

source

const GAS_COST_CALL_CREATE: u64 = 100_000u64

Gas cost of rofl.Create call.

+
source

const GAS_COST_CALL_UPDATE: u64 = 100_000u64

Gas cost of rofl.Update call.

+
source

const GAS_COST_CALL_REMOVE: u64 = 10_000u64

Gas cost of rofl.Remove call.

+
source

const GAS_COST_CALL_REGISTER: u64 = 100_000u64

Gas cost of rofl.Register call.

+
source

const GAS_COST_CALL_IS_AUTHORIZED_ORIGIN: u64 = 1_000u64

Gas cost of rofl.IsAuthorizedOrigin call.

+
source

const GAS_COST_CALL_AUTHORIZED_ORIGIN_NODE: u64 = 2_000u64

Gas cost of rofl.AuthorizedOriginNode call.

+
source

const GAS_COST_CALL_AUTHORIZED_ORIGIN_ENTITY: u64 = 2_000u64

Gas cost of rofl.AuthorizedOriginEntity call.

+
source

const GAS_COST_CALL_STAKE_THRESHOLDS: u64 = 10u64

Gas cost of rofl.StakeThresholds call.

+
source

const STAKE_APP_CREATE: BaseUnits = _

Amount of stake required for maintaining an application.

+

The stake is held in escrow and is returned to the administrator when the application is +removed.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/enum.IdentifierScheme.html b/rust/oasis_runtime_sdk/modules/rofl/types/enum.IdentifierScheme.html new file mode 100644 index 0000000000..9dfaba2cc7 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/enum.IdentifierScheme.html @@ -0,0 +1,30 @@ +IdentifierScheme in oasis_runtime_sdk::modules::rofl::types - Rust
#[repr(u8)]
pub enum IdentifierScheme { + CreatorRoundIndex = 0, + CreatorNonce = 1, +}
Expand description

ROFL application identifier generation scheme.

+

Variants§

§

CreatorRoundIndex = 0

§

CreatorNonce = 1

Trait Implementations§

source§

impl Clone for IdentifierScheme

source§

fn clone(&self) -> IdentifierScheme

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for IdentifierScheme

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for IdentifierScheme

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for IdentifierScheme

source§

fn default() -> IdentifierScheme

Returns the “default value” for a type. Read more
source§

impl Encode for IdentifierScheme

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Copy for IdentifierScheme

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/index.html b/rust/oasis_runtime_sdk/modules/rofl/types/index.html new file mode 100644 index 0000000000..514b873e1c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/index.html @@ -0,0 +1 @@ +oasis_runtime_sdk::modules::rofl::types - Rust

Module oasis_runtime_sdk::modules::rofl::types

source ·

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/sidebar-items.js b/rust/oasis_runtime_sdk/modules/rofl/types/sidebar-items.js new file mode 100644 index 0000000000..509bbae6d9 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["IdentifierScheme"],"struct":["AppConfig","AppInstanceQuery","AppQuery","Create","Register","Registration","Remove","StakeThresholds","Update"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppConfig.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppConfig.html new file mode 100644 index 0000000000..995ef63368 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppConfig.html @@ -0,0 +1,36 @@ +AppConfig in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::AppConfig

source ·
pub struct AppConfig {
+    pub id: AppId,
+    pub policy: AppAuthPolicy,
+    pub admin: Option<Address>,
+    pub stake: BaseUnits,
+}
Expand description

ROFL application configuration.

+

Fields§

§id: AppId

ROFL application identifier.

+
§policy: AppAuthPolicy

Authentication policy.

+
§admin: Option<Address>

Application administrator address.

+
§stake: BaseUnits

Staked amount.

+

Trait Implementations§

source§

impl Clone for AppConfig

source§

fn clone(&self) -> AppConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AppConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AppConfig

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AppConfig

source§

fn default() -> AppConfig

Returns the “default value” for a type. Read more
source§

impl Encode for AppConfig

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AppConfig

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppInstanceQuery.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppInstanceQuery.html new file mode 100644 index 0000000000..4a4564c180 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppInstanceQuery.html @@ -0,0 +1,33 @@ +AppInstanceQuery in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::AppInstanceQuery

source ·
pub struct AppInstanceQuery {
+    pub app: AppId,
+    pub rak: PublicKey,
+}
Expand description

Application instance query.

+

Fields§

§app: AppId

ROFL application identifier.

+
§rak: PublicKey

Runtime Attestation Key.

+

Trait Implementations§

source§

impl Clone for AppInstanceQuery

source§

fn clone(&self) -> AppInstanceQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AppInstanceQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AppInstanceQuery

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for AppInstanceQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AppInstanceQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppQuery.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppQuery.html new file mode 100644 index 0000000000..41ba815eb3 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.AppQuery.html @@ -0,0 +1,30 @@ +AppQuery in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::AppQuery

source ·
pub struct AppQuery {
+    pub id: AppId,
+}
Expand description

Application-related query.

+

Fields§

§id: AppId

ROFL application identifier.

+

Trait Implementations§

source§

impl Clone for AppQuery

source§

fn clone(&self) -> AppQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AppQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AppQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AppQuery

source§

fn default() -> AppQuery

Returns the “default value” for a type. Read more
source§

impl Encode for AppQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AppQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.Create.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Create.html new file mode 100644 index 0000000000..c728a14684 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Create.html @@ -0,0 +1,32 @@ +Create in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::Create

source ·
pub struct Create {
+    pub policy: AppAuthPolicy,
+    pub scheme: IdentifierScheme,
+}
Expand description

Create new ROFL application call.

+

Fields§

§policy: AppAuthPolicy

Application authentication policy.

+
§scheme: IdentifierScheme

Identifier generation scheme.

+

Trait Implementations§

source§

impl Clone for Create

source§

fn clone(&self) -> Create

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Create

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Create

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Create

source§

fn default() -> Create

Returns the “default value” for a type. Read more
source§

impl Encode for Create

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Create

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Create

§

impl RefUnwindSafe for Create

§

impl Send for Create

§

impl Sync for Create

§

impl Unpin for Create

§

impl UnwindSafe for Create

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.Register.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Register.html new file mode 100644 index 0000000000..359c2e00df --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Register.html @@ -0,0 +1,37 @@ +Register in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::Register

source ·
pub struct Register {
+    pub app: AppId,
+    pub ect: EndorsedCapabilityTEE,
+    pub expiration: EpochTime,
+    pub extra_keys: Vec<PublicKey>,
+}
Expand description

Register ROFL call.

+

Fields§

§app: AppId

ROFL application identifier.

+
§ect: EndorsedCapabilityTEE

Endorsed TEE capability.

+
§expiration: EpochTime

Epoch when the ROFL registration expires if not renewed.

+
§extra_keys: Vec<PublicKey>

Extra public keys to endorse (e.g. secp256k1 keys).

+

All of these keys need to co-sign the registration transaction to prove ownership.

+

Trait Implementations§

source§

impl Clone for Register

source§

fn clone(&self) -> Register

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Register

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Register

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Register

source§

fn default() -> Register

Returns the “default value” for a type. Read more
source§

impl Encode for Register

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Register

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.Registration.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Registration.html new file mode 100644 index 0000000000..0a5751c24f --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Registration.html @@ -0,0 +1,46 @@ +Registration in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::Registration

source ·
pub struct Registration {
+    pub app: AppId,
+    pub node_id: PublicKey,
+    pub entity_id: Option<PublicKey>,
+    pub rak: PublicKey,
+    pub rek: PublicKey,
+    pub expiration: EpochTime,
+    pub extra_keys: Vec<PublicKey>,
+}
Expand description

ROFL registration descriptor.

+

Fields§

§app: AppId

Application this enclave is registered for.

+
§node_id: PublicKey

Identifier of the endorsing node.

+
§entity_id: Option<PublicKey>

Optional identifier of the endorsing entity.

+
§rak: PublicKey

Runtime Attestation Key.

+
§rek: PublicKey

Runtime Encryption Key.

+
§expiration: EpochTime

Epoch when the ROFL registration expires if not renewed.

+
§extra_keys: Vec<PublicKey>

Extra public keys to endorse (e.g. secp256k1 keys).

+

Trait Implementations§

source§

impl Clone for Registration

source§

fn clone(&self) -> Registration

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Registration

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Registration

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Registration

source§

fn default() -> Registration

Returns the “default value” for a type. Read more
source§

impl Encode for Registration

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Registration

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for Registration

source§

fn eq(&self, other: &Registration) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for Registration

source§

impl StructuralPartialEq for Registration

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.Remove.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Remove.html new file mode 100644 index 0000000000..70743a5ebb --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Remove.html @@ -0,0 +1,30 @@ +Remove in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::Remove

source ·
pub struct Remove {
+    pub id: AppId,
+}
Expand description

Remove an existing ROFL application call.

+

Fields§

§id: AppId

ROFL application identifier.

+

Trait Implementations§

source§

impl Clone for Remove

source§

fn clone(&self) -> Remove

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Remove

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Remove

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Remove

source§

fn default() -> Remove

Returns the “default value” for a type. Read more
source§

impl Encode for Remove

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Remove

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Remove

§

impl RefUnwindSafe for Remove

§

impl Send for Remove

§

impl Sync for Remove

§

impl Unpin for Remove

§

impl UnwindSafe for Remove

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.StakeThresholds.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.StakeThresholds.html new file mode 100644 index 0000000000..c736a3472c --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.StakeThresholds.html @@ -0,0 +1,30 @@ +StakeThresholds in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::StakeThresholds

source ·
pub struct StakeThresholds {
+    pub app_create: BaseUnits,
+}
Expand description

Stake thresholds for managing ROFL.

+

Fields§

§app_create: BaseUnits

Required stake for creating new ROFL application.

+

Trait Implementations§

source§

impl Clone for StakeThresholds

source§

fn clone(&self) -> StakeThresholds

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StakeThresholds

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StakeThresholds

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for StakeThresholds

source§

fn default() -> StakeThresholds

Returns the “default value” for a type. Read more
source§

impl Encode for StakeThresholds

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for StakeThresholds

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/types/struct.Update.html b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Update.html new file mode 100644 index 0000000000..33b05f36a4 --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/rofl/types/struct.Update.html @@ -0,0 +1,34 @@ +Update in oasis_runtime_sdk::modules::rofl::types - Rust

Struct oasis_runtime_sdk::modules::rofl::types::Update

source ·
pub struct Update {
+    pub id: AppId,
+    pub policy: AppAuthPolicy,
+    pub admin: Option<Address>,
+}
Expand description

Update an existing ROFL application call.

+

Fields§

§id: AppId

ROFL application identifier.

+
§policy: AppAuthPolicy

Authentication policy.

+
§admin: Option<Address>

Application administrator address.

+

Trait Implementations§

source§

impl Clone for Update

source§

fn clone(&self) -> Update

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Update

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Update

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Update

source§

fn default() -> Update

Returns the “default value” for a type. Read more
source§

impl Encode for Update

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Update

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Update

§

impl RefUnwindSafe for Update

§

impl Send for Update

§

impl Sync for Update

§

impl Unpin for Update

§

impl UnwindSafe for Update

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/sidebar-items.js b/rust/oasis_runtime_sdk/modules/sidebar-items.js new file mode 100644 index 0000000000..ebc557025f --- /dev/null +++ b/rust/oasis_runtime_sdk/modules/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["access","accounts","consensus","consensus_accounts","core","rewards","rofl"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/runtime/index.html b/rust/oasis_runtime_sdk/runtime/index.html new file mode 100644 index 0000000000..704abd8f65 --- /dev/null +++ b/rust/oasis_runtime_sdk/runtime/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::runtime - Rust

Module oasis_runtime_sdk::runtime

source ·
Expand description

Runtime.

+

Traits§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/runtime/sidebar-items.js b/rust/oasis_runtime_sdk/runtime/sidebar-items.js new file mode 100644 index 0000000000..78cc0152af --- /dev/null +++ b/rust/oasis_runtime_sdk/runtime/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["Runtime"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/runtime/trait.Runtime.html b/rust/oasis_runtime_sdk/runtime/trait.Runtime.html new file mode 100644 index 0000000000..909c621236 --- /dev/null +++ b/rust/oasis_runtime_sdk/runtime/trait.Runtime.html @@ -0,0 +1,51 @@ +Runtime in oasis_runtime_sdk::runtime - Rust

Trait oasis_runtime_sdk::runtime::Runtime

source ·
pub trait Runtime {
+    type Core: API;
+    type Accounts: API;
+    type Modules: TransactionHandler + MigrationHandler + MethodHandler + BlockHandler + InvariantHandler + ModuleInfoHandler;
+    type FeeProxy: FeeProxyHandler = ();
+
+    const VERSION: Version;
+    const STATE_VERSION: u32 = 0u32;
+    const PREFETCH_LIMIT: u16 = 0u16;
+    const SCHEDULE_CONTROL: ScheduleControl = _;
+
+    // Required method
+    fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis;
+
+    // Provided methods
+    fn trusted_signers() -> Option<TrustedSigners> { ... }
+    fn consensus_trust_root() -> Option<TrustRoot> { ... }
+    fn migrate_state<C: Context>(_ctx: &C) { ... }
+    fn is_allowed_query(_method: &str) -> bool { ... }
+    fn is_allowed_private_km_query(_method: &str) -> bool { ... }
+    fn is_allowed_interactive_call(_method: &str) -> bool { ... }
+    fn migrate<C: Context>(ctx: &C) { ... }
+    fn start()
+       where Self: Sized + Send + Sync + 'static { ... }
+}
Expand description

A runtime.

+

Required Associated Types§

source

type Core: API

Module that provides the core API.

+
source

type Accounts: API

Module that provides the accounts API.

+
source

type Modules: TransactionHandler + MigrationHandler + MethodHandler + BlockHandler + InvariantHandler + ModuleInfoHandler

Supported modules.

+

Provided Associated Types§

source

type FeeProxy: FeeProxyHandler = ()

Handler for proxy fee payments.

+

Required Associated Constants§

source

const VERSION: Version

Runtime version.

+

Provided Associated Constants§

source

const STATE_VERSION: u32 = 0u32

State version.

+
source

const PREFETCH_LIMIT: u16 = 0u16

Prefetch limit. To enable prefetch set it to a non-zero value.

+
source

const SCHEDULE_CONTROL: ScheduleControl = _

Runtime schedule control configuration.

+

Required Methods§

source

fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis

Genesis state for the runtime.

+

Provided Methods§

source

fn trusted_signers() -> Option<TrustedSigners>

Return the trusted signers for this runtime; if None, a key manager connection will not be +established on startup.

+
source

fn consensus_trust_root() -> Option<TrustRoot>

Return the consensus layer trust root for this runtime; if None, consensus layer integrity +verification will not be performed.

+
source

fn migrate_state<C: Context>(_ctx: &C)

Perform runtime-specific state migration. This method is only called when the recorded +state version does not match STATE_VERSION.

+
source

fn is_allowed_query(_method: &str) -> bool

Whether a given query method is allowed to be invoked.

+
source

fn is_allowed_private_km_query(_method: &str) -> bool

Whether a given query method is allowed to access private key manager state.

+

Note that even if this returns true for a method, the method also needs to be tagged as +being allowed to access private key manager state (e.g. with allow_private_km).

+
source

fn is_allowed_interactive_call(_method: &str) -> bool

Whether a given call is allowed to be invoked interactively.

+

Note that even if this returns true for a method, the method also needs to be tagged as +being allowed to be executed interactively (e.g. with allow_interactive)

+
source

fn migrate<C: Context>(ctx: &C)

Perform state migrations if required.

+
source

fn start()
where + Self: Sized + Send + Sync + 'static,

Start the runtime.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/schedule_control/enum.Error.html b/rust/oasis_runtime_sdk/schedule_control/enum.Error.html new file mode 100644 index 0000000000..0df47d9de7 --- /dev/null +++ b/rust/oasis_runtime_sdk/schedule_control/enum.Error.html @@ -0,0 +1,26 @@ +Error in oasis_runtime_sdk::schedule_control - Rust

Enum oasis_runtime_sdk::schedule_control::Error

source ·
pub enum Error {
+    FailedToFetchBatch,
+}
Expand description

Schedule control errors.

+

Variants§

§

FailedToFetchBatch

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/schedule_control/index.html b/rust/oasis_runtime_sdk/schedule_control/index.html new file mode 100644 index 0000000000..5e144af9b4 --- /dev/null +++ b/rust/oasis_runtime_sdk/schedule_control/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::schedule_control - Rust

Module oasis_runtime_sdk::schedule_control

source ·
Expand description

Types related to schedule control.

+

Enums§

  • Schedule control errors.

Traits§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/schedule_control/sidebar-items.js b/rust/oasis_runtime_sdk/schedule_control/sidebar-items.js new file mode 100644 index 0000000000..849f7e77cc --- /dev/null +++ b/rust/oasis_runtime_sdk/schedule_control/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"trait":["ScheduleControlHost"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/schedule_control/trait.ScheduleControlHost.html b/rust/oasis_runtime_sdk/schedule_control/trait.ScheduleControlHost.html new file mode 100644 index 0000000000..0a05ac413c --- /dev/null +++ b/rust/oasis_runtime_sdk/schedule_control/trait.ScheduleControlHost.html @@ -0,0 +1,21 @@ +ScheduleControlHost in oasis_runtime_sdk::schedule_control - Rust
pub trait ScheduleControlHost: Send + Sync {
+    // Required method
+    fn fetch_tx_batch(
+        &self,
+        offset: Option<Hash>,
+        limit: u32,
+    ) -> Result<Option<TxnBatch>, Error>;
+}
Expand description

Interface to the runtime host that supports schedule control features.

+

Required Methods§

source

fn fetch_tx_batch( + &self, + offset: Option<Hash>, + limit: u32, +) -> Result<Option<TxnBatch>, Error>

Fetch the specified set of transactions from the host’s transaction queue.

+

Offset specifies the transaction hash that should serve as an offset when returning +transactions from the pool. Transactions will be skipped until the given hash is encountered +and only following transactions will be returned.

+

Implementations on Foreign Types§

source§

impl ScheduleControlHost for Protocol

source§

fn fetch_tx_batch( + &self, + offset: Option<Hash>, + limit: u32, +) -> Result<Option<TxnBatch>, Error>

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/sender/index.html b/rust/oasis_runtime_sdk/sender/index.html new file mode 100644 index 0000000000..cb7e0b6941 --- /dev/null +++ b/rust/oasis_runtime_sdk/sender/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::sender - Rust

Module oasis_runtime_sdk::sender

source ·
Expand description

Transaction sender metadata.

+

Structs§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/sender/sidebar-items.js b/rust/oasis_runtime_sdk/sender/sidebar-items.js new file mode 100644 index 0000000000..d0ea6d18f5 --- /dev/null +++ b/rust/oasis_runtime_sdk/sender/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["SenderMeta"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/sender/struct.SenderMeta.html b/rust/oasis_runtime_sdk/sender/struct.SenderMeta.html new file mode 100644 index 0000000000..683394077f --- /dev/null +++ b/rust/oasis_runtime_sdk/sender/struct.SenderMeta.html @@ -0,0 +1,35 @@ +SenderMeta in oasis_runtime_sdk::sender - Rust

Struct oasis_runtime_sdk::sender::SenderMeta

source ·
pub struct SenderMeta {
+    pub address: Address,
+    pub tx_nonce: u64,
+    pub state_nonce: u64,
+}
Expand description

Transaction sender metadata.

+

Fields§

§address: Address

Sender address.

+
§tx_nonce: u64

Sender nonce contained in the transaction.

+
§state_nonce: u64

Sender nonce contained in runtime state.

+

Implementations§

source§

impl SenderMeta

source

pub fn id(&self) -> Vec<u8>

Unique identifier of the sender, currently derived from the sender address.

+

Trait Implementations§

source§

impl Clone for SenderMeta

source§

fn clone(&self) -> SenderMeta

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SenderMeta

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SenderMeta

source§

fn default() -> SenderMeta

Returns the “default value” for a type. Read more
source§

impl PartialEq for SenderMeta

source§

fn eq(&self, other: &SenderMeta) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SenderMeta

source§

impl StructuralPartialEq for SenderMeta

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/sidebar-items.js b/rust/oasis_runtime_sdk/sidebar-items.js new file mode 100644 index 0000000000..2bd0396e1f --- /dev/null +++ b/rust/oasis_runtime_sdk/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"attr":["handler","migration","sdk_derive"],"derive":["Error","Event"],"macro":["version_from_cargo"],"mod":["callformat","config","context","crypto","dispatcher","enclave_rpc","error","event","history","keymanager","module","modules","runtime","schedule_control","sender","state","storage","subcall","testing","types"],"struct":["Version"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/enum.Mode.html b/rust/oasis_runtime_sdk/state/enum.Mode.html new file mode 100644 index 0000000000..11b233d4ed --- /dev/null +++ b/rust/oasis_runtime_sdk/state/enum.Mode.html @@ -0,0 +1,38 @@ +Mode in oasis_runtime_sdk::state - Rust

Enum oasis_runtime_sdk::state::Mode

source ·
#[repr(u8)]
pub enum Mode { + Execute = 0, + Check = 1, + Simulate = 2, + PreSchedule = 3, +}
Expand description

Execution mode.

+

Variants§

§

Execute = 0

Actually execute transactions during block production.

+
§

Check = 1

Check that transactions are valid for local acceptance into the transaction pool.

+
§

Simulate = 2

Simulate transaction outcomes (e.g. for gas estimation).

+
§

PreSchedule = 3

Check that transactions are still valid before scheduling.

+

Trait Implementations§

source§

impl Clone for Mode

source§

fn clone(&self) -> Mode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Mode

source§

fn default() -> Mode

Returns the “default value” for a type. Read more
source§

impl Display for Mode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&Mode> for &'static str

source§

fn from(m: &Mode) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Mode

source§

fn eq(&self, other: &Mode) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Mode

source§

impl Eq for Mode

source§

impl StructuralPartialEq for Mode

Auto Trait Implementations§

§

impl Freeze for Mode

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnwindSafe for Mode

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/enum.TransactionResult.html b/rust/oasis_runtime_sdk/state/enum.TransactionResult.html new file mode 100644 index 0000000000..7097136bdc --- /dev/null +++ b/rust/oasis_runtime_sdk/state/enum.TransactionResult.html @@ -0,0 +1,30 @@ +TransactionResult in oasis_runtime_sdk::state - Rust

Enum oasis_runtime_sdk::state::TransactionResult

source ·
pub enum TransactionResult<T> {
+    Commit(T),
+    Rollback(T),
+}
Expand description

Result of a transaction helper closure.

+

Variants§

§

Commit(T)

§

Rollback(T)

Trait Implementations§

source§

impl From<()> for TransactionResult<()>

source§

fn from(_: ()) -> TransactionResult<()>

Converts to this type from the input type.
source§

impl<R, E> From<Result<R, E>> for TransactionResult<Result<R, E>>

source§

fn from(v: Result<R, E>) -> TransactionResult<Result<R, E>>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> Freeze for TransactionResult<T>
where + T: Freeze,

§

impl<T> RefUnwindSafe for TransactionResult<T>
where + T: RefUnwindSafe,

§

impl<T> Send for TransactionResult<T>
where + T: Send,

§

impl<T> Sync for TransactionResult<T>
where + T: Sync,

§

impl<T> Unpin for TransactionResult<T>
where + T: Unpin,

§

impl<T> UnwindSafe for TransactionResult<T>
where + T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/index.html b/rust/oasis_runtime_sdk/state/index.html new file mode 100644 index 0000000000..96f3f2ec7d --- /dev/null +++ b/rust/oasis_runtime_sdk/state/index.html @@ -0,0 +1 @@ +oasis_runtime_sdk::state - Rust

Module oasis_runtime_sdk::state

source ·

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/sidebar-items.js b/rust/oasis_runtime_sdk/state/sidebar-items.js new file mode 100644 index 0000000000..a4f36f45e7 --- /dev/null +++ b/rust/oasis_runtime_sdk/state/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Mode","TransactionResult"],"struct":["CurrentState","Environment","Options","State","StateValue","TransactionWithMeta"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/struct.CurrentState.html b/rust/oasis_runtime_sdk/state/struct.CurrentState.html new file mode 100644 index 0000000000..15acc2b2e9 --- /dev/null +++ b/rust/oasis_runtime_sdk/state/struct.CurrentState.html @@ -0,0 +1,78 @@ +CurrentState in oasis_runtime_sdk::state - Rust

Struct oasis_runtime_sdk::state::CurrentState

source ·
pub struct CurrentState;
Expand description

State attached to the current thread.

+

Implementations§

source§

impl CurrentState

source

pub fn enter<S, F, R>(root: S, f: F) -> R
where + S: Store, + F: FnOnce() -> R,

Attach a new state to the current thread and enter the state’s context.

+

The passed store is used as the root store.

+
§Panics
+

This method will panic if called from within a CurrentState::with block.

+
source

pub fn enter_opts<S, F, R>(opts: Options, root: S, f: F) -> R
where + S: Store, + F: FnOnce() -> R,

Attach a new state to the current thread and enter the state’s context.

+

The passed store is used as the root store.

+
§Panics
+

This method will panic if called from within a CurrentState::with block or if the mode +has not been explicitly set in opts.

+
source

pub fn with<F, R>(f: F) -> R
where + F: FnOnce(&mut State) -> R,

Run a closure with the currently active state.

+
§Panics
+

This method will panic if called outside CurrentState::enter or if any transaction methods +are called from the closure.

+
source

pub fn with_store<F, R>(f: F) -> R
where + F: FnOnce(&mut dyn Store) -> R,

Run a closure with the store of the currently active state.

+
§Panics
+

This method will panic if called outside CurrentState::enter or if any transaction methods +are called from the closure.

+
source

pub fn with_env<F, R>(f: F) -> R
where + F: FnOnce(&Environment) -> R,

Run a closure with the environment of the currently active state.

+
§Panics
+

This method will panic if called outside CurrentState::enter or if any transaction methods +are called from the closure.

+
source

pub fn with_env_origin<F, R>(f: F) -> R
where + F: FnOnce(&Environment) -> R,

Run a closure with the origin environment of the currently active state.

+
§Panics
+

This method will panic if called outside CurrentState::enter or if any transaction methods +are called from the closure.

+
source

pub fn start_transaction()

Start a new transaction by opening a new child state.

+
§Panics
+

This method will panic if called outside CurrentState::enter or if called within a +CurrentState::with block.

+
source

pub fn commit_transaction()

Commit a previously started transaction.

+
§Panics
+

This method will panic if called outside CurrentState::enter, if there is no currently +open transaction (started via CurrentState::start_transaction) or if called within a +CurrentState::with block.

+
source

pub fn rollback_transaction()

Rollback a previously started transaction.

+
§Panics
+

This method will panic if called outside CurrentState::enter, if there is no currently +open transaction (started via CurrentState::start_transaction) or if called within a +CurrentState::with block.

+
source

pub fn with_transaction<F, R, Rs>(f: F) -> R
where + F: FnOnce() -> Rs, + Rs: Into<TransactionResult<R>>,

Run a closure within a state transaction.

+

If the closure returns TransactionResult::Commit(R) then the child state is committed, +otherwise the child state is rolled back.

+
source

pub fn with_transaction_opts<F, R, Rs>(opts: Options, f: F) -> R
where + F: FnOnce() -> Rs, + Rs: Into<TransactionResult<R>>,

Run a closure within a state transaction, allowing the caller to customize state.

+

If the closure returns TransactionResult::Commit(R) then the child state is committed, +otherwise the child state is rolled back.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/struct.Environment.html b/rust/oasis_runtime_sdk/state/struct.Environment.html new file mode 100644 index 0000000000..2728d78a6b --- /dev/null +++ b/rust/oasis_runtime_sdk/state/struct.Environment.html @@ -0,0 +1,56 @@ +Environment in oasis_runtime_sdk::state - Rust

Struct oasis_runtime_sdk::state::Environment

source ·
pub struct Environment { /* private fields */ }
Expand description

Information about the execution environment.

+

Implementations§

source§

impl Environment

source

pub fn mode(&self) -> Mode

Execution mode.

+
source

pub fn is_check_only(&self) -> bool

Whether the execution mode is such that only checks should be performed.

+
source

pub fn is_pre_schedule(&self) -> bool

Whether the execution mode is Mode::PreSchedule.

+
source

pub fn is_simulation(&self) -> bool

Whether the execution mode is Mode::Simulate.

+
source

pub fn is_execute(&self) -> bool

Whether the execution mode is Mode::Execute.

+
source

pub fn is_transaction(&self) -> bool

Whether there is an active transaction in the current environment.

+
source

pub fn tx_index(&self) -> usize

An active transaction’s index (order) within the block.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

pub fn tx_size(&self) -> u32

An active transaction’s size in bytes.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

pub fn tx_auth_info(&self) -> &AuthInfo

An active transaction’s authentication information.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

pub fn tx_call_format(&self) -> CallFormat

An active transaction’s call format.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

pub fn is_read_only(&self) -> bool

An active transaction’s read only flag.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

pub fn is_internal(&self) -> bool

Whether the current execution environment is part of an internal subcall.

+
source

pub fn tx_caller_address(&self) -> Address

Authenticated address of the caller.

+

In case there are multiple signers of a transaction, this will return the address +corresponding to the first signer. If there are no signers, it returns the default address.

+
§Panics
+

This method will panic if called outside a transaction environment.

+
source

pub fn tx_caller_public_key(&self) -> Option<PublicKey>

Authenticated caller public key if available.

+

In case there are multiple signers of a transaction, this will return the public key +corresponding to the first signer. If there are no signers or if the address specification +does not represent a single public key, it returns None.

+
§Panics
+

This method will panic if called outside a transaction environment.

+

Trait Implementations§

source§

impl Clone for Environment

source§

fn clone(&self) -> Environment

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Environment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Environment

source§

fn default() -> Environment

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/struct.Options.html b/rust/oasis_runtime_sdk/state/struct.Options.html new file mode 100644 index 0000000000..186b1e4fff --- /dev/null +++ b/rust/oasis_runtime_sdk/state/struct.Options.html @@ -0,0 +1,37 @@ +Options in oasis_runtime_sdk::state - Rust

Struct oasis_runtime_sdk::state::Options

source ·
pub struct Options {
+    pub mode: Option<Mode>,
+    pub tx: Option<TransactionWithMeta>,
+    pub internal: Option<bool>,
+    pub rng_local_entropy: bool,
+}
Expand description

Environment modification options.

+

Fields§

§mode: Option<Mode>§tx: Option<TransactionWithMeta>§internal: Option<bool>§rng_local_entropy: bool

Implementations§

source§

impl Options

source

pub fn new() -> Self

Create options with default values.

+
source

pub fn with_mode(self, mode: Mode) -> Self

Change the execution mode of the environment.

+
source

pub fn with_tx(self, tx: TransactionWithMeta) -> Self

Change the active transaction of the environment.

+
source

pub fn with_internal(self, internal: bool) -> Self

Change the internal flag of the environment.

+
source

pub fn with_rng_local_entropy(self) -> Self

Request for local entropy to be mixed into the current RNG.

+
§Determinisim
+

Using this method will result in non-deterministic behavior as the node’s local entropy is +mixed into the RNG. As such, this method should only be used in cases where non-determinism +is not problematic (e.g. local queries).

+

Trait Implementations§

source§

impl Clone for Options

source§

fn clone(&self) -> Options

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Options

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Options

source§

fn default() -> Options

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/struct.State.html b/rust/oasis_runtime_sdk/state/struct.State.html new file mode 100644 index 0000000000..0fac5a7ea2 --- /dev/null +++ b/rust/oasis_runtime_sdk/state/struct.State.html @@ -0,0 +1,67 @@ +State in oasis_runtime_sdk::state - Rust

Struct oasis_runtime_sdk::state::State

source ·
pub struct State { /* private fields */ }
Expand description

Mutable block state of a runtime.

+

The state includes storage, emitted events, messages to consensus layer, etc. States can be +nested via open, commit and rollback methods which behave like transactions.

+

Implementations§

source§

impl State

source

pub fn open(&mut self)

Open a child state after which self will point to the child state.

+
source

pub fn commit(&mut self)

Commit the current state and return to its parent state.

+
§Panics
+

This method will panic when attempting to commit the root state.

+
source

pub fn rollback(&mut self)

Rollback the current state and return to its parent state.

+
§Panics
+

This method will panic when attempting to rollback the root state.

+
source

pub fn block_value<V: Any>(&mut self, key: &'static str) -> StateValue<'_, V>

Fetches a block state value entry.

+

Block values live as long as the root State and are propagated to child states. They are +not affected by state rollbacks. If you need state-scoped values, use local values.

+
source

pub fn local_value<V: Any>(&mut self, key: &'static str) -> StateValue<'_, V>

Fetches a local state value entry.

+

Local values only live as long as the current State, are dropped upon exiting to parent +state and child states start with an empty set. If you need longer-lived values, use block +values.

+
source

pub fn hide_block_values(&mut self)

Hides block values from the current state which will have an empty set of values after this +method returns. Hidden values will be restored upon exit to parent state.

+
source

pub fn emitted_messages_count(&self) -> usize

Emitted messages count returns the number of messages emitted so far across this and all +parent states.

+
source

pub fn emitted_messages_local_count(&self) -> usize

Emitted messages count returns the number of messages emitted so far in this state, not +counting any parent states.

+
source

pub fn emitted_messages_max<C: Context>(&self, ctx: &C) -> u32

Maximum number of messages that can be emitted.

+
source

pub fn emit_message<C: Context>( + &mut self, + ctx: &C, + msg: Message, + hook: MessageEventHookInvocation, +) -> Result<(), Error>

Queue a message to be emitted by the runtime for consensus layer to process.

+
source

pub fn take_messages(&mut self) -> Vec<(Message, MessageEventHookInvocation)>

Take all messages accumulated in the current state.

+
source

pub fn emit_event<E: Event>(&mut self, event: E)

Emit an event.

+
source

pub fn emit_event_raw(&mut self, etag: EventTag)

Emit a raw event.

+
source

pub fn emit_unconditional_event<E: Event>(&mut self, event: E)

Emit an unconditional event.

+

The only difference to regular events is that these are handled as a separate set.

+
source

pub fn take_events(&mut self) -> EventTags

Take all regular events accumulated in the current state.

+
source

pub fn take_unconditional_events(&mut self) -> EventTags

Take all unconditional events accumulated in the current state.

+
source

pub fn take_all_events(&mut self) -> EventTags

Take all events accumulated in the current state and return the merged set.

+
source

pub fn store(&mut self) -> &mut dyn Store

Store associated with the state.

+
§Panics
+

This method will panic if no store exists.

+
source

pub fn has_pending_store_updates(&self) -> bool

Whether the store associated with the state has any pending updates.

+
source

pub fn pending_store_update_byte_size(&self) -> usize

Size (in bytes) of any pending updates in the associated store.

+
source

pub fn rng(&mut self) -> &mut RootRng

Random number generator.

+
source

pub fn env(&self) -> &Environment

Environment information.

+
source

pub fn env_origin(&self) -> &Environment

Origin environment information.

+

The origin environment is the first non-internal environment in the hierarchy.

+
source

pub fn level(&self) -> usize

Returns the nesting level of the current state.

+

Auto Trait Implementations§

§

impl !Freeze for State

§

impl !RefUnwindSafe for State

§

impl !Send for State

§

impl !Sync for State

§

impl Unpin for State

§

impl !UnwindSafe for State

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/struct.StateValue.html b/rust/oasis_runtime_sdk/state/struct.StateValue.html new file mode 100644 index 0000000000..69871b979f --- /dev/null +++ b/rust/oasis_runtime_sdk/state/struct.StateValue.html @@ -0,0 +1,36 @@ +StateValue in oasis_runtime_sdk::state - Rust

Struct oasis_runtime_sdk::state::StateValue

source ·
pub struct StateValue<'a, V> { /* private fields */ }
Expand description

A per-state arbitrary value.

+

Implementations§

source§

impl<'a, V: Any> StateValue<'a, V>

source

pub fn get(self) -> Option<&'a V>

Gets a reference to the specified per-state value.

+
§Panics
+

Panics if the retrieved type is not the type that was stored.

+
source

pub fn get_mut(&mut self) -> Option<&mut V>

Gets a mutable reference to the specified per-state value.

+
§Panics
+

Panics if the retrieved type is not the type that was stored.

+
source

pub fn set(self, value: V) -> &'a mut V

Sets the context value, returning a mutable reference to the set value.

+
§Panics
+

Panics if the retrieved type is not the type that was stored.

+
source

pub fn take(self) -> Option<V>

Takes the context value, if it exists.

+
§Panics
+

Panics if the retrieved type is not the type that was stored.

+
source§

impl<'a, V: Any + Default> StateValue<'a, V>

source

pub fn or_default(self) -> &'a mut V

Retrieves the existing value or inserts and returns the default.

+
§Panics
+

Panics if the retrieved type is not the type that was stored.

+

Auto Trait Implementations§

§

impl<'a, V> Freeze for StateValue<'a, V>

§

impl<'a, V> !RefUnwindSafe for StateValue<'a, V>

§

impl<'a, V> !Send for StateValue<'a, V>

§

impl<'a, V> !Sync for StateValue<'a, V>

§

impl<'a, V> Unpin for StateValue<'a, V>
where + V: Unpin,

§

impl<'a, V> !UnwindSafe for StateValue<'a, V>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/state/struct.TransactionWithMeta.html b/rust/oasis_runtime_sdk/state/struct.TransactionWithMeta.html new file mode 100644 index 0000000000..969c47484e --- /dev/null +++ b/rust/oasis_runtime_sdk/state/struct.TransactionWithMeta.html @@ -0,0 +1,34 @@ +TransactionWithMeta in oasis_runtime_sdk::state - Rust

Struct oasis_runtime_sdk::state::TransactionWithMeta

source ·
pub struct TransactionWithMeta {
+    pub data: Transaction,
+    pub size: u32,
+    pub index: usize,
+    pub hash: Hash,
+}
Expand description

Decoded transaction with additional metadata.

+

Fields§

§data: Transaction

Decoded transaction.

+
§size: u32

Transaction size.

+
§index: usize

Transaction index within the batch.

+
§hash: Hash

Transaction hash.

+

Implementations§

source§

impl TransactionWithMeta

source

pub fn internal(tx: Transaction) -> Self

Create transaction with metadata for an internally generated transaction.

+

Internally generated transactions have zero size, index and hash.

+

Trait Implementations§

source§

impl Clone for TransactionWithMeta

source§

fn clone(&self) -> TransactionWithMeta

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TransactionWithMeta

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/confidential/constant.KEY_SIZE.html b/rust/oasis_runtime_sdk/storage/confidential/constant.KEY_SIZE.html new file mode 100644 index 0000000000..2923d93803 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/confidential/constant.KEY_SIZE.html @@ -0,0 +1,2 @@ +KEY_SIZE in oasis_runtime_sdk::storage::confidential - Rust

Constant oasis_runtime_sdk::storage::confidential::KEY_SIZE

pub const KEY_SIZE: usize = 32; // 32usize
Expand description

Size of the Deoxys-II-256-128 key in bytes.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/confidential/enum.Error.html b/rust/oasis_runtime_sdk/storage/confidential/enum.Error.html new file mode 100644 index 0000000000..2ef5327bf2 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/confidential/enum.Error.html @@ -0,0 +1,26 @@ +Error in oasis_runtime_sdk::storage::confidential - Rust

Enum oasis_runtime_sdk::storage::confidential::Error

source ·
pub enum Error {
+    CorruptKey,
+    CorruptValue,
+    DecryptionFailure(Error),
+}
Expand description

Errors emitted by the confidential store.

+

Variants§

§

CorruptKey

§

CorruptValue

§

DecryptionFailure(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/confidential/index.html b/rust/oasis_runtime_sdk/storage/confidential/index.html new file mode 100644 index 0000000000..97bc0b3045 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/confidential/index.html @@ -0,0 +1 @@ +oasis_runtime_sdk::storage::confidential - Rust

Module oasis_runtime_sdk::storage::confidential

source ·

Structs§

Enums§

  • Errors emitted by the confidential store.

Constants§

  • Size of the Deoxys-II-256-128 key in bytes.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/confidential/sidebar-items.js b/rust/oasis_runtime_sdk/storage/confidential/sidebar-items.js new file mode 100644 index 0000000000..29f985c2ef --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/confidential/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["KEY_SIZE"],"enum":["Error"],"struct":["ConfidentialStore"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/confidential/struct.ConfidentialStore.html b/rust/oasis_runtime_sdk/storage/confidential/struct.ConfidentialStore.html new file mode 100644 index 0000000000..269f619099 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/confidential/struct.ConfidentialStore.html @@ -0,0 +1,29 @@ +ConfidentialStore in oasis_runtime_sdk::storage::confidential - Rust
pub struct ConfidentialStore<S: Store> { /* private fields */ }
Expand description

A key-value store that encrypts all content with DeoxysII.

+

Implementations§

source§

impl<S: Store> ConfidentialStore<S>

source

pub fn new_with_key(inner: S, key: [u8; 32], value_context: &[&[u8]]) -> Self

Create a new confidential store with the given keypair.

+

Trait Implementations§

source§

impl<S: Store> Store for ConfidentialStore<S>

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.
source§

fn insert(&mut self, key: &[u8], value: &[u8])

Update entry with given key to the given value.
source§

fn remove(&mut self, key: &[u8])

Remove entry with given key.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.
source§

impl<S: Store> Zeroize for ConfidentialStore<S>

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

§

impl<S> Freeze for ConfidentialStore<S>
where + S: Freeze,

§

impl<S> RefUnwindSafe for ConfidentialStore<S>
where + S: RefUnwindSafe,

§

impl<S> Send for ConfidentialStore<S>
where + S: Send,

§

impl<S> Sync for ConfidentialStore<S>
where + S: Sync,

§

impl<S> Unpin for ConfidentialStore<S>
where + S: Unpin,

§

impl<S> UnwindSafe for ConfidentialStore<S>
where + S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/hashed/struct.HashedStore.html b/rust/oasis_runtime_sdk/storage/hashed/struct.HashedStore.html new file mode 100644 index 0000000000..4abe91198c --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/hashed/struct.HashedStore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../oasis_runtime_sdk/storage/struct.HashedStore.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/host/struct.HostStore.html b/rust/oasis_runtime_sdk/storage/host/struct.HostStore.html new file mode 100644 index 0000000000..4a06d42fd9 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/host/struct.HostStore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../oasis_runtime_sdk/storage/struct.HostStore.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/index.html b/rust/oasis_runtime_sdk/storage/index.html new file mode 100644 index 0000000000..5b2c9d44c9 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::storage - Rust

Module oasis_runtime_sdk::storage

source ·
Expand description

Storage.

+

Re-exports§

Modules§

Structs§

  • A key-value store that hashes all keys and stores them as H(k) || k.
  • A store for a specific state root that talks to the runtime host.
  • A key-value store backed by MKVS.
  • An overlay store which keeps values locally until explicitly committed.
  • A key prefix.
  • A key-value store that prefixes all keys with the given prefix.
  • A key-value store that transparently handles serialization/deserialization.

Traits§

  • A key-value store that supports the commit operation.
  • A key-value store.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/mkvs/struct.MKVSStore.html b/rust/oasis_runtime_sdk/storage/mkvs/struct.MKVSStore.html new file mode 100644 index 0000000000..6b1e1818c2 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/mkvs/struct.MKVSStore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../oasis_runtime_sdk/storage/struct.MKVSStore.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/overlay/struct.OverlayStore.html b/rust/oasis_runtime_sdk/storage/overlay/struct.OverlayStore.html new file mode 100644 index 0000000000..f8010d5973 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/overlay/struct.OverlayStore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../oasis_runtime_sdk/storage/struct.OverlayStore.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/prefix/struct.PrefixStore.html b/rust/oasis_runtime_sdk/storage/prefix/struct.PrefixStore.html new file mode 100644 index 0000000000..71bf6cfae8 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/prefix/struct.PrefixStore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../oasis_runtime_sdk/storage/struct.PrefixStore.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/sidebar-items.js b/rust/oasis_runtime_sdk/storage/sidebar-items.js new file mode 100644 index 0000000000..53b9c6ba90 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["confidential"],"struct":["HashedStore","HostStore","MKVSStore","OverlayStore","Prefix","PrefixStore","TypedStore"],"trait":["NestedStore","Store"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/struct.HashedStore.html b/rust/oasis_runtime_sdk/storage/struct.HashedStore.html new file mode 100644 index 0000000000..e227891164 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/struct.HashedStore.html @@ -0,0 +1,33 @@ +HashedStore in oasis_runtime_sdk::storage - Rust

Struct oasis_runtime_sdk::storage::HashedStore

source ·
pub struct HashedStore<S: Store, D: Digest> { /* private fields */ }
Expand description

A key-value store that hashes all keys and stores them as H(k) || k.

+

Implementations§

source§

impl<S: Store, D: Digest> HashedStore<S, D>

source

pub fn new(parent: S) -> Self

Create a new hashed store.

+

Trait Implementations§

source§

impl<S: Store, D: Digest> Store for HashedStore<S, D>

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.
source§

fn insert(&mut self, key: &[u8], value: &[u8])

Update entry with given key to the given value.
source§

fn remove(&mut self, key: &[u8])

Remove entry with given key.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.

Auto Trait Implementations§

§

impl<S, D> Freeze for HashedStore<S, D>
where + S: Freeze,

§

impl<S, D> RefUnwindSafe for HashedStore<S, D>
where + S: RefUnwindSafe, + D: RefUnwindSafe,

§

impl<S, D> Send for HashedStore<S, D>
where + S: Send, + D: Send,

§

impl<S, D> Sync for HashedStore<S, D>
where + S: Sync, + D: Sync,

§

impl<S, D> Unpin for HashedStore<S, D>
where + S: Unpin, + D: Unpin,

§

impl<S, D> UnwindSafe for HashedStore<S, D>
where + S: UnwindSafe, + D: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/struct.HostStore.html b/rust/oasis_runtime_sdk/storage/struct.HostStore.html new file mode 100644 index 0000000000..dfb1c0c3b6 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/struct.HostStore.html @@ -0,0 +1,29 @@ +HostStore in oasis_runtime_sdk::storage - Rust

Struct oasis_runtime_sdk::storage::HostStore

source ·
pub struct HostStore { /* private fields */ }
Expand description

A store for a specific state root that talks to the runtime host.

+

Implementations§

source§

impl HostStore

source

pub fn new(host: Arc<Protocol>, root: Root) -> Self

Create a new host store for the given host and root.

+
source

pub async fn new_for_round( + host: Arc<Protocol>, + consensus_verifier: &Arc<dyn Verifier>, + id: Namespace, + round: u64, +) -> Result<Self>

Create a new host store for the given host and root at the given round.

+

The corresponding root hash is fetched by looking it up in consensus layer state, verified +by the passed verifier to be correct.

+

Trait Implementations§

source§

impl Store for HostStore

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.
source§

fn insert(&mut self, key: &[u8], value: &[u8])

Update entry with given key to the given value.
source§

fn remove(&mut self, key: &[u8])

Remove entry with given key.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/struct.MKVSStore.html b/rust/oasis_runtime_sdk/storage/struct.MKVSStore.html new file mode 100644 index 0000000000..d24011d9d1 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/struct.MKVSStore.html @@ -0,0 +1,27 @@ +MKVSStore in oasis_runtime_sdk::storage - Rust

Struct oasis_runtime_sdk::storage::MKVSStore

source ·
pub struct MKVSStore<M: MKVS> { /* private fields */ }
Expand description

A key-value store backed by MKVS.

+

Implementations§

source§

impl<M: MKVS> MKVSStore<M>

source

pub fn new(parent: M) -> Self

Trait Implementations§

source§

impl<M: MKVS> NestedStore for MKVSStore<M>

§

type Inner = M

Type of the inner store.
source§

fn commit(self) -> Self::Inner

Commit any changes to the underlying store. Read more
source§

fn rollback(self) -> Self::Inner

Rollback any changes.
source§

fn has_pending_updates(&self) -> bool

Whether there are any store updates pending to be committed.
source§

fn pending_update_byte_size(&self) -> usize

Size (in bytes) of any pending updates.
source§

impl<M: MKVS> Store for MKVSStore<M>

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.
source§

fn insert(&mut self, key: &[u8], value: &[u8])

Update entry with given key to the given value.
source§

fn remove(&mut self, key: &[u8])

Remove entry with given key.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.

Auto Trait Implementations§

§

impl<M> Freeze for MKVSStore<M>
where + M: Freeze,

§

impl<M> RefUnwindSafe for MKVSStore<M>
where + M: RefUnwindSafe,

§

impl<M> Send for MKVSStore<M>
where + M: Send,

§

impl<M> Sync for MKVSStore<M>
where + M: Sync,

§

impl<M> Unpin for MKVSStore<M>
where + M: Unpin,

§

impl<M> UnwindSafe for MKVSStore<M>
where + M: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/struct.OverlayStore.html b/rust/oasis_runtime_sdk/storage/struct.OverlayStore.html new file mode 100644 index 0000000000..e119f27d7a --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/struct.OverlayStore.html @@ -0,0 +1,28 @@ +OverlayStore in oasis_runtime_sdk::storage - Rust

Struct oasis_runtime_sdk::storage::OverlayStore

source ·
pub struct OverlayStore<S: Store> { /* private fields */ }
Expand description

An overlay store which keeps values locally until explicitly committed.

+

Implementations§

source§

impl<S: Store> OverlayStore<S>

source

pub fn new(parent: S) -> Self

Create a new overlay store.

+

Trait Implementations§

source§

impl<S: Store> NestedStore for OverlayStore<S>

§

type Inner = S

Type of the inner store.
source§

fn commit(self) -> Self::Inner

Commit any changes to the underlying store. Read more
source§

fn rollback(self) -> Self::Inner

Rollback any changes.
source§

fn has_pending_updates(&self) -> bool

Whether there are any store updates pending to be committed.
source§

fn pending_update_byte_size(&self) -> usize

Size (in bytes) of any pending updates.
source§

impl<S: Store> Store for OverlayStore<S>

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.
source§

fn insert(&mut self, key: &[u8], value: &[u8])

Update entry with given key to the given value.
source§

fn remove(&mut self, key: &[u8])

Remove entry with given key.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.

Auto Trait Implementations§

§

impl<S> Freeze for OverlayStore<S>
where + S: Freeze,

§

impl<S> RefUnwindSafe for OverlayStore<S>
where + S: RefUnwindSafe,

§

impl<S> Send for OverlayStore<S>
where + S: Send,

§

impl<S> Sync for OverlayStore<S>
where + S: Sync,

§

impl<S> Unpin for OverlayStore<S>
where + S: Unpin,

§

impl<S> UnwindSafe for OverlayStore<S>
where + S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/struct.Prefix.html b/rust/oasis_runtime_sdk/storage/struct.Prefix.html new file mode 100644 index 0000000000..96b19802a4 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/struct.Prefix.html @@ -0,0 +1,3141 @@ +Prefix in oasis_runtime_sdk::storage - Rust

Struct oasis_runtime_sdk::storage::Prefix

source ·
pub struct Prefix(/* private fields */);
Expand description

A key prefix.

+

Methods from Deref<Target = Vec<u8>>§

1.0.0 · source

pub fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without +reallocating.

+
§Examples
+
let mut vec: Vec<i32> = Vec::with_capacity(10);
+vec.push(42);
+assert!(vec.capacity() >= 10);
+
1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more elements to be inserted +in the given Vec<T>. The collection may reserve more space to +speculatively avoid frequent reallocations. After calling reserve, +capacity will be greater than or equal to self.len() + additional. +Does nothing if capacity is already sufficient.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1];
+vec.reserve(10);
+assert!(vec.capacity() >= 11);
+
1.0.0 · source

pub fn reserve_exact(&mut self, additional: usize)

Reserves the minimum capacity for at least additional more elements to +be inserted in the given Vec<T>. Unlike reserve, this will not +deliberately over-allocate to speculatively avoid frequent allocations. +After calling reserve_exact, capacity will be greater than or equal to +self.len() + additional. Does nothing if the capacity is already +sufficient.

+

Note that the allocator may give the collection more space than it +requests. Therefore, capacity can not be relied upon to be precisely +minimal. Prefer reserve if future insertions are expected.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1];
+vec.reserve_exact(10);
+assert!(vec.capacity() >= 11);
+
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional more elements to be inserted +in the given Vec<T>. The collection may reserve more space to speculatively avoid +frequent reallocations. After calling try_reserve, capacity will be +greater than or equal to self.len() + additional if it returns +Ok(()). Does nothing if capacity is already sufficient. This method +preserves the contents even if an error occurs.

+
§Errors
+

If the capacity overflows, or the allocator reports a failure, then an error +is returned.

+
§Examples
+
use std::collections::TryReserveError;
+
+fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {
+    let mut output = Vec::new();
+
+    // Pre-reserve the memory, exiting if we can't
+    output.try_reserve(data.len())?;
+
+    // Now we know this can't OOM in the middle of our complex work
+    output.extend(data.iter().map(|&val| {
+        val * 2 + 5 // very complicated
+    }));
+
+    Ok(output)
+}
+
1.57.0 · source

pub fn try_reserve_exact( + &mut self, + additional: usize, +) -> Result<(), TryReserveError>

Tries to reserve the minimum capacity for at least additional +elements to be inserted in the given Vec<T>. Unlike try_reserve, +this will not deliberately over-allocate to speculatively avoid frequent +allocations. After calling try_reserve_exact, capacity will be greater +than or equal to self.len() + additional if it returns Ok(()). +Does nothing if the capacity is already sufficient.

+

Note that the allocator may give the collection more space than it +requests. Therefore, capacity can not be relied upon to be precisely +minimal. Prefer try_reserve if future insertions are expected.

+
§Errors
+

If the capacity overflows, or the allocator reports a failure, then an error +is returned.

+
§Examples
+
use std::collections::TryReserveError;
+
+fn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {
+    let mut output = Vec::new();
+
+    // Pre-reserve the memory, exiting if we can't
+    output.try_reserve_exact(data.len())?;
+
+    // Now we know this can't OOM in the middle of our complex work
+    output.extend(data.iter().map(|&val| {
+        val * 2 + 5 // very complicated
+    }));
+
+    Ok(output)
+}
+
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the vector as much as possible.

+

The behavior of this method depends on the allocator, which may either shrink the vector +in-place or reallocate. The resulting vector might still have some excess capacity, just as +is the case for with_capacity. See Allocator::shrink for more details.

+
§Examples
+
let mut vec = Vec::with_capacity(10);
+vec.extend([1, 2, 3]);
+assert!(vec.capacity() >= 10);
+vec.shrink_to_fit();
+assert!(vec.capacity() >= 3);
+
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of the vector with a lower bound.

+

The capacity will remain at least as large as both the length +and the supplied value.

+

If the current capacity is less than the lower limit, this is a no-op.

+
§Examples
+
let mut vec = Vec::with_capacity(10);
+vec.extend([1, 2, 3]);
+assert!(vec.capacity() >= 10);
+vec.shrink_to(4);
+assert!(vec.capacity() >= 4);
+vec.shrink_to(0);
+assert!(vec.capacity() >= 3);
+
1.0.0 · source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping +the rest.

+

If len is greater or equal to the vector’s current length, this has +no effect.

+

The drain method can emulate truncate, but causes the excess +elements to be returned instead of dropped.

+

Note that this method has no effect on the allocated capacity +of the vector.

+
§Examples
+

Truncating a five element vector to two elements:

+ +
let mut vec = vec![1, 2, 3, 4, 5];
+vec.truncate(2);
+assert_eq!(vec, [1, 2]);
+

No truncation occurs when len is greater than the vector’s current +length:

+ +
let mut vec = vec![1, 2, 3];
+vec.truncate(8);
+assert_eq!(vec, [1, 2, 3]);
+

Truncating when len == 0 is equivalent to calling the clear +method.

+ +
let mut vec = vec![1, 2, 3];
+vec.truncate(0);
+assert_eq!(vec, []);
+
1.7.0 · source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

+

Equivalent to &s[..].

+
§Examples
+
use std::io::{self, Write};
+let buffer = vec![1, 2, 3, 5, 8];
+io::sink().write(buffer.as_slice()).unwrap();
+
1.7.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Extracts a mutable slice of the entire vector.

+

Equivalent to &mut s[..].

+
§Examples
+
use std::io::{self, Read};
+let mut buffer = vec![0; 3];
+io::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
+
1.37.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer +valid for zero sized reads if the vector didn’t allocate.

+

The caller must ensure that the vector outlives the pointer this +function returns, or else it will end up pointing to garbage. +Modifying the vector may cause its buffer to be reallocated, +which would also make any pointers to it invalid.

+

The caller must also ensure that the memory the pointer (non-transitively) points to +is never written to (except inside an UnsafeCell) using this pointer or any pointer +derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

+

This method guarantees that for the purpose of the aliasing model, this method +does not materialize a reference to the underlying slice, and thus the returned pointer +will remain valid when mixed with other calls to as_ptr and as_mut_ptr. +Note that calling other methods that materialize mutable references to the slice, +or mutable references to specific elements you are planning on accessing through this pointer, +as well as writing to those elements, may still invalidate this pointer. +See the second example below for how this guarantee can be used.

+
§Examples
+
let x = vec![1, 2, 4];
+let x_ptr = x.as_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        assert_eq!(*x_ptr.add(i), 1 << i);
+    }
+}
+

Due to the aliasing guarantee, the following code is legal:

+ +
unsafe {
+    let mut v = vec![0, 1, 2];
+    let ptr1 = v.as_ptr();
+    let _ = ptr1.read();
+    let ptr2 = v.as_mut_ptr().offset(2);
+    ptr2.write(2);
+    // Notably, the write to `ptr2` did *not* invalidate `ptr1`
+    // because it mutated a different element:
+    let _ = ptr1.read();
+}
+
1.37.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the vector’s buffer, or a dangling +raw pointer valid for zero sized reads if the vector didn’t allocate.

+

The caller must ensure that the vector outlives the pointer this +function returns, or else it will end up pointing to garbage. +Modifying the vector may cause its buffer to be reallocated, +which would also make any pointers to it invalid.

+

This method guarantees that for the purpose of the aliasing model, this method +does not materialize a reference to the underlying slice, and thus the returned pointer +will remain valid when mixed with other calls to as_ptr and as_mut_ptr. +Note that calling other methods that materialize references to the slice, +or references to specific elements you are planning on accessing through this pointer, +may still invalidate this pointer. +See the second example below for how this guarantee can be used.

+
§Examples
+
// Allocate vector big enough for 4 elements.
+let size = 4;
+let mut x: Vec<i32> = Vec::with_capacity(size);
+let x_ptr = x.as_mut_ptr();
+
+// Initialize elements via raw pointer writes, then set length.
+unsafe {
+    for i in 0..size {
+        *x_ptr.add(i) = i as i32;
+    }
+    x.set_len(size);
+}
+assert_eq!(&*x, &[0, 1, 2, 3]);
+

Due to the aliasing guarantee, the following code is legal:

+ +
unsafe {
+    let mut v = vec![0];
+    let ptr1 = v.as_mut_ptr();
+    ptr1.write(1);
+    let ptr2 = v.as_mut_ptr();
+    ptr2.write(2);
+    // Notably, the write to `ptr2` did *not* invalidate `ptr1`:
+    ptr1.write(3);
+}
+
source

pub fn allocator(&self) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

+
1.0.0 · source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

+

This is a low-level operation that maintains none of the normal +invariants of the type. Normally changing the length of a vector +is done using one of the safe operations instead, such as +truncate, resize, extend, or clear.

+
§Safety
+
    +
  • new_len must be less than or equal to capacity().
  • +
  • The elements at old_len..new_len must be initialized.
  • +
+
§Examples
+

This method can be useful for situations in which the vector +is serving as a buffer for other code, particularly over FFI:

+ +
pub fn get_dictionary(&self) -> Option<Vec<u8>> {
+    // Per the FFI method's docs, "32768 bytes is always enough".
+    let mut dict = Vec::with_capacity(32_768);
+    let mut dict_length = 0;
+    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:
+    // 1. `dict_length` elements were initialized.
+    // 2. `dict_length` <= the capacity (32_768)
+    // which makes `set_len` safe to call.
+    unsafe {
+        // Make the FFI call...
+        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);
+        if r == Z_OK {
+            // ...and update the length to what was initialized.
+            dict.set_len(dict_length);
+            Some(dict)
+        } else {
+            None
+        }
+    }
+}
+

While the following example is sound, there is a memory leak since +the inner vectors were not freed prior to the set_len call:

+ +
let mut vec = vec![vec![1, 0, 0],
+                   vec![0, 1, 0],
+                   vec![0, 0, 1]];
+// SAFETY:
+// 1. `old_len..0` is empty so no elements need to be initialized.
+// 2. `0 <= capacity` always holds whatever `capacity` is.
+unsafe {
+    vec.set_len(0);
+}
+

Normally, here, one would use clear instead to correctly drop +the contents and thus not leak memory.

+
1.0.0 · source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

+

The removed element is replaced by the last element of the vector.

+

This does not preserve ordering of the remaining elements, but is O(1). +If you need to preserve the element order, use remove instead.

+
§Panics
+

Panics if index is out of bounds.

+
§Examples
+
let mut v = vec!["foo", "bar", "baz", "qux"];
+
+assert_eq!(v.swap_remove(1), "bar");
+assert_eq!(v, ["foo", "qux", "baz"]);
+
+assert_eq!(v.swap_remove(0), "foo");
+assert_eq!(v, ["baz", "qux"]);
+
1.0.0 · source

pub fn insert(&mut self, index: usize, element: T)

Inserts an element at position index within the vector, shifting all +elements after it to the right.

+
§Panics
+

Panics if index > len.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+vec.insert(1, 4);
+assert_eq!(vec, [1, 4, 2, 3]);
+vec.insert(4, 5);
+assert_eq!(vec, [1, 4, 2, 3, 5]);
+
§Time complexity
+

Takes O(Vec::len) time. All items after the insertion index must be +shifted to the right. In the worst case, all elements are shifted when +the insertion index is 0.

+
1.0.0 · source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector, +shifting all elements after it to the left.

+

Note: Because this shifts over the remaining elements, it has a +worst-case performance of O(n). If you don’t need the order of elements +to be preserved, use swap_remove instead. If you’d like to remove +elements from the beginning of the Vec, consider using +VecDeque::pop_front instead.

+
§Panics
+

Panics if index is out of bounds.

+
§Examples
+
let mut v = vec![1, 2, 3];
+assert_eq!(v.remove(1), 2);
+assert_eq!(v, [1, 3]);
+
1.0.0 · source

pub fn retain<F>(&mut self, f: F)
where + F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

+

In other words, remove all elements e for which f(&e) returns false. +This method operates in place, visiting each element exactly once in the +original order, and preserves the order of the retained elements.

+
§Examples
+
let mut vec = vec![1, 2, 3, 4];
+vec.retain(|&x| x % 2 == 0);
+assert_eq!(vec, [2, 4]);
+

Because the elements are visited exactly once in the original order, +external state may be used to decide which elements to keep.

+ +
let mut vec = vec![1, 2, 3, 4, 5];
+let keep = [false, true, true, false, true];
+let mut iter = keep.iter();
+vec.retain(|_| *iter.next().unwrap());
+assert_eq!(vec, [2, 3, 5]);
+
1.61.0 · source

pub fn retain_mut<F>(&mut self, f: F)
where + F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

+

In other words, remove all elements e such that f(&mut e) returns false. +This method operates in place, visiting each element exactly once in the +original order, and preserves the order of the retained elements.

+
§Examples
+
let mut vec = vec![1, 2, 3, 4];
+vec.retain_mut(|x| if *x <= 3 {
+    *x += 1;
+    true
+} else {
+    false
+});
+assert_eq!(vec, [2, 3, 4]);
+
1.16.0 · source

pub fn dedup_by_key<F, K>(&mut self, key: F)
where + F: FnMut(&mut T) -> K, + K: PartialEq,

Removes all but the first of consecutive elements in the vector that resolve to the same +key.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec![10, 20, 21, 30, 20];
+
+vec.dedup_by_key(|i| *i / 10);
+
+assert_eq!(vec, [10, 20, 30, 20]);
+
1.16.0 · source

pub fn dedup_by<F>(&mut self, same_bucket: F)
where + F: FnMut(&mut T, &mut T) -> bool,

Removes all but the first of consecutive elements in the vector satisfying a given equality +relation.

+

The same_bucket function is passed references to two elements from the vector and +must determine if the elements compare equal. The elements are passed in opposite order +from their order in the slice, so if same_bucket(a, b) returns true, a is removed.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec!["foo", "bar", "Bar", "baz", "bar"];
+
+vec.dedup_by(|a, b| a.eq_ignore_ascii_case(b));
+
+assert_eq!(vec, ["foo", "bar", "baz", "bar"]);
+
1.0.0 · source

pub fn push(&mut self, value: T)

Appends an element to the back of a collection.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1, 2];
+vec.push(3);
+assert_eq!(vec, [1, 2, 3]);
+
§Time complexity
+

Takes amortized O(1) time. If the vector’s length would exceed its +capacity after the push, O(capacity) time is taken to copy the +vector’s elements to a larger allocation. This expensive operation is +offset by the capacity O(1) insertions it allows.

+
source

pub fn push_within_capacity(&mut self, value: T) -> Result<(), T>

🔬This is a nightly-only experimental API. (vec_push_within_capacity)

Appends an element if there is sufficient spare capacity, otherwise an error is returned +with the element.

+

Unlike push this method will not reallocate when there’s insufficient capacity. +The caller should use reserve or try_reserve to ensure that there is enough capacity.

+
§Examples
+

A manual, panic-free alternative to FromIterator:

+ +
#![feature(vec_push_within_capacity)]
+
+use std::collections::TryReserveError;
+fn from_iter_fallible<T>(iter: impl Iterator<Item=T>) -> Result<Vec<T>, TryReserveError> {
+    let mut vec = Vec::new();
+    for value in iter {
+        if let Err(value) = vec.push_within_capacity(value) {
+            vec.try_reserve(1)?;
+            // this cannot fail, the previous line either returned or added at least 1 free slot
+            let _ = vec.push_within_capacity(value);
+        }
+    }
+    Ok(vec)
+}
+assert_eq!(from_iter_fallible(0..100), Ok(Vec::from_iter(0..100)));
+
§Time complexity
+

Takes O(1) time.

+
1.0.0 · source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it +is empty.

+

If you’d like to pop the first element, consider using +VecDeque::pop_front instead.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+assert_eq!(vec.pop(), Some(3));
+assert_eq!(vec, [1, 2]);
+
§Time complexity
+

Takes O(1) time.

+
source

pub fn pop_if<F>(&mut self, f: F) -> Option<T>
where + F: FnOnce(&mut T) -> bool,

🔬This is a nightly-only experimental API. (vec_pop_if)

Removes and returns the last element in a vector if the predicate +returns true, or None if the predicate returns false or the vector +is empty.

+
§Examples
+
#![feature(vec_pop_if)]
+
+let mut vec = vec![1, 2, 3, 4];
+let pred = |x: &mut i32| *x % 2 == 0;
+
+assert_eq!(vec.pop_if(pred), Some(4));
+assert_eq!(vec, [1, 2, 3]);
+assert_eq!(vec.pop_if(pred), None);
+
1.4.0 · source

pub fn append(&mut self, other: &mut Vec<T, A>)

Moves all the elements of other into self, leaving other empty.

+
§Panics
+

Panics if the new capacity exceeds isize::MAX bytes.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+let mut vec2 = vec![4, 5, 6];
+vec.append(&mut vec2);
+assert_eq!(vec, [1, 2, 3, 4, 5, 6]);
+assert_eq!(vec2, []);
+
1.6.0 · source

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
where + R: RangeBounds<usize>,

Removes the specified range from the vector in bulk, returning all +removed elements as an iterator. If the iterator is dropped before +being fully consumed, it drops the remaining removed elements.

+

The returned iterator keeps a mutable borrow on the vector to optimize +its implementation.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Leaking
+

If the returned iterator goes out of scope without being dropped (due to +mem::forget, for example), the vector may have lost and leaked +elements arbitrarily, including elements outside the range.

+
§Examples
+
let mut v = vec![1, 2, 3];
+let u: Vec<_> = v.drain(1..).collect();
+assert_eq!(v, &[1]);
+assert_eq!(u, &[2, 3]);
+
+// A full range clears the vector, like `clear()` does
+v.drain(..);
+assert_eq!(v, &[]);
+
1.0.0 · source

pub fn clear(&mut self)

Clears the vector, removing all values.

+

Note that this method has no effect on the allocated capacity +of the vector.

+
§Examples
+
let mut v = vec![1, 2, 3];
+
+v.clear();
+
+assert!(v.is_empty());
+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to +as its ‘length’.

+
§Examples
+
let a = vec![1, 2, 3];
+assert_eq!(a.len(), 3);
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

+
§Examples
+
let mut v = Vec::new();
+assert!(v.is_empty());
+
+v.push(1);
+assert!(!v.is_empty());
+
1.4.0 · source

pub fn split_off(&mut self, at: usize) -> Vec<T, A>
where + A: Clone,

Splits the collection into two at the given index.

+

Returns a newly allocated vector containing the elements in the range +[at, len). After the call, the original vector will be left containing +the elements [0, at) with its previous capacity unchanged.

+
    +
  • If you want to take ownership of the entire contents and capacity of +the vector, see mem::take or mem::replace.
  • +
  • If you don’t need the returned vector at all, see Vec::truncate.
  • +
  • If you want to take ownership of an arbitrary subslice, or you don’t +necessarily want to store the removed items in a vector, see Vec::drain.
  • +
+
§Panics
+

Panics if at > len.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+let vec2 = vec.split_off(1);
+assert_eq!(vec, [1]);
+assert_eq!(vec2, [2, 3]);
+
1.33.0 · source

pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where + F: FnMut() -> T,

Resizes the Vec in-place so that len is equal to new_len.

+

If new_len is greater than len, the Vec is extended by the +difference, with each additional slot filled with the result of +calling the closure f. The return values from f will end up +in the Vec in the order they have been generated.

+

If new_len is less than len, the Vec is simply truncated.

+

This method uses a closure to create new values on every push. If +you’d rather Clone a given value, use Vec::resize. If you +want to use the Default trait to generate values, you can +pass Default::default as the second argument.

+
§Examples
+
let mut vec = vec![1, 2, 3];
+vec.resize_with(5, Default::default);
+assert_eq!(vec, [1, 2, 3, 0, 0]);
+
+let mut vec = vec![];
+let mut p = 1;
+vec.resize_with(4, || { p *= 2; p });
+assert_eq!(vec, [2, 4, 8, 16]);
+
1.60.0 · source

pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]

Returns the remaining spare capacity of the vector as a slice of +MaybeUninit<T>.

+

The returned slice can be used to fill the vector with data (e.g. by +reading from a file) before marking the data as initialized using the +set_len method.

+
§Examples
+
// Allocate vector big enough for 10 elements.
+let mut v = Vec::with_capacity(10);
+
+// Fill in the first 3 elements.
+let uninit = v.spare_capacity_mut();
+uninit[0].write(0);
+uninit[1].write(1);
+uninit[2].write(2);
+
+// Mark the first 3 elements of the vector as being initialized.
+unsafe {
+    v.set_len(3);
+}
+
+assert_eq!(&v, &[0, 1, 2]);
+
source

pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>])

🔬This is a nightly-only experimental API. (vec_split_at_spare)

Returns vector content as a slice of T, along with the remaining spare +capacity of the vector as a slice of MaybeUninit<T>.

+

The returned spare capacity slice can be used to fill the vector with data +(e.g. by reading from a file) before marking the data as initialized using +the set_len method.

+

Note that this is a low-level API, which should be used with care for +optimization purposes. If you need to append data to a Vec +you can use push, extend, extend_from_slice, +extend_from_within, insert, append, resize or +resize_with, depending on your exact needs.

+
§Examples
+
#![feature(vec_split_at_spare)]
+
+let mut v = vec![1, 1, 2];
+
+// Reserve additional space big enough for 10 elements.
+v.reserve(10);
+
+let (init, uninit) = v.split_at_spare_mut();
+let sum = init.iter().copied().sum::<u32>();
+
+// Fill in the next 4 elements.
+uninit[0].write(sum);
+uninit[1].write(sum * 2);
+uninit[2].write(sum * 3);
+uninit[3].write(sum * 4);
+
+// Mark the 4 elements of the vector as being initialized.
+unsafe {
+    let len = v.len();
+    v.set_len(len + 4);
+}
+
+assert_eq!(&v, &[1, 1, 2, 4, 8, 12, 16]);
+
1.5.0 · source

pub fn resize(&mut self, new_len: usize, value: T)

Resizes the Vec in-place so that len is equal to new_len.

+

If new_len is greater than len, the Vec is extended by the +difference, with each additional slot filled with value. +If new_len is less than len, the Vec is simply truncated.

+

This method requires T to implement Clone, +in order to be able to clone the passed value. +If you need more flexibility (or want to rely on Default instead of +Clone), use Vec::resize_with. +If you only need to resize to a smaller size, use Vec::truncate.

+
§Examples
+
let mut vec = vec!["hello"];
+vec.resize(3, "world");
+assert_eq!(vec, ["hello", "world", "world"]);
+
+let mut vec = vec![1, 2, 3, 4];
+vec.resize(2, 0);
+assert_eq!(vec, [1, 2]);
+
1.6.0 · source

pub fn extend_from_slice(&mut self, other: &[T])

Clones and appends all elements in a slice to the Vec.

+

Iterates over the slice other, clones each element, and then appends +it to this Vec. The other slice is traversed in-order.

+

Note that this function is same as extend except that it is +specialized to work with slices instead. If and when Rust gets +specialization this function will likely be deprecated (but still +available).

+
§Examples
+
let mut vec = vec![1];
+vec.extend_from_slice(&[2, 3, 4]);
+assert_eq!(vec, [1, 2, 3, 4]);
+
1.53.0 · source

pub fn extend_from_within<R>(&mut self, src: R)
where + R: RangeBounds<usize>,

Copies elements from src range to the end of the vector.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Examples
+
let mut vec = vec![0, 1, 2, 3, 4];
+
+vec.extend_from_within(2..);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);
+
+vec.extend_from_within(..2);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);
+
+vec.extend_from_within(4..8);
+assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
+
1.0.0 · source

pub fn dedup(&mut self)

Removes consecutive repeated elements in the vector according to the +PartialEq trait implementation.

+

If the vector is sorted, this removes all duplicates.

+
§Examples
+
let mut vec = vec![1, 2, 2, 3, 2];
+
+vec.dedup();
+
+assert_eq!(vec, [1, 2, 3, 2]);
+
1.21.0 · source

pub fn splice<R, I>( + &mut self, + range: R, + replace_with: I, +) -> Splice<'_, <I as IntoIterator>::IntoIter, A>
where + R: RangeBounds<usize>, + I: IntoIterator<Item = T>,

Creates a splicing iterator that replaces the specified range in the vector +with the given replace_with iterator and yields the removed items. +replace_with does not need to be the same length as range.

+

range is removed even if the iterator is not consumed until the end.

+

It is unspecified how many elements are removed from the vector +if the Splice value is leaked.

+

The input iterator replace_with is only consumed when the Splice value is dropped.

+

This is optimal if:

+
    +
  • The tail (elements in the vector after range) is empty,
  • +
  • or replace_with yields fewer or equal elements than range’s length
  • +
  • or the lower bound of its size_hint() is exact.
  • +
+

Otherwise, a temporary vector is allocated and the tail is moved twice.

+
§Panics
+

Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.

+
§Examples
+
let mut v = vec![1, 2, 3, 4];
+let new = [7, 8, 9];
+let u: Vec<_> = v.splice(1..3, new).collect();
+assert_eq!(v, &[1, 7, 8, 9, 4]);
+assert_eq!(u, &[2, 3]);
+
source

pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
where + F: FnMut(&mut T) -> bool,

🔬This is a nightly-only experimental API. (extract_if)

Creates an iterator which uses a closure to determine if an element should be removed.

+

If the closure returns true, then the element is removed and yielded. +If the closure returns false, the element will remain in the vector and will not be yielded +by the iterator.

+

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating +or the iteration short-circuits, then the remaining elements will be retained. +Use retain with a negated predicate if you do not need the returned iterator.

+

Using this method is equivalent to the following code:

+ +
let mut i = 0;
+while i < vec.len() {
+    if some_predicate(&mut vec[i]) {
+        let val = vec.remove(i);
+        // your code here
+    } else {
+        i += 1;
+    }
+}
+
+

But extract_if is easier to use. extract_if is also more efficient, +because it can backshift the elements of the array in bulk.

+

Note that extract_if also lets you mutate every element in the filter closure, +regardless of whether you choose to keep or remove it.

+
§Examples
+

Splitting an array into evens and odds, reusing the original allocation:

+ +
#![feature(extract_if)]
+let mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15];
+
+let evens = numbers.extract_if(|x| *x % 2 == 0).collect::<Vec<_>>();
+let odds = numbers;
+
+assert_eq!(evens, vec![2, 4, 6, 8, 14]);
+assert_eq!(odds, vec![1, 3, 5, 9, 11, 13, 15]);
+

Methods from Deref<Target = [T]>§

source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

+
source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f32::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

+
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of +ASCII characters, otherwise returns None.

+
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, +without checking whether they’re valid.

+
§Safety
+

Every byte in the slice must be in 0..=127, or else this is UB.

+
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

+

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), +but without allocating and copying temporaries.

+
1.23.0 · source

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To return a new uppercased value without modifying the existing one, use +to_ascii_uppercase.

+
1.23.0 · source

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To return a new lowercased value without modifying the existing one, use +to_ascii_lowercase.

+
1.60.0 · source

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, +treating it as an ASCII string.

+
§Examples
+

+let s = b"0\t\r\n'\"\\\x9d";
+let escaped = s.escape_ascii().to_string();
+assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
+
1.80.0 · source

pub fn trim_ascii_start(&self) -> &[u8]

Returns a byte slice with leading ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
+assert_eq!(b"  ".trim_ascii_start(), b"");
+assert_eq!(b"".trim_ascii_start(), b"");
+
1.80.0 · source

pub fn trim_ascii_end(&self) -> &[u8]

Returns a byte slice with trailing ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
+assert_eq!(b"  ".trim_ascii_end(), b"");
+assert_eq!(b"".trim_ascii_end(), b"");
+
1.80.0 · source

pub fn trim_ascii(&self) -> &[u8]

Returns a byte slice with leading and trailing ASCII whitespace bytes +removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
+assert_eq!(b"  ".trim_ascii(), b"");
+assert_eq!(b"".trim_ascii(), b"");
+
1.79.0 · source

pub fn utf8_chunks(&self) -> Utf8Chunks<'_>

Creates an iterator over the contiguous valid UTF-8 ranges of this +slice, and the non-UTF-8 fragments in between.

+
§Examples
+

This function formats arbitrary but mostly-UTF-8 bytes into Rust source +code in the form of a C-string literal (c"...").

+ +
use std::fmt::Write as _;
+
+pub fn cstr_literal(bytes: &[u8]) -> String {
+    let mut repr = String::new();
+    repr.push_str("c\"");
+    for chunk in bytes.utf8_chunks() {
+        for ch in chunk.valid().chars() {
+            // Escapes \0, \t, \r, \n, \\, \', \", and uses \u{...} for non-printable characters.
+            write!(repr, "{}", ch.escape_debug()).unwrap();
+        }
+        for byte in chunk.invalid() {
+            write!(repr, "\\x{:02X}", byte).unwrap();
+        }
+    }
+    repr.push('"');
+    repr
+}
+
+fn main() {
+    let lit = cstr_literal(b"\xferris the \xf0\x9f\xa6\x80\x07");
+    let expected = stringify!(c"\xFErris the 🦀\u{7}");
+    assert_eq!(lit, expected);
+}
+
1.80.0 · source

pub fn as_flattened(&self) -> &[T]

Takes a &[[T; N]], and flattens it to a &[T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened(), &[1, 2, 3, 4, 5, 6]);
+
+assert_eq!(
+    [[1, 2, 3], [4, 5, 6]].as_flattened(),
+    [[1, 2], [3, 4], [5, 6]].as_flattened(),
+);
+
+let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
+assert!(slice_of_empty_arrays.as_flattened().is_empty());
+
+let empty_slice_of_arrays: &[[u32; 10]] = &[];
+assert!(empty_slice_of_arrays.as_flattened().is_empty());
+
1.80.0 · source

pub fn as_flattened_mut(&mut self) -> &mut [T]

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
fn add_5_to_all(slice: &mut [i32]) {
+    for i in slice {
+        *i += 5;
+    }
+}
+
+let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
+add_5_to_all(array.as_flattened_mut());
+assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f64::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the slice.

+
§Examples
+
let a = [1, 2, 3];
+assert_eq!(a.len(), 3);
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

+
§Examples
+
let a = [1, 2, 3];
+assert!(!a.is_empty());
+
+let b: &[i32] = &[];
+assert!(b.is_empty());
+
1.0.0 · source

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&10), v.first());
+
+let w: &[i32] = &[];
+assert_eq!(None, w.first());
+
1.0.0 · source

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(first) = x.first_mut() {
+    *first = 5;
+}
+assert_eq!(x, &[5, 1, 2]);
+
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.first_mut());
+
1.5.0 · source

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((first, elements)) = x.split_first() {
+    assert_eq!(first, &0);
+    assert_eq!(elements, &[1, 2]);
+}
+
1.5.0 · source

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_mut() {
+    *first = 3;
+    elements[0] = 4;
+    elements[1] = 5;
+}
+assert_eq!(x, &[3, 4, 5]);
+
1.5.0 · source

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((last, elements)) = x.split_last() {
+    assert_eq!(last, &2);
+    assert_eq!(elements, &[0, 1]);
+}
+
1.5.0 · source

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((last, elements)) = x.split_last_mut() {
+    *last = 3;
+    elements[0] = 4;
+    elements[1] = 5;
+}
+assert_eq!(x, &[4, 5, 3]);
+
1.0.0 · source

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&30), v.last());
+
+let w: &[i32] = &[];
+assert_eq!(None, w.last());
+
1.0.0 · source

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable reference to the last item in the slice, or None if it is empty.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(last) = x.last_mut() {
+    *last = 10;
+}
+assert_eq!(x, &[0, 1, 10]);
+
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.last_mut());
+
1.77.0 · source

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
+assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
+
+let v: &[i32] = &[10];
+assert_eq!(None, v.first_chunk::<2>());
+
+let w: &[i32] = &[];
+assert_eq!(Some(&[]), w.first_chunk::<0>());
+
1.77.0 · source

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(first) = x.first_chunk_mut::<2>() {
+    first[0] = 5;
+    first[1] = 4;
+}
+assert_eq!(x, &[5, 4, 2]);
+
+assert_eq!(None, x.first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

Return an array reference to the first N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_chunk::<2>() {
+    assert_eq!(first, &[0, 1]);
+    assert_eq!(elements, &[2]);
+}
+
+assert_eq!(None, x.split_first_chunk::<4>());
+
1.77.0 · source

pub fn split_first_chunk_mut<const N: usize>( + &mut self, +) -> Option<(&mut [T; N], &mut [T])>

Return a mutable array reference to the first N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((first, elements)) = x.split_first_chunk_mut::<2>() {
+    first[0] = 3;
+    first[1] = 4;
+    elements[0] = 5;
+}
+assert_eq!(x, &[3, 4, 5]);
+
+assert_eq!(None, x.split_first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

Return an array reference to the last N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
+
+if let Some((elements, last)) = x.split_last_chunk::<2>() {
+    assert_eq!(elements, &[0]);
+    assert_eq!(last, &[1, 2]);
+}
+
+assert_eq!(None, x.split_last_chunk::<4>());
+
1.77.0 · source

pub fn split_last_chunk_mut<const N: usize>( + &mut self, +) -> Option<(&mut [T], &mut [T; N])>

Return a mutable array reference to the last N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some((elements, last)) = x.split_last_chunk_mut::<2>() {
+    last[0] = 3;
+    last[1] = 4;
+    elements[0] = 5;
+}
+assert_eq!(x, &[5, 3, 4]);
+
+assert_eq!(None, x.split_last_chunk_mut::<4>());
+
1.77.0 · source

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
+assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
+
+let v: &[i32] = &[10];
+assert_eq!(None, v.last_chunk::<2>());
+
+let w: &[i32] = &[];
+assert_eq!(Some(&[]), w.last_chunk::<0>());
+
1.77.0 · source

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(last) = x.last_chunk_mut::<2>() {
+    last[0] = 10;
+    last[1] = 20;
+}
+assert_eq!(x, &[0, 10, 20]);
+
+assert_eq!(None, x.last_chunk_mut::<4>());
+
1.0.0 · source

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
where + I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of +index.

+
    +
  • If given a position, returns a reference to the element at that +position or None if out of bounds.
  • +
  • If given a range, returns the subslice corresponding to that range, +or None if out of bounds.
  • +
+
§Examples
+
let v = [10, 40, 30];
+assert_eq!(Some(&40), v.get(1));
+assert_eq!(Some(&[10, 40][..]), v.get(0..2));
+assert_eq!(None, v.get(3));
+assert_eq!(None, v.get(0..4));
+
1.0.0 · source

pub fn get_mut<I>( + &mut self, + index: I, +) -> Option<&mut <I as SliceIndex<[T]>>::Output>
where + I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the +type of index (see get) or None if the index is out of bounds.

+
§Examples
+
let x = &mut [0, 1, 2];
+
+if let Some(elem) = x.get_mut(1) {
+    *elem = 42;
+}
+assert_eq!(x, &[0, 42, 2]);
+
1.0.0 · source

pub unsafe fn get_unchecked<I>( + &self, + index: I, +) -> &<I as SliceIndex<[T]>>::Output
where + I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds +checking.

+

For a safe alternative see get.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used.

+

You can think of this like .get(index).unwrap_unchecked(). It’s UB +to call .get_unchecked(len), even if you immediately convert to a +pointer. And it’s UB to call .get_unchecked(..len + 1), +.get_unchecked(..=len), or similar.

+
§Examples
+
let x = &[1, 2, 4];
+
+unsafe {
+    assert_eq!(x.get_unchecked(1), &2);
+}
+
1.0.0 · source

pub unsafe fn get_unchecked_mut<I>( + &mut self, + index: I, +) -> &mut <I as SliceIndex<[T]>>::Output
where + I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing +bounds checking.

+

For a safe alternative see get_mut.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used.

+

You can think of this like .get_mut(index).unwrap_unchecked(). It’s +UB to call .get_unchecked_mut(len), even if you immediately convert +to a pointer. And it’s UB to call .get_unchecked_mut(..len + 1), +.get_unchecked_mut(..=len), or similar.

+
§Examples
+
let x = &mut [1, 2, 4];
+
+unsafe {
+    let elem = x.get_unchecked_mut(1);
+    *elem = 13;
+}
+assert_eq!(x, &[1, 13, 4]);
+
1.0.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

+

The caller must ensure that the slice outlives the pointer this +function returns, or else it will end up pointing to garbage.

+

The caller must also ensure that the memory the pointer (non-transitively) points to +is never written to (except inside an UnsafeCell) using this pointer or any pointer +derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

+

Modifying the container referenced by this slice may cause its buffer +to be reallocated, which would also make any pointers to it invalid.

+
§Examples
+
let x = &[1, 2, 4];
+let x_ptr = x.as_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));
+    }
+}
+
1.0.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

+

The caller must ensure that the slice outlives the pointer this +function returns, or else it will end up pointing to garbage.

+

Modifying the container referenced by this slice may cause its buffer +to be reallocated, which would also make any pointers to it invalid.

+
§Examples
+
let x = &mut [1, 2, 4];
+let x_ptr = x.as_mut_ptr();
+
+unsafe {
+    for i in 0..x.len() {
+        *x_ptr.add(i) += 2;
+    }
+}
+assert_eq!(x, &[3, 4, 6]);
+
1.48.0 · source

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

+

The returned range is half-open, which means that the end pointer +points one past the last element of the slice. This way, an empty +slice is represented by two equal pointers, and the difference between +the two pointers represents the size of the slice.

+

See as_ptr for warnings on using these pointers. The end pointer +requires extra caution, as it does not point to a valid element in the +slice.

+

This function is useful for interacting with foreign interfaces which +use two pointers to refer to a range of elements in memory, as is +common in C++.

+

It can also be useful to check if a pointer to an element refers to an +element of this slice:

+ +
let a = [1, 2, 3];
+let x = &a[1] as *const _;
+let y = &5 as *const _;
+
+assert!(a.as_ptr_range().contains(&x));
+assert!(!a.as_ptr_range().contains(&y));
+
1.48.0 · source

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

+

The returned range is half-open, which means that the end pointer +points one past the last element of the slice. This way, an empty +slice is represented by two equal pointers, and the difference between +the two pointers represents the size of the slice.

+

See as_mut_ptr for warnings on using these pointers. The end +pointer requires extra caution, as it does not point to a valid element +in the slice.

+

This function is useful for interacting with foreign interfaces which +use two pointers to refer to a range of elements in memory, as is +common in C++.

+
1.0.0 · source

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

+

If a equals to b, it’s guaranteed that elements won’t change value.

+
§Arguments
+
    +
  • a - The index of the first element
  • +
  • b - The index of the second element
  • +
+
§Panics
+

Panics if a or b are out of bounds.

+
§Examples
+
let mut v = ["a", "b", "c", "d", "e"];
+v.swap(2, 4);
+assert!(v == ["a", "b", "e", "d", "c"]);
+
source

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

+

For a safe alternative see swap.

+
§Arguments
+
    +
  • a - The index of the first element
  • +
  • b - The index of the second element
  • +
+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior. +The caller has to ensure that a < self.len() and b < self.len().

+
§Examples
+
#![feature(slice_swap_unchecked)]
+
+let mut v = ["a", "b", "c", "d"];
+// SAFETY: we know that 1 and 3 are both indices of the slice
+unsafe { v.swap_unchecked(1, 3) };
+assert!(v == ["a", "d", "c", "b"]);
+
1.0.0 · source

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

+
§Examples
+
let mut v = [1, 2, 3];
+v.reverse();
+assert!(v == [3, 2, 1]);
+
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

+

The iterator yields all items from start to end.

+
§Examples
+
let x = &[1, 2, 4];
+let mut iterator = x.iter();
+
+assert_eq!(iterator.next(), Some(&1));
+assert_eq!(iterator.next(), Some(&2));
+assert_eq!(iterator.next(), Some(&4));
+assert_eq!(iterator.next(), None);
+
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

+

The iterator yields all items from start to end.

+
§Examples
+
let x = &mut [1, 2, 4];
+for elem in x.iter_mut() {
+    *elem += 2;
+}
+assert_eq!(x, &[3, 4, 6]);
+
1.0.0 · source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +size. The windows overlap. If the slice is shorter than +size, the iterator returns no values.

+
§Panics
+

Panics if size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.windows(3);
+assert_eq!(iter.next().unwrap(), &['l', 'o', 'r']);
+assert_eq!(iter.next().unwrap(), &['o', 'r', 'e']);
+assert_eq!(iter.next().unwrap(), &['r', 'e', 'm']);
+assert!(iter.next().is_none());
+

If the slice is shorter than size:

+ +
let slice = ['f', 'o', 'o'];
+let mut iter = slice.windows(4);
+assert!(iter.next().is_none());
+

There’s no windows_mut, as that existing would let safe code violate the +“only one &mut at a time to the same thing” rule. However, you can sometimes +use Cell::as_slice_of_cells in +conjunction with windows to accomplish something similar:

+ +
use std::cell::Cell;
+
+let mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];
+let slice = &mut array[..];
+let slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();
+for w in slice_of_cells.windows(3) {
+    Cell::swap(&w[0], &w[2]);
+}
+assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
+
1.0.0 · source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last chunk will not have length chunk_size.

+

See chunks_exact for a variant of this iterator that returns chunks of always exactly +chunk_size elements, and rchunks for the same iterator but starting at the end of the +slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.chunks(2);
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert_eq!(iter.next().unwrap(), &['m']);
+assert!(iter.next().is_none());
+
1.0.0 · source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last chunk will not have length chunk_size.

+

See chunks_exact_mut for a variant of this iterator that returns chunks of always +exactly chunk_size elements, and rchunks_mut for the same iterator but starting at +the end of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.chunks_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 3]);
+
1.31.0 · source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved +from the remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks.

+

See chunks for a variant of this iterator that also returns the remainder as a smaller +chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.chunks_exact(2);
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['m']);
+
1.31.0 · source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last up to chunk_size-1 elements will be omitted and can be +retrieved from the into_remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks_mut.

+

See chunks_mut for a variant of this iterator that also returns the remainder as a +smaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of +the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.chunks_exact_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 0]);
+
source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +assuming that there’s no remainder.

+
§Safety
+

This may only be called when

+
    +
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • +
  • N != 0.
  • +
+
§Examples
+
#![feature(slice_as_chunks)]
+let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
+let chunks: &[[char; 1]] =
+    // SAFETY: 1-element chunks never have remainder
+    unsafe { slice.as_chunks_unchecked() };
+assert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);
+let chunks: &[[char; 3]] =
+    // SAFETY: The slice length (6) is a multiple of 3
+    unsafe { slice.as_chunks_unchecked() };
+assert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);
+
+// These would be unsound:
+// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5
+// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
+
source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the beginning of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let (chunks, remainder) = slice.as_chunks();
+assert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);
+assert_eq!(remainder, &['m']);
+

If you expect the slice to be an exact multiple, you can combine +let-else with an empty slice pattern:

+ +
#![feature(slice_as_chunks)]
+let slice = ['R', 'u', 's', 't'];
+let (chunks, []) = slice.as_chunks::<2>() else {
+    panic!("slice didn't have even length")
+};
+assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
+
source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the end of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let (remainder, chunks) = slice.as_rchunks();
+assert_eq!(remainder, &['l']);
+assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
+
source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are array references and do not overlap. If N does not divide the +length of the slice, then the last up to N-1 elements will be omitted and can be +retrieved from the remainder function of the iterator.

+

This method is the const generic equivalent of chunks_exact.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_chunks)]
+let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.array_chunks();
+assert_eq!(iter.next().unwrap(), &['l', 'o']);
+assert_eq!(iter.next().unwrap(), &['r', 'e']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['m']);
+
source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( + &mut self, +) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +assuming that there’s no remainder.

+
§Safety
+

This may only be called when

+
    +
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • +
  • N != 0.
  • +
+
§Examples
+
#![feature(slice_as_chunks)]
+let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
+let chunks: &mut [[char; 1]] =
+    // SAFETY: 1-element chunks never have remainder
+    unsafe { slice.as_chunks_unchecked_mut() };
+chunks[0] = ['L'];
+assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);
+let chunks: &mut [[char; 3]] =
+    // SAFETY: The slice length (6) is a multiple of 3
+    unsafe { slice.as_chunks_unchecked_mut() };
+chunks[1] = ['a', 'x', '?'];
+assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);
+
+// These would be unsound:
+// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
+// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
+
source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the beginning of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+let (chunks, remainder) = v.as_chunks_mut();
+remainder[0] = 9;
+for chunk in chunks {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 9]);
+
source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +starting at the end of the slice, +and a remainder slice with length strictly less than N.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(slice_as_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+let (remainder, chunks) = v.as_rchunks_mut();
+remainder[0] = 9;
+for chunk in chunks {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[9, 1, 1, 2, 2]);
+
source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +beginning of the slice.

+

The chunks are mutable array references and do not overlap. If N does not divide +the length of the slice, then the last up to N-1 elements will be omitted and +can be retrieved from the into_remainder function of the iterator.

+

This method is the const generic equivalent of chunks_exact_mut.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_chunks)]
+let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.array_chunks_mut() {
+    *chunk = [count; 2];
+    count += 1;
+}
+assert_eq!(v, &[1, 1, 2, 2, 0]);
+
source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +starting at the beginning of the slice.

+

This is the const generic equivalent of windows.

+

If N is greater than the size of the slice, it will return no windows.

+
§Panics
+

Panics if N is 0. This check will most probably get changed to a compile time +error before this method gets stabilized.

+
§Examples
+
#![feature(array_windows)]
+let slice = [0, 1, 2, 3];
+let mut iter = slice.array_windows();
+assert_eq!(iter.next().unwrap(), &[0, 1]);
+assert_eq!(iter.next().unwrap(), &[1, 2]);
+assert_eq!(iter.next().unwrap(), &[2, 3]);
+assert!(iter.next().is_none());
+
1.31.0 · source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last chunk will not have length chunk_size.

+

See rchunks_exact for a variant of this iterator that returns chunks of always exactly +chunk_size elements, and chunks for the same iterator but starting at the beginning +of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.rchunks(2);
+assert_eq!(iter.next().unwrap(), &['e', 'm']);
+assert_eq!(iter.next().unwrap(), &['o', 'r']);
+assert_eq!(iter.next().unwrap(), &['l']);
+assert!(iter.next().is_none());
+
1.31.0 · source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last chunk will not have length chunk_size.

+

See rchunks_exact_mut for a variant of this iterator that returns chunks of always +exactly chunk_size elements, and chunks_mut for the same iterator but starting at the +beginning of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.rchunks_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[3, 2, 2, 1, 1]);
+
1.31.0 · source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +end of the slice.

+

The chunks are slices and do not overlap. If chunk_size does not divide the length of the +slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved +from the remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of rchunks.

+

See rchunks for a variant of this iterator that also returns the remainder as a smaller +chunk, and chunks_exact for the same iterator but starting at the beginning of the +slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let slice = ['l', 'o', 'r', 'e', 'm'];
+let mut iter = slice.rchunks_exact(2);
+assert_eq!(iter.next().unwrap(), &['e', 'm']);
+assert_eq!(iter.next().unwrap(), &['o', 'r']);
+assert!(iter.next().is_none());
+assert_eq!(iter.remainder(), &['l']);
+
1.31.0 · source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +of the slice.

+

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the +length of the slice, then the last up to chunk_size-1 elements will be omitted and can be +retrieved from the into_remainder function of the iterator.

+

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the +resulting code better than in the case of chunks_mut.

+

See rchunks_mut for a variant of this iterator that also returns the remainder as a +smaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning +of the slice.

+
§Panics
+

Panics if chunk_size is 0.

+
§Examples
+
let v = &mut [0, 0, 0, 0, 0];
+let mut count = 1;
+
+for chunk in v.rchunks_exact_mut(2) {
+    for elem in chunk.iter_mut() {
+        *elem += count;
+    }
+    count += 1;
+}
+assert_eq!(v, &[0, 2, 2, 1, 1]);
+
1.77.0 · source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs +of elements using the predicate to separate them.

+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
+
+let mut iter = slice.chunk_by(|a, b| a == b);
+
+assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
+assert_eq!(iter.next(), Some(&[3, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
+assert_eq!(iter.next(), None);
+

This method can be used to extract the sorted subslices:

+ +
let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
+
+let mut iter = slice.chunk_by(|a, b| a <= b);
+
+assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 3][..]));
+assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
+assert_eq!(iter.next(), None);
+
1.77.0 · source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable +runs of elements using the predicate to separate them.

+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
+
+let mut iter = slice.chunk_by_mut(|a, b| a == b);
+
+assert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));
+assert_eq!(iter.next(), Some(&mut [3, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 2, 2][..]));
+assert_eq!(iter.next(), None);
+

This method can be used to extract the sorted subslices:

+ +
let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
+
+let mut iter = slice.chunk_by_mut(|a, b| a <= b);
+
+assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 3][..]));
+assert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));
+assert_eq!(iter.next(), None);
+
1.0.0 · source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_checked.

+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
+
+{
+   let (left, right) = v.split_at(0);
+   assert_eq!(left, []);
+   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_at(2);
+    assert_eq!(left, [1, 2]);
+    assert_eq!(right, [3, 4, 5, 6]);
+}
+
+{
+    let (left, right) = v.split_at(6);
+    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, []);
+}
+
1.0.0 · source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_mut_checked.

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+let (left, right) = v.split_at_mut(2);
+assert_eq!(left, [1, 0]);
+assert_eq!(right, [3, 0, 5, 6]);
+left[1] = 2;
+right[1] = 4;
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
1.79.0 · source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+

For a safe alternative see split_at.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used. The caller has to ensure that +0 <= mid <= self.len().

+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
+
+unsafe {
+   let (left, right) = v.split_at_unchecked(0);
+   assert_eq!(left, []);
+   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+}
+
+unsafe {
+    let (left, right) = v.split_at_unchecked(2);
+    assert_eq!(left, [1, 2]);
+    assert_eq!(right, [3, 4, 5, 6]);
+}
+
+unsafe {
+    let (left, right) = v.split_at_unchecked(6);
+    assert_eq!(left, [1, 2, 3, 4, 5, 6]);
+    assert_eq!(right, []);
+}
+
1.79.0 · source

pub unsafe fn split_at_mut_unchecked( + &mut self, + mid: usize, +) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

+

The first will contain all indices from [0, mid) (excluding +the index mid itself) and the second will contain all +indices from [mid, len) (excluding the index len itself).

+

For a safe alternative see split_at_mut.

+
§Safety
+

Calling this method with an out-of-bounds index is undefined behavior +even if the resulting reference is not used. The caller has to ensure that +0 <= mid <= self.len().

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+// scoped to restrict the lifetime of the borrows
+unsafe {
+    let (left, right) = v.split_at_mut_unchecked(2);
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
+}
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
1.80.0 · source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is +too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
let v = [1, -2, 3, -4, 5, -6];
+
+{
+   let (left, right) = v.split_at_checked(0).unwrap();
+   assert_eq!(left, []);
+   assert_eq!(right, [1, -2, 3, -4, 5, -6]);
+}
+
+{
+    let (left, right) = v.split_at_checked(2).unwrap();
+    assert_eq!(left, [1, -2]);
+    assert_eq!(right, [3, -4, 5, -6]);
+}
+
+{
+    let (left, right) = v.split_at_checked(6).unwrap();
+    assert_eq!(left, [1, -2, 3, -4, 5, -6]);
+    assert_eq!(right, []);
+}
+
+assert_eq!(None, v.split_at_checked(7));
+
1.80.0 · source

pub fn split_at_mut_checked( + &mut self, + mid: usize, +) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the +slice is too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
+
+if let Some((left, right)) = v.split_at_mut_checked(2) {
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
+}
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
+
+assert_eq!(None, v.split_at_mut_checked(7));
+
1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred. The matched element is not contained in the subslices.

+
§Examples
+
let slice = [10, 40, 33, 20];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+

If the first element is matched, an empty slice will be the first item +returned by the iterator. Similarly, if the last element in the slice +is matched, an empty slice will be the last item returned by the +iterator:

+ +
let slice = [10, 40, 33];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40]);
+assert_eq!(iter.next().unwrap(), &[]);
+assert!(iter.next().is_none());
+

If two matched elements are directly adjacent, an empty slice will be +present between them:

+ +
let slice = [10, 6, 33, 20];
+let mut iter = slice.split(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10]);
+assert_eq!(iter.next().unwrap(), &[]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+
1.0.0 · source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred. The matched element is not contained in the subslices.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.split_mut(|num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(v, [1, 40, 30, 1, 60, 1]);
+
1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred. The matched element is contained in the end of the previous +subslice as a terminator.

+
§Examples
+
let slice = [10, 40, 33, 20];
+let mut iter = slice.split_inclusive(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
+assert_eq!(iter.next().unwrap(), &[20]);
+assert!(iter.next().is_none());
+

If the last element of the slice is matched, +that element will be considered the terminator of the preceding slice. +That slice will be the last item returned by the iterator.

+ +
let slice = [3, 10, 40, 33];
+let mut iter = slice.split_inclusive(|num| num % 3 == 0);
+
+assert_eq!(iter.next().unwrap(), &[3]);
+assert_eq!(iter.next().unwrap(), &[10, 40, 33]);
+assert!(iter.next().is_none());
+
1.51.0 · source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred. The matched element is contained in the previous +subslice as a terminator.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.split_inclusive_mut(|num| *num % 3 == 0) {
+    let terminator_idx = group.len()-1;
+    group[terminator_idx] = 1;
+}
+assert_eq!(v, [10, 40, 1, 20, 1, 1]);
+
1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred, starting at the end of the slice and working backwards. +The matched element is not contained in the subslices.

+
§Examples
+
let slice = [11, 22, 33, 0, 44, 55];
+let mut iter = slice.rsplit(|num| *num == 0);
+
+assert_eq!(iter.next().unwrap(), &[44, 55]);
+assert_eq!(iter.next().unwrap(), &[11, 22, 33]);
+assert_eq!(iter.next(), None);
+

As with split(), if the first or last element is matched, an empty +slice will be the first (or last) item returned by the iterator.

+ +
let v = &[0, 1, 1, 2, 3, 5, 8];
+let mut it = v.rsplit(|n| *n % 2 == 0);
+assert_eq!(it.next().unwrap(), &[]);
+assert_eq!(it.next().unwrap(), &[3, 5]);
+assert_eq!(it.next().unwrap(), &[1, 1]);
+assert_eq!(it.next().unwrap(), &[]);
+assert_eq!(it.next(), None);
+
1.27.0 · source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that +match pred, starting at the end of the slice and working +backwards. The matched element is not contained in the subslices.

+
§Examples
+
let mut v = [100, 400, 300, 200, 600, 500];
+
+let mut count = 0;
+for group in v.rsplit_mut(|num| *num % 3 == 0) {
+    count += 1;
+    group[0] = count;
+}
+assert_eq!(v, [3, 400, 300, 2, 600, 1]);
+
1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred, limited to returning at most n items. The matched element is +not contained in the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], +[20, 60, 50]):

+ +
let v = [10, 40, 30, 20, 60, 50];
+
+for group in v.splitn(2, |num| *num % 3 == 0) {
+    println!("{group:?}");
+}
+
1.0.0 · source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match +pred, limited to returning at most n items. The matched element is +not contained in the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+
let mut v = [10, 40, 30, 20, 60, 50];
+
+for group in v.splitn_mut(2, |num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(v, [1, 40, 30, 1, 60, 50]);
+
1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred limited to returning at most n items. This starts at the end of +the slice and works backwards. The matched element is not contained in +the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+

Print the slice split once, starting from the end, by numbers divisible +by 3 (i.e., [50], [10, 40, 30, 20]):

+ +
let v = [10, 40, 30, 20, 60, 50];
+
+for group in v.rsplitn(2, |num| *num % 3 == 0) {
+    println!("{group:?}");
+}
+
1.0.0 · source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where + F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match +pred limited to returning at most n items. This starts at the end of +the slice and works backwards. The matched element is not contained in +the subslices.

+

The last element returned, if any, will contain the remainder of the +slice.

+
§Examples
+
let mut s = [10, 40, 30, 20, 60, 50];
+
+for group in s.rsplitn_mut(2, |num| *num % 3 == 0) {
+    group[0] = 1;
+}
+assert_eq!(s, [1, 40, 30, 20, 60, 1]);
+
source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where + F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified +predicate.

+

If any matching elements are present in the slice, returns the prefix +before the match and suffix after. The matching element itself is not +included. If no elements match, returns None.

+
§Examples
+
#![feature(slice_split_once)]
+let s = [1, 2, 3, 2, 4];
+assert_eq!(s.split_once(|&x| x == 2), Some((
+    &[1][..],
+    &[3, 2, 4][..]
+)));
+assert_eq!(s.split_once(|&x| x == 0), None);
+
source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where + F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified +predicate.

+

If any matching elements are present in the slice, returns the prefix +before the match and suffix after. The matching element itself is not +included. If no elements match, returns None.

+
§Examples
+
#![feature(slice_split_once)]
+let s = [1, 2, 3, 2, 4];
+assert_eq!(s.rsplit_once(|&x| x == 2), Some((
+    &[1, 2, 3][..],
+    &[4][..]
+)));
+assert_eq!(s.rsplit_once(|&x| x == 0), None);
+
1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where + T: PartialEq,

Returns true if the slice contains an element with the given value.

+

This operation is O(n).

+

Note that if you have a sorted slice, binary_search may be faster.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.contains(&30));
+assert!(!v.contains(&50));
+

If you do not have a &T, but some other value that you can compare +with one (for example, String implements PartialEq<str>), you can +use iter().any:

+ +
let v = [String::from("hello"), String::from("world")]; // slice of `String`
+assert!(v.iter().any(|e| e == "hello")); // search with `&str`
+assert!(!v.iter().any(|e| e == "hi"));
+
1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.starts_with(&[10]));
+assert!(v.starts_with(&[10, 40]));
+assert!(v.starts_with(&v));
+assert!(!v.starts_with(&[50]));
+assert!(!v.starts_with(&[10, 50]));
+

Always returns true if needle is an empty slice:

+ +
let v = &[10, 40, 30];
+assert!(v.starts_with(&[]));
+let v: &[u8] = &[];
+assert!(v.starts_with(&[]));
+
1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

+
§Examples
+
let v = [10, 40, 30];
+assert!(v.ends_with(&[30]));
+assert!(v.ends_with(&[40, 30]));
+assert!(v.ends_with(&v));
+assert!(!v.ends_with(&[50]));
+assert!(!v.ends_with(&[50, 30]));
+

Always returns true if needle is an empty slice:

+ +
let v = &[10, 40, 30];
+assert!(v.ends_with(&[]));
+let v: &[u8] = &[];
+assert!(v.ends_with(&[]));
+
1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where + P: SlicePattern<Item = T> + ?Sized, + T: PartialEq,

Returns a subslice with the prefix removed.

+

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. +If prefix is empty, simply returns the original slice. If prefix is equal to the +original slice, returns an empty slice.

+

If the slice does not start with prefix, returns None.

+
§Examples
+
let v = &[10, 40, 30];
+assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
+assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
+assert_eq!(v.strip_prefix(&[10, 40, 30]), Some(&[][..]));
+assert_eq!(v.strip_prefix(&[50]), None);
+assert_eq!(v.strip_prefix(&[10, 50]), None);
+
+let prefix : &str = "he";
+assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
+           Some(b"llo".as_ref()));
+
1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where + P: SlicePattern<Item = T> + ?Sized, + T: PartialEq,

Returns a subslice with the suffix removed.

+

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. +If suffix is empty, simply returns the original slice. If suffix is equal to the +original slice, returns an empty slice.

+

If the slice does not end with suffix, returns None.

+
§Examples
+
let v = &[10, 40, 30];
+assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
+assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
+assert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..]));
+assert_eq!(v.strip_suffix(&[50]), None);
+assert_eq!(v.strip_suffix(&[50, 30]), None);
+

Binary searches this slice for a given element. +If the slice is not sorted, the returned result is unspecified and +meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search_by, binary_search_by_key, and partition_point.

+
§Examples
+

Looks up a series of four elements. The first is found, with a +uniquely determined position; the second and third are not +found; the fourth could match any position in [1, 4].

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+assert_eq!(s.binary_search(&13),  Ok(9));
+assert_eq!(s.binary_search(&4),   Err(7));
+assert_eq!(s.binary_search(&100), Err(13));
+let r = s.binary_search(&1);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+

If you want to find that whole range of matching items, rather than +an arbitrary matching one, that can be done using partition_point:

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+let low = s.partition_point(|x| x < &1);
+assert_eq!(low, 1);
+let high = s.partition_point(|x| x <= &1);
+assert_eq!(high, 5);
+let r = s.binary_search(&1);
+assert!((low..high).contains(&r.unwrap()));
+
+assert!(s[..low].iter().all(|&x| x < 1));
+assert!(s[low..high].iter().all(|&x| x == 1));
+assert!(s[high..].iter().all(|&x| x > 1));
+
+// For something not found, the "range" of equal items is empty
+assert_eq!(s.partition_point(|x| x < &11), 9);
+assert_eq!(s.partition_point(|x| x <= &11), 9);
+assert_eq!(s.binary_search(&11), Err(9));
+

If you want to insert an item to a sorted vector, while maintaining +sort order, consider using partition_point:

+ +
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+let num = 42;
+let idx = s.partition_point(|&x| x <= num);
+// If `num` is unique, `s.partition_point(|&x| x < num)` (with `<`) is equivalent to
+// `s.binary_search(&num).unwrap_or_else(|x| x)`, but using `<=` will allow `insert`
+// to shift less elements.
+s.insert(idx, num);
+assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where + F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

+

The comparator function should return an order code that indicates +whether its argument is Less, Equal or Greater the desired +target. +If the slice is not sorted or if the comparator function does not +implement an order consistent with the sort order of the underlying +slice, the returned result is unspecified and meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search, binary_search_by_key, and partition_point.

+
§Examples
+

Looks up a series of four elements. The first is found, with a +uniquely determined position; the second and third are not +found; the fourth could match any position in [1, 4].

+ +
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+
+let seek = 13;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));
+let seek = 4;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));
+let seek = 100;
+assert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));
+let seek = 1;
+let r = s.binary_search_by(|probe| probe.cmp(&seek));
+assert!(match r { Ok(1..=4) => true, _ => false, });
+
1.10.0 · source

pub fn binary_search_by_key<'a, B, F>( + &'a self, + b: &B, + f: F, +) -> Result<usize, usize>
where + F: FnMut(&'a T) -> B, + B: Ord,

Binary searches this slice with a key extraction function.

+

Assumes that the slice is sorted by the key, for instance with +sort_by_key using the same key extraction function. +If the slice is not sorted by the key, the returned result is +unspecified and meaningless.

+

If the value is found then Result::Ok is returned, containing the +index of the matching element. If there are multiple matches, then any +one of the matches could be returned. The index is chosen +deterministically, but is subject to change in future versions of Rust. +If the value is not found then Result::Err is returned, containing +the index where a matching element could be inserted while maintaining +sorted order.

+

See also binary_search, binary_search_by, and partition_point.

+
§Examples
+

Looks up a series of four elements in a slice of pairs sorted by +their second elements. The first is found, with a uniquely +determined position; the second and third are not found; the +fourth could match any position in [1, 4].

+ +
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
+         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
+         (1, 21), (2, 34), (4, 55)];
+
+assert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));
+assert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));
+assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));
+let r = s.binary_search_by_key(&1, |&(a, b)| b);
+assert!(match r { Ok(1..=4) => true, _ => false, });
+
1.20.0 · source

pub fn sort_unstable(&mut self)
where + T: Ord,

Sorts the slice without preserving the initial order of equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

If T: Ord does not implement a total order the resulting order is unspecified. All +original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if T: Ord panics.

+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5, 4, 1, -3, 2];
+
+v.sort_unstable();
+assert!(v == [-5, -3, 1, 2, 4]);
+
1.20.0 · source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where + F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, without preserving the initial order of +equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

The comparator function should define a total ordering for the elements in the slice. If the +ordering is not total, the order of the elements is unspecified.

+

If the comparator function does not implement a total order the resulting order is +unspecified. All original elements will remain in the slice and any possible modifications +via interior mutability are observed in the input. Same is true if the comparator function +panics. A total order (for all a, b and c):

+
    +
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • +
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • +
+

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use +partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

+ +
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
+floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
+assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [5, 4, 1, 3, 2];
+v.sort_unstable_by(|a, b| a.cmp(b));
+assert!(v == [1, 2, 3, 4, 5]);
+
+// reverse sorting
+v.sort_unstable_by(|a, b| b.cmp(a));
+assert!(v == [5, 4, 3, 2, 1]);
+
1.20.0 · source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of +equal elements.

+

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not +allocate), and O(n * log(n)) worst-case.

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+
§Current implementation
+

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which +combines the fast average case of quicksort with the fast worst case of heapsort, achieving +linear time on fully sorted and reversed inputs. On inputs with k distinct elements, the +expected time to sort the data is O(n * log(k)).

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is partially sorted.

+

If K: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+v.sort_unstable_by_key(|k| k.abs());
+assert!(v == [1, 2, -3, 4, -5]);
+
1.49.0 · source

pub fn select_nth_unstable( + &mut self, + index: usize, +) -> (&mut [T], &mut T, &mut [T])
where + T: Ord,

Reorder the slice such that the element at index after the reordering is at its final +sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index. Additionally, this reordering is +unstable (i.e. any number of equal elements may end up at position index), in-place (i.e. +does not allocate), and runs in O(n) time. This function is also known as “kth element” +in other libraries.

+

It returns a triplet of the following from the reordered slice: the subslice prior to +index, the element at index, and the subslice after index; accordingly, the values in +those two subslices will respectively all be less-than-or-equal-to and +greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median.
+let (lesser, median, greater) = v.select_nth_unstable(2);
+
+assert!(lesser == [-3, -5] || lesser == [-5, -3]);
+assert_eq!(median, &mut 1);
+assert!(greater == [4, 2] || greater == [2, 4]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [-3, -5, 1, 2, 4] ||
+        v == [-5, -3, 1, 2, 4] ||
+        v == [-3, -5, 1, 4, 2] ||
+        v == [-5, -3, 1, 4, 2]);
+
1.49.0 · source

pub fn select_nth_unstable_by<F>( + &mut self, + index: usize, + compare: F, +) -> (&mut [T], &mut T, &mut [T])
where + F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index after the +reordering is at its final sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index using the comparator function. +Additionally, this reordering is unstable (i.e. any number of equal elements may end up at +position index), in-place (i.e. does not allocate), and runs in O(n) time. This +function is also known as “kth element” in other libraries.

+

It returns a triplet of the following from the slice reordered according to the provided +comparator function: the subslice prior to index, the element at index, and the subslice +after index; accordingly, the values in those two subslices will respectively all be +less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted in descending order.
+let (lesser, median, greater) = v.select_nth_unstable_by(2, |a, b| b.cmp(a));
+
+assert!(lesser == [4, 2] || lesser == [2, 4]);
+assert_eq!(median, &mut 1);
+assert!(greater == [-3, -5] || greater == [-5, -3]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [2, 4, 1, -5, -3] ||
+        v == [2, 4, 1, -3, -5] ||
+        v == [4, 2, 1, -5, -3] ||
+        v == [4, 2, 1, -3, -5]);
+
1.49.0 · source

pub fn select_nth_unstable_by_key<K, F>( + &mut self, + index: usize, + f: F, +) -> (&mut [T], &mut T, &mut [T])
where + F: FnMut(&T) -> K, + K: Ord,

Reorder the slice with a key extraction function such that the element at index after the +reordering is at its final sorted position.

+

This reordering has the additional property that any value at position i < index will be +less than or equal to any value at a position j > index using the key extraction function. +Additionally, this reordering is unstable (i.e. any number of equal elements may end up at +position index), in-place (i.e. does not allocate), and runs in O(n) time. This +function is also known as “kth element” in other libraries.

+

It returns a triplet of the following from the slice reordered according to the provided key +extraction function: the subslice prior to index, the element at index, and the subslice +after index; accordingly, the values in those two subslices will respectively all be +less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

+
§Current implementation
+

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll +and Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is +Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime +for all inputs.

+

It is typically faster than stable sorting, except in a few special cases, e.g., when the +slice is nearly fully sorted, where slice::sort may be faster.

+
§Panics
+

Panics when index >= len(), meaning it always panics on empty slices.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted according to absolute value.
+let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
+
+assert!(lesser == [1, 2] || lesser == [2, 1]);
+assert_eq!(median, &mut -3);
+assert!(greater == [4, -5] || greater == [-5, 4]);
+
+// We are only guaranteed the slice will be one of the following, based on the way we sort
+// about the specified index.
+assert!(v == [1, 2, -3, 4, -5] ||
+        v == [1, 2, -3, -5, 4] ||
+        v == [2, 1, -3, 4, -5] ||
+        v == [2, 1, -3, -5, 4]);
+
source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where + T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the +PartialEq trait implementation.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = [1, 2, 2, 3, 3, 2, 1, 1];
+
+let (dedup, duplicates) = slice.partition_dedup();
+
+assert_eq!(dedup, [1, 2, 3, 2, 1]);
+assert_eq!(duplicates, [2, 3, 1]);
+
source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where + F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying +a given equality relation.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

The same_bucket function is passed references to two elements from the slice and +must determine if the elements compare equal. The elements are passed in opposite order +from their order in the slice, so if same_bucket(a, b) returns true, a is moved +at the end of the slice.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"];
+
+let (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b));
+
+assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]);
+assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
+
source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where + F: FnMut(&mut T) -> K, + K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve +to the same key.

+

Returns two slices. The first contains no consecutive repeated elements. +The second contains all the duplicates in no specified order.

+

If the slice is sorted, the first returned slice contains no duplicates.

+
§Examples
+
#![feature(slice_partition_dedup)]
+
+let mut slice = [10, 20, 21, 30, 30, 20, 11, 13];
+
+let (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10);
+
+assert_eq!(dedup, [10, 20, 30, 20, 11]);
+assert_eq!(duplicates, [21, 30, 13]);
+
1.26.0 · source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +slice move to the end while the last self.len() - mid elements move to +the front. After calling rotate_left, the element previously at index +mid will become the first element in the slice.

+
§Panics
+

This function will panic if mid is greater than the length of the +slice. Note that mid == self.len() does not panic and is a no-op +rotation.

+
§Complexity
+

Takes linear (in self.len()) time.

+
§Examples
+
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a.rotate_left(2);
+assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
+

Rotating a subslice:

+ +
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a[1..5].rotate_left(1);
+assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
+
1.26.0 · source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +elements of the slice move to the end while the last k elements move +to the front. After calling rotate_right, the element previously at +index self.len() - k will become the first element in the slice.

+
§Panics
+

This function will panic if k is greater than the length of the +slice. Note that k == self.len() does not panic and is a no-op +rotation.

+
§Complexity
+

Takes linear (in self.len()) time.

+
§Examples
+
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a.rotate_right(2);
+assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
+

Rotating a subslice:

+ +
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
+a[1..5].rotate_right(1);
+assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
+
1.50.0 · source

pub fn fill(&mut self, value: T)
where + T: Clone,

Fills self with elements by cloning value.

+
§Examples
+
let mut buf = vec![0; 10];
+buf.fill(1);
+assert_eq!(buf, vec![1; 10]);
+
1.51.0 · source

pub fn fill_with<F>(&mut self, f: F)
where + F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

+

This method uses a closure to create new values. If you’d rather +Clone a given value, use fill. If you want to use the Default +trait to generate values, you can pass Default::default as the +argument.

+
§Examples
+
let mut buf = vec![1; 10];
+buf.fill_with(Default::default);
+assert_eq!(buf, vec![0; 10]);
+
1.7.0 · source

pub fn clone_from_slice(&mut self, src: &[T])
where + T: Clone,

Copies the elements from src into self.

+

The length of src must be the same as self.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Examples
+

Cloning two elements from a slice into another:

+ +
let src = [1, 2, 3, 4];
+let mut dst = [0, 0];
+
+// Because the slices have to be the same length,
+// we slice the source slice from four elements
+// to two. It will panic if we don't do this.
+dst.clone_from_slice(&src[2..]);
+
+assert_eq!(src, [1, 2, 3, 4]);
+assert_eq!(dst, [3, 4]);
+

Rust enforces that there can only be one mutable reference with no +immutable references to a particular piece of data in a particular +scope. Because of this, attempting to use clone_from_slice on a +single slice will result in a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+slice[..2].clone_from_slice(&slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.clone_from_slice(&right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 4, 5]);
+
1.9.0 · source

pub fn copy_from_slice(&mut self, src: &[T])
where + T: Copy,

Copies all elements from src into self, using a memcpy.

+

The length of src must be the same as self.

+

If T does not implement Copy, use clone_from_slice.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Examples
+

Copying two elements from a slice into another:

+ +
let src = [1, 2, 3, 4];
+let mut dst = [0, 0];
+
+// Because the slices have to be the same length,
+// we slice the source slice from four elements
+// to two. It will panic if we don't do this.
+dst.copy_from_slice(&src[2..]);
+
+assert_eq!(src, [1, 2, 3, 4]);
+assert_eq!(dst, [3, 4]);
+

Rust enforces that there can only be one mutable reference with no +immutable references to a particular piece of data in a particular +scope. Because of this, attempting to use copy_from_slice on a +single slice will result in a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+slice[..2].copy_from_slice(&slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.copy_from_slice(&right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 4, 5]);
+
1.37.0 · source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where + R: RangeBounds<usize>, + T: Copy,

Copies elements from one part of the slice to another part of itself, +using a memmove.

+

src is the range within self to copy from. dest is the starting +index of the range within self to copy to, which will have the same +length as src. The two ranges may overlap. The ends of the two ranges +must be less than or equal to self.len().

+
§Panics
+

This function will panic if either range exceeds the end of the slice, +or if the end of src is before the start.

+
§Examples
+

Copying four bytes within a slice:

+ +
let mut bytes = *b"Hello, World!";
+
+bytes.copy_within(1..5, 8);
+
+assert_eq!(&bytes, b"Hello, Wello!");
+
1.27.0 · source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+

The length of other must be the same as self.

+
§Panics
+

This function will panic if the two slices have different lengths.

+
§Example
+

Swapping two elements across slices:

+ +
let mut slice1 = [0, 0];
+let mut slice2 = [1, 2, 3, 4];
+
+slice1.swap_with_slice(&mut slice2[2..]);
+
+assert_eq!(slice1, [3, 4]);
+assert_eq!(slice2, [1, 2, 0, 0]);
+

Rust enforces that there can only be one mutable reference to a +particular piece of data in a particular scope. Because of this, +attempting to use swap_with_slice on a single slice will result in +a compile failure:

+ +
let mut slice = [1, 2, 3, 4, 5];
+slice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
+

To work around this, we can use split_at_mut to create two distinct +mutable sub-slices from a slice:

+ +
let mut slice = [1, 2, 3, 4, 5];
+
+{
+    let (left, right) = slice.split_at_mut(2);
+    left.swap_with_slice(&mut right[1..]);
+}
+
+assert_eq!(slice, [4, 5, 3, 1, 2]);
+
1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is +maintained.

+

This method splits the slice into three distinct slices: prefix, correctly aligned middle +slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

+

This method has no purpose when either input element T or output element U are +zero-sized and will return the original slice without splitting anything.

+
§Safety
+

This method is essentially a transmute with respect to the elements in the returned +middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

+
§Examples
+

Basic usage:

+ +
unsafe {
+    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
+    let (prefix, shorts, suffix) = bytes.align_to::<u16>();
+    // less_efficient_algorithm_for_bytes(prefix);
+    // more_efficient_algorithm_for_aligned_shorts(shorts);
+    // less_efficient_algorithm_for_bytes(suffix);
+}
+
1.30.0 · source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the +types is maintained.

+

This method splits the slice into three distinct slices: prefix, correctly aligned middle +slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

+

This method has no purpose when either input element T or output element U are +zero-sized and will return the original slice without splitting anything.

+
§Safety
+

This method is essentially a transmute with respect to the elements in the returned +middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

+
§Examples
+

Basic usage:

+ +
unsafe {
+    let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];
+    let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();
+    // less_efficient_algorithm_for_bytes(prefix);
+    // more_efficient_algorithm_for_aligned_shorts(shorts);
+    // less_efficient_algorithm_for_bytes(suffix);
+}
+
source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where + Simd<T, LANES>: AsRef<[T; LANES]>, + T: SimdElement, + LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

+

This is a safe wrapper around slice::align_to, so has the same weak +postconditions as that method. You’re only assured that +self.len() == prefix.len() + middle.len() * LANES + suffix.len().

+

Notably, all of the following are possible:

+
    +
  • prefix.len() >= LANES.
  • +
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • +
  • suffix.len() >= LANES.
  • +
+

That said, this is a safe method, so if you’re only writing safe code, +then this can at most cause incorrect logic, not unsoundness.

+
§Panics
+

This will panic if the size of the SIMD type is different from +LANES times that of the scalar.

+

At the time of writing, the trait restrictions on Simd<T, LANES> keeps +that from ever happening, as only power-of-two numbers of lanes are +supported. It’s possible that, in the future, those restrictions might +be lifted in a way that would make it possible to see panics from this +method for something like LANES == 3.

+
§Examples
+
#![feature(portable_simd)]
+use core::simd::prelude::*;
+
+let short = &[1, 2, 3];
+let (prefix, middle, suffix) = short.as_simd::<4>();
+assert_eq!(middle, []); // Not enough elements for anything in the middle
+
+// They might be split in any possible way between prefix and suffix
+let it = prefix.iter().chain(suffix).copied();
+assert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);
+
+fn basic_simd_sum(x: &[f32]) -> f32 {
+    use std::ops::Add;
+    let (prefix, middle, suffix) = x.as_simd();
+    let sums = f32x4::from_array([
+        prefix.iter().copied().sum(),
+        0.0,
+        0.0,
+        suffix.iter().copied().sum(),
+    ]);
+    let sums = middle.iter().copied().fold(sums, f32x4::add);
+    sums.reduce_sum()
+}
+
+let numbers: Vec<f32> = (1..101).map(|x| x as _).collect();
+assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
+
source

pub fn as_simd_mut<const LANES: usize>( + &mut self, +) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where + Simd<T, LANES>: AsMut<[T; LANES]>, + T: SimdElement, + LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a mutable slice into a mutable prefix, a middle of aligned SIMD types, +and a mutable suffix.

+

This is a safe wrapper around slice::align_to_mut, so has the same weak +postconditions as that method. You’re only assured that +self.len() == prefix.len() + middle.len() * LANES + suffix.len().

+

Notably, all of the following are possible:

+
    +
  • prefix.len() >= LANES.
  • +
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • +
  • suffix.len() >= LANES.
  • +
+

That said, this is a safe method, so if you’re only writing safe code, +then this can at most cause incorrect logic, not unsoundness.

+

This is the mutable version of slice::as_simd; see that for examples.

+
§Panics
+

This will panic if the size of the SIMD type is different from +LANES times that of the scalar.

+

At the time of writing, the trait restrictions on Simd<T, LANES> keeps +that from ever happening, as only power-of-two numbers of lanes are +supported. It’s possible that, in the future, those restrictions might +be lifted in a way that would make it possible to see panics from this +method for something like LANES == 3.

+
source

pub fn is_sorted(&self) -> bool
where + T: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

+

That is, for each element a and its following element b, a <= b must hold. If the +slice yields exactly zero or one element, true is returned.

+

Note that if Self::Item is only PartialOrd, but not Ord, the above definition +implies that this function returns false if any two consecutive items are not +comparable.

+
§Examples
+
#![feature(is_sorted)]
+let empty: [i32; 0] = [];
+
+assert!([1, 2, 2, 9].is_sorted());
+assert!(![1, 3, 2, 4].is_sorted());
+assert!([0].is_sorted());
+assert!(empty.is_sorted());
+assert!(![0.0, 1.0, f32::NAN].is_sorted());
+
source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where + F: FnMut(&'a T, &'a T) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

+

Instead of using PartialOrd::partial_cmp, this function uses the given compare +function to determine whether two elements are to be considered in sorted order.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!([1, 2, 2, 9].is_sorted_by(|a, b| a <= b));
+assert!(![1, 2, 2, 9].is_sorted_by(|a, b| a < b));
+
+assert!([0].is_sorted_by(|a, b| true));
+assert!([0].is_sorted_by(|a, b| false));
+
+let empty: [i32; 0] = [];
+assert!(empty.is_sorted_by(|a, b| false));
+assert!(empty.is_sorted_by(|a, b| true));
+
source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where + F: FnMut(&'a T) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

+

Instead of comparing the slice’s elements directly, this function compares the keys of the +elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its +documentation for more information.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
+assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
+
1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where + P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate +(the index of the first element of the second partition).

+

The slice is assumed to be partitioned according to the given predicate. +This means that all elements for which the predicate returns true are at the start of the slice +and all elements for which the predicate returns false are at the end. +For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0 +(all odd numbers are at the start, all even at the end).

+

If this slice is not partitioned, the returned result is unspecified and meaningless, +as this method performs a kind of binary search.

+

See also binary_search, binary_search_by, and binary_search_by_key.

+
§Examples
+
let v = [1, 2, 3, 3, 5, 6, 7];
+let i = v.partition_point(|&x| x < 5);
+
+assert_eq!(i, 4);
+assert!(v[..i].iter().all(|&x| x < 5));
+assert!(v[i..].iter().all(|&x| !(x < 5)));
+

If all elements of the slice match the predicate, including if the slice +is empty, then the length of the slice will be returned:

+ +
let a = [2, 4, 8];
+assert_eq!(a.partition_point(|x| x < &100), a.len());
+let a: [i32; 0] = [];
+assert_eq!(a.partition_point(|x| x < &100), 0);
+

If you want to insert an item to a sorted vector, while maintaining +sort order:

+ +
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
+let num = 42;
+let idx = s.partition_point(|&x| x <= num);
+s.insert(idx, num);
+assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
+
source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where + R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range +and returns a reference to it.

+

Returns None and does not modify the slice if the given +range is out of bounds.

+

Note that this method only accepts one-sided ranges such as +2.. or ..6, but not 2..6.

+
§Examples
+

Taking the first three elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+let mut first_three = slice.take(..3).unwrap();
+
+assert_eq!(slice, &['d']);
+assert_eq!(first_three, &['a', 'b', 'c']);
+

Taking the last two elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+let mut tail = slice.take(2..).unwrap();
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(tail, &['c', 'd']);
+

Getting None when range is out of bounds:

+ +
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c', 'd'];
+
+assert_eq!(None, slice.take(5..));
+assert_eq!(None, slice.take(..5));
+assert_eq!(None, slice.take(..=4));
+let expected: &[char] = &['a', 'b', 'c', 'd'];
+assert_eq!(Some(expected), slice.take(..4));
+
source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where + R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range +and returns a mutable reference to it.

+

Returns None and does not modify the slice if the given +range is out of bounds.

+

Note that this method only accepts one-sided ranges such as +2.. or ..6, but not 2..6.

+
§Examples
+

Taking the first three elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+let mut first_three = slice.take_mut(..3).unwrap();
+
+assert_eq!(slice, &mut ['d']);
+assert_eq!(first_three, &mut ['a', 'b', 'c']);
+

Taking the last two elements of a slice:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+let mut tail = slice.take_mut(2..).unwrap();
+
+assert_eq!(slice, &mut ['a', 'b']);
+assert_eq!(tail, &mut ['c', 'd']);
+

Getting None when range is out of bounds:

+ +
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+
+assert_eq!(None, slice.take_mut(5..));
+assert_eq!(None, slice.take_mut(..5));
+assert_eq!(None, slice.take_mut(..=4));
+let expected: &mut [_] = &mut ['a', 'b', 'c', 'd'];
+assert_eq!(Some(expected), slice.take_mut(..4));
+
source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c'];
+let first = slice.take_first().unwrap();
+
+assert_eq!(slice, &['b', 'c']);
+assert_eq!(first, &'a');
+
source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +reference to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
+let first = slice.take_first_mut().unwrap();
+*first = 'd';
+
+assert_eq!(slice, &['b', 'c']);
+assert_eq!(first, &'d');
+
source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &[_] = &['a', 'b', 'c'];
+let last = slice.take_last().unwrap();
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(last, &'c');
+
source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +reference to it.

+

Returns None if the slice is empty.

+
§Examples
+
#![feature(slice_take)]
+
+let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
+let last = slice.take_last_mut().unwrap();
+*last = 'd';
+
+assert_eq!(slice, &['a', 'b']);
+assert_eq!(last, &'d');
+
source

pub unsafe fn get_many_unchecked_mut<const N: usize>( + &mut self, + indices: [usize; N], +) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

+

For a safe alternative see get_many_mut.

+
§Safety
+

Calling this method with overlapping or out-of-bounds indices is undefined behavior +even if the resulting references are not used.

+
§Examples
+
#![feature(get_many_mut)]
+
+let x = &mut [1, 2, 4];
+
+unsafe {
+    let [a, b] = x.get_many_unchecked_mut([0, 2]);
+    *a *= 10;
+    *b *= 100;
+}
+assert_eq!(x, &[10, 2, 400]);
+
source

pub fn get_many_mut<const N: usize>( + &mut self, + indices: [usize; N], +) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

+

Returns an error if any index is out-of-bounds, or if the same index was +passed more than once.

+
§Examples
+
#![feature(get_many_mut)]
+
+let v = &mut [1, 2, 3];
+if let Ok([a, b]) = v.get_many_mut([0, 2]) {
+    *a = 413;
+    *b = 612;
+}
+assert_eq!(v, &[413, 2, 612]);
+
1.0.0 · source

pub fn sort(&mut self)
where + T: Ord,

Sorts the slice, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) +worst-case.

+

If T: Ord does not implement a total order the resulting order is unspecified. All +original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if T: Ord panics.

+

When applicable, unstable sorting is preferred because it is generally faster than stable +sorting and it doesn’t allocate auxiliary memory. See +sort_unstable. The exception are partially sorted slices, which +may be better served with slice::sort.

+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5, 4, 1, -3, 2];
+
+v.sort();
+assert!(v == [-5, -3, 1, 2, 4]);
+
1.0.0 · source

pub fn sort_by<F>(&mut self, compare: F)
where + F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n)) +worst-case.

+

The comparator function should define a total ordering for the elements in the slice. If the +ordering is not total, the order of the elements is unspecified.

+

If the comparator function does not implement a total order the resulting order is +unspecified. All original elements will remain in the slice and any possible modifications +via interior mutability are observed in the input. Same is true if the comparator function +panics. A total order (for all a, b and c):

+
    +
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • +
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • +
+

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use +partial_cmp as our sort function when we know the slice doesn’t contain a NaN.

+ +
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
+floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
+assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If T: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [5, 4, 1, 3, 2];
+v.sort_by(|a, b| a.cmp(b));
+assert!(v == [1, 2, 3, 4, 5]);
+
+// reverse sorting
+v.sort_by(|a, b| b.cmp(a));
+assert!(v == [5, 4, 3, 2, 1]);
+
1.7.0 · source

pub fn sort_by_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n)) +worst-case, where the key function is O(m).

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+
§Current implementation
+

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which +combines the fast average case of quicksort with the fast worst case and partial run +detection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs +with k distinct elements, the expected time to sort the data is O(n * log(k)).

+

The auxiliary memory allocation behavior depends on the input length. Short slices are +handled without allocation, medium sized slices allocate self.len() and beyond that it +clamps at self.len() / 2.

+

If K: Ord does not implement a total order, the implementation may panic.

+
§Examples
+
let mut v = [-5i32, 4, 1, -3, 2];
+
+v.sort_by_key(|k| k.abs());
+assert!(v == [1, 2, -3, 4, -5]);
+
1.34.0 · source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where + F: FnMut(&T) -> K, + K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

+

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n * +log(n)) worst-case, where the key function is O(m).

+

During sorting, the key function is called at most once per element, by using temporary +storage to remember the results of key evaluation. The order of calls to the key function is +unspecified and may change in future versions of the standard library.

+

If K: Ord does not implement a total order the resulting order is unspecified. +All original elements will remain in the slice and any possible modifications via interior +mutability are observed in the input. Same is true if K: Ord panics.

+

For simple key functions (e.g., functions that are property accesses or basic operations), +sort_by_key is likely to be faster.

+
§Current implementation
+

The current implementation is based on instruction-parallel-network sort by Lukas +Bergdoll, which combines the fast average case of randomized quicksort with the fast worst +case of heapsort, while achieving linear time on fully sorted and reversed inputs. And +O(k * log(n)) where k is the number of distinct elements in the input. It leverages +superscalar out-of-order execution capabilities commonly found in CPUs, to efficiently +perform the operation.

+

In the worst case, the algorithm allocates temporary storage in a Vec<(K, usize)> the +length of the slice.

+
§Examples
+
let mut v = [-5i32, 4, 32, -3, 2];
+
+v.sort_by_cached_key(|k| k.to_string());
+assert!(v == [-3, -5, 2, 32, 4]);
+
1.0.0 · source

pub fn to_vec(&self) -> Vec<T>
where + T: Clone,

Copies self into a new Vec.

+
§Examples
+
let s = [10, 40, 30];
+let x = s.to_vec();
+// Here, `s` and `x` can be modified independently.
+
source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where + A: Allocator, + T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

+
§Examples
+
#![feature(allocator_api)]
+
+use std::alloc::System;
+
+let s = [10, 40, 30];
+let x = s.to_vec_in(System);
+// Here, `s` and `x` can be modified independently.
+
1.40.0 · source

pub fn repeat(&self, n: usize) -> Vec<T>
where + T: Copy,

Creates a vector by copying a slice n times.

+
§Panics
+

This function will panic if the capacity would overflow.

+
§Examples
+

Basic usage:

+ +
assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
+

A panic upon overflow:

+ +
// this will panic at runtime
+b"0123456789abcdef".repeat(usize::MAX);
+
1.0.0 · source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where + [T]: Concat<Item>, + Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

+
§Examples
+
assert_eq!(["hello", "world"].concat(), "helloworld");
+assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
+
1.3.0 · source

pub fn join<Separator>( + &self, + sep: Separator, +) -> <[T] as Join<Separator>>::Output
where + [T]: Join<Separator>,

Flattens a slice of T into a single value Self::Output, placing a +given separator between each.

+
§Examples
+
assert_eq!(["hello", "world"].join(" "), "hello world");
+assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
+assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
+
1.0.0 · source

pub fn connect<Separator>( + &self, + sep: Separator, +) -> <[T] as Join<Separator>>::Output
where + [T]: Join<Separator>,

👎Deprecated since 1.3.0: renamed to join

Flattens a slice of T into a single value Self::Output, placing a +given separator between each.

+
§Examples
+
assert_eq!(["hello", "world"].connect(" "), "hello world");
+assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
+
1.23.0 · source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +is mapped to its ASCII upper case equivalent.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To uppercase the value in-place, use make_ascii_uppercase.

+
1.23.0 · source

pub fn to_ascii_lowercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte +is mapped to its ASCII lower case equivalent.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To lowercase the value in-place, use make_ascii_lowercase.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Prefix

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Prefix

source§

fn clone(&self) -> Prefix

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Prefix

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Decode for Prefix

source§

fn try_default() -> Result<Prefix, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Prefix, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Prefix

source§

fn default() -> Prefix

Returns the “default value” for a type. Read more
source§

impl Deref for Prefix

§

type Target = Vec<u8>

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Prefix as Deref>::Target

Dereferences the value.
source§

impl DerefMut for Prefix

source§

fn deref_mut(&mut self) -> &mut <Prefix as Deref>::Target

Mutably dereferences the value.
source§

impl Encode for Prefix

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<Prefix> for Vec<u8>

source§

fn from(val: Prefix) -> Vec<u8>

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Prefix

source§

fn from(v: Vec<u8>) -> Prefix

Converts to this type from the input type.
source§

impl Ord for Prefix

source§

fn cmp(&self, other: &Prefix) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Prefix

source§

fn eq(&self, other: &Prefix) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Prefix

source§

fn partial_cmp(&self, other: &Prefix) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for Prefix

source§

impl StructuralPartialEq for Prefix

Auto Trait Implementations§

§

impl Freeze for Prefix

§

impl RefUnwindSafe for Prefix

§

impl Send for Prefix

§

impl Sync for Prefix

§

impl Unpin for Prefix

§

impl UnwindSafe for Prefix

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/struct.PrefixStore.html b/rust/oasis_runtime_sdk/storage/struct.PrefixStore.html new file mode 100644 index 0000000000..afeb494157 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/struct.PrefixStore.html @@ -0,0 +1,34 @@ +PrefixStore in oasis_runtime_sdk::storage - Rust

Struct oasis_runtime_sdk::storage::PrefixStore

source ·
pub struct PrefixStore<S: Store, P: AsRef<[u8]>> { /* private fields */ }
Expand description

A key-value store that prefixes all keys with the given prefix.

+

Implementations§

source§

impl<S: Store, P: AsRef<[u8]>> PrefixStore<S, P>

source

pub fn new(parent: S, prefix: P) -> Self

Create a new prefix store with the given prefix.

+

Trait Implementations§

source§

impl<S: Store, P: AsRef<[u8]>> Store for PrefixStore<S, P>

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.
source§

fn insert(&mut self, key: &[u8], value: &[u8])

Update entry with given key to the given value.
source§

fn remove(&mut self, key: &[u8])

Remove entry with given key.
source§

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.
source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.

Auto Trait Implementations§

§

impl<S, P> Freeze for PrefixStore<S, P>
where + S: Freeze, + P: Freeze,

§

impl<S, P> RefUnwindSafe for PrefixStore<S, P>
where + S: RefUnwindSafe, + P: RefUnwindSafe,

§

impl<S, P> Send for PrefixStore<S, P>
where + S: Send, + P: Send,

§

impl<S, P> Sync for PrefixStore<S, P>
where + S: Sync, + P: Sync,

§

impl<S, P> Unpin for PrefixStore<S, P>
where + S: Unpin, + P: Unpin,

§

impl<S, P> UnwindSafe for PrefixStore<S, P>
where + S: UnwindSafe, + P: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/struct.TypedStore.html b/rust/oasis_runtime_sdk/storage/struct.TypedStore.html new file mode 100644 index 0000000000..7956adf8f4 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/struct.TypedStore.html @@ -0,0 +1,33 @@ +TypedStore in oasis_runtime_sdk::storage - Rust

Struct oasis_runtime_sdk::storage::TypedStore

source ·
pub struct TypedStore<S: Store> { /* private fields */ }
Expand description

A key-value store that transparently handles serialization/deserialization.

+

Implementations§

source§

impl<S: Store> TypedStore<S>

source

pub fn new(parent: S) -> Self

Create a new typed store.

+
source

pub fn get<K: AsRef<[u8]>, T: Decode>(&self, key: K) -> Option<T>

Fetch entry with given key.

+
source

pub fn insert<K: AsRef<[u8]>, T: Encode>(&mut self, key: K, value: T)

Update entry with given key to the given value.

+
source

pub fn remove<K: AsRef<[u8]>>(&mut self, key: K)

Remove entry with given key.

+
source

pub fn iter<'store, K, V>(&'store self) -> TypedStoreIterator<'store, K, V>
where + K: for<'k> TryFrom<&'k [u8]>, + V: Decode + Default,

Auto Trait Implementations§

§

impl<S> Freeze for TypedStore<S>
where + S: Freeze,

§

impl<S> RefUnwindSafe for TypedStore<S>
where + S: RefUnwindSafe,

§

impl<S> Send for TypedStore<S>
where + S: Send,

§

impl<S> Sync for TypedStore<S>
where + S: Sync,

§

impl<S> Unpin for TypedStore<S>
where + S: Unpin,

§

impl<S> UnwindSafe for TypedStore<S>
where + S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/trait.NestedStore.html b/rust/oasis_runtime_sdk/storage/trait.NestedStore.html new file mode 100644 index 0000000000..8f4be899f7 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/trait.NestedStore.html @@ -0,0 +1,16 @@ +NestedStore in oasis_runtime_sdk::storage - Rust

Trait oasis_runtime_sdk::storage::NestedStore

source ·
pub trait NestedStore: Store {
+    type Inner;
+
+    // Required methods
+    fn commit(self) -> Self::Inner;
+    fn rollback(self) -> Self::Inner;
+    fn has_pending_updates(&self) -> bool;
+    fn pending_update_byte_size(&self) -> usize;
+}
Expand description

A key-value store that supports the commit operation.

+

Required Associated Types§

source

type Inner

Type of the inner store.

+

Required Methods§

source

fn commit(self) -> Self::Inner

Commit any changes to the underlying store.

+

If this method is not called the changes may be discarded by the store.

+
source

fn rollback(self) -> Self::Inner

Rollback any changes.

+
source

fn has_pending_updates(&self) -> bool

Whether there are any store updates pending to be committed.

+
source

fn pending_update_byte_size(&self) -> usize

Size (in bytes) of any pending updates.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/trait.Store.html b/rust/oasis_runtime_sdk/storage/trait.Store.html new file mode 100644 index 0000000000..6d22f24ae6 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/trait.Store.html @@ -0,0 +1,14 @@ +Store in oasis_runtime_sdk::storage - Rust

Trait oasis_runtime_sdk::storage::Store

source ·
pub trait Store {
+    // Required methods
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;
+    fn insert(&mut self, key: &[u8], value: &[u8]);
+    fn remove(&mut self, key: &[u8]);
+    fn iter(&self) -> Box<dyn Iterator + '_>;
+    fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16);
+}
Expand description

A key-value store.

+

Required Methods§

source

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Fetch entry with given key.

+
source

fn insert(&mut self, key: &[u8], value: &[u8])

Update entry with given key to the given value.

+
source

fn remove(&mut self, key: &[u8])

Remove entry with given key.

+
source

fn iter(&self) -> Box<dyn Iterator + '_>

Returns an iterator over the tree.

+
source

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Populate the in-memory tree with nodes for keys starting with given prefixes.

+

Implementations on Foreign Types§

source§

impl<S: Store + ?Sized> Store for &mut S

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

source§

fn insert(&mut self, key: &[u8], value: &[u8])

source§

fn remove(&mut self, key: &[u8])

source§

fn iter(&self) -> Box<dyn Iterator + '_>

source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

source§

impl<S: Store + ?Sized> Store for Box<S>

source§

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

source§

fn insert(&mut self, key: &[u8], value: &[u8])

source§

fn remove(&mut self, key: &[u8])

source§

fn iter(&self) -> Box<dyn Iterator + '_>

source§

fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16)

Implementors§

source§

impl Store for HostStore

source§

impl<M: MKVS> Store for MKVSStore<M>

source§

impl<S: Store> Store for ConfidentialStore<S>

source§

impl<S: Store> Store for OverlayStore<S>

source§

impl<S: Store, D: Digest> Store for HashedStore<S, D>

source§

impl<S: Store, P: AsRef<[u8]>> Store for PrefixStore<S, P>

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/storage/typed/struct.TypedStore.html b/rust/oasis_runtime_sdk/storage/typed/struct.TypedStore.html new file mode 100644 index 0000000000..44dcd21108 --- /dev/null +++ b/rust/oasis_runtime_sdk/storage/typed/struct.TypedStore.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../oasis_runtime_sdk/storage/struct.TypedStore.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/struct.Version.html b/rust/oasis_runtime_sdk/struct.Version.html new file mode 100644 index 0000000000..111ebae4bf --- /dev/null +++ b/rust/oasis_runtime_sdk/struct.Version.html @@ -0,0 +1,41 @@ +Version in oasis_runtime_sdk - Rust

Struct oasis_runtime_sdk::Version

source ·
pub struct Version {
+    pub major: u16,
+    pub minor: u16,
+    pub patch: u16,
+}
Expand description

A protocol or runtime version.

+

Fields§

§major: u16§minor: u16§patch: u16

Implementations§

source§

impl Version

source

pub const fn new(major: u16, minor: u16, patch: u16) -> Version

Creates a new version with given major, minor, and patch segments.

+
source

pub fn is_compatible_with(&self, other: &Version) -> bool

Checks if two versions are compatible.

+

Trait Implementations§

source§

impl Clone for Version

source§

fn clone(&self) -> Version

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Version

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Decode for Version

source§

fn try_default() -> Result<Version, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Version, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Version

source§

fn default() -> Version

Returns the “default value” for a type. Read more
source§

impl Encode for Version

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Version

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<u64> for Version

source§

fn from(v: u64) -> Version

Converts to this type from the input type.
source§

impl Hash for Version

source§

fn hash<__H>(&self, state: &mut __H)
where + __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Version

source§

fn eq(&self, other: &Version) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Version

source§

impl Eq for Version

source§

impl StructuralPartialEq for Version

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/subcall/fn.call.html b/rust/oasis_runtime_sdk/subcall/fn.call.html new file mode 100644 index 0000000000..bbef026bce --- /dev/null +++ b/rust/oasis_runtime_sdk/subcall/fn.call.html @@ -0,0 +1,6 @@ +call in oasis_runtime_sdk::subcall - Rust

Function oasis_runtime_sdk::subcall::call

source ·
pub fn call<C: Context, V: Validator + 'static>(
+    ctx: &C,
+    info: SubcallInfo,
+    validator: V,
+) -> Result<SubcallResult, Error>
Expand description

Perform a subcall.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/subcall/fn.get_current_subcall_depth.html b/rust/oasis_runtime_sdk/subcall/fn.get_current_subcall_depth.html new file mode 100644 index 0000000000..5759dae667 --- /dev/null +++ b/rust/oasis_runtime_sdk/subcall/fn.get_current_subcall_depth.html @@ -0,0 +1,2 @@ +get_current_subcall_depth in oasis_runtime_sdk::subcall - Rust
pub fn get_current_subcall_depth<C: Context>(_ctx: &C) -> u16
Expand description

The current subcall depth.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/subcall/index.html b/rust/oasis_runtime_sdk/subcall/index.html new file mode 100644 index 0000000000..f30afef513 --- /dev/null +++ b/rust/oasis_runtime_sdk/subcall/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::subcall - Rust

Module oasis_runtime_sdk::subcall

source ·
Expand description

Subcall dispatch.

+

Structs§

Traits§

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/subcall/sidebar-items.js b/rust/oasis_runtime_sdk/subcall/sidebar-items.js new file mode 100644 index 0000000000..d8ea06ae4b --- /dev/null +++ b/rust/oasis_runtime_sdk/subcall/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["call","get_current_subcall_depth"],"struct":["AllowAllValidator","SubcallInfo","SubcallResult"],"trait":["Validator"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/subcall/struct.AllowAllValidator.html b/rust/oasis_runtime_sdk/subcall/struct.AllowAllValidator.html new file mode 100644 index 0000000000..50c641b004 --- /dev/null +++ b/rust/oasis_runtime_sdk/subcall/struct.AllowAllValidator.html @@ -0,0 +1,21 @@ +AllowAllValidator in oasis_runtime_sdk::subcall - Rust

Struct oasis_runtime_sdk::subcall::AllowAllValidator

source ·
pub struct AllowAllValidator;
Expand description

A validator which allows everything.

+

Trait Implementations§

source§

impl Validator for AllowAllValidator

source§

fn validate(&self, _info: &SubcallInfo) -> Result<(), Error>

Validate a subcall before it is performed.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/subcall/struct.SubcallInfo.html b/rust/oasis_runtime_sdk/subcall/struct.SubcallInfo.html new file mode 100644 index 0000000000..5adb33eba8 --- /dev/null +++ b/rust/oasis_runtime_sdk/subcall/struct.SubcallInfo.html @@ -0,0 +1,34 @@ +SubcallInfo in oasis_runtime_sdk::subcall - Rust

Struct oasis_runtime_sdk::subcall::SubcallInfo

source ·
pub struct SubcallInfo {
+    pub caller: CallerAddress,
+    pub method: String,
+    pub body: Value,
+    pub max_depth: u16,
+    pub max_gas: u64,
+}
Expand description

Information about a subcall to be dispatched.

+

Fields§

§caller: CallerAddress

Address of the caller.

+
§method: String

Method to call.

+
§body: Value

Subcall body.

+
§max_depth: u16

Maximum subcall depth.

+
§max_gas: u64

Maximum gas amount that can be consumed.

+

Trait Implementations§

source§

impl Clone for SubcallInfo

source§

fn clone(&self) -> SubcallInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SubcallInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/subcall/struct.SubcallResult.html b/rust/oasis_runtime_sdk/subcall/struct.SubcallResult.html new file mode 100644 index 0000000000..35d8c42d3a --- /dev/null +++ b/rust/oasis_runtime_sdk/subcall/struct.SubcallResult.html @@ -0,0 +1,26 @@ +SubcallResult in oasis_runtime_sdk::subcall - Rust

Struct oasis_runtime_sdk::subcall::SubcallResult

source ·
pub struct SubcallResult {
+    pub call_result: CallResult,
+    pub gas_used: u64,
+}
Expand description

Result of dispatching a subcall.

+

Fields§

§call_result: CallResult

Result of the subcall.

+
§gas_used: u64

Gas used by the subcall.

+

Trait Implementations§

source§

impl Debug for SubcallResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/subcall/trait.Validator.html b/rust/oasis_runtime_sdk/subcall/trait.Validator.html new file mode 100644 index 0000000000..1208ae432d --- /dev/null +++ b/rust/oasis_runtime_sdk/subcall/trait.Validator.html @@ -0,0 +1,6 @@ +Validator in oasis_runtime_sdk::subcall - Rust

Trait oasis_runtime_sdk::subcall::Validator

source ·
pub trait Validator {
+    // Required method
+    fn validate(&self, info: &SubcallInfo) -> Result<(), Error>;
+}
Expand description

Subcall validator.

+

Required Methods§

source

fn validate(&self, info: &SubcallInfo) -> Result<(), Error>

Validate a subcall before it is performed.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/index.html b/rust/oasis_runtime_sdk/testing/index.html new file mode 100644 index 0000000000..87773c38b4 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::testing - Rust

Module oasis_runtime_sdk::testing

source ·
Expand description

Module which contains utilities useful for testing and development.

+

Modules§

  • Mock key manager implementation.
  • Module that contains known test keys.
  • Mock dispatch context for use in tests.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/enum.KeyManagerError.html b/rust/oasis_runtime_sdk/testing/keymanager/enum.KeyManagerError.html new file mode 100644 index 0000000000..3e8383f247 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/enum.KeyManagerError.html @@ -0,0 +1,56 @@ +KeyManagerError in oasis_runtime_sdk::testing::keymanager - Rust
pub enum KeyManagerError {
+
Show 33 variants NotAuthenticated, + NotAuthorized, + InvalidEpoch(u64, u64), + InvalidGeneration(u64, u64), + GenerationFromFuture(u64, u64), + HeightNotFresh, + NotInitialized, + StateCorrupted, + StorageCorrupted, + PolicyRequired, + PolicyRollback, + PolicyChanged, + PolicyInvalidRuntime, + InsufficientKeyShares, + InsufficientSignatures, + RSKMissing, + REKNotPublished, + InvalidSignature(Error), + MasterSecretChecksumMismatch, + MasterSecretNotFound(u64), + MasterSecretNotReplicated(u64), + MasterSecretNotPublished, + EphemeralSecretNotFound(u64), + EphemeralSecretNotReplicated(u64), + EphemeralSecretNotPublished, + EphemeralSecretChecksumMismatch, + InvalidCiphertext, + StatusNotFound, + RuntimeMismatch, + ActiveDeploymentNotFound, + StateError(StateError), + VerificationError(Error), + Other(Error), +
}
Expand description

Key manager error.

+

Variants§

§

NotAuthenticated

§

NotAuthorized

§

InvalidEpoch(u64, u64)

§

InvalidGeneration(u64, u64)

§

GenerationFromFuture(u64, u64)

§

HeightNotFresh

§

NotInitialized

§

StateCorrupted

§

StorageCorrupted

§

PolicyRequired

§

PolicyRollback

§

PolicyChanged

§

PolicyInvalidRuntime

§

InsufficientKeyShares

§

InsufficientSignatures

§

RSKMissing

§

REKNotPublished

§

InvalidSignature(Error)

§

MasterSecretChecksumMismatch

§

MasterSecretNotFound(u64)

§

MasterSecretNotReplicated(u64)

§

MasterSecretNotPublished

§

EphemeralSecretNotFound(u64)

§

EphemeralSecretNotReplicated(u64)

§

EphemeralSecretNotPublished

§

EphemeralSecretChecksumMismatch

§

InvalidCiphertext

§

StatusNotFound

§

RuntimeMismatch

§

ActiveDeploymentNotFound

§

StateError(StateError)

§

VerificationError(Error)

§

Other(Error)

Trait Implementations§

§

impl Debug for KeyManagerError

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for KeyManagerError

§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Error for KeyManagerError

§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
§

impl From<Error> for KeyManagerError

§

fn from(source: Error) -> KeyManagerError

Converts to this type from the input type.
§

impl From<Error> for KeyManagerError

§

fn from(source: Error) -> KeyManagerError

Converts to this type from the input type.
source§

impl From<KeyManagerError> for Error

source§

fn from(source: KeyManagerError) -> Self

Converts to this type from the input type.
§

impl From<StateError> for KeyManagerError

§

fn from(source: StateError) -> KeyManagerError

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/index.html b/rust/oasis_runtime_sdk/testing/keymanager/index.html new file mode 100644 index 0000000000..65e93d0aa6 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::testing::keymanager - Rust

Module oasis_runtime_sdk::testing::keymanager

source ·
Expand description

Mock key manager implementation.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keymanager/sidebar-items.js new file mode 100644 index 0000000000..cfd5594a7f --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["KeyManagerError"],"struct":["KeyPair","KeyPairId","MockKeyManagerClient","SignedPublicKey","StateKey","TrustedSigners"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/struct.KeyPair.html b/rust/oasis_runtime_sdk/testing/keymanager/struct.KeyPair.html new file mode 100644 index 0000000000..c1f2c27a8b --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/struct.KeyPair.html @@ -0,0 +1,42 @@ +KeyPair in oasis_runtime_sdk::testing::keymanager - Rust

Struct oasis_runtime_sdk::testing::keymanager::KeyPair

pub struct KeyPair {
+    pub input_keypair: InputKeyPair,
+    pub state_key: StateKey,
+    pub checksum: Vec<u8>,
+}
Expand description

A key pair managed by the key manager.

+

Fields§

§input_keypair: InputKeyPair

Input key pair (pk, sk)

+
§state_key: StateKey

State encryption key

+
§checksum: Vec<u8>

Checksum of the key manager state.

+

Implementations§

§

impl KeyPair

pub fn generate_mock() -> KeyPair

Generate a new random key (for testing).

+

pub fn new( + pk: PublicKey, + sk: PrivateKey, + state_key: StateKey, + checksum: Vec<u8>, +) -> KeyPair

Create a KeyPair.

+

pub fn from_public_key(pk: PublicKey, checksum: Vec<u8>) -> KeyPair

Create a KeyPair with only the public key.

+

Trait Implementations§

§

impl Clone for KeyPair

§

fn clone(&self) -> KeyPair

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Decode for KeyPair

§

fn try_default() -> Result<KeyPair, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<KeyPair, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for KeyPair

§

fn default() -> KeyPair

Returns the “default value” for a type. Read more
§

impl Encode for KeyPair

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl EncodeAsMap for KeyPair

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/struct.KeyPairId.html b/rust/oasis_runtime_sdk/testing/keymanager/struct.KeyPairId.html new file mode 100644 index 0000000000..23aa8ba2bd --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/struct.KeyPairId.html @@ -0,0 +1,48 @@ +KeyPairId in oasis_runtime_sdk::testing::keymanager - Rust

Struct oasis_runtime_sdk::testing::keymanager::KeyPairId

pub struct KeyPairId(pub [u8; 32]);
Expand description

A 256-bit key pair identifier.

+

Tuple Fields§

§0: [u8; 32]

Implementations§

§

impl KeyPairId

pub const fn len() -> usize

Size of this object in bytes.

+

Trait Implementations§

§

impl AsRef<[u8]> for KeyPairId

§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for KeyPairId

§

fn clone(&self) -> KeyPairId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for KeyPairId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for KeyPairId

§

fn try_default() -> Result<KeyPairId, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<KeyPairId, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for KeyPairId

§

fn default() -> KeyPairId

Returns the “default value” for a type. Read more
§

impl Display for KeyPairId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Encode for KeyPairId

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl From<&[u8]> for KeyPairId

§

fn from(b: &[u8]) -> KeyPairId

Converts to this type from the input type.
§

impl From<&'static str> for KeyPairId

§

fn from(s: &'static str) -> KeyPairId

Converts to this type from the input type.
§

impl From<KeyPairId> for [u8; 32]

§

fn from(b: KeyPairId) -> [u8; 32]

Converts to this type from the input type.
§

impl From<Vec<u8>> for KeyPairId

§

fn from(v: Vec<u8>) -> KeyPairId

Converts to this type from the input type.
§

impl FromStr for KeyPairId

§

type Err = FromHexError

The associated error which can be returned from parsing.
§

fn from_str(s: &str) -> Result<KeyPairId, FromHexError>

Parses a string s to return a value of this type. Read more
§

impl Hash for KeyPairId

§

fn hash<H>(&self, state: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl LowerHex for KeyPairId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Ord for KeyPairId

§

fn cmp(&self, other: &KeyPairId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for KeyPairId

§

fn eq(&self, other: &KeyPairId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for KeyPairId

§

fn partial_cmp(&self, other: &KeyPairId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl Zeroize for KeyPairId

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.
§

impl Copy for KeyPairId

§

impl Eq for KeyPairId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/struct.MockKeyManagerClient.html b/rust/oasis_runtime_sdk/testing/keymanager/struct.MockKeyManagerClient.html new file mode 100644 index 0000000000..ff46be84d9 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/struct.MockKeyManagerClient.html @@ -0,0 +1,37 @@ +MockKeyManagerClient in oasis_runtime_sdk::testing::keymanager - Rust
pub struct MockKeyManagerClient { /* private fields */ }

Implementations§

Trait Implementations§

source§

impl Clone for MockKeyManagerClient

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for MockKeyManagerClient

source§

fn default() -> MockKeyManagerClient

Returns the “default value” for a type. Read more
source§

impl KeyManager for MockKeyManagerClient

source§

fn runtime_id(&self) -> Option<Namespace>

Key manager runtime identifier this client is connected to. It may be None in case the +identifier is not known yet (e.g. the client has not yet been initialized). Read more
source§

fn runtime_signing_key(&self) -> Option<PublicKey>

Key manager runtime signing key used to sign messages from the key manager. Read more
source§

fn clear_cache(&self)

Clear local key cache. Read more
source§

fn get_or_create_keys( + &self, + key_pair_id: KeyPairId, +) -> Result<KeyPair, KeyManagerError>

Get or create named key pair. Read more
source§

fn get_public_key( + &self, + _key_pair_id: KeyPairId, +) -> Result<SignedPublicKey, KeyManagerError>

Get public key for a key pair id. Read more
source§

fn get_or_create_ephemeral_keys( + &self, + key_pair_id: KeyPairId, + _epoch: EpochTime, +) -> Result<KeyPair, KeyManagerError>

Get or create named ephemeral key pair for given epoch. Read more
source§

fn get_public_ephemeral_key( + &self, + _key_pair_id: KeyPairId, + _epoch: EpochTime, +) -> Result<SignedPublicKey, KeyManagerError>

Get ephemeral public key for an epoch and a key pair id. Read more
source§

fn box_clone(&self) -> Box<dyn KeyManager>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/struct.SignedPublicKey.html b/rust/oasis_runtime_sdk/testing/keymanager/struct.SignedPublicKey.html new file mode 100644 index 0000000000..ab8185d5eb --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/struct.SignedPublicKey.html @@ -0,0 +1,57 @@ +SignedPublicKey in oasis_runtime_sdk::testing::keymanager - Rust
pub struct SignedPublicKey {
+    pub key: PublicKey,
+    pub checksum: Vec<u8>,
+    pub signature: Signature,
+    pub expiration: Option<u64>,
+}
Expand description

Signed public key.

+

Fields§

§key: PublicKey

Public key.

+
§checksum: Vec<u8>

Checksum of the key manager state.

+
§signature: Signature

Sign(sk, (key || checksum || runtime id || key pair id || epoch || expiration epoch)) from +the key manager.

+
§expiration: Option<u64>

Expiration epoch.

+

Implementations§

§

impl SignedPublicKey

pub fn new( + key: PublicKey, + checksum: Vec<u8>, + runtime_id: Namespace, + key_pair_id: KeyPairId, + epoch: Option<u64>, + signer: &Arc<dyn Signer>, +) -> Result<SignedPublicKey, Error>

Create a new signed public key.

+

pub fn verify( + &self, + runtime_id: Namespace, + key_pair_id: KeyPairId, + epoch: Option<u64>, + now: Option<u64>, + pk: &PublicKey, +) -> Result<(), Error>

Verify the signature.

+

Trait Implementations§

§

impl Clone for SignedPublicKey

§

fn clone(&self) -> SignedPublicKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for SignedPublicKey

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for SignedPublicKey

§

fn try_default() -> Result<SignedPublicKey, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<SignedPublicKey, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for SignedPublicKey

§

fn default() -> SignedPublicKey

Returns the “default value” for a type. Read more
§

impl Encode for SignedPublicKey

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl EncodeAsMap for SignedPublicKey

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
§

impl PartialEq for SignedPublicKey

§

fn eq(&self, other: &SignedPublicKey) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl Eq for SignedPublicKey

§

impl StructuralPartialEq for SignedPublicKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/struct.StateKey.html b/rust/oasis_runtime_sdk/testing/keymanager/struct.StateKey.html new file mode 100644 index 0000000000..a5060bfe4e --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/struct.StateKey.html @@ -0,0 +1,31 @@ +StateKey in oasis_runtime_sdk::testing::keymanager - Rust

Struct oasis_runtime_sdk::testing::keymanager::StateKey

pub struct StateKey(pub [u8; 32]);
Expand description

A state encryption key.

+

Tuple Fields§

§0: [u8; 32]

Trait Implementations§

§

impl AsRef<[u8]> for StateKey

§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for StateKey

§

fn clone(&self) -> StateKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Decode for StateKey

§

fn try_default() -> Result<StateKey, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<StateKey, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for StateKey

§

fn default() -> StateKey

Returns the “default value” for a type. Read more
§

impl Drop for StateKey

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl Encode for StateKey

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl Zeroize for StateKey

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the +zeroization operation is not “optimized away” by the compiler.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keymanager/struct.TrustedSigners.html b/rust/oasis_runtime_sdk/testing/keymanager/struct.TrustedSigners.html new file mode 100644 index 0000000000..3123a8cb78 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keymanager/struct.TrustedSigners.html @@ -0,0 +1,37 @@ +TrustedSigners in oasis_runtime_sdk::testing::keymanager - Rust

Struct oasis_runtime_sdk::testing::keymanager::TrustedSigners

pub struct TrustedSigners {
+    pub signers: HashSet<PublicKey>,
+    pub threshold: u64,
+}
Expand description

Set of trusted key manager signing keys.

+

Fields§

§signers: HashSet<PublicKey>

Set of trusted signers.

+
§threshold: u64

Threshold for determining if enough valid signatures are present.

+

Implementations§

§

impl TrustedSigners

pub fn verify<'a, P>( + &self, + signed_data: &'a impl SignedData<P>, +) -> Result<&'a P, Error>

Verifies that signed data has valid signatures and that enough of them +are from trusted signers.

+

Trait Implementations§

§

impl Clone for TrustedSigners

§

fn clone(&self) -> TrustedSigners

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for TrustedSigners

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Decode for TrustedSigners

§

fn try_default() -> Result<TrustedSigners, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<TrustedSigners, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
§

impl Default for TrustedSigners

§

fn default() -> TrustedSigners

Returns the “default value” for a type. Read more
§

impl Encode for TrustedSigners

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

impl EncodeAsMap for TrustedSigners

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/alice/fn.address.html b/rust/oasis_runtime_sdk/testing/keys/alice/fn.address.html new file mode 100644 index 0000000000..491e052b75 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/alice/fn.address.html @@ -0,0 +1,4 @@ +address in oasis_runtime_sdk::testing::keys::alice - Rust

Function oasis_runtime_sdk::testing::keys::alice::address

source ·
pub fn address() -> Address
Expand description

Test address +A +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/alice/fn.pk.html b/rust/oasis_runtime_sdk/testing/keys/alice/fn.pk.html new file mode 100644 index 0000000000..9821a82972 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/alice/fn.pk.html @@ -0,0 +1,4 @@ +pk in oasis_runtime_sdk::testing::keys::alice - Rust

Function oasis_runtime_sdk::testing::keys::alice::pk

source ·
pub fn pk() -> PublicKey
Expand description

Test public key +A +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/alice/fn.pk_ed25519.html b/rust/oasis_runtime_sdk/testing/keys/alice/fn.pk_ed25519.html new file mode 100644 index 0000000000..ae71617718 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/alice/fn.pk_ed25519.html @@ -0,0 +1,4 @@ +pk_ed25519 in oasis_runtime_sdk::testing::keys::alice - Rust

Function oasis_runtime_sdk::testing::keys::alice::pk_ed25519

source ·
pub fn pk_ed25519() -> PublicKey
Expand description

Test Ed25519 public key +A +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/alice/fn.sigspec.html b/rust/oasis_runtime_sdk/testing/keys/alice/fn.sigspec.html new file mode 100644 index 0000000000..79404892f6 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/alice/fn.sigspec.html @@ -0,0 +1,4 @@ +sigspec in oasis_runtime_sdk::testing::keys::alice - Rust

Function oasis_runtime_sdk::testing::keys::alice::sigspec

source ·
pub fn sigspec() -> SignatureAddressSpec
Expand description

Test address derivation information +A +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/alice/index.html b/rust/oasis_runtime_sdk/testing/keys/alice/index.html new file mode 100644 index 0000000000..bac4973949 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/alice/index.html @@ -0,0 +1,12 @@ +oasis_runtime_sdk::testing::keys::alice - Rust

Module oasis_runtime_sdk::testing::keys::alice

source ·
Expand description

Test key +A +.

+

Functions§

  • Test address +A +.
  • Test public key +A +.
  • Test Ed25519 public key +A +.
  • Test address derivation information +A +.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/alice/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keys/alice/sidebar-items.js new file mode 100644 index 0000000000..5835359b69 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/alice/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address","pk","pk_ed25519","sigspec"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/bob/fn.address.html b/rust/oasis_runtime_sdk/testing/keys/bob/fn.address.html new file mode 100644 index 0000000000..a5ce4eb44c --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/bob/fn.address.html @@ -0,0 +1,4 @@ +address in oasis_runtime_sdk::testing::keys::bob - Rust

Function oasis_runtime_sdk::testing::keys::bob::address

source ·
pub fn address() -> Address
Expand description

Test address +B +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/bob/fn.pk.html b/rust/oasis_runtime_sdk/testing/keys/bob/fn.pk.html new file mode 100644 index 0000000000..05a0f0d255 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/bob/fn.pk.html @@ -0,0 +1,4 @@ +pk in oasis_runtime_sdk::testing::keys::bob - Rust

Function oasis_runtime_sdk::testing::keys::bob::pk

source ·
pub fn pk() -> PublicKey
Expand description

Test public key +B +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/bob/fn.pk_ed25519.html b/rust/oasis_runtime_sdk/testing/keys/bob/fn.pk_ed25519.html new file mode 100644 index 0000000000..334a1e9b28 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/bob/fn.pk_ed25519.html @@ -0,0 +1,4 @@ +pk_ed25519 in oasis_runtime_sdk::testing::keys::bob - Rust

Function oasis_runtime_sdk::testing::keys::bob::pk_ed25519

source ·
pub fn pk_ed25519() -> PublicKey
Expand description

Test Ed25519 public key +B +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/bob/fn.sigspec.html b/rust/oasis_runtime_sdk/testing/keys/bob/fn.sigspec.html new file mode 100644 index 0000000000..dda383db57 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/bob/fn.sigspec.html @@ -0,0 +1,4 @@ +sigspec in oasis_runtime_sdk::testing::keys::bob - Rust

Function oasis_runtime_sdk::testing::keys::bob::sigspec

source ·
pub fn sigspec() -> SignatureAddressSpec
Expand description

Test address derivation information +B +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/bob/index.html b/rust/oasis_runtime_sdk/testing/keys/bob/index.html new file mode 100644 index 0000000000..7d39de72f3 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/bob/index.html @@ -0,0 +1,12 @@ +oasis_runtime_sdk::testing::keys::bob - Rust

Module oasis_runtime_sdk::testing::keys::bob

source ·
Expand description

Test key +B +.

+

Functions§

  • Test address +B +.
  • Test public key +B +.
  • Test Ed25519 public key +B +.
  • Test address derivation information +B +.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/bob/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keys/bob/sidebar-items.js new file mode 100644 index 0000000000..5835359b69 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/bob/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address","pk","pk_ed25519","sigspec"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/charlie/fn.address.html b/rust/oasis_runtime_sdk/testing/keys/charlie/fn.address.html new file mode 100644 index 0000000000..f990aa0eb4 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/charlie/fn.address.html @@ -0,0 +1,4 @@ +address in oasis_runtime_sdk::testing::keys::charlie - Rust

Function oasis_runtime_sdk::testing::keys::charlie::address

source ·
pub fn address() -> Address
Expand description

Test address +C +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/charlie/fn.pk.html b/rust/oasis_runtime_sdk/testing/keys/charlie/fn.pk.html new file mode 100644 index 0000000000..e6b0e9804d --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/charlie/fn.pk.html @@ -0,0 +1,4 @@ +pk in oasis_runtime_sdk::testing::keys::charlie - Rust

Function oasis_runtime_sdk::testing::keys::charlie::pk

source ·
pub fn pk() -> PublicKey
Expand description

Test public key +C +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/charlie/fn.pk_ed25519.html b/rust/oasis_runtime_sdk/testing/keys/charlie/fn.pk_ed25519.html new file mode 100644 index 0000000000..8d7809a21e --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/charlie/fn.pk_ed25519.html @@ -0,0 +1,4 @@ +pk_ed25519 in oasis_runtime_sdk::testing::keys::charlie - Rust

Function oasis_runtime_sdk::testing::keys::charlie::pk_ed25519

source ·
pub fn pk_ed25519() -> PublicKey
Expand description

Test Ed25519 public key +C +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/charlie/fn.sigspec.html b/rust/oasis_runtime_sdk/testing/keys/charlie/fn.sigspec.html new file mode 100644 index 0000000000..1a6764d3e1 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/charlie/fn.sigspec.html @@ -0,0 +1,4 @@ +sigspec in oasis_runtime_sdk::testing::keys::charlie - Rust

Function oasis_runtime_sdk::testing::keys::charlie::sigspec

source ·
pub fn sigspec() -> SignatureAddressSpec
Expand description

Test address derivation information +C +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/charlie/index.html b/rust/oasis_runtime_sdk/testing/keys/charlie/index.html new file mode 100644 index 0000000000..1a79a05439 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/charlie/index.html @@ -0,0 +1,12 @@ +oasis_runtime_sdk::testing::keys::charlie - Rust

Module oasis_runtime_sdk::testing::keys::charlie

source ·
Expand description

Test key +C +.

+

Functions§

  • Test address +C +.
  • Test public key +C +.
  • Test Ed25519 public key +C +.
  • Test address derivation information +C +.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/charlie/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keys/charlie/sidebar-items.js new file mode 100644 index 0000000000..5835359b69 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/charlie/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address","pk","pk_ed25519","sigspec"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/dave/fn.address.html b/rust/oasis_runtime_sdk/testing/keys/dave/fn.address.html new file mode 100644 index 0000000000..405ceba976 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/dave/fn.address.html @@ -0,0 +1,4 @@ +address in oasis_runtime_sdk::testing::keys::dave - Rust

Function oasis_runtime_sdk::testing::keys::dave::address

source ·
pub fn address() -> Address
Expand description

Test address +D +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/dave/fn.pk.html b/rust/oasis_runtime_sdk/testing/keys/dave/fn.pk.html new file mode 100644 index 0000000000..a20a3f84dc --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/dave/fn.pk.html @@ -0,0 +1,4 @@ +pk in oasis_runtime_sdk::testing::keys::dave - Rust

Function oasis_runtime_sdk::testing::keys::dave::pk

source ·
pub fn pk() -> PublicKey
Expand description

Test public key +D +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/dave/fn.pk_secp256k1.html b/rust/oasis_runtime_sdk/testing/keys/dave/fn.pk_secp256k1.html new file mode 100644 index 0000000000..28acc7d692 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/dave/fn.pk_secp256k1.html @@ -0,0 +1,4 @@ +pk_secp256k1 in oasis_runtime_sdk::testing::keys::dave - Rust

Function oasis_runtime_sdk::testing::keys::dave::pk_secp256k1

source ·
pub fn pk_secp256k1() -> PublicKey
Expand description

Test Secp256k1 public key +D +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/dave/fn.sigspec.html b/rust/oasis_runtime_sdk/testing/keys/dave/fn.sigspec.html new file mode 100644 index 0000000000..d1fc7da87a --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/dave/fn.sigspec.html @@ -0,0 +1,4 @@ +sigspec in oasis_runtime_sdk::testing::keys::dave - Rust

Function oasis_runtime_sdk::testing::keys::dave::sigspec

source ·
pub fn sigspec() -> SignatureAddressSpec
Expand description

Test address derivation information +D +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/dave/index.html b/rust/oasis_runtime_sdk/testing/keys/dave/index.html new file mode 100644 index 0000000000..8e5fb9a95e --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/dave/index.html @@ -0,0 +1,12 @@ +oasis_runtime_sdk::testing::keys::dave - Rust

Module oasis_runtime_sdk::testing::keys::dave

source ·
Expand description

Test key +D +.

+

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/dave/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keys/dave/sidebar-items.js new file mode 100644 index 0000000000..4999413e18 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/dave/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address","pk","pk_secp256k1","sigspec"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/erin/fn.address.html b/rust/oasis_runtime_sdk/testing/keys/erin/fn.address.html new file mode 100644 index 0000000000..508291c8af --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/erin/fn.address.html @@ -0,0 +1,4 @@ +address in oasis_runtime_sdk::testing::keys::erin - Rust

Function oasis_runtime_sdk::testing::keys::erin::address

source ·
pub fn address() -> Address
Expand description

Test address +E +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/erin/fn.pk.html b/rust/oasis_runtime_sdk/testing/keys/erin/fn.pk.html new file mode 100644 index 0000000000..8eb5d75480 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/erin/fn.pk.html @@ -0,0 +1,4 @@ +pk in oasis_runtime_sdk::testing::keys::erin - Rust

Function oasis_runtime_sdk::testing::keys::erin::pk

source ·
pub fn pk() -> PublicKey
Expand description

Test public key +E +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/erin/fn.pk_secp256k1.html b/rust/oasis_runtime_sdk/testing/keys/erin/fn.pk_secp256k1.html new file mode 100644 index 0000000000..8c8beb6e47 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/erin/fn.pk_secp256k1.html @@ -0,0 +1,4 @@ +pk_secp256k1 in oasis_runtime_sdk::testing::keys::erin - Rust

Function oasis_runtime_sdk::testing::keys::erin::pk_secp256k1

source ·
pub fn pk_secp256k1() -> PublicKey
Expand description

Test Secp256k1 public key +E +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/erin/fn.sigspec.html b/rust/oasis_runtime_sdk/testing/keys/erin/fn.sigspec.html new file mode 100644 index 0000000000..97a8debcb1 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/erin/fn.sigspec.html @@ -0,0 +1,4 @@ +sigspec in oasis_runtime_sdk::testing::keys::erin - Rust

Function oasis_runtime_sdk::testing::keys::erin::sigspec

source ·
pub fn sigspec() -> SignatureAddressSpec
Expand description

Test address derivation information +E +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/erin/index.html b/rust/oasis_runtime_sdk/testing/keys/erin/index.html new file mode 100644 index 0000000000..9ee79f90cc --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/erin/index.html @@ -0,0 +1,12 @@ +oasis_runtime_sdk::testing::keys::erin - Rust

Module oasis_runtime_sdk::testing::keys::erin

source ·
Expand description

Test key +E +.

+

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/erin/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keys/erin/sidebar-items.js new file mode 100644 index 0000000000..4999413e18 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/erin/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address","pk","pk_secp256k1","sigspec"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/frank/fn.address.html b/rust/oasis_runtime_sdk/testing/keys/frank/fn.address.html new file mode 100644 index 0000000000..7e7c60b93e --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/frank/fn.address.html @@ -0,0 +1,4 @@ +address in oasis_runtime_sdk::testing::keys::frank - Rust

Function oasis_runtime_sdk::testing::keys::frank::address

source ·
pub fn address() -> Address
Expand description

Test address +F +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/frank/fn.pk.html b/rust/oasis_runtime_sdk/testing/keys/frank/fn.pk.html new file mode 100644 index 0000000000..6e970bb707 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/frank/fn.pk.html @@ -0,0 +1,4 @@ +pk in oasis_runtime_sdk::testing::keys::frank - Rust

Function oasis_runtime_sdk::testing::keys::frank::pk

source ·
pub fn pk() -> PublicKey
Expand description

Test public key +F +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/frank/fn.pk_sr25519.html b/rust/oasis_runtime_sdk/testing/keys/frank/fn.pk_sr25519.html new file mode 100644 index 0000000000..4d46b6c927 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/frank/fn.pk_sr25519.html @@ -0,0 +1,4 @@ +pk_sr25519 in oasis_runtime_sdk::testing::keys::frank - Rust

Function oasis_runtime_sdk::testing::keys::frank::pk_sr25519

source ·
pub fn pk_sr25519() -> PublicKey
Expand description

Test Sr25519 public key +F +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/frank/fn.sigspec.html b/rust/oasis_runtime_sdk/testing/keys/frank/fn.sigspec.html new file mode 100644 index 0000000000..70f12674bd --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/frank/fn.sigspec.html @@ -0,0 +1,4 @@ +sigspec in oasis_runtime_sdk::testing::keys::frank - Rust

Function oasis_runtime_sdk::testing::keys::frank::sigspec

source ·
pub fn sigspec() -> SignatureAddressSpec
Expand description

Test address derivation information +F +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/frank/index.html b/rust/oasis_runtime_sdk/testing/keys/frank/index.html new file mode 100644 index 0000000000..433486b355 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/frank/index.html @@ -0,0 +1,12 @@ +oasis_runtime_sdk::testing::keys::frank - Rust

Module oasis_runtime_sdk::testing::keys::frank

source ·
Expand description

Test key +F +.

+

Functions§

  • Test address +F +.
  • Test public key +F +.
  • Test Sr25519 public key +F +.
  • Test address derivation information +F +.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/frank/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keys/frank/sidebar-items.js new file mode 100644 index 0000000000..c9caf271c7 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/frank/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address","pk","pk_sr25519","sigspec"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/grace/fn.address.html b/rust/oasis_runtime_sdk/testing/keys/grace/fn.address.html new file mode 100644 index 0000000000..d7640df7b5 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/grace/fn.address.html @@ -0,0 +1,4 @@ +address in oasis_runtime_sdk::testing::keys::grace - Rust

Function oasis_runtime_sdk::testing::keys::grace::address

source ·
pub fn address() -> Address
Expand description

Test address +G +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/grace/fn.pk.html b/rust/oasis_runtime_sdk/testing/keys/grace/fn.pk.html new file mode 100644 index 0000000000..4874a6639f --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/grace/fn.pk.html @@ -0,0 +1,4 @@ +pk in oasis_runtime_sdk::testing::keys::grace - Rust

Function oasis_runtime_sdk::testing::keys::grace::pk

source ·
pub fn pk() -> PublicKey
Expand description

Test public key +G +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/grace/fn.pk_sr25519.html b/rust/oasis_runtime_sdk/testing/keys/grace/fn.pk_sr25519.html new file mode 100644 index 0000000000..a807b6f7ba --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/grace/fn.pk_sr25519.html @@ -0,0 +1,4 @@ +pk_sr25519 in oasis_runtime_sdk::testing::keys::grace - Rust

Function oasis_runtime_sdk::testing::keys::grace::pk_sr25519

source ·
pub fn pk_sr25519() -> PublicKey
Expand description

Test Sr25519 public key +G +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/grace/fn.sigspec.html b/rust/oasis_runtime_sdk/testing/keys/grace/fn.sigspec.html new file mode 100644 index 0000000000..1578fce428 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/grace/fn.sigspec.html @@ -0,0 +1,4 @@ +sigspec in oasis_runtime_sdk::testing::keys::grace - Rust

Function oasis_runtime_sdk::testing::keys::grace::sigspec

source ·
pub fn sigspec() -> SignatureAddressSpec
Expand description

Test address derivation information +G +.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/grace/index.html b/rust/oasis_runtime_sdk/testing/keys/grace/index.html new file mode 100644 index 0000000000..86db90e6c0 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/grace/index.html @@ -0,0 +1,12 @@ +oasis_runtime_sdk::testing::keys::grace - Rust

Module oasis_runtime_sdk::testing::keys::grace

source ·
Expand description

Test key +G +.

+

Functions§

  • Test address +G +.
  • Test public key +G +.
  • Test Sr25519 public key +G +.
  • Test address derivation information +G +.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/grace/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keys/grace/sidebar-items.js new file mode 100644 index 0000000000..c9caf271c7 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/grace/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["address","pk","pk_sr25519","sigspec"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/index.html b/rust/oasis_runtime_sdk/testing/keys/index.html new file mode 100644 index 0000000000..4f33767380 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/index.html @@ -0,0 +1,16 @@ +oasis_runtime_sdk::testing::keys - Rust

Module oasis_runtime_sdk::testing::keys

source ·
Expand description

Module that contains known test keys.

+

Modules§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/keys/sidebar-items.js b/rust/oasis_runtime_sdk/testing/keys/sidebar-items.js new file mode 100644 index 0000000000..c2e468ba23 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/keys/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["alice","bob","charlie","dave","erin","frank","grace"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/fn.empty_store.html b/rust/oasis_runtime_sdk/testing/mock/fn.empty_store.html new file mode 100644 index 0000000000..b7a8fb4d35 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/fn.empty_store.html @@ -0,0 +1,2 @@ +empty_store in oasis_runtime_sdk::testing::mock - Rust

Function oasis_runtime_sdk::testing::mock::empty_store

source ·
pub fn empty_store() -> MKVSStore<OverlayTree<Tree>>
Expand description

Create an empty MKVS store.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/fn.transaction.html b/rust/oasis_runtime_sdk/testing/mock/fn.transaction.html new file mode 100644 index 0000000000..70e101b035 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/fn.transaction.html @@ -0,0 +1,2 @@ +transaction in oasis_runtime_sdk::testing::mock - Rust

Function oasis_runtime_sdk::testing::mock::transaction

source ·
pub fn transaction() -> Transaction
Expand description

Create a new mock transaction.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/index.html b/rust/oasis_runtime_sdk/testing/mock/index.html new file mode 100644 index 0000000000..c0592edb77 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::testing::mock - Rust

Module oasis_runtime_sdk::testing::mock

source ·
Expand description

Mock dispatch context for use in tests.

+

Structs§

  • Options that can be used during mock signer calls.
  • A mock runtime that only has the core module.
  • Mock dispatch context factory.
  • A mock signer for use during tests.

Functions§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/sidebar-items.js b/rust/oasis_runtime_sdk/testing/mock/sidebar-items.js new file mode 100644 index 0000000000..5835145e44 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["empty_store","transaction"],"struct":["CallOptions","Config","EmptyRuntime","Mock","Signer"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/struct.CallOptions.html b/rust/oasis_runtime_sdk/testing/mock/struct.CallOptions.html new file mode 100644 index 0000000000..a582d2e6ab --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/struct.CallOptions.html @@ -0,0 +1,28 @@ +CallOptions in oasis_runtime_sdk::testing::mock - Rust

Struct oasis_runtime_sdk::testing::mock::CallOptions

source ·
pub struct CallOptions {
+    pub fee: Fee,
+    pub encrypted: bool,
+}
Expand description

Options that can be used during mock signer calls.

+

Fields§

§fee: Fee

Transaction fee.

+
§encrypted: bool

Should the call be encrypted.

+

Trait Implementations§

source§

impl Clone for CallOptions

source§

fn clone(&self) -> CallOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CallOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/struct.Config.html b/rust/oasis_runtime_sdk/testing/mock/struct.Config.html new file mode 100644 index 0000000000..782ade9b25 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/struct.Config.html @@ -0,0 +1,22 @@ +Config in oasis_runtime_sdk::testing::mock - Rust

Struct oasis_runtime_sdk::testing::mock::Config

source ·
pub struct Config;

Trait Implementations§

source§

impl Config for Config

source§

const DEFAULT_LOCAL_MIN_GAS_PRICE: Lazy<BTreeMap<Denomination, u128>> = _

Default local minimum gas price configuration that is used in case no overrides are set in +local per-node configuration.
source§

const DEFAULT_LOCAL_ESTIMATE_GAS_SEARCH_MAX_ITERS: u64 = 0u64

Default local estimate gas max search iterations configuration that is used in case no overrides +are set in the local per-node configuration.
source§

const ESTIMATE_GAS_EXTRA_FAIL: Lazy<BTreeMap<&'static str, u64>> = _

Estimated gas amount to be added to failed transaction simulations for selected methods.
source§

const MIN_GAS_PRICE_EXEMPT_METHODS: Lazy<BTreeSet<&'static str>> = _

Methods which are exempt from minimum gas price requirements.
source§

const EMIT_GAS_USED_EVENTS: bool = true

Whether gas used events should be emitted for every transaction. Read more
source§

const ALLOW_INTERACTIVE_READ_ONLY_TRANSACTIONS: bool = false

Whether to allow submission of read-only transactions in an interactive way. Read more
source§

const GAS_COST_CALL_CALLDATA_PUBLIC_KEY: u64 = 20u64

The gas cost of the internal call to retrieve the current calldata public key.
source§

const GAS_COST_CALL_CURRENT_EPOCH: u64 = 10u64

The gas cost of the internal call to retrieve the current epoch.

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/struct.EmptyRuntime.html b/rust/oasis_runtime_sdk/testing/mock/struct.EmptyRuntime.html new file mode 100644 index 0000000000..76b252680b --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/struct.EmptyRuntime.html @@ -0,0 +1,25 @@ +EmptyRuntime in oasis_runtime_sdk::testing::mock - Rust

Struct oasis_runtime_sdk::testing::mock::EmptyRuntime

source ·
pub struct EmptyRuntime;
Expand description

A mock runtime that only has the core module.

+

Trait Implementations§

source§

impl Runtime for EmptyRuntime

source§

const VERSION: Version = _

Runtime version.
§

type Core = Module<Config>

Module that provides the core API.
§

type Accounts = Module

Module that provides the accounts API.
§

type Modules = Module<Config>

Supported modules.
source§

fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis

Genesis state for the runtime.
source§

const STATE_VERSION: u32 = 0u32

State version.
source§

const PREFETCH_LIMIT: u16 = 0u16

Prefetch limit. To enable prefetch set it to a non-zero value.
source§

const SCHEDULE_CONTROL: ScheduleControl = _

Runtime schedule control configuration.
§

type FeeProxy = ()

Handler for proxy fee payments.
source§

fn trusted_signers() -> Option<TrustedSigners>

Return the trusted signers for this runtime; if None, a key manager connection will not be +established on startup.
source§

fn consensus_trust_root() -> Option<TrustRoot>

Return the consensus layer trust root for this runtime; if None, consensus layer integrity +verification will not be performed.
source§

fn migrate_state<C: Context>(_ctx: &C)

Perform runtime-specific state migration. This method is only called when the recorded +state version does not match STATE_VERSION.
source§

fn is_allowed_query(_method: &str) -> bool

Whether a given query method is allowed to be invoked.
source§

fn is_allowed_private_km_query(_method: &str) -> bool

Whether a given query method is allowed to access private key manager state. Read more
source§

fn is_allowed_interactive_call(_method: &str) -> bool

Whether a given call is allowed to be invoked interactively. Read more
source§

fn migrate<C: Context>(ctx: &C)

Perform state migrations if required.
source§

fn start()
where + Self: Sized + Send + Sync + 'static,

Start the runtime.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/struct.Mock.html b/rust/oasis_runtime_sdk/testing/mock/struct.Mock.html new file mode 100644 index 0000000000..6222ba6cdd --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/struct.Mock.html @@ -0,0 +1,34 @@ +Mock in oasis_runtime_sdk::testing::mock - Rust

Struct oasis_runtime_sdk::testing::mock::Mock

source ·
pub struct Mock {
+    pub host_info: HostInfo,
+    pub runtime_header: Header,
+    pub runtime_round_results: RoundResults,
+    pub consensus_state: ConsensusState,
+    pub history: Box<dyn HistoryHost>,
+    pub epoch: EpochTime,
+    pub max_messages: u32,
+}
Expand description

Mock dispatch context factory.

+

Fields§

§host_info: HostInfo§runtime_header: Header§runtime_round_results: RoundResults§consensus_state: ConsensusState§history: Box<dyn HistoryHost>§epoch: EpochTime§max_messages: u32

Implementations§

source§

impl Mock

source

pub fn create_ctx(&mut self) -> RuntimeBatchContext<'_, EmptyRuntime>

Create a new mock dispatch context.

+
source

pub fn create_ctx_for_runtime<R: Runtime>( + &mut self, + confidential: bool, +) -> RuntimeBatchContext<'_, R>

Create a new mock dispatch context.

+
source

pub fn with_local_config(local_config: BTreeMap<String, Value>) -> Self

Create an instance with the given local configuration.

+

Trait Implementations§

source§

impl Default for Mock

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for Mock

§

impl !RefUnwindSafe for Mock

§

impl !Send for Mock

§

impl !Sync for Mock

§

impl Unpin for Mock

§

impl !UnwindSafe for Mock

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/mock/struct.Signer.html b/rust/oasis_runtime_sdk/testing/mock/struct.Signer.html new file mode 100644 index 0000000000..a40ac35460 --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/mock/struct.Signer.html @@ -0,0 +1,44 @@ +Signer in oasis_runtime_sdk::testing::mock - Rust

Struct oasis_runtime_sdk::testing::mock::Signer

source ·
pub struct Signer { /* private fields */ }
Expand description

A mock signer for use during tests.

+

Implementations§

source§

impl Signer

source

pub fn new(nonce: u64, sigspec: SignatureAddressSpec) -> Self

Create a new mock signer using the given nonce and signature spec.

+
source

pub fn sigspec(&self) -> &SignatureAddressSpec

Address specification for this signer.

+
source

pub fn call<C, B>(&mut self, ctx: &C, method: &str, body: B) -> DispatchResult
where + C: Context, + B: Encode,

Dispatch a call to the given method.

+
source

pub fn call_opts<C, B>( + &mut self, + ctx: &C, + method: &str, + body: B, + opts: CallOptions, +) -> DispatchResult
where + C: Context, + B: Encode,

Dispatch a call to the given method with the given options.

+
source

pub fn query<C, A, R>( + &self, + ctx: &C, + method: &str, + args: A, +) -> Result<R, RuntimeError>
where + C: Context, + A: Encode, + R: Decode,

Dispatch a query to the given method.

+

Auto Trait Implementations§

§

impl Freeze for Signer

§

impl RefUnwindSafe for Signer

§

impl Send for Signer

§

impl Sync for Signer

§

impl Unpin for Signer

§

impl UnwindSafe for Signer

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/testing/sidebar-items.js b/rust/oasis_runtime_sdk/testing/sidebar-items.js new file mode 100644 index 0000000000..559583d5cb --- /dev/null +++ b/rust/oasis_runtime_sdk/testing/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["keymanager","keys","mock"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_BECH32_HRP.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_BECH32_HRP.html new file mode 100644 index 0000000000..8afff6fa77 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_BECH32_HRP.html @@ -0,0 +1,2 @@ +ADDRESS_BECH32_HRP in oasis_runtime_sdk::types::address - Rust

Constant oasis_runtime_sdk::types::address::ADDRESS_BECH32_HRP

source ·
pub const ADDRESS_BECH32_HRP: Hrp;
Expand description

Human readable part for Bech32-encoded addresses.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_RUNTIME_V0_CONTEXT.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_RUNTIME_V0_CONTEXT.html new file mode 100644 index 0000000000..cf328094b6 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_RUNTIME_V0_CONTEXT.html @@ -0,0 +1,2 @@ +ADDRESS_RUNTIME_V0_CONTEXT in oasis_runtime_sdk::types::address - Rust
pub const ADDRESS_RUNTIME_V0_CONTEXT: &[u8] = b"oasis-core/address: runtime";
Expand description

V0 runtime address context.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_RUNTIME_V0_VERSION.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_RUNTIME_V0_VERSION.html new file mode 100644 index 0000000000..e612386abc --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_RUNTIME_V0_VERSION.html @@ -0,0 +1,2 @@ +ADDRESS_RUNTIME_V0_VERSION in oasis_runtime_sdk::types::address - Rust
pub const ADDRESS_RUNTIME_V0_VERSION: u8 = 0;
Expand description

V0 runtime address version.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_ED25519_CONTEXT.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_ED25519_CONTEXT.html new file mode 100644 index 0000000000..0a296a1b5e --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_ED25519_CONTEXT.html @@ -0,0 +1,2 @@ +ADDRESS_V0_ED25519_CONTEXT in oasis_runtime_sdk::types::address - Rust
pub const ADDRESS_V0_ED25519_CONTEXT: &[u8] = b"oasis-core/address: staking";
Expand description

V0 Ed25519 addres context (shared with consensus layer).

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_MODULE_CONTEXT.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_MODULE_CONTEXT.html new file mode 100644 index 0000000000..9fd8ef74e8 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_MODULE_CONTEXT.html @@ -0,0 +1,2 @@ +ADDRESS_V0_MODULE_CONTEXT in oasis_runtime_sdk::types::address - Rust
pub const ADDRESS_V0_MODULE_CONTEXT: &[u8] = b"oasis-runtime-sdk/address: module";
Expand description

V0 module address context.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_MULTISIG_CONTEXT.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_MULTISIG_CONTEXT.html new file mode 100644 index 0000000000..a9f97c6096 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_MULTISIG_CONTEXT.html @@ -0,0 +1,2 @@ +ADDRESS_V0_MULTISIG_CONTEXT in oasis_runtime_sdk::types::address - Rust
pub const ADDRESS_V0_MULTISIG_CONTEXT: &[u8] = b"oasis-runtime-sdk/address: multisig";
Expand description

V0 multisig address context.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_SECP256K1ETH_CONTEXT.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_SECP256K1ETH_CONTEXT.html new file mode 100644 index 0000000000..996da95fe1 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_SECP256K1ETH_CONTEXT.html @@ -0,0 +1,2 @@ +ADDRESS_V0_SECP256K1ETH_CONTEXT in oasis_runtime_sdk::types::address - Rust
pub const ADDRESS_V0_SECP256K1ETH_CONTEXT: &[u8] = b"oasis-runtime-sdk/address: secp256k1eth";
Expand description

V0 Secp256k1 address context.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_SR25519_CONTEXT.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_SR25519_CONTEXT.html new file mode 100644 index 0000000000..1439dda6c3 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_SR25519_CONTEXT.html @@ -0,0 +1,2 @@ +ADDRESS_V0_SR25519_CONTEXT in oasis_runtime_sdk::types::address - Rust
pub const ADDRESS_V0_SR25519_CONTEXT: &[u8] = b"oasis-runtime-sdk/address: sr25519";
Expand description

V0 Sr25519 address context.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_VERSION.html b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_VERSION.html new file mode 100644 index 0000000000..8f14436cc5 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/constant.ADDRESS_V0_VERSION.html @@ -0,0 +1,2 @@ +ADDRESS_V0_VERSION in oasis_runtime_sdk::types::address - Rust

Constant oasis_runtime_sdk::types::address::ADDRESS_V0_VERSION

source ·
pub const ADDRESS_V0_VERSION: u8 = 0;
Expand description

V0 address version.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/enum.Error.html b/rust/oasis_runtime_sdk/types/address/enum.Error.html new file mode 100644 index 0000000000..cf76187cd5 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/enum.Error.html @@ -0,0 +1,24 @@ +Error in oasis_runtime_sdk::types::address - Rust

Enum oasis_runtime_sdk::types::address::Error

source ·
pub enum Error {
+    MalformedAddress,
+}
Expand description

Error.

+

Variants§

§

MalformedAddress

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/enum.SignatureAddressSpec.html b/rust/oasis_runtime_sdk/types/address/enum.SignatureAddressSpec.html new file mode 100644 index 0000000000..021a9355da --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/enum.SignatureAddressSpec.html @@ -0,0 +1,42 @@ +SignatureAddressSpec in oasis_runtime_sdk::types::address - Rust
pub enum SignatureAddressSpec {
+    Ed25519(PublicKey),
+    Secp256k1Eth(PublicKey),
+    Sr25519(PublicKey),
+}
Expand description

Information for signature-based authentication and public key-based address derivation.

+

Variants§

§

Ed25519(PublicKey)

Ed25519 address derivation compatible with the consensus layer.

+
§

Secp256k1Eth(PublicKey)

Ethereum-compatible address derivation from Secp256k1 public keys.

+
§

Sr25519(PublicKey)

Sr25519 address derivation.

+

Implementations§

source§

impl SignatureAddressSpec

source

pub fn try_from_pk(pk: &PublicKey) -> Option<Self>

Try to construct an authentication/address derivation specification from the given public +key. In case the given scheme is not supported, it returns None.

+
source

pub fn public_key(&self) -> PublicKey

Public key of the authentication/address derivation specification.

+

Trait Implementations§

source§

impl Clone for SignatureAddressSpec

source§

fn clone(&self) -> SignatureAddressSpec

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SignatureAddressSpec

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignatureAddressSpec

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for SignatureAddressSpec

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SignatureAddressSpec

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl PartialEq for SignatureAddressSpec

source§

fn eq(&self, other: &SignatureAddressSpec) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Eq for SignatureAddressSpec

source§

impl StructuralPartialEq for SignatureAddressSpec

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/index.html b/rust/oasis_runtime_sdk/types/address/index.html new file mode 100644 index 0000000000..f0e3f93ec1 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::types::address - Rust

Module oasis_runtime_sdk::types::address

source ·
Expand description

Account address type.

+

Structs§

Enums§

Constants§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/sidebar-items.js b/rust/oasis_runtime_sdk/types/address/sidebar-items.js new file mode 100644 index 0000000000..d1fa47e876 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["ADDRESS_BECH32_HRP","ADDRESS_RUNTIME_V0_CONTEXT","ADDRESS_RUNTIME_V0_VERSION","ADDRESS_V0_ED25519_CONTEXT","ADDRESS_V0_MODULE_CONTEXT","ADDRESS_V0_MULTISIG_CONTEXT","ADDRESS_V0_SECP256K1ETH_CONTEXT","ADDRESS_V0_SR25519_CONTEXT","ADDRESS_V0_VERSION"],"enum":["Error","SignatureAddressSpec"],"struct":["Address"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/address/struct.Address.html b/rust/oasis_runtime_sdk/types/address/struct.Address.html new file mode 100644 index 0000000000..73454fd43a --- /dev/null +++ b/rust/oasis_runtime_sdk/types/address/struct.Address.html @@ -0,0 +1,65 @@ +Address in oasis_runtime_sdk::types::address - Rust

Struct oasis_runtime_sdk::types::address::Address

source ·
pub struct Address(/* private fields */);
Expand description

An account address.

+

Implementations§

source§

impl Address

source

pub const SIZE: usize = 21usize

Size of an address in bytes.

+
source

pub fn new(ctx: &'static [u8], version: u8, data: &[u8]) -> Self

Creates a new address from a context, version and data.

+
source

pub fn from_bytes(data: &[u8]) -> Result<Self, Error>

Tries to create a new address from raw bytes.

+
source

pub fn into_bytes(self) -> [u8; 21]

Convert the address into raw bytes.

+
source

pub fn from_module(module: &str, kind: &str) -> Self

Creates a new address for a specific module and kind.

+
source

pub fn from_module_raw(module: &str, kind: &[u8]) -> Self

Creates a new address for a specific module and raw kind.

+
source

pub fn from_runtime_id(id: &Namespace) -> Self

Creates a new runtime address.

+
source

pub fn from_sigspec(spec: &SignatureAddressSpec) -> Self

Creates a new address from a public key.

+
source

pub fn from_multisig(config: Config) -> Self

Creates a new address from a multisig configuration.

+
source

pub fn from_eth(eth_address: &[u8]) -> Self

Creates a new address from an Ethereum-compatible address.

+
source

pub fn from_consensus_pk(pk: &ConsensusPublicKey) -> Self

Creates a new address from a consensus-layer Ed25519 public key.

+

This is a convenience wrapper and the same result can be obtained by going via the +from_sigspec method using the same Ed25519 public key.

+
source

pub fn from_bech32(data: &str) -> Result<Self, Error>

Tries to create a new address from Bech32-encoded string.

+
source

pub fn to_bech32(self) -> String

Converts an address to Bech32 representation.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Address

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Address

source§

fn clone(&self) -> Address

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Address

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Address

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Address

source§

fn default() -> Address

Returns the “default value” for a type. Read more
source§

impl Display for Address

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Address

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<&'static str> for Address

source§

fn from(s: &'static str) -> Self

Converts to this type from the input type.
source§

impl From<Address> for Address

source§

fn from(addr: Address) -> ConsensusAddress

Converts to this type from the input type.
source§

impl Hash for Address

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for Address

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Address

source§

fn cmp(&self, other: &Address) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Address

source§

fn eq(&self, other: &Address) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Address

source§

fn partial_cmp(&self, other: &Address) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl TryFrom<&[u8]> for Address

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Value for Address

source§

fn serialize( + &self, + _record: &Record<'_>, + key: Key, + serializer: &mut dyn Serializer, +) -> Result

Serialize self into Serializer Read more
source§

impl Copy for Address

source§

impl Eq for Address

source§

impl StructuralPartialEq for Address

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/callformat/constant.CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE.html b/rust/oasis_runtime_sdk/types/callformat/constant.CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE.html new file mode 100644 index 0000000000..82866e8895 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/callformat/constant.CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE.html @@ -0,0 +1,2 @@ +CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE in oasis_runtime_sdk::types::callformat - Rust
pub const CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE: &[u8] = b"oasis-runtime-sdk/private: tx";
Expand description

Call data key pair ID domain separation context base.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/callformat/index.html b/rust/oasis_runtime_sdk/types/callformat/index.html new file mode 100644 index 0000000000..eb155c8b13 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/callformat/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::types::callformat - Rust

Module oasis_runtime_sdk::types::callformat

source ·
Expand description

Types related to call formats.

+

Structs§

Constants§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/callformat/sidebar-items.js b/rust/oasis_runtime_sdk/types/callformat/sidebar-items.js new file mode 100644 index 0000000000..2b7307ed4b --- /dev/null +++ b/rust/oasis_runtime_sdk/types/callformat/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE"],"struct":["CallEnvelopeX25519DeoxysII","ResultEnvelopeX25519DeoxysII"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/callformat/struct.CallEnvelopeX25519DeoxysII.html b/rust/oasis_runtime_sdk/types/callformat/struct.CallEnvelopeX25519DeoxysII.html new file mode 100644 index 0000000000..dc75674020 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/callformat/struct.CallEnvelopeX25519DeoxysII.html @@ -0,0 +1,36 @@ +CallEnvelopeX25519DeoxysII in oasis_runtime_sdk::types::callformat - Rust
pub struct CallEnvelopeX25519DeoxysII {
+    pub pk: PublicKey,
+    pub nonce: [u8; 15],
+    pub epoch: u64,
+    pub data: Vec<u8>,
+}
Expand description

A call envelope when using the EncryptedX25519DeoxysII format.

+

Fields§

§pk: PublicKey

Caller’s ephemeral public key used for X25519.

+
§nonce: [u8; 15]

Nonce.

+
§epoch: u64

Epoch of the ephemeral runtime key.

+
§data: Vec<u8>

Encrypted call data.

+

Trait Implementations§

source§

impl Clone for CallEnvelopeX25519DeoxysII

source§

fn clone(&self) -> CallEnvelopeX25519DeoxysII

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallEnvelopeX25519DeoxysII

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CallEnvelopeX25519DeoxysII

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CallEnvelopeX25519DeoxysII

source§

fn default() -> CallEnvelopeX25519DeoxysII

Returns the “default value” for a type. Read more
source§

impl Encode for CallEnvelopeX25519DeoxysII

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CallEnvelopeX25519DeoxysII

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/callformat/struct.ResultEnvelopeX25519DeoxysII.html b/rust/oasis_runtime_sdk/types/callformat/struct.ResultEnvelopeX25519DeoxysII.html new file mode 100644 index 0000000000..a99438dae1 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/callformat/struct.ResultEnvelopeX25519DeoxysII.html @@ -0,0 +1,32 @@ +ResultEnvelopeX25519DeoxysII in oasis_runtime_sdk::types::callformat - Rust
pub struct ResultEnvelopeX25519DeoxysII {
+    pub nonce: [u8; 15],
+    pub data: Vec<u8>,
+}
Expand description

A result envelope when using the EncryptedX25519DeoxysII format.

+

Fields§

§nonce: [u8; 15]

Nonce.

+
§data: Vec<u8>

Encrypted call data.

+

Trait Implementations§

source§

impl Clone for ResultEnvelopeX25519DeoxysII

source§

fn clone(&self) -> ResultEnvelopeX25519DeoxysII

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ResultEnvelopeX25519DeoxysII

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ResultEnvelopeX25519DeoxysII

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ResultEnvelopeX25519DeoxysII

source§

fn default() -> ResultEnvelopeX25519DeoxysII

Returns the “default value” for a type. Read more
source§

impl Encode for ResultEnvelopeX25519DeoxysII

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ResultEnvelopeX25519DeoxysII

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/index.html b/rust/oasis_runtime_sdk/types/index.html new file mode 100644 index 0000000000..dd08e2a06a --- /dev/null +++ b/rust/oasis_runtime_sdk/types/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::types - Rust

Module oasis_runtime_sdk::types

source ·
Expand description

Types defined by the SDK.

+

Modules§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/message/index.html b/rust/oasis_runtime_sdk/types/message/index.html new file mode 100644 index 0000000000..33ebd2037c --- /dev/null +++ b/rust/oasis_runtime_sdk/types/message/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::types::message - Rust

Module oasis_runtime_sdk::types::message

source ·

Structs§

  • Handler name and context to be called after message is executed.
  • Result of a message being processed by the consensus layer combined with the context for the +result handler.

Type Aliases§

  • Result of a message being processed by the consensus layer.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/message/sidebar-items.js b/rust/oasis_runtime_sdk/types/message/sidebar-items.js new file mode 100644 index 0000000000..51a09c91c3 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/message/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["MessageEventHookInvocation","MessageResult"],"type":["MessageEvent"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/message/struct.MessageEventHookInvocation.html b/rust/oasis_runtime_sdk/types/message/struct.MessageEventHookInvocation.html new file mode 100644 index 0000000000..b506fa7d91 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/message/struct.MessageEventHookInvocation.html @@ -0,0 +1,32 @@ +MessageEventHookInvocation in oasis_runtime_sdk::types::message - Rust
pub struct MessageEventHookInvocation {
+    pub hook_name: String,
+    pub payload: Value,
+}
Expand description

Handler name and context to be called after message is executed.

+

Fields§

§hook_name: String§payload: Value

Implementations§

source§

impl MessageEventHookInvocation

source

pub fn new<S: Encode>(name: String, payload: S) -> Self

Constructs a new message hook invocation.

+

Trait Implementations§

source§

impl Clone for MessageEventHookInvocation

source§

fn clone(&self) -> MessageEventHookInvocation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MessageEventHookInvocation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for MessageEventHookInvocation

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for MessageEventHookInvocation

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for MessageEventHookInvocation

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/message/struct.MessageResult.html b/rust/oasis_runtime_sdk/types/message/struct.MessageResult.html new file mode 100644 index 0000000000..0a32d91e03 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/message/struct.MessageResult.html @@ -0,0 +1,27 @@ +MessageResult in oasis_runtime_sdk::types::message - Rust

Struct oasis_runtime_sdk::types::message::MessageResult

source ·
pub struct MessageResult {
+    pub event: MessageEvent,
+    pub context: Value,
+}
Expand description

Result of a message being processed by the consensus layer combined with the context for the +result handler.

+

Fields§

§event: MessageEvent§context: Value

Trait Implementations§

source§

impl Clone for MessageResult

source§

fn clone(&self) -> MessageResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MessageResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/message/type.MessageEvent.html b/rust/oasis_runtime_sdk/types/message/type.MessageEvent.html new file mode 100644 index 0000000000..c3a7833d04 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/message/type.MessageEvent.html @@ -0,0 +1,7 @@ +MessageEvent in oasis_runtime_sdk::types::message - Rust

Type Alias oasis_runtime_sdk::types::message::MessageEvent

source ·
pub type MessageEvent = MessageEvent;
Expand description

Result of a message being processed by the consensus layer.

+

Aliased Type§

struct MessageEvent {
+    pub module: String,
+    pub code: u32,
+    pub index: u32,
+    pub result: Option<Value>,
+}

Fields§

§module: String§code: u32§index: u32§result: Option<Value>
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/sidebar-items.js b/rust/oasis_runtime_sdk/types/sidebar-items.js new file mode 100644 index 0000000000..699c49038d --- /dev/null +++ b/rust/oasis_runtime_sdk/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["address","callformat","message","token","transaction"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/token/enum.Error.html b/rust/oasis_runtime_sdk/types/token/enum.Error.html new file mode 100644 index 0000000000..7643b2bbf3 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/token/enum.Error.html @@ -0,0 +1,25 @@ +Error in oasis_runtime_sdk::types::token - Rust

Enum oasis_runtime_sdk::types::token::Error

source ·
pub enum Error {
+    NameTooLong {
+        length: usize,
+    },
+}

Variants§

§

NameTooLong

Fields

§length: usize

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/token/index.html b/rust/oasis_runtime_sdk/types/token/index.html new file mode 100644 index 0000000000..6faa788dfd --- /dev/null +++ b/rust/oasis_runtime_sdk/types/token/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::types::token - Rust

Module oasis_runtime_sdk::types::token

source ·
Expand description

Token types.

+

Structs§

Enums§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/token/sidebar-items.js b/rust/oasis_runtime_sdk/types/token/sidebar-items.js new file mode 100644 index 0000000000..f1022eb171 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/token/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"struct":["BaseUnits","Denomination"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/token/struct.BaseUnits.html b/rust/oasis_runtime_sdk/types/token/struct.BaseUnits.html new file mode 100644 index 0000000000..5de1802a5c --- /dev/null +++ b/rust/oasis_runtime_sdk/types/token/struct.BaseUnits.html @@ -0,0 +1,40 @@ +BaseUnits in oasis_runtime_sdk::types::token - Rust

Struct oasis_runtime_sdk::types::token::BaseUnits

source ·
pub struct BaseUnits(pub u128, pub Denomination);
Expand description

Token amount of given denomination in base units.

+

Tuple Fields§

§0: u128§1: Denomination

Implementations§

source§

impl BaseUnits

source

pub const fn new(amount: u128, denomination: Denomination) -> Self

Creates a new token amount of the given denomination.

+
source

pub fn amount(&self) -> u128

Token amount in base units.

+
source

pub fn denomination(&self) -> &Denomination

Denomination of the token amount.

+

Trait Implementations§

source§

impl Clone for BaseUnits

source§

fn clone(&self) -> BaseUnits

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BaseUnits

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for BaseUnits

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for BaseUnits

source§

fn default() -> BaseUnits

Returns the “default value” for a type. Read more
source§

impl Display for BaseUnits

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for BaseUnits

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Ord for BaseUnits

source§

fn cmp(&self, other: &BaseUnits) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for BaseUnits

source§

fn eq(&self, other: &BaseUnits) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for BaseUnits

source§

fn partial_cmp(&self, other: &BaseUnits) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for BaseUnits

source§

impl StructuralPartialEq for BaseUnits

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/token/struct.Denomination.html b/rust/oasis_runtime_sdk/types/token/struct.Denomination.html new file mode 100644 index 0000000000..db2a0f64a2 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/token/struct.Denomination.html @@ -0,0 +1,48 @@ +Denomination in oasis_runtime_sdk::types::token - Rust

Struct oasis_runtime_sdk::types::token::Denomination

source ·
pub struct Denomination(/* private fields */);
Expand description

Name/type of the token.

+

Implementations§

source§

impl Denomination

source

pub const MAX_LENGTH: usize = 32usize

Maximum length of a denomination.

+
source

pub const NATIVE: Denomination = _

Denomination in native token.

+
source

pub fn is_native(&self) -> bool

Whether the denomination represents the native token.

+
source

pub fn into_vec(self) -> Vec<u8>

Raw representation of a denomination.

+

Trait Implementations§

source§

impl AsRef<[u8]> for Denomination

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for Denomination

source§

fn clone(&self) -> Denomination

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Denomination

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Denomination

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Denomination

source§

fn default() -> Denomination

Returns the “default value” for a type. Read more
source§

impl Display for Denomination

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Denomination

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl FromStr for Denomination

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(v: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Denomination

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Denomination

source§

fn cmp(&self, other: &Denomination) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Denomination

source§

fn eq(&self, other: &Denomination) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Denomination

source§

fn partial_cmp(&self, other: &Denomination) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl TryFrom<&[u8]> for Denomination

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Denomination

source§

impl StructuralPartialEq for Denomination

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToHex for T
where + T: AsRef<[u8]>,

source§

fn encode_hex<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Lower case +letters are used (e.g. f9b4ca)
source§

fn encode_hex_upper<U>(&self) -> U
where + U: FromIterator<char>,

Encode the hex strict representing self into the result. Upper case +letters are used (e.g. F9B4CA)
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/constant.LATEST_TRANSACTION_VERSION.html b/rust/oasis_runtime_sdk/types/transaction/constant.LATEST_TRANSACTION_VERSION.html new file mode 100644 index 0000000000..a137b70230 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/constant.LATEST_TRANSACTION_VERSION.html @@ -0,0 +1,2 @@ +LATEST_TRANSACTION_VERSION in oasis_runtime_sdk::types::transaction - Rust
pub const LATEST_TRANSACTION_VERSION: u16 = 1;
Expand description

The latest transaction format version.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/constant.SIGNATURE_CONTEXT_BASE.html b/rust/oasis_runtime_sdk/types/transaction/constant.SIGNATURE_CONTEXT_BASE.html new file mode 100644 index 0000000000..7a747fff65 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/constant.SIGNATURE_CONTEXT_BASE.html @@ -0,0 +1,2 @@ +SIGNATURE_CONTEXT_BASE in oasis_runtime_sdk::types::transaction - Rust
pub const SIGNATURE_CONTEXT_BASE: &[u8] = b"oasis-runtime-sdk/tx: v0";
Expand description

Transaction signature domain separation context base.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/enum.AddressSpec.html b/rust/oasis_runtime_sdk/types/transaction/enum.AddressSpec.html new file mode 100644 index 0000000000..3654adb98d --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/enum.AddressSpec.html @@ -0,0 +1,43 @@ +AddressSpec in oasis_runtime_sdk::types::transaction - Rust

Enum oasis_runtime_sdk::types::transaction::AddressSpec

source ·
pub enum AddressSpec {
+    Signature(SignatureAddressSpec),
+    Multisig(Config),
+    Internal(CallerAddress),
+}
Expand description

Common information that specifies an address as well as how to authenticate.

+

Variants§

§

Signature(SignatureAddressSpec)

For signature authentication.

+
§

Multisig(Config)

For multisig authentication.

+
§

Internal(CallerAddress)

For internal child calls (cannot be serialized/deserialized).

+

Implementations§

source§

impl AddressSpec

source

pub fn public_key(&self) -> Option<PublicKey>

Returns the public key when the address spec represents a single public key.

+
source

pub fn address(&self) -> Address

Derives the address.

+
source

pub fn caller_address(&self) -> CallerAddress

Derives the caller address.

+
source

pub fn batch( + &self, + auth_proof: &AuthProof, +) -> Result<(Vec<PublicKey>, Vec<Signature>), Error>

Checks that the address specification and the authentication proof are acceptable. +Returns vectors of public keys and signatures for batch verification of included signatures.

+

Trait Implementations§

source§

impl Clone for AddressSpec

source§

fn clone(&self) -> AddressSpec

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AddressSpec

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AddressSpec

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for AddressSpec

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AddressSpec

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/enum.AuthProof.html b/rust/oasis_runtime_sdk/types/transaction/enum.AuthProof.html new file mode 100644 index 0000000000..d4f3d595ed --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/enum.AuthProof.html @@ -0,0 +1,38 @@ +AuthProof in oasis_runtime_sdk::types::transaction - Rust

Enum oasis_runtime_sdk::types::transaction::AuthProof

source ·
pub enum AuthProof {
+    Signature(Signature),
+    Multisig(SignatureSetOwned),
+    Module(String),
+    Invalid,
+}
Expand description

A container for data that authenticates a transaction.

+

Variants§

§

Signature(Signature)

For signature authentication.

+
§

Multisig(SignatureSetOwned)

For multisig authentication.

+
§

Module(String)

A flag to use module-controlled decoding. The string is an encoding scheme name that a +module must handle. The scheme name must not be empty.

+
§

Invalid

A non-serializable placeholder value.

+

Trait Implementations§

source§

impl Clone for AuthProof

source§

fn clone(&self) -> AuthProof

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AuthProof

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AuthProof

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AuthProof

source§

fn default() -> AuthProof

Returns the “default value” for a type. Read more
source§

impl Encode for AuthProof

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AuthProof

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/enum.CallFormat.html b/rust/oasis_runtime_sdk/types/transaction/enum.CallFormat.html new file mode 100644 index 0000000000..c7f9313359 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/enum.CallFormat.html @@ -0,0 +1,35 @@ +CallFormat in oasis_runtime_sdk::types::transaction - Rust

Enum oasis_runtime_sdk::types::transaction::CallFormat

source ·
#[repr(u8)]
pub enum CallFormat { + Plain = 0, + EncryptedX25519DeoxysII = 1, +}
Expand description

Format used for encoding the call (and output) information.

+

Variants§

§

Plain = 0

Plain text call data.

+
§

EncryptedX25519DeoxysII = 1

Encrypted call data using X25519 for key exchange and Deoxys-II for symmetric encryption.

+

Trait Implementations§

source§

impl Clone for CallFormat

source§

fn clone(&self) -> CallFormat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallFormat

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CallFormat

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CallFormat

source§

fn default() -> CallFormat

Returns the “default value” for a type. Read more
source§

impl Encode for CallFormat

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl PartialEq for CallFormat

source§

fn eq(&self, other: &CallFormat) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for CallFormat

source§

impl Eq for CallFormat

source§

impl StructuralPartialEq for CallFormat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/enum.CallResult.html b/rust/oasis_runtime_sdk/types/transaction/enum.CallResult.html new file mode 100644 index 0000000000..0e0ce38b18 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/enum.CallResult.html @@ -0,0 +1,39 @@ +CallResult in oasis_runtime_sdk::types::transaction - Rust

Enum oasis_runtime_sdk::types::transaction::CallResult

source ·
pub enum CallResult {
+    Ok(Value),
+    Failed {
+        module: String,
+        code: u32,
+        message: String,
+    },
+    Unknown(Value),
+}
Expand description

Call result.

+

Variants§

§

Ok(Value)

§

Failed

Fields

§module: String
§code: u32
§message: String
§

Unknown(Value)

Implementations§

source§

impl CallResult

source

pub fn is_success(&self) -> bool

Check whether the call result indicates a successful operation or not.

+
source

pub fn ok(self) -> Result<Value>

Transforms CallResult into anyhow::Result<cbor::Value>, mapping Ok(v) and Unknown(v) +to Ok(v) and Failed to Err.

+

Trait Implementations§

source§

impl Clone for CallResult

source§

fn clone(&self) -> CallResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CallResult

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CallResult

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for CallResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CallResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl From<CallResult> for CallResult

source§

fn from(v: CallResult) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/enum.CallerAddress.html b/rust/oasis_runtime_sdk/types/transaction/enum.CallerAddress.html new file mode 100644 index 0000000000..286b1c705f --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/enum.CallerAddress.html @@ -0,0 +1,33 @@ +CallerAddress in oasis_runtime_sdk::types::transaction - Rust
pub enum CallerAddress {
+    Address(Address),
+    EthAddress([u8; 20]),
+}
Expand description

A caller address.

+

Variants§

§

Address(Address)

§

EthAddress([u8; 20])

Implementations§

source§

impl CallerAddress

source

pub fn address(&self) -> Address

Derives the address.

+
source

pub fn zeroized(&self) -> Self

Maps the caller address to one of the same type but with an all-zero address.

+

Trait Implementations§

source§

impl Clone for CallerAddress

source§

fn clone(&self) -> CallerAddress

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallerAddress

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CallerAddress

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for CallerAddress

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CallerAddress

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/enum.Error.html b/rust/oasis_runtime_sdk/types/transaction/enum.Error.html new file mode 100644 index 0000000000..f883e822c8 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/enum.Error.html @@ -0,0 +1,27 @@ +Error in oasis_runtime_sdk::types::transaction - Rust

Enum oasis_runtime_sdk::types::transaction::Error

source ·
pub enum Error {
+    UnsupportedVersion,
+    MalformedTransaction(Error),
+    SignerNotFound,
+    FailedToSign(Error),
+}
Expand description

Error.

+

Variants§

§

UnsupportedVersion

§

MalformedTransaction(Error)

§

SignerNotFound

§

FailedToSign(Error)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/index.html b/rust/oasis_runtime_sdk/types/transaction/index.html new file mode 100644 index 0000000000..cfe5352d0e --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk::types::transaction - Rust

Module oasis_runtime_sdk::types::transaction

source ·
Expand description

Transaction types.

+

Structs§

Enums§

Constants§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/sidebar-items.js b/rust/oasis_runtime_sdk/types/transaction/sidebar-items.js new file mode 100644 index 0000000000..eb94cba1e2 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["LATEST_TRANSACTION_VERSION","SIGNATURE_CONTEXT_BASE"],"enum":["AddressSpec","AuthProof","CallFormat","CallResult","CallerAddress","Error"],"struct":["AuthInfo","Call","Fee","FeeProxy","SignerInfo","Transaction","TransactionSigner","UnverifiedTransaction"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/struct.AuthInfo.html b/rust/oasis_runtime_sdk/types/transaction/struct.AuthInfo.html new file mode 100644 index 0000000000..8f06341754 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/struct.AuthInfo.html @@ -0,0 +1,36 @@ +AuthInfo in oasis_runtime_sdk::types::transaction - Rust

Struct oasis_runtime_sdk::types::transaction::AuthInfo

source ·
pub struct AuthInfo {
+    pub signer_info: Vec<SignerInfo>,
+    pub fee: Fee,
+    pub not_before: Option<u64>,
+    pub not_after: Option<u64>,
+}
Expand description

Transaction authentication information.

+

Fields§

§signer_info: Vec<SignerInfo>

Transaction signer information.

+
§fee: Fee

Fee payment information.

+
§not_before: Option<u64>

Earliest round when the transaction is valid.

+
§not_after: Option<u64>

Latest round when the transaction is valid.

+

Trait Implementations§

source§

impl Clone for AuthInfo

source§

fn clone(&self) -> AuthInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AuthInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for AuthInfo

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for AuthInfo

source§

fn default() -> AuthInfo

Returns the “default value” for a type. Read more
source§

impl Encode for AuthInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for AuthInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/struct.Call.html b/rust/oasis_runtime_sdk/types/transaction/struct.Call.html new file mode 100644 index 0000000000..4f8977232b --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/struct.Call.html @@ -0,0 +1,38 @@ +Call in oasis_runtime_sdk::types::transaction - Rust

Struct oasis_runtime_sdk::types::transaction::Call

source ·
pub struct Call {
+    pub format: CallFormat,
+    pub method: String,
+    pub body: Value,
+    pub read_only: bool,
+}
Expand description

Method call.

+

Fields§

§format: CallFormat

Call format.

+
§method: String

Method name.

+
§body: Value

Method body.

+
§read_only: bool

Read-only flag.

+

A read-only call cannot make any changes to runtime state. Any attempt at modifying state +will result in the call failing.

+

Trait Implementations§

source§

impl Clone for Call

source§

fn clone(&self) -> Call

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Call

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Call

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Call

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for Call

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Call

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Call

§

impl RefUnwindSafe for Call

§

impl Send for Call

§

impl Sync for Call

§

impl Unpin for Call

§

impl UnwindSafe for Call

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/struct.Fee.html b/rust/oasis_runtime_sdk/types/transaction/struct.Fee.html new file mode 100644 index 0000000000..ae6d3f5fec --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/struct.Fee.html @@ -0,0 +1,38 @@ +Fee in oasis_runtime_sdk::types::transaction - Rust

Struct oasis_runtime_sdk::types::transaction::Fee

source ·
pub struct Fee {
+    pub amount: BaseUnits,
+    pub gas: u64,
+    pub consensus_messages: u32,
+    pub proxy: Option<FeeProxy>,
+}
Expand description

Transaction fee.

+

Fields§

§amount: BaseUnits

Amount of base units paid as fee for transaction processing.

+
§gas: u64

Maximum amount of gas paid for.

+
§consensus_messages: u32

Maximum amount of emitted consensus messages paid for. Zero means that up to the maximum +number of per-batch messages can be emitted.

+
§proxy: Option<FeeProxy>

Proxy which has authorized the fees to be paid.

+

Implementations§

source§

impl Fee

source

pub fn gas_price(&self) -> u128

Calculates gas price from fee amount and gas.

+

Trait Implementations§

source§

impl Clone for Fee

source§

fn clone(&self) -> Fee

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Fee

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Fee

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Fee

source§

fn default() -> Fee

Returns the “default value” for a type. Read more
source§

impl Encode for Fee

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Fee

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Fee

§

impl RefUnwindSafe for Fee

§

impl Send for Fee

§

impl Sync for Fee

§

impl Unpin for Fee

§

impl UnwindSafe for Fee

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/struct.FeeProxy.html b/rust/oasis_runtime_sdk/types/transaction/struct.FeeProxy.html new file mode 100644 index 0000000000..4ad6a0e01a --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/struct.FeeProxy.html @@ -0,0 +1,32 @@ +FeeProxy in oasis_runtime_sdk::types::transaction - Rust

Struct oasis_runtime_sdk::types::transaction::FeeProxy

source ·
pub struct FeeProxy {
+    pub module: String,
+    pub id: Vec<u8>,
+}
Expand description

Information about a fee proxy.

+

Fields§

§module: String

Module that will handle the proxy payment.

+
§id: Vec<u8>

Module-specific identifier that will handle fee payments for the transaction signer.

+

Trait Implementations§

source§

impl Clone for FeeProxy

source§

fn clone(&self) -> FeeProxy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FeeProxy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for FeeProxy

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for FeeProxy

source§

fn default() -> FeeProxy

Returns the “default value” for a type. Read more
source§

impl Encode for FeeProxy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for FeeProxy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/struct.SignerInfo.html b/rust/oasis_runtime_sdk/types/transaction/struct.SignerInfo.html new file mode 100644 index 0000000000..e430c33047 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/struct.SignerInfo.html @@ -0,0 +1,33 @@ +SignerInfo in oasis_runtime_sdk::types::transaction - Rust

Struct oasis_runtime_sdk::types::transaction::SignerInfo

source ·
pub struct SignerInfo {
+    pub address_spec: AddressSpec,
+    pub nonce: u64,
+}
Expand description

Transaction signer information.

+

Fields§

§address_spec: AddressSpec§nonce: u64

Implementations§

source§

impl SignerInfo

source

pub fn new_sigspec(spec: SignatureAddressSpec, nonce: u64) -> Self

Create a new signer info from a signature address specification and nonce.

+
source

pub fn new_multisig(config: Config, nonce: u64) -> Self

Create a new signer info from a multisig configuration and a nonce.

+

Trait Implementations§

source§

impl Clone for SignerInfo

source§

fn clone(&self) -> SignerInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SignerInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for SignerInfo

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for SignerInfo

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for SignerInfo

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/struct.Transaction.html b/rust/oasis_runtime_sdk/types/transaction/struct.Transaction.html new file mode 100644 index 0000000000..be1037e2aa --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/struct.Transaction.html @@ -0,0 +1,46 @@ +Transaction in oasis_runtime_sdk::types::transaction - Rust

Struct oasis_runtime_sdk::types::transaction::Transaction

source ·
pub struct Transaction {
+    pub version: u16,
+    pub call: Call,
+    pub auth_info: AuthInfo,
+}
Expand description

Transaction.

+

Fields§

§version: u16§call: Call§auth_info: AuthInfo

Implementations§

source§

impl Transaction

source

pub fn new<B>(method: &str, body: B) -> Self
where + B: Encode,

Create a new (unsigned) transaction.

+
source

pub fn prepare_for_signing(self) -> TransactionSigner

Prepare this transaction for signing.

+
source

pub fn fee_gas(&self) -> u64

Maximum amount of gas that the transaction can use.

+
source

pub fn set_fee_gas(&mut self, gas: u64)

Set maximum amount of gas that the transaction can use.

+
source

pub fn fee_amount(&self) -> &BaseUnits

Amount of fee to pay for transaction execution.

+
source

pub fn set_fee_amount(&mut self, amount: BaseUnits)

Set amount of fee to pay for transaction execution.

+
source

pub fn set_fee_proxy(&mut self, module: &str, id: &[u8])

Set a proxy for paying the transaction fee.

+
source

pub fn append_signer_info(&mut self, address_spec: AddressSpec, nonce: u64)

Append a new transaction signer information to the transaction.

+
source

pub fn append_auth_signature(&mut self, spec: SignatureAddressSpec, nonce: u64)

Append a new transaction signer information with a signature address specification to the +transaction.

+
source

pub fn append_auth_multisig(&mut self, cfg: Config, nonce: u64)

Append a new transaction signer information with a multisig address specification to the +transaction.

+
source

pub fn validate_basic(&self) -> Result<(), Error>

Perform basic validation on the transaction.

+

Trait Implementations§

source§

impl Clone for Transaction

source§

fn clone(&self) -> Transaction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Transaction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Transaction

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Transaction

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Transaction

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/struct.TransactionSigner.html b/rust/oasis_runtime_sdk/types/transaction/struct.TransactionSigner.html new file mode 100644 index 0000000000..14349f5aef --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/struct.TransactionSigner.html @@ -0,0 +1,26 @@ +TransactionSigner in oasis_runtime_sdk::types::transaction - Rust
pub struct TransactionSigner { /* private fields */ }
Expand description

Transaction signer.

+

Implementations§

source§

impl TransactionSigner

source

pub fn new(tx: Transaction) -> Self

Construct a new transaction signer for the given transaction.

+
source

pub fn append_sign<S>(&mut self, signer: &S) -> Result<(), Error>
where + S: Signer + ?Sized,

Sign the transaction and append the signature.

+

The signer must be specified in the auth_info field.

+
source

pub fn finalize(self) -> UnverifiedTransaction

Finalize the signing process and return the (signed) unverified transaction.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/types/transaction/struct.UnverifiedTransaction.html b/rust/oasis_runtime_sdk/types/transaction/struct.UnverifiedTransaction.html new file mode 100644 index 0000000000..8c4c428121 --- /dev/null +++ b/rust/oasis_runtime_sdk/types/transaction/struct.UnverifiedTransaction.html @@ -0,0 +1,27 @@ +UnverifiedTransaction in oasis_runtime_sdk::types::transaction - Rust
pub struct UnverifiedTransaction(pub Vec<u8>, pub Vec<AuthProof>);
Expand description

An unverified signed transaction.

+

Tuple Fields§

§0: Vec<u8>§1: Vec<AuthProof>

Implementations§

source§

impl UnverifiedTransaction

source

pub fn verify(self) -> Result<Transaction, Error>

Verify and deserialize the unverified transaction.

+

Trait Implementations§

source§

impl Clone for UnverifiedTransaction

source§

fn clone(&self) -> UnverifiedTransaction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UnverifiedTransaction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for UnverifiedTransaction

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for UnverifiedTransaction

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/all.html b/rust/oasis_runtime_sdk_contracts/all.html new file mode 100644 index 0000000000..10f60e1cc0 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Constants

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/enum.Error.html b/rust/oasis_runtime_sdk_contracts/enum.Error.html new file mode 100644 index 0000000000..fbd0f98f21 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/enum.Error.html @@ -0,0 +1,58 @@ +Error in oasis_runtime_sdk_contracts - Rust

Enum oasis_runtime_sdk_contracts::Error

source ·
pub enum Error {
+
Show 33 variants InvalidArgument, + CodeTooLarge(u32, u32), + CodeMalformed, + UnsupportedABI, + CodeMissingRequiredExport(String), + CodeDeclaresReservedExport(String), + CodeDeclaresStartFunction, + CodeDeclaresTooManyMemories, + CodeNotFound(u64), + InstanceNotFound(u64), + ModuleLoadingFailed, + ExecutionFailed(Error), + Forbidden, + Unsupported, + InsufficientCallerBalance, + ResultTooLarge(u32, u32), + TooManySubcalls(u16, u16), + CodeAlreadyUpgraded(u64), + Abort(Error), + StorageKeyTooLarge(u32, u32), + StorageValueTooLarge(u32, u32), + CryptoMsgTooLarge(u32, u32), + CryptoMalformedPublicKey, + CodeDeclaresMultipleSubVersions, + CryptoMalformedPrivateKey, + CryptoMalformedKey, + CryptoMalformedNonce, + CryptoKeyDerivationFunctionFailure, + ModuleUsesFloatingPoint, + CodeDeclaresTooManyFunctions, + CodeDeclaresTooManyLocals, + Core(Error), + Contract(ContractError), +
}
Expand description

Errors emitted by the contracts module.

+

Variants§

§

InvalidArgument

§

CodeTooLarge(u32, u32)

§

CodeMalformed

§

UnsupportedABI

§

CodeMissingRequiredExport(String)

§

CodeDeclaresReservedExport(String)

§

CodeDeclaresStartFunction

§

CodeDeclaresTooManyMemories

§

CodeNotFound(u64)

§

InstanceNotFound(u64)

§

ModuleLoadingFailed

§

ExecutionFailed(Error)

§

Forbidden

§

Unsupported

§

InsufficientCallerBalance

§

ResultTooLarge(u32, u32)

§

TooManySubcalls(u16, u16)

§

CodeAlreadyUpgraded(u64)

§

Abort(Error)

§

StorageKeyTooLarge(u32, u32)

§

StorageValueTooLarge(u32, u32)

§

CryptoMsgTooLarge(u32, u32)

§

CryptoMalformedPublicKey

§

CodeDeclaresMultipleSubVersions

§

CryptoMalformedPrivateKey

§

CryptoMalformedKey

§

CryptoMalformedNonce

§

CryptoKeyDerivationFunctionFailure

§

ModuleUsesFloatingPoint

§

CodeDeclaresTooManyFunctions

§

CodeDeclaresTooManyLocals

§

Core(Error)

§

Contract(ContractError)

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Error for Error

source§

fn module_name(&self) -> &str

Name of the module that emitted the error.
source§

fn code(&self) -> u32

Error code uniquely identifying the error.
source§

fn into_abort(self) -> Result<Error, Self>

Consumes self and returns either Ok(err) (where err is a dispatcher error) when batch +should abort or Err(self) when this is just a regular error.
source§

fn into_call_result(self) -> CallResult
where + Self: Sized,

Converts the error into a call result.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for RuntimeError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/enum.Event.html b/rust/oasis_runtime_sdk_contracts/enum.Event.html new file mode 100644 index 0000000000..b183103125 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/enum.Event.html @@ -0,0 +1,21 @@ +Event in oasis_runtime_sdk_contracts - Rust

Enum oasis_runtime_sdk_contracts::Event

source ·
pub enum Event {}
Expand description

Events emitted by the contracts module.

+

Trait Implementations§

source§

impl Debug for Event

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Encode for Event

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Event for Event

source§

fn module_name() -> &'static str

Name of the module that emitted the event.
source§

fn code(&self) -> u32

Code uniquely identifying the event.
source§

fn into_event_tag(self) -> EventTag

Converts an event into an event tag. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/index.html b/rust/oasis_runtime_sdk_contracts/index.html new file mode 100644 index 0000000000..8b462a98f7 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk_contracts - Rust

Crate oasis_runtime_sdk_contracts

source ·
Expand description

Smart contracts module.

+

Modules§

  • State schema constants.
  • Contracts module types.

Structs§

Enums§

  • Errors emitted by the contracts module.
  • Events emitted by the contracts module.

Traits§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/sidebar-items.js b/rust/oasis_runtime_sdk_contracts/sidebar-items.js new file mode 100644 index 0000000000..daf8c281a3 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error","Event"],"mod":["state","types"],"struct":["GasCosts","Genesis","LocalConfig","Module","Parameters"],"trait":["Config"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/state/constant.CODE.html b/rust/oasis_runtime_sdk_contracts/state/constant.CODE.html new file mode 100644 index 0000000000..a238837e78 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/state/constant.CODE.html @@ -0,0 +1,2 @@ +CODE in oasis_runtime_sdk_contracts::state - Rust

Constant oasis_runtime_sdk_contracts::state::CODE

source ·
pub const CODE: &[u8];
Expand description

Uploaded code.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/state/constant.CODE_INFO.html b/rust/oasis_runtime_sdk_contracts/state/constant.CODE_INFO.html new file mode 100644 index 0000000000..b6660ca8e2 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/state/constant.CODE_INFO.html @@ -0,0 +1,2 @@ +CODE_INFO in oasis_runtime_sdk_contracts::state - Rust

Constant oasis_runtime_sdk_contracts::state::CODE_INFO

source ·
pub const CODE_INFO: &[u8];
Expand description

Information about uploaded code.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/state/constant.INSTANCE_INFO.html b/rust/oasis_runtime_sdk_contracts/state/constant.INSTANCE_INFO.html new file mode 100644 index 0000000000..d0fce91af1 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/state/constant.INSTANCE_INFO.html @@ -0,0 +1,2 @@ +INSTANCE_INFO in oasis_runtime_sdk_contracts::state - Rust

Constant oasis_runtime_sdk_contracts::state::INSTANCE_INFO

source ·
pub const INSTANCE_INFO: &[u8];
Expand description

Information about the deployed contract instance.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/state/constant.INSTANCE_STATE.html b/rust/oasis_runtime_sdk_contracts/state/constant.INSTANCE_STATE.html new file mode 100644 index 0000000000..9ad49623a6 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/state/constant.INSTANCE_STATE.html @@ -0,0 +1,2 @@ +INSTANCE_STATE in oasis_runtime_sdk_contracts::state - Rust

Constant oasis_runtime_sdk_contracts::state::INSTANCE_STATE

source ·
pub const INSTANCE_STATE: &[u8];
Expand description

Per-instance key/value store.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/state/constant.NEXT_CODE_IDENTIFIER.html b/rust/oasis_runtime_sdk_contracts/state/constant.NEXT_CODE_IDENTIFIER.html new file mode 100644 index 0000000000..01da63962e --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/state/constant.NEXT_CODE_IDENTIFIER.html @@ -0,0 +1,2 @@ +NEXT_CODE_IDENTIFIER in oasis_runtime_sdk_contracts::state - Rust
pub const NEXT_CODE_IDENTIFIER: &[u8];
Expand description

Next code identifier (u64).

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/state/constant.NEXT_INSTANCE_IDENTIFIER.html b/rust/oasis_runtime_sdk_contracts/state/constant.NEXT_INSTANCE_IDENTIFIER.html new file mode 100644 index 0000000000..d42a028ff3 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/state/constant.NEXT_INSTANCE_IDENTIFIER.html @@ -0,0 +1,2 @@ +NEXT_INSTANCE_IDENTIFIER in oasis_runtime_sdk_contracts::state - Rust
pub const NEXT_INSTANCE_IDENTIFIER: &[u8];
Expand description

Next instance identifier (u64).

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/state/index.html b/rust/oasis_runtime_sdk_contracts/state/index.html new file mode 100644 index 0000000000..088a4c3fb4 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/state/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk_contracts::state - Rust

Module oasis_runtime_sdk_contracts::state

source ·
Expand description

State schema constants.

+

Constants§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/state/sidebar-items.js b/rust/oasis_runtime_sdk_contracts/state/sidebar-items.js new file mode 100644 index 0000000000..b17cc33d03 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/state/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["CODE","CODE_INFO","INSTANCE_INFO","INSTANCE_STATE","NEXT_CODE_IDENTIFIER","NEXT_INSTANCE_IDENTIFIER"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/struct.GasCosts.html b/rust/oasis_runtime_sdk_contracts/struct.GasCosts.html new file mode 100644 index 0000000000..8f0a54d3fe --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/struct.GasCosts.html @@ -0,0 +1,55 @@ +GasCosts in oasis_runtime_sdk_contracts - Rust

Struct oasis_runtime_sdk_contracts::GasCosts

source ·
pub struct GasCosts {
Show 27 fields + pub tx_upload: u64, + pub tx_upload_per_byte: u64, + pub tx_instantiate: u64, + pub tx_call: u64, + pub tx_upgrade: u64, + pub tx_change_upgrade_policy: u64, + pub subcall_dispatch: u64, + pub wasm_public_storage_get_base: u64, + pub wasm_public_storage_insert_base: u64, + pub wasm_public_storage_remove_base: u64, + pub wasm_public_storage_key_byte: u64, + pub wasm_public_storage_value_byte: u64, + pub wasm_confidential_storage_get_base: u64, + pub wasm_confidential_storage_insert_base: u64, + pub wasm_confidential_storage_remove_base: u64, + pub wasm_confidential_storage_key_byte: u64, + pub wasm_confidential_storage_value_byte: u64, + pub wasm_env_query_base: u64, + pub wasm_crypto_ecdsa_recover: u64, + pub wasm_crypto_signature_verify_ed25519: u64, + pub wasm_crypto_signature_verify_secp256k1: u64, + pub wasm_crypto_signature_verify_sr25519: u64, + pub wasm_crypto_x25519_derive_symmetric: u64, + pub wasm_crypto_deoxysii_base: u64, + pub wasm_crypto_deoxysii_byte: u64, + pub wasm_crypto_random_bytes_base: u64, + pub wasm_crypto_random_bytes_byte: u64, +
}
Expand description

Gas costs.

+

Fields§

§tx_upload: u64§tx_upload_per_byte: u64§tx_instantiate: u64§tx_call: u64§tx_upgrade: u64§tx_change_upgrade_policy: u64§subcall_dispatch: u64§wasm_public_storage_get_base: u64§wasm_public_storage_insert_base: u64§wasm_public_storage_remove_base: u64§wasm_public_storage_key_byte: u64§wasm_public_storage_value_byte: u64§wasm_confidential_storage_get_base: u64§wasm_confidential_storage_insert_base: u64§wasm_confidential_storage_remove_base: u64§wasm_confidential_storage_key_byte: u64§wasm_confidential_storage_value_byte: u64§wasm_env_query_base: u64§wasm_crypto_ecdsa_recover: u64§wasm_crypto_signature_verify_ed25519: u64§wasm_crypto_signature_verify_secp256k1: u64§wasm_crypto_signature_verify_sr25519: u64§wasm_crypto_x25519_derive_symmetric: u64§wasm_crypto_deoxysii_base: u64§wasm_crypto_deoxysii_byte: u64§wasm_crypto_random_bytes_base: u64§wasm_crypto_random_bytes_byte: u64

Trait Implementations§

source§

impl Clone for GasCosts

source§

fn clone(&self) -> GasCosts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GasCosts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for GasCosts

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for GasCosts

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for GasCosts

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for GasCosts

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/struct.Genesis.html b/rust/oasis_runtime_sdk_contracts/struct.Genesis.html new file mode 100644 index 0000000000..eff8056de7 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/struct.Genesis.html @@ -0,0 +1,29 @@ +Genesis in oasis_runtime_sdk_contracts - Rust

Struct oasis_runtime_sdk_contracts::Genesis

source ·
pub struct Genesis {
+    pub parameters: Parameters,
+}
Expand description

Genesis state for the contracts module.

+

Fields§

§parameters: Parameters

Trait Implementations§

source§

impl Clone for Genesis

source§

fn clone(&self) -> Genesis

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Genesis

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Genesis

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Genesis

source§

fn default() -> Genesis

Returns the “default value” for a type. Read more
source§

impl Encode for Genesis

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Genesis

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/struct.LocalConfig.html b/rust/oasis_runtime_sdk_contracts/struct.LocalConfig.html new file mode 100644 index 0000000000..81acc8a8eb --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/struct.LocalConfig.html @@ -0,0 +1,32 @@ +LocalConfig in oasis_runtime_sdk_contracts - Rust

Struct oasis_runtime_sdk_contracts::LocalConfig

source ·
pub struct LocalConfig {
+    pub query_custom_max_gas: u64,
+    pub max_instance_raw_storage_query_items: u64,
+}
Expand description

Local configuration that can be provided by the node operator.

+

Fields§

§query_custom_max_gas: u64

Gas limit for custom queries that invoke smart contracts.

+
§max_instance_raw_storage_query_items: u64

Maximum number of items per page in InstanceRawStorage query result.

+

Trait Implementations§

source§

impl Clone for LocalConfig

source§

fn clone(&self) -> LocalConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LocalConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for LocalConfig

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for LocalConfig

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for LocalConfig

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for LocalConfig

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/struct.Module.html b/rust/oasis_runtime_sdk_contracts/struct.Module.html new file mode 100644 index 0000000000..f94a4da95f --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/struct.Module.html @@ -0,0 +1,117 @@ +Module in oasis_runtime_sdk_contracts - Rust

Struct oasis_runtime_sdk_contracts::Module

source ·
pub struct Module<Cfg: Config> { /* private fields */ }

Implementations§

source§

impl<Cfg: Config> Module<Cfg>

source

pub fn load_code(code_info: &Code) -> Result<Vec<u8>, Error>

Loads code with the specified code identifier.

+
source

pub fn store_code(code_info: &Code, code: &[u8]) -> Result<(), Error>

Stores code with the specified code identifier.

+
source§

impl<Cfg: Config> Module<Cfg>

Trait Implementations§

source§

impl<Cfg: Config> BlockHandler for Module<Cfg>

source§

fn begin_block<C>(_ctx: &C)
where + C: Context,

Perform any common actions at the start of the block (before any transactions have been +executed).
source§

fn end_block<C>(_ctx: &C)
where + C: Context,

Perform any common actions at the end of the block (after all transactions have been +executed).
source§

impl<Cfg: Config> InvariantHandler for Module<Cfg>

source§

fn check_invariants<C>(_ctx: &C) -> Result<(), Error>
where + C: Context,

Check invariants.
source§

impl<Cfg: Config> MethodHandler for Module<Cfg>

source§

fn dispatch_call<C: Context>( + ctx: &C, + method: &str, + body: Value, +) -> DispatchResult<Value, CallResult>

Dispatch a call.
source§

fn dispatch_query<C: Context>( + ctx: &C, + method: &str, + args: Value, +) -> DispatchResult<Value, Result<Value, RuntimeError>>

Dispatch a query.
source§

fn supported_methods() -> Vec<MethodHandlerInfo>

Lists the names of all RPC methods exposed by this module. The result is informational +only. An empty return vector means that the implementor does not care to list the methods, +or the implementor is a tuple of modules.
source§

fn is_expensive_query(method: &str) -> bool

Checks whether the given query method is tagged as expensive.
source§

fn is_allowed_interactive_call(method: &str) -> bool

Checks whether the given call is allowed to be called interactively via read-only +transactions.
source§

fn prefetch( + _prefixes: &mut BTreeSet<Prefix>, + _method: &str, + body: Value, + _auth_info: &AuthInfo, +) -> DispatchResult<Value, Result<(), Error>>

Add storage prefixes to prefetch.
source§

fn dispatch_message_result<C>( + _ctx: &C, + _handler_name: &str, + result: MessageResult, +) -> DispatchResult<MessageResult, ()>
where + C: Context,

Dispatch a message result.
source§

fn is_allowed_private_km_query(_method: &str) -> bool

Checks whether the given query is allowed to access private key manager state.
source§

impl<Cfg: Config> MigrationHandler for Module<Cfg>

§

type Genesis = Genesis

Genesis state type. Read more
source§

fn init_or_migrate<C: Context>( + _ctx: &C, + meta: &mut Metadata, + genesis: Self::Genesis, +) -> bool

Initialize state from genesis or perform a migration. Read more
source§

impl<Cfg: Config> Module for Module<Cfg>

source§

const NAME: &'static str = MODULE_NAME

Module name.
§

type Error = Error

Module error type.
§

type Event = Event

Module event type.
§

type Parameters = Parameters

Module parameters.
source§

const VERSION: u32 = 1u32

Module version.
source§

fn params() -> Self::Parameters

Return the module’s parameters.
source§

fn set_params(params: Self::Parameters)

Set the module’s parameters.
source§

impl<Cfg: Config> TransactionHandler for Module<Cfg>

source§

fn approve_raw_tx<C>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>
where + C: Context,

Judge if a raw transaction is good enough to undergo decoding. +This takes place before even decoding the transaction.
source§

fn approve_unverified_tx<C>( + _ctx: &C, + _utx: &UnverifiedTransaction, +) -> Result<(), Error>
where + C: Context,

Judge if an unverified transaction is good enough to undergo verification. +This takes place before even verifying signatures.
source§

fn decode_tx<C>( + _ctx: &C, + _scheme: &str, + _body: &[u8], +) -> Result<Option<Transaction>, Error>
where + C: Context,

Decode a transaction that was sent with module-controlled decoding and verify any +signatures. Read more
source§

fn authenticate_tx<C>( + _ctx: &C, + _tx: &Transaction, +) -> Result<AuthDecision, Error>
where + C: Context,

Authenticate a transaction. Read more
source§

fn before_handle_call<C>(_ctx: &C, _call: &Call) -> Result<(), Error>
where + C: Context,

Perform any action after authentication, within the transaction context. Read more
source§

fn before_authorized_call_dispatch<C>( + _ctx: &C, + _call: &Call, +) -> Result<(), Error>
where + C: Context,

Perform any action after authentication and decoding, within the transaction context. Read more
source§

fn after_handle_call<C>( + _ctx: &C, + result: CallResult, +) -> Result<CallResult, Error>
where + C: Context,

Perform any action after call, within the transaction context. Read more
source§

fn after_dispatch_tx<C>( + _ctx: &C, + _tx_auth_info: &AuthInfo, + _result: &CallResult, +)
where + C: Context,

Perform any action after dispatching the transaction, in batch context.

Auto Trait Implementations§

§

impl<Cfg> Freeze for Module<Cfg>

§

impl<Cfg> RefUnwindSafe for Module<Cfg>
where + Cfg: RefUnwindSafe,

§

impl<Cfg> Send for Module<Cfg>
where + Cfg: Send,

§

impl<Cfg> Sync for Module<Cfg>
where + Cfg: Sync,

§

impl<Cfg> Unpin for Module<Cfg>
where + Cfg: Unpin,

§

impl<Cfg> UnwindSafe for Module<Cfg>
where + Cfg: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<M> ModuleInfoHandler for M
where + M: Module + MethodHandler,

source§

fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>
where + C: Context,

Reports info about the module (or modules, if Self is a tuple).
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/struct.Parameters.html b/rust/oasis_runtime_sdk_contracts/struct.Parameters.html new file mode 100644 index 0000000000..781223030c --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/struct.Parameters.html @@ -0,0 +1,41 @@ +Parameters in oasis_runtime_sdk_contracts - Rust

Struct oasis_runtime_sdk_contracts::Parameters

source ·
pub struct Parameters {
Show 13 fields + pub max_code_size: u32, + pub max_stack_size: u32, + pub max_memory_pages: u32, + pub max_wasm_functions: u32, + pub max_wasm_locals: u32, + pub max_subcall_depth: u16, + pub max_subcall_count: u16, + pub max_result_size_bytes: u32, + pub max_query_size_bytes: u32, + pub max_storage_key_size_bytes: u32, + pub max_storage_value_size_bytes: u32, + pub max_crypto_signature_verify_message_size_bytes: u32, + pub gas_costs: GasCosts, +
}
Expand description

Parameters for the contracts module.

+

Fields§

§max_code_size: u32§max_stack_size: u32§max_memory_pages: u32§max_wasm_functions: u32§max_wasm_locals: u32§max_subcall_depth: u16§max_subcall_count: u16§max_result_size_bytes: u32§max_query_size_bytes: u32§max_storage_key_size_bytes: u32§max_storage_value_size_bytes: u32§max_crypto_signature_verify_message_size_bytes: u32§gas_costs: GasCosts

Trait Implementations§

source§

impl Clone for Parameters

source§

fn clone(&self) -> Parameters

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Parameters

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Parameters

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for Parameters

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Encode for Parameters

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Parameters

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Parameters for Parameters

§

type Error = Infallible

source§

const STORE_KEY: &'static [u8] = _

Store key used for storing parameters.
source§

fn validate_basic(&self) -> Result<(), Self::Error>

Perform basic parameter validation.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/trait.Config.html b/rust/oasis_runtime_sdk_contracts/trait.Config.html new file mode 100644 index 0000000000..c3b708137a --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/trait.Config.html @@ -0,0 +1,2 @@ +Config in oasis_runtime_sdk_contracts - Rust

Trait oasis_runtime_sdk_contracts::Config

source ·
pub trait Config: 'static { }
Expand description

Module configuration.

+

Implementors§

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/enum.ABI.html b/rust/oasis_runtime_sdk_contracts/types/enum.ABI.html new file mode 100644 index 0000000000..0065dd6e4a --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/enum.ABI.html @@ -0,0 +1,38 @@ +ABI in oasis_runtime_sdk_contracts::types - Rust

Enum oasis_runtime_sdk_contracts::types::ABI

source ·
#[repr(u8)]
pub enum ABI { + OasisV1 = 1, +}
Expand description

ABI that the given contract should conform to.

+

Variants§

§

OasisV1 = 1

Custom Oasis SDK-specific ABI (v1).

+

Trait Implementations§

source§

impl Clone for ABI

source§

fn clone(&self) -> ABI

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ABI

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ABI

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for ABI

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl Hash for ABI

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ABI

source§

fn eq(&self, other: &ABI) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for ABI

source§

impl Eq for ABI

source§

impl StructuralPartialEq for ABI

Auto Trait Implementations§

§

impl Freeze for ABI

§

impl RefUnwindSafe for ABI

§

impl Send for ABI

§

impl Sync for ABI

§

impl Unpin for ABI

§

impl UnwindSafe for ABI

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/enum.Policy.html b/rust/oasis_runtime_sdk_contracts/types/enum.Policy.html new file mode 100644 index 0000000000..5f767fe980 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/enum.Policy.html @@ -0,0 +1,34 @@ +Policy in oasis_runtime_sdk_contracts::types - Rust

Enum oasis_runtime_sdk_contracts::types::Policy

source ·
pub enum Policy {
+    Nobody,
+    Address(Address),
+    Everyone,
+}
Expand description

A generic policy that specifies who is allowed to perform an action.

+

Variants§

§

Nobody

§

Address(Address)

§

Everyone

Implementations§

source§

impl Policy

source

pub fn enforce(&self, caller: &Address) -> Result<(), Error>

Enforce the given policy by returning an error if the policy is not satisfied.

+

Trait Implementations§

source§

impl Clone for Policy

source§

fn clone(&self) -> Policy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Policy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Policy

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Policy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Policy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.
source§

impl Copy for Policy

Auto Trait Implementations§

§

impl Freeze for Policy

§

impl RefUnwindSafe for Policy

§

impl Send for Policy

§

impl Sync for Policy

§

impl Unpin for Policy

§

impl UnwindSafe for Policy

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/enum.PublicKeyKind.html b/rust/oasis_runtime_sdk_contracts/types/enum.PublicKeyKind.html new file mode 100644 index 0000000000..d4ee8cf5e2 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/enum.PublicKeyKind.html @@ -0,0 +1,28 @@ +PublicKeyKind in oasis_runtime_sdk_contracts::types - Rust
#[repr(u8)]
pub enum PublicKeyKind { + Transaction = 1, +}
Expand description

Public key kind.

+

Variants§

§

Transaction = 1

Trait Implementations§

source§

impl Clone for PublicKeyKind

source§

fn clone(&self) -> PublicKeyKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKeyKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKeyKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PublicKeyKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/enum.StoreKind.html b/rust/oasis_runtime_sdk_contracts/types/enum.StoreKind.html new file mode 100644 index 0000000000..173b8c351f --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/enum.StoreKind.html @@ -0,0 +1,29 @@ +StoreKind in oasis_runtime_sdk_contracts::types - Rust

Enum oasis_runtime_sdk_contracts::types::StoreKind

source ·
#[repr(u32)]
pub enum StoreKind { + Public = 0, + Confidential = 1, +}
Expand description

Exposed wrapper for oasis-contract-sdk-types::StoreKind.

+

Variants§

§

Public = 0

§

Confidential = 1

Trait Implementations§

source§

impl Clone for StoreKind

source§

fn clone(&self) -> StoreKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StoreKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for StoreKind

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for StoreKind

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/index.html b/rust/oasis_runtime_sdk_contracts/types/index.html new file mode 100644 index 0000000000..c5ed3a15d0 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/index.html @@ -0,0 +1,2 @@ +oasis_runtime_sdk_contracts::types - Rust

Module oasis_runtime_sdk_contracts::types

source ·
Expand description

Contracts module types.

+

Structs§

Enums§

  • ABI that the given contract should conform to.
  • A generic policy that specifies who is allowed to perform an action.
  • Public key kind.
  • Exposed wrapper for oasis-contract-sdk-types::StoreKind.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/sidebar-items.js b/rust/oasis_runtime_sdk_contracts/types/sidebar-items.js new file mode 100644 index 0000000000..6d1d0454c5 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["ABI","Policy","PublicKeyKind","StoreKind"],"struct":["Call","CallResult","ChangeUpgradePolicy","Code","CodeId","CodeQuery","CodeStorageQuery","CodeStorageQueryResult","ContractEvent","CustomQuery","CustomQueryResult","Instance","InstanceId","InstanceQuery","InstanceRawStorageQuery","InstanceRawStorageQueryResult","InstanceStorageQuery","InstanceStorageQueryResult","Instantiate","InstantiateResult","PublicKeyQuery","PublicKeyQueryResult","Upgrade","Upload","UploadResult"]}; \ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.Call.html b/rust/oasis_runtime_sdk_contracts/types/struct.Call.html new file mode 100644 index 0000000000..ea9494c76f --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.Call.html @@ -0,0 +1,35 @@ +Call in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::Call

source ·
pub struct Call {
+    pub id: InstanceId,
+    pub data: Vec<u8>,
+    pub tokens: Vec<BaseUnits>,
+}
Expand description

Contract call.

+

Fields§

§id: InstanceId

Instance identifier.

+
§data: Vec<u8>

Call arguments.

+
§tokens: Vec<BaseUnits>

Tokens that should be sent to the contract as part of the call.

+

Trait Implementations§

source§

impl Clone for Call

source§

fn clone(&self) -> Call

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Call

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Call

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Call

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Call

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Call

§

impl RefUnwindSafe for Call

§

impl Send for Call

§

impl Sync for Call

§

impl Unpin for Call

§

impl UnwindSafe for Call

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.CallResult.html b/rust/oasis_runtime_sdk_contracts/types/struct.CallResult.html new file mode 100644 index 0000000000..2ac35f67c6 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.CallResult.html @@ -0,0 +1,25 @@ +CallResult in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::CallResult

source ·
pub struct CallResult(pub Vec<u8>);
Expand description

Contract call result.

+

Tuple Fields§

§0: Vec<u8>

Trait Implementations§

source§

impl Clone for CallResult

source§

fn clone(&self) -> CallResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CallResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CallResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CallResult

source§

fn default() -> CallResult

Returns the “default value” for a type. Read more
source§

impl Encode for CallResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.ChangeUpgradePolicy.html b/rust/oasis_runtime_sdk_contracts/types/struct.ChangeUpgradePolicy.html new file mode 100644 index 0000000000..34263a8ed4 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.ChangeUpgradePolicy.html @@ -0,0 +1,33 @@ +ChangeUpgradePolicy in oasis_runtime_sdk_contracts::types - Rust
pub struct ChangeUpgradePolicy {
+    pub id: InstanceId,
+    pub upgrades_policy: Policy,
+}
Expand description

Change upgrade policy call.

+

Fields§

§id: InstanceId

Instance identifier.

+
§upgrades_policy: Policy

Updated upgrade policy.

+

Trait Implementations§

source§

impl Clone for ChangeUpgradePolicy

source§

fn clone(&self) -> ChangeUpgradePolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ChangeUpgradePolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ChangeUpgradePolicy

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for ChangeUpgradePolicy

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ChangeUpgradePolicy

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.Code.html b/rust/oasis_runtime_sdk_contracts/types/struct.Code.html new file mode 100644 index 0000000000..8723da05b7 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.Code.html @@ -0,0 +1,41 @@ +Code in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::Code

source ·
pub struct Code {
+    pub id: CodeId,
+    pub hash: Hash,
+    pub abi: ABI,
+    pub abi_sv: u32,
+    pub uploader: Address,
+    pub instantiate_policy: Policy,
+}
Expand description

Stored code information.

+

Fields§

§id: CodeId

Unique code identifier.

+
§hash: Hash

Code hash.

+
§abi: ABI

ABI.

+
§abi_sv: u32

ABI sub-version.

+
§uploader: Address

Code uploader address.

+
§instantiate_policy: Policy

Who is allowed to instantiate this code.

+

Trait Implementations§

source§

impl Clone for Code

source§

fn clone(&self) -> Code

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Code

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Code

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Code

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Code

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Code

§

impl RefUnwindSafe for Code

§

impl Send for Code

§

impl Sync for Code

§

impl Unpin for Code

§

impl UnwindSafe for Code

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.CodeId.html b/rust/oasis_runtime_sdk_contracts/types/struct.CodeId.html new file mode 100644 index 0000000000..c762d72e24 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.CodeId.html @@ -0,0 +1,35 @@ +CodeId in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::CodeId

source ·
pub struct CodeId(/* private fields */);
Expand description

Unique stored code identifier.

+

Implementations§

source§

impl CodeId

source

pub fn as_u64(&self) -> u64

Convert identifier to u64.

+
source

pub fn increment(&self) -> CodeId

Return the next identifier in sequence.

+
source

pub fn to_storage_key(self) -> [u8; 8]

Convert identifier to storage key representation.

+

Trait Implementations§

source§

impl Clone for CodeId

source§

fn clone(&self) -> CodeId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CodeId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Decode for CodeId

source§

fn try_default() -> Result<CodeId, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<CodeId, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CodeId

source§

fn default() -> CodeId

Returns the “default value” for a type. Read more
source§

impl Encode for CodeId

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<u64> for CodeId

source§

fn from(v: u64) -> CodeId

Converts to this type from the input type.
source§

impl PartialEq for CodeId

source§

fn eq(&self, other: &CodeId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for CodeId

source§

impl Eq for CodeId

source§

impl StructuralPartialEq for CodeId

Auto Trait Implementations§

§

impl Freeze for CodeId

§

impl RefUnwindSafe for CodeId

§

impl Send for CodeId

§

impl Sync for CodeId

§

impl Unpin for CodeId

§

impl UnwindSafe for CodeId

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.CodeQuery.html b/rust/oasis_runtime_sdk_contracts/types/struct.CodeQuery.html new file mode 100644 index 0000000000..7703bc6668 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.CodeQuery.html @@ -0,0 +1,31 @@ +CodeQuery in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::CodeQuery

source ·
pub struct CodeQuery {
+    pub id: CodeId,
+}
Expand description

Code information query.

+

Fields§

§id: CodeId

Code identifier.

+

Trait Implementations§

source§

impl Clone for CodeQuery

source§

fn clone(&self) -> CodeQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CodeQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CodeQuery

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for CodeQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CodeQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.CodeStorageQuery.html b/rust/oasis_runtime_sdk_contracts/types/struct.CodeStorageQuery.html new file mode 100644 index 0000000000..03e492eb18 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.CodeStorageQuery.html @@ -0,0 +1,30 @@ +CodeStorageQuery in oasis_runtime_sdk_contracts::types - Rust
pub struct CodeStorageQuery {
+    pub id: CodeId,
+}
Expand description

Code storage information query.

+

Fields§

§id: CodeId

Code identifier.

+

Trait Implementations§

source§

impl Clone for CodeStorageQuery

source§

fn clone(&self) -> CodeStorageQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CodeStorageQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CodeStorageQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CodeStorageQuery

source§

fn default() -> CodeStorageQuery

Returns the “default value” for a type. Read more
source§

impl Encode for CodeStorageQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CodeStorageQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.CodeStorageQueryResult.html b/rust/oasis_runtime_sdk_contracts/types/struct.CodeStorageQueryResult.html new file mode 100644 index 0000000000..19484c382f --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.CodeStorageQueryResult.html @@ -0,0 +1,30 @@ +CodeStorageQueryResult in oasis_runtime_sdk_contracts::types - Rust
pub struct CodeStorageQueryResult {
+    pub code: Vec<u8>,
+}
Expand description

Code storage query result.

+

Fields§

§code: Vec<u8>

Stored contract code.

+

Trait Implementations§

source§

impl Clone for CodeStorageQueryResult

source§

fn clone(&self) -> CodeStorageQueryResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CodeStorageQueryResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CodeStorageQueryResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CodeStorageQueryResult

source§

fn default() -> CodeStorageQueryResult

Returns the “default value” for a type. Read more
source§

impl Encode for CodeStorageQueryResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CodeStorageQueryResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.ContractEvent.html b/rust/oasis_runtime_sdk_contracts/types/struct.ContractEvent.html new file mode 100644 index 0000000000..0517fb279a --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.ContractEvent.html @@ -0,0 +1,32 @@ +ContractEvent in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::ContractEvent

source ·
pub struct ContractEvent {
+    pub id: InstanceId,
+    pub data: Vec<u8>,
+}
Expand description

An event emitted from a contract, wrapped to include additional metadata.

+

Fields§

§id: InstanceId

Identifier of the instance that emitted the event.

+
§data: Vec<u8>

Raw event data emitted by the instance.

+

Trait Implementations§

source§

impl Clone for ContractEvent

source§

fn clone(&self) -> ContractEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ContractEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for ContractEvent

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for ContractEvent

source§

fn default() -> ContractEvent

Returns the “default value” for a type. Read more
source§

impl Encode for ContractEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for ContractEvent

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.CustomQuery.html b/rust/oasis_runtime_sdk_contracts/types/struct.CustomQuery.html new file mode 100644 index 0000000000..75145848c6 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.CustomQuery.html @@ -0,0 +1,32 @@ +CustomQuery in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::CustomQuery

source ·
pub struct CustomQuery {
+    pub id: InstanceId,
+    pub data: Vec<u8>,
+}
Expand description

Custom contract query.

+

Fields§

§id: InstanceId

Instance identifier.

+
§data: Vec<u8>

Query arguments.

+

Trait Implementations§

source§

impl Clone for CustomQuery

source§

fn clone(&self) -> CustomQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CustomQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CustomQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CustomQuery

source§

fn default() -> CustomQuery

Returns the “default value” for a type. Read more
source§

impl Encode for CustomQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for CustomQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.CustomQueryResult.html b/rust/oasis_runtime_sdk_contracts/types/struct.CustomQueryResult.html new file mode 100644 index 0000000000..54e9b194ba --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.CustomQueryResult.html @@ -0,0 +1,25 @@ +CustomQueryResult in oasis_runtime_sdk_contracts::types - Rust
pub struct CustomQueryResult(pub Vec<u8>);
Expand description

Custom query result.

+

Tuple Fields§

§0: Vec<u8>

Trait Implementations§

source§

impl Clone for CustomQueryResult

source§

fn clone(&self) -> CustomQueryResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CustomQueryResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for CustomQueryResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for CustomQueryResult

source§

fn default() -> CustomQueryResult

Returns the “default value” for a type. Read more
source§

impl Encode for CustomQueryResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.Instance.html b/rust/oasis_runtime_sdk_contracts/types/struct.Instance.html new file mode 100644 index 0000000000..27b2c390b6 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.Instance.html @@ -0,0 +1,39 @@ +Instance in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::Instance

source ·
pub struct Instance {
+    pub id: InstanceId,
+    pub code_id: CodeId,
+    pub creator: Address,
+    pub upgrades_policy: Policy,
+}
Expand description

Deployed code instance information.

+

Fields§

§id: InstanceId

Unique instance identifier.

+
§code_id: CodeId

Identifier of code used by the instance.

+
§creator: Address

Instance creator address.

+
§upgrades_policy: Policy

Who is allowed to upgrade this instance.

+

Implementations§

source§

impl Instance

source

pub fn address_for(id: InstanceId) -> Address

Address associated with a specific contract instance.

+
source

pub fn address(&self) -> Address

Address associated with the contract.

+

Trait Implementations§

source§

impl Clone for Instance

source§

fn clone(&self) -> Instance

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Instance

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Instance

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Instance

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Instance

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.InstanceId.html b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceId.html new file mode 100644 index 0000000000..e7f5fef56d --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceId.html @@ -0,0 +1,35 @@ +InstanceId in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::InstanceId

source ·
pub struct InstanceId(/* private fields */);
Expand description

Unique deployed code instance identifier.

+

Implementations§

source§

impl InstanceId

source

pub fn as_u64(&self) -> u64

Convert identifier to u64.

+
source

pub fn increment(&self) -> InstanceId

Return the next identifier in sequence.

+
source

pub fn to_storage_key(self) -> [u8; 8]

Convert identifier to storage key representation.

+

Trait Implementations§

source§

impl Clone for InstanceId

source§

fn clone(&self) -> InstanceId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Decode for InstanceId

source§

fn try_default() -> Result<InstanceId, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<InstanceId, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for InstanceId

source§

fn default() -> InstanceId

Returns the “default value” for a type. Read more
source§

impl Encode for InstanceId

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl From<u64> for InstanceId

source§

fn from(v: u64) -> InstanceId

Converts to this type from the input type.
source§

impl PartialEq for InstanceId

source§

fn eq(&self, other: &InstanceId) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for InstanceId

source§

impl Eq for InstanceId

source§

impl StructuralPartialEq for InstanceId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.InstanceQuery.html b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceQuery.html new file mode 100644 index 0000000000..f29f7e8e83 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceQuery.html @@ -0,0 +1,30 @@ +InstanceQuery in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::InstanceQuery

source ·
pub struct InstanceQuery {
+    pub id: InstanceId,
+}
Expand description

Instance information query.

+

Fields§

§id: InstanceId

Instance identifier.

+

Trait Implementations§

source§

impl Clone for InstanceQuery

source§

fn clone(&self) -> InstanceQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for InstanceQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for InstanceQuery

source§

fn default() -> InstanceQuery

Returns the “default value” for a type. Read more
source§

impl Encode for InstanceQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for InstanceQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.InstanceRawStorageQuery.html b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceRawStorageQuery.html new file mode 100644 index 0000000000..e6a0035492 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceRawStorageQuery.html @@ -0,0 +1,37 @@ +InstanceRawStorageQuery in oasis_runtime_sdk_contracts::types - Rust
pub struct InstanceRawStorageQuery {
+    pub id: InstanceId,
+    pub store_kind: StoreKind,
+    pub limit: Option<u64>,
+    pub offset: Option<u64>,
+}
Expand description

Instance raw storage query.

+

Fields§

§id: InstanceId

Instance identifier.

+
§store_kind: StoreKind

Kind of the store to query.

+
§limit: Option<u64>

Maximum number of items per page.

+
§offset: Option<u64>

Number of skipped items.

+

Trait Implementations§

source§

impl Clone for InstanceRawStorageQuery

source§

fn clone(&self) -> InstanceRawStorageQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceRawStorageQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for InstanceRawStorageQuery

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for InstanceRawStorageQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for InstanceRawStorageQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.InstanceRawStorageQueryResult.html b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceRawStorageQueryResult.html new file mode 100644 index 0000000000..2ad9e0f80d --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceRawStorageQueryResult.html @@ -0,0 +1,30 @@ +InstanceRawStorageQueryResult in oasis_runtime_sdk_contracts::types - Rust
pub struct InstanceRawStorageQueryResult {
+    pub items: Vec<(Vec<u8>, Vec<u8>)>,
+}
Expand description

Instance raw storage query result.

+

Fields§

§items: Vec<(Vec<u8>, Vec<u8>)>

List of key-value pairs in contract’s public store.

+

Trait Implementations§

source§

impl Clone for InstanceRawStorageQueryResult

source§

fn clone(&self) -> InstanceRawStorageQueryResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceRawStorageQueryResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for InstanceRawStorageQueryResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for InstanceRawStorageQueryResult

source§

fn default() -> InstanceRawStorageQueryResult

Returns the “default value” for a type. Read more
source§

impl Encode for InstanceRawStorageQueryResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for InstanceRawStorageQueryResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.InstanceStorageQuery.html b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceStorageQuery.html new file mode 100644 index 0000000000..e075b7595c --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceStorageQuery.html @@ -0,0 +1,32 @@ +InstanceStorageQuery in oasis_runtime_sdk_contracts::types - Rust
pub struct InstanceStorageQuery {
+    pub id: InstanceId,
+    pub key: Vec<u8>,
+}
Expand description

Instance storage query.

+

Fields§

§id: InstanceId

Instance identifier.

+
§key: Vec<u8>

Storage key.

+

Trait Implementations§

source§

impl Clone for InstanceStorageQuery

source§

fn clone(&self) -> InstanceStorageQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceStorageQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for InstanceStorageQuery

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for InstanceStorageQuery

source§

fn default() -> InstanceStorageQuery

Returns the “default value” for a type. Read more
source§

impl Encode for InstanceStorageQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for InstanceStorageQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.InstanceStorageQueryResult.html b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceStorageQueryResult.html new file mode 100644 index 0000000000..3d8297fd7f --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.InstanceStorageQueryResult.html @@ -0,0 +1,29 @@ +InstanceStorageQueryResult in oasis_runtime_sdk_contracts::types - Rust
pub struct InstanceStorageQueryResult {
+    pub value: Option<Vec<u8>>,
+}

Fields§

§value: Option<Vec<u8>>

Storage value or None if key doesn’t exist.

+

Trait Implementations§

source§

impl Clone for InstanceStorageQueryResult

source§

fn clone(&self) -> InstanceStorageQueryResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceStorageQueryResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for InstanceStorageQueryResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for InstanceStorageQueryResult

source§

fn default() -> InstanceStorageQueryResult

Returns the “default value” for a type. Read more
source§

impl Encode for InstanceStorageQueryResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for InstanceStorageQueryResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.Instantiate.html b/rust/oasis_runtime_sdk_contracts/types/struct.Instantiate.html new file mode 100644 index 0000000000..3c5233d8f9 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.Instantiate.html @@ -0,0 +1,37 @@ +Instantiate in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::Instantiate

source ·
pub struct Instantiate {
+    pub code_id: CodeId,
+    pub upgrades_policy: Policy,
+    pub data: Vec<u8>,
+    pub tokens: Vec<BaseUnits>,
+}
Expand description

Instantiate call.

+

Fields§

§code_id: CodeId

Identifier of code used by the instance.

+
§upgrades_policy: Policy

Who is allowed to upgrade this instance.

+
§data: Vec<u8>

Arguments to contract’s instantiation function.

+
§tokens: Vec<BaseUnits>

Tokens that should be sent to the contract as part of the instantiate call.

+

Trait Implementations§

source§

impl Clone for Instantiate

source§

fn clone(&self) -> Instantiate

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Instantiate

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Instantiate

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Instantiate

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Instantiate

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.InstantiateResult.html b/rust/oasis_runtime_sdk_contracts/types/struct.InstantiateResult.html new file mode 100644 index 0000000000..f0d1db1310 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.InstantiateResult.html @@ -0,0 +1,30 @@ +InstantiateResult in oasis_runtime_sdk_contracts::types - Rust
pub struct InstantiateResult {
+    pub id: InstanceId,
+}
Expand description

Instantiate call result.

+

Fields§

§id: InstanceId

Assigned instance identifier.

+

Trait Implementations§

source§

impl Clone for InstantiateResult

source§

fn clone(&self) -> InstantiateResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstantiateResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for InstantiateResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for InstantiateResult

source§

fn default() -> InstantiateResult

Returns the “default value” for a type. Read more
source§

impl Encode for InstantiateResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for InstantiateResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.PublicKeyQuery.html b/rust/oasis_runtime_sdk_contracts/types/struct.PublicKeyQuery.html new file mode 100644 index 0000000000..d25184a315 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.PublicKeyQuery.html @@ -0,0 +1,33 @@ +PublicKeyQuery in oasis_runtime_sdk_contracts::types - Rust
pub struct PublicKeyQuery {
+    pub id: InstanceId,
+    pub kind: PublicKeyKind,
+}
Expand description

Public key query.

+

Fields§

§id: InstanceId

Instance identifier.

+
§kind: PublicKeyKind

Kind of public key.

+

Trait Implementations§

source§

impl Clone for PublicKeyQuery

source§

fn clone(&self) -> PublicKeyQuery

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKeyQuery

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKeyQuery

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for PublicKeyQuery

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for PublicKeyQuery

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.PublicKeyQueryResult.html b/rust/oasis_runtime_sdk_contracts/types/struct.PublicKeyQueryResult.html new file mode 100644 index 0000000000..3ea17db041 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.PublicKeyQueryResult.html @@ -0,0 +1,34 @@ +PublicKeyQueryResult in oasis_runtime_sdk_contracts::types - Rust
pub struct PublicKeyQueryResult {
+    pub key: Vec<u8>,
+    pub checksum: Vec<u8>,
+    pub signature: Vec<u8>,
+}
Expand description

Public key query result.

+

Fields§

§key: Vec<u8>

Public key.

+
§checksum: Vec<u8>

Checksum of the key manager state.

+
§signature: Vec<u8>

Sign(sk, (key || checksum)) from the key manager.

+

Trait Implementations§

source§

impl Clone for PublicKeyQueryResult

source§

fn clone(&self) -> PublicKeyQueryResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PublicKeyQueryResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for PublicKeyQueryResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for PublicKeyQueryResult

source§

fn default() -> PublicKeyQueryResult

Returns the “default value” for a type. Read more
source§

impl Encode for PublicKeyQueryResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for PublicKeyQueryResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.Upgrade.html b/rust/oasis_runtime_sdk_contracts/types/struct.Upgrade.html new file mode 100644 index 0000000000..89c590efb3 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.Upgrade.html @@ -0,0 +1,37 @@ +Upgrade in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::Upgrade

source ·
pub struct Upgrade {
+    pub id: InstanceId,
+    pub code_id: CodeId,
+    pub data: Vec<u8>,
+    pub tokens: Vec<BaseUnits>,
+}
Expand description

Upgrade call.

+

Fields§

§id: InstanceId

Instance identifier.

+
§code_id: CodeId

Updated code identifier.

+
§data: Vec<u8>

Arguments to contract’s upgrade function.

+
§tokens: Vec<BaseUnits>

Tokens that should be sent to the contract as part of the call.

+

Trait Implementations§

source§

impl Clone for Upgrade

source§

fn clone(&self) -> Upgrade

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Upgrade

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Upgrade

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Upgrade

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Upgrade

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.Upload.html b/rust/oasis_runtime_sdk_contracts/types/struct.Upload.html new file mode 100644 index 0000000000..563fd77d65 --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.Upload.html @@ -0,0 +1,35 @@ +Upload in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::Upload

source ·
pub struct Upload {
+    pub abi: ABI,
+    pub instantiate_policy: Policy,
+    pub code: Vec<u8>,
+}
Expand description

Upload call.

+

Fields§

§abi: ABI

ABI.

+
§instantiate_policy: Policy

Who is allowed to instantiate this code.

+
§code: Vec<u8>

Compiled contract code.

+

Trait Implementations§

source§

impl Clone for Upload

source§

fn clone(&self) -> Upload

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Upload

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for Upload

source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Encode for Upload

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for Upload

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

§

impl Freeze for Upload

§

impl RefUnwindSafe for Upload

§

impl Send for Upload

§

impl Sync for Upload

§

impl Unpin for Upload

§

impl UnwindSafe for Upload

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_contracts/types/struct.UploadResult.html b/rust/oasis_runtime_sdk_contracts/types/struct.UploadResult.html new file mode 100644 index 0000000000..83ede42b7e --- /dev/null +++ b/rust/oasis_runtime_sdk_contracts/types/struct.UploadResult.html @@ -0,0 +1,30 @@ +UploadResult in oasis_runtime_sdk_contracts::types - Rust

Struct oasis_runtime_sdk_contracts::types::UploadResult

source ·
pub struct UploadResult {
+    pub id: CodeId,
+}
Expand description

Upload call result.

+

Fields§

§id: CodeId

Assigned code identifier.

+

Trait Implementations§

source§

impl Clone for UploadResult

source§

fn clone(&self) -> UploadResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UploadResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decode for UploadResult

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where + Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or +undefined.
source§

impl Default for UploadResult

source§

fn default() -> UploadResult

Returns the “default value” for a type. Read more
source§

impl Encode for UploadResult

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
source§

impl EncodeAsMap for UploadResult

§

fn into_cbor_value_map(self) -> Value
where + Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where + Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32, +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> SendSyncUnwindSafe for T
where + T: Send + Sync + UnwindSafe + ?Sized,

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/all.html b/rust/oasis_runtime_sdk_macros/all.html new file mode 100644 index 0000000000..5ab0db15a5 --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Macros

Attribute Macros

Derive Macros

\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/attr.handler.html b/rust/oasis_runtime_sdk_macros/attr.handler.html new file mode 100644 index 0000000000..9902eed642 --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/attr.handler.html @@ -0,0 +1,25 @@ +handler in oasis_runtime_sdk_macros - Rust

Attribute Macro oasis_runtime_sdk_macros::handler

source ·
#[handler]
Expand description

A helper attribute for #[sdk_derive(...)]. It doesn’t do anyting on its own; +it only marks functions that represent a paratime method handler. +The permitted forms are:

+
    +
  • #[handler(call = "my_module.MyCall")]: Marks a function that handles +the “my_module.MyCall” call and can be passed to +oasis_runtime_sdk::module::dispatch_call.
  • +
  • #[handler(prefetch = "my_module.MyCall")]: Marks a function that handles +the request to prefetch any data ahead of the “my_module.MyCall” call. +Its signature should be Fn( add_prefix: &mut dyn FnMut(Prefix) -> (), body: cbor::Value, auth_info: &AuthInfo, ) -> Result<(), oasis_runtime_sdk::error::RuntimeError>
  • +
  • #[handler(query = "my_module.MyQuery")]: Marks a function that handles +the “my_module.MyQuery” query and can be passed to +oasis_runtime_sdk::module::dispatch_query.
  • +
  • #[handler(message_result = "my_module.MyMR")]: Marks a function that handles +the “my_module.MyMR” message result and can be passed to +oasis_runtime_sdk::module::dispatch_message_result.
  • +
+

Query handler can also contain the expensive tag. Example: +#[handler(query = "my_module.MyQuery", expensive)]. +Queries tagged expensive can be enabled/disabled are disabled by default to avoid +excessive costs to the node operator. This can be overridden in the node config.

+

NOTE: This attribute is parsed by the #[sdk_derive(...)] macro, which cannot +interpret the attribute name semantically. Use #[handler], not +#[oasis_runtime_sdk_macros::handler] or other paths/aliases.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/attr.migration.html b/rust/oasis_runtime_sdk_macros/attr.migration.html new file mode 100644 index 0000000000..6174818cf2 --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/attr.migration.html @@ -0,0 +1,9 @@ +migration in oasis_runtime_sdk_macros - Rust

Attribute Macro oasis_runtime_sdk_macros::migration

source ·
#[migration]
Expand description

A helper attribute for #[sdk_derive(...)]. It doesn’t do anything on its own; +it only marks functions that represent a module state migration.

+

The permitted forms are:

+
    +
  • #[migration(init)]: Marks the initial (genesis) migration.
  • +
  • #[migration(from = v)]: Marks a migration from version v to v+1, where v is +a non-negative integer.
  • +
+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/attr.sdk_derive.html b/rust/oasis_runtime_sdk_macros/attr.sdk_derive.html new file mode 100644 index 0000000000..4f4bacb782 --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/attr.sdk_derive.html @@ -0,0 +1,5 @@ +sdk_derive in oasis_runtime_sdk_macros - Rust

Attribute Macro oasis_runtime_sdk_macros::sdk_derive

source ·
#[sdk_derive]
Expand description

Derives traits from a non-trait impl block (rather than from a struct).

+

Only the Module trait is supported. In other words, given an impl MyModule block, the macro +derives implementations needed for implementing a module. +See also the #[handler] and #[migration] attributes.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/derive.Error.html b/rust/oasis_runtime_sdk_macros/derive.Error.html new file mode 100644 index 0000000000..3daf78a46e --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/derive.Error.html @@ -0,0 +1,9 @@ +Error in oasis_runtime_sdk_macros - Rust

Derive Macro oasis_runtime_sdk_macros::Error

source ·
#[derive(Error)]
+{
+    // Attributes available to this derive:
+    #[sdk_error]
+    #[source]
+    #[from]
+}
+
Expand description

Derives the Error trait on an enum.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/derive.Event.html b/rust/oasis_runtime_sdk_macros/derive.Event.html new file mode 100644 index 0000000000..19996e4eb1 --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/derive.Event.html @@ -0,0 +1,7 @@ +Event in oasis_runtime_sdk_macros - Rust

Derive Macro oasis_runtime_sdk_macros::Event

source ·
#[derive(Event)]
+{
+    // Attributes available to this derive:
+    #[sdk_event]
+}
+
Expand description

Derives the Event trait on an enum.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/index.html b/rust/oasis_runtime_sdk_macros/index.html new file mode 100644 index 0000000000..ef27357d99 --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/index.html @@ -0,0 +1,4 @@ +oasis_runtime_sdk_macros - Rust

Crate oasis_runtime_sdk_macros

source ·

Macros§

  • Constructs an oasis_sdk::core::common::version::Version from the Cargo.toml version.

Attribute Macros§

  • A helper attribute for #[sdk_derive(...)]. It doesn’t do anyting on its own; +it only marks functions that represent a paratime method handler. +The permitted forms are:
  • A helper attribute for #[sdk_derive(...)]. It doesn’t do anything on its own; +it only marks functions that represent a module state migration.
  • Derives traits from a non-trait impl block (rather than from a struct).

Derive Macros§

  • Derives the Error trait on an enum.
  • Derives the Event trait on an enum.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/macro.version_from_cargo!.html b/rust/oasis_runtime_sdk_macros/macro.version_from_cargo!.html new file mode 100644 index 0000000000..c5e9f7f133 --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/macro.version_from_cargo!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.version_from_cargo.html...

+ + + \ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/macro.version_from_cargo.html b/rust/oasis_runtime_sdk_macros/macro.version_from_cargo.html new file mode 100644 index 0000000000..820ca6c92b --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/macro.version_from_cargo.html @@ -0,0 +1,2 @@ +version_from_cargo in oasis_runtime_sdk_macros - Rust
version_from_cargo!() { /* proc-macro */ }
Expand description

Constructs an oasis_sdk::core::common::version::Version from the Cargo.toml version.

+
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk_macros/sidebar-items.js b/rust/oasis_runtime_sdk_macros/sidebar-items.js new file mode 100644 index 0000000000..63451a0f65 --- /dev/null +++ b/rust/oasis_runtime_sdk_macros/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"attr":["handler","migration","sdk_derive"],"derive":["Error","Event"],"macro":["version_from_cargo"]}; \ No newline at end of file diff --git a/rust/rofl_utils/all.html b/rust/rofl_utils/all.html new file mode 100644 index 0000000000..71b944ed0b --- /dev/null +++ b/rust/rofl_utils/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/rust/rofl_utils/https/fn.agent.html b/rust/rofl_utils/https/fn.agent.html new file mode 100644 index 0000000000..9476a9a293 --- /dev/null +++ b/rust/rofl_utils/https/fn.agent.html @@ -0,0 +1,4 @@ +agent in rofl_utils::https - Rust

Function rofl_utils::https::agent

source ·
pub fn agent() -> Agent
Expand description

An ureq::Agent that can be used to perform blocking HTTPS requests.

+

Note that this forbids non-HTTPS requests. If you need to perform plain HTTP requests consider +using agent_with_config and pass a suitable config.

+
\ No newline at end of file diff --git a/rust/rofl_utils/https/fn.agent_with_config.html b/rust/rofl_utils/https/fn.agent_with_config.html new file mode 100644 index 0000000000..cc27a6e6ce --- /dev/null +++ b/rust/rofl_utils/https/fn.agent_with_config.html @@ -0,0 +1,2 @@ +agent_with_config in rofl_utils::https - Rust

Function rofl_utils::https::agent_with_config

source ·
pub fn agent_with_config(cfg: AgentConfig) -> Agent
Expand description

An ureq::Agent with given configuration that can be used to perform blocking HTTPS requests.

+
\ No newline at end of file diff --git a/rust/rofl_utils/https/index.html b/rust/rofl_utils/https/index.html new file mode 100644 index 0000000000..d19f68c2cc --- /dev/null +++ b/rust/rofl_utils/https/index.html @@ -0,0 +1,4 @@ +rofl_utils::https - Rust

Module rofl_utils::https

source ·
Expand description

A very simple HTTPS client that can be used inside ROFL apps.

+

This simple client is needed because Fortanix EDP does not yet have support for mio/Tokio +networking and so the usual hyper and reqwest cannot be used without patches.

+

Functions§

  • An ureq::Agent that can be used to perform blocking HTTPS requests.
  • An ureq::Agent with given configuration that can be used to perform blocking HTTPS requests.
\ No newline at end of file diff --git a/rust/rofl_utils/https/sidebar-items.js b/rust/rofl_utils/https/sidebar-items.js new file mode 100644 index 0000000000..7a08c89636 --- /dev/null +++ b/rust/rofl_utils/https/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["agent","agent_with_config"]}; \ No newline at end of file diff --git a/rust/rofl_utils/index.html b/rust/rofl_utils/index.html new file mode 100644 index 0000000000..2e3c8a4b22 --- /dev/null +++ b/rust/rofl_utils/index.html @@ -0,0 +1,2 @@ +rofl_utils - Rust

Crate rofl_utils

source ·
Expand description

ROFL utilities.

+

Modules§

  • A very simple HTTPS client that can be used inside ROFL apps.
\ No newline at end of file diff --git a/rust/rofl_utils/sidebar-items.js b/rust/rofl_utils/sidebar-items.js new file mode 100644 index 0000000000..ce1dbe050f --- /dev/null +++ b/rust/rofl_utils/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["https"]}; \ No newline at end of file diff --git a/rust/search-index.js b/rust/search-index.js new file mode 100644 index 0000000000..a08aa299c7 --- /dev/null +++ b/rust/search-index.js @@ -0,0 +1,15 @@ +var searchIndex = new Map(JSON.parse('[\ +["fuzz_mkvs_node",{"t":"H","n":["main"],"q":[[0,"fuzz_mkvs_node"]],"i":[0],"f":"{{}b}","D":"`","p":[[1,"unit"]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAEAAAAAAAEAEAAAAAAAAQA="}],\ +["fuzz_mkvs_proof",{"t":"H","n":["main"],"q":[[0,"fuzz_mkvs_proof"]],"i":[0],"f":"{{}b}","D":"`","p":[[1,"unit"]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAEAAAAAAAEAEAAAAAAAAQA="}],\ +["fuzz_sgx_pcs_quote",{"t":"H","n":["main"],"q":[[0,"fuzz_sgx_pcs_quote"]],"i":[0],"f":"{{}b}","D":"`","p":[[1,"unit"]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAEAAAAAAAEAEAAAAAAAAQA="}],\ +["oasis_contract_sdk",{"t":"EEEYEYECCQCCCCCCERKRRMMMMMMMMMMMKRRRMNNNNMKGPKMNNMMMNNNMNNNNNMMMMMNNNNNMKMMNKMNMFFHNNNNHNNNNNNNNNNNNNNNNNNOOOONNNNNNNNKKKMMMFFFNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNONNNNOONNNNNNNNNNNNNNNONNNONNNNNNNNNNNNNNNNNNNNN","n":["Context","Contract","Error","Error","Event","Event","cbor","context","contract","create_contract","env","error","event","memory","storage","testing","types","ConfidentialStore","Context","Env","PublicStore","call_format","caller_address","confidential_store","deposited_tokens","emit_event","emit_message","env","instance_address","instance_id","is_read_only","public_store","Contract","Error","Request","Response","call","handle_reply","instantiate","post_upgrade","pre_upgrade","query","Crypto","CryptoError","DecryptionFailed","Env","address_for_instance","borrow","borrow_mut","debug_print","deoxysii_open","deoxysii_seal","deref","deref_mut","drop","ecdsa_recover","fmt","fmt","from","init","into","query","random_bytes","signature_verify_ed25519","signature_verify_secp256k1","signature_verify_sr25519","to_string","try_from","try_into","type_id","vzip","x25519_derive_symmetric","Error","code","module_name","to_execution_result","Event","code","into_raw","module_name","HostRegion","HostRegionRef","allocate_host","borrow","borrow","borrow_mut","borrow_mut","deallocate_host","deref","deref","deref","deref_mut","deref_mut","drop","drop","from","from","from_arg","from_args","from_slice","from_vec","init","init","into","into","into_vec","length","length","offset","offset","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","ConfidentialStore","PublicStore","Store","get","insert","remove","MockContext","MockEnv","MockStore","address_for_instance","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","call_format","caller_address","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","confidential_store","confidential_store","debug_print","default","default","deoxysii_open","deoxysii_seal","deposited_tokens","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","ec","ecdsa_recover","emit_event","emit_message","env","env","events","from","from","from","from","get","init","init","init","insert","instance_address","instance_id","into","into","into","is_read_only","messages","new","new","public_store","public_store","query","random_bytes","remove","signature_verify_ed25519","signature_verify_secp256k1","signature_verify_sr25519","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","x25519_derive_symmetric"],"q":[[0,"oasis_contract_sdk"],[17,"oasis_contract_sdk::context"],[32,"oasis_contract_sdk::contract"],[42,"oasis_contract_sdk::env"],[72,"oasis_contract_sdk::error"],[76,"oasis_contract_sdk::event"],[80,"oasis_contract_sdk::memory"],[118,"oasis_contract_sdk::storage"],[124,"oasis_contract_sdk::testing"],[207,"oasis_contract_sdk_types"],[208,"oasis_contract_sdk_types::address"],[209,"oasis_contract_sdk_types::token"],[210,"oasis_contract_sdk_types::message"],[211,"core::result"],[212,"core::option"],[213,"alloc::vec"],[214,"core::fmt"],[215,"oasis_contract_sdk_types::env"],[216,"core::convert"],[217,"alloc::string"],[218,"core::any"],[219,"oasis_contract_sdk_types::event"],[220,"oasis_contract_sdk_macros"]],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,4,4,4,4,4,4,4,4,4,4,4,4,4,0,48,48,48,48,48,48,48,48,48,0,0,26,0,9,26,26,9,10,10,26,26,26,10,26,26,26,26,26,9,10,10,10,10,26,26,26,26,26,10,0,36,36,36,0,16,16,16,0,0,0,40,42,40,42,0,40,40,42,40,42,40,42,40,42,40,40,42,40,40,42,40,42,40,40,42,40,42,40,42,40,42,40,42,40,42,0,0,0,43,43,43,0,0,0,44,45,46,44,45,46,44,45,45,46,44,46,44,46,44,45,45,44,46,44,44,44,45,45,46,44,45,46,44,45,46,44,45,44,45,45,45,45,45,45,45,46,44,46,45,46,44,46,45,45,45,46,44,45,45,46,44,45,45,44,44,46,44,44,44,46,44,45,46,44,45,46,44,45,46,44,45,46,44,44],"f":"`````````````````````{{{j{{h{}{{b{c}}{d{e}}{f{g}}}}}}}lnA`{AbAd}}{{{j{{h{}{{b{c}}{d{e}}{f{g}}}}}}}{{j{Af}}}nA`{AbAd}}{{{j{Ah{h{}{{b{c}}{d{e}}{f{g}}}}}}}{{j{Ahe}}}nA`{AbAd}}{{{j{{h{}{{b{c}}{d{e}}{f{g}}}}}}}{{j{{Al{Aj}}}}}nA`{AbAd}}{{{j{Ah{h{}{{b{c}}{d{e}}{f{g}}}}}}i}AnnA`{AbAd}B`}{{{j{Ah{h{}{{b{c}}{d{e}}{f{g}}}}}}Bb}AnnA`{AbAd}}{{{j{{h{}{{b{c}}{d{e}}{f{g}}}}}}}{{j{g}}}nA`{AbAd}}5{{{j{{h{}{{b{c}}{d{e}}{f{g}}}}}}}BdnA`{AbAd}}{{{j{{h{}{{b{c}}{d{e}}{f{g}}}}}}}BfnA`{AbAd}}{{{j{Ah{h{}{{b{c}}{d{e}}{f{g}}}}}}}{{j{Ahc}}}nA`{AbAd}}````{{{j{Ahc}}e}{{Bh{gi}}}h{}{}{}}{{{j{Ahc}}Bj}{{Bh{{Bl{e}}g}}}h{}{}}{{{j{Ahc}}e}{{Bh{Ang}}}h{}{}}002````{{{j{Ab}}Bd}Af}{{{j{c}}}{{j{e}}}{}{}}{{{j{Ahc}}}{{j{Ahe}}}{}{}}{{{j{Ab}}{j{Bn}}}An}{{{j{Ad}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}}{{Bh{{Cb{C`}}Cd}}}}0{Cf{{j{c}}}{}}{Cf{{j{Ahc}}}{}}{CfAn}{{{j{Ad}}{j{{Al{C`}}}}}{{Ch{C`}}}}{{{j{Cd}}{j{AhCj}}}Cl}0{cc{}}{{}Cf}{ce{}{}}{{{j{Ab}}c}Cn{{Db{D`}}}}{{{j{Ad}}{j{{Al{C`}}}}{j{Ah{Al{C`}}}}}Cf}{{{j{Ad}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}}Bf}0{{{j{Ad}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}}Bf}{{{j{c}}}Dd{}}{c{{Bh{e}}}{}{}}0{{{j{c}}}Df{}}7{{{j{Ad}}{j{{Al{C`}}}}{j{{Al{C`}}}}}{{Ch{C`}}}}`{{{j{Dh}}}Dj}{{{j{Dh}}}{{j{Bn}}}}{{{j{Dh}}}Dl}`{{{j{B`}}}Dj}{B`Dn}{{{j{B`}}}{{j{Bn}}}}``{DjDj}{{{j{c}}}{{j{e}}}{}{}}0{{{j{Ahc}}}{{j{Ahe}}}{}{}}0{{DjDj}An}{Cf{{j{c}}}{}}{E`E`}1{Cf{{j{Ahc}}}{}}0{CfAn}0{cc{}}0{{{Eb{DjDj}}}E`}{{DjDj}E`}{{{j{{Al{C`}}}}}Ed}{{{Cb{C`}}}E`}{{}Cf}0{ce{}{}}0{E`{{Cb{C`}}}}````{c{{Bh{e}}}{}{}}000{{{j{c}}}Df{}}033```{{{j{Ef}}{j{{Al{C`}}}}}{{Bl{{Cb{C`}}}}}}{{{j{AhEf}}{j{{Al{C`}}}}{j{{Al{C`}}}}}An}{{{j{AhEf}}{j{{Al{C`}}}}}An}```{{{j{Eh}}Bd}Af}{{{j{c}}}{{j{e}}}{}{}}00{{{j{Ahc}}}{{j{Ahe}}}{}{}}00{{{j{Ej}}}l}{{{j{Ej}}}{{j{Af}}}}{{{j{El}}}El}{{{j{Eh}}}Eh}{{{j{c}}{j{Ahe}}}An{}{}}0{{{j{c}}}An{}}0{{{j{AhEj}}}{{j{Ahc}}}{}}`{{{j{Eh}}{j{Bn}}}An}{{}El}{{}Eh}{{{j{Eh}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}}{{Bh{{Cb{C`}}Cd}}}}0{{{j{Ej}}}{{j{{Al{Aj}}}}}}{Cf{{j{c}}}{}}00{Cf{{j{Ahc}}}{}}00{CfAn}00`{{{j{Eh}}{j{{Al{C`}}}}}{{Ch{C`}}}}{{{j{AhEj}}c}AnB`}{{{j{AhEj}}Bb}An}{{{j{Ej}}}{{j{c}}}{}}``{cc{}}{EnEj}11{{{j{El}}{j{{Al{C`}}}}}{{Bl{{Cb{C`}}}}}}{{}Cf}00{{{j{AhEl}}{j{{Al{C`}}}}{j{{Al{C`}}}}}An}{{{j{Ej}}}{{j{Af}}}}{{{j{Ej}}}Bd}{ce{}{}}00{{{j{Ej}}}Bf}`{{}El}{{}Eh}{{{j{AhEj}}}{{j{Ahc}}}{}}`{{{j{Eh}}c}Cn{{Db{D`}}}}{{{j{Eh}}{j{{Al{C`}}}}{j{Ah{Al{C`}}}}}Cf}{{{j{AhEl}}{j{{Al{C`}}}}}An}{{{j{Eh}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}}Bf}0{{{j{Eh}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}{j{{Al{C`}}}}}Bf}{{{j{c}}}e{}{}}0{c{{Bh{e}}}{}{}}00000{{{j{c}}}Df{}}00<<<{{{j{Eh}}{j{{Al{C`}}}}{j{{Al{C`}}}}}{{Ch{C`}}}}","D":"Lb","p":[[17,"PublicStore"],[17,"ConfidentialStore"],[17,"Env"],[10,"Context",17],[1,"reference"],[6,"CallFormat",207],[10,"PublicStore",118],[10,"ConfidentialStore",118],[10,"Env",42],[10,"Crypto",42],[5,"Address",208],[0,"mut"],[5,"BaseUnits",209],[1,"slice"],[1,"unit"],[10,"Event",76],[6,"Message",210],[5,"InstanceId",207],[1,"bool"],[6,"Result",211],[6,"Reply",210],[6,"Option",212],[1,"str"],[1,"u8"],[5,"Vec",213],[6,"CryptoError",42],[1,"usize"],[1,"array"],[5,"Formatter",214],[8,"Result",214],[6,"QueryResponse",215],[6,"QueryRequest",215],[10,"Into",216],[5,"String",217],[5,"TypeId",218],[10,"Error",72],[1,"u32"],[6,"ExecutionResult",207],[5,"Event",219],[5,"HostRegion",80],[1,"tuple"],[5,"HostRegionRef",80],[10,"Store",118],[5,"MockEnv",124],[5,"MockContext",124],[5,"MockStore",124],[5,"ExecutionContext",207],[10,"Contract",32]],"r":[[0,17],[1,32],[2,72],[3,220],[4,76],[5,220],[9,220]],"b":[[56,"impl-Display-for-CryptoError"],[57,"impl-Debug-for-CryptoError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAG4AGAABAAIABQAAAAcAAAAKAAAAEQAAAC0AAAAwAAEANQACADkAAQA8AAAAQwAEAFQAAwBZAAAAWwAEAGYAAQBrAAsAgAAPAJEADgChAAMAqAAAAKsABgC1AAAAuQAAALsAFAA="}],\ +["oasis_contract_sdk_storage",{"t":"CCFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFRFKKFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNMNNNNNNNNNNNN","n":["cell","map","ConfidentialCell","PublicCell","borrow","borrow","borrow_mut","borrow_mut","clear","clear","deref","deref","deref_mut","deref_mut","drop","drop","from","from","get","get","init","init","into","into","new","new","set","set","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","ConfidentialMap","Encoded","Int","Integer","MapKey","PublicMap","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","from","from","from","from","get","get","init","init","init","insert","insert","into","into","into","key","key","new","new","new","remove","remove","to_be_bytes","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip"],"q":[[0,"oasis_contract_sdk_storage"],[2,"oasis_contract_sdk_storage::cell"],[36,"oasis_contract_sdk_storage::map"],[91,"oasis_contract_sdk::storage"],[92,"core::option"],[93,"oasis_cbor::decode"],[94,"oasis_cbor::encode"],[95,"core::result"],[96,"core::any"],[97,"alloc::vec"],[98,"core::convert"]],"i":[0,0,0,0,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,3,6,0,17,0,0,0,0,16,18,20,16,18,20,16,18,20,16,18,20,16,18,20,16,16,18,20,18,20,16,18,20,18,20,16,18,20,19,16,16,18,20,18,20,17,16,18,20,16,18,20,16,18,20,16,18,20],"f":"````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{{f{c}}}}{b{dh}}}j{}}{{{b{{l{c}}}}{b{dn}}}j{}}{A`{{b{c}}}{}}0{A`{{b{dc}}}{}}0{A`j}0{cc{}}0{{{b{{f{c}}}}{b{h}}}{{Ab{c}}}Ad}{{{b{{l{c}}}}{b{n}}}{{Ab{c}}}Ad}{{}A`}0{ce{}{}}0{{{b{{Ah{Af}}}}}{{f{c}}}{}}{{{b{{Ah{Af}}}}}{{l{c}}}{}}{{{b{{f{c}}}}{b{dh}}c}jAj}{{{b{{l{c}}}}{b{dn}}c}jAj}{c{{Al{e}}}{}{}}000{{{b{c}}}An{}}066``````{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00???>>>==={c{{B`{c}}}Bb}==={{{b{{Bd{ce}}}}{b{h}}c}{{Ab{e}}}Bf{AjAd}}{{{b{{Bh{ce}}}}{b{n}}c}{{Ab{e}}}Bf{AjAd}}<<<{{{b{{Bd{ce}}}}{b{dh}}ce}jBf{AjAd}}{{{b{{Bh{ce}}}}{b{dn}}ce}jBf{AjAd}}==={{{b{Bf}}}{{Bj{{b{{Ah{Af}}}}}}}}{{{b{{B`{c}}}}}{{Bj{{b{{Ah{Af}}}}}}}Bb}6{{{b{{Ah{Af}}}}}{{Bd{ce}}}{}{}}{{{b{{Ah{Af}}}}}{{Bh{ce}}}{}{}}{{{b{{Bd{ce}}}}{b{dh}}c}jBf{AjAd}}{{{b{{Bh{ce}}}}{b{dn}}c}jBf{AjAd}}{{{Bb{}{{Bl{c}}}}}c{{Bn{{Ah{Af}}}}}}??????>>>{ce{}{}}00","D":"E`","p":[[1,"reference"],[0,"mut"],[5,"PublicCell",2],[10,"PublicStore",91],[1,"unit"],[5,"ConfidentialCell",2],[10,"ConfidentialStore",91],[1,"usize"],[6,"Option",92],[10,"Decode",93],[1,"u8"],[1,"slice"],[10,"Encode",94],[6,"Result",95],[5,"TypeId",96],[5,"Int",36],[10,"Integer",36],[5,"PublicMap",36],[10,"MapKey",36],[5,"ConfidentialMap",36],[5,"Vec",97],[17,"Encoded"],[10,"AsRef",98]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAADMACAAFAAMACwAFABUAAQAdAAcAKwAPAEAAAgBJAAAAUAALAA=="}],\ +["oasis_contract_sdk_types",{"t":"GFPFFGPFPPCNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNCONNNNNONNNNNNNNNNNNNNNNNNCNNNNNNCONNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNCOCOCCNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOFGPTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPGPNNNNNNNNNNNNNNNNNNPPGGPPPPPGGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOFNNNNNOONNNNNNNNONNNNNNPPPGPGPGPPPGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOCFNNNNNNNNNNNONNNNNNNNNNPPGNNNNNNNNNNNNNNNNNNNCCCCCHHHHFFGTTPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNO","n":["CallFormat","CodeId","EncryptedX25519DeoxysII","ExecutionContext","ExecutionOk","ExecutionResult","Failed","InstanceId","Ok","Plain","address","as_u64","as_u64","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call_format","caller_address","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","crypto","data","default","default","default","default","default","deposited_tokens","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","env","eq","eq","eq","equivalent","equivalent","equivalent","event","events","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","increment","increment","init","init","init","init","init","init","instance_address","instance_id","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","message","messages","modules","read_only","storage","testing","to_owned","to_owned","to_owned","to_owned","to_owned","to_storage_key","to_storage_key","token","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","code","message","module","Address","Error","MalformedAddress","SIZE","as_ref","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","clone_to_uninit","cmp","compare","default","deref","deref","deref_mut","deref_mut","drop","drop","encode_hex","encode_hex_upper","eq","equivalent","fmt","fmt","fmt","from","from","from","from_bech32","from_bytes","init","init","into","into","into_cbor_value","partial_cmp","to_bech32","to_owned","to_string","try_default","try_from","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","Ed25519","Secp256k1","SignatureKind","Sr25519","borrow","borrow_mut","clone","clone_into","clone_to_uninit","clone_to_uninit","deref","deref_mut","drop","from","init","into","to_owned","try_from","try_from","try_into","type_id","vzip","Accounts","Accounts","AccountsQuery","AccountsResponse","Balance","Balance","BlockInfo","BlockInfo","Error","QueryRequest","QueryResponse","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","fmt","fmt","fmt","fmt","from","from","from","from","from","from","init","init","init","init","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","address","denomination","balance","code","epoch","message","module","round","timestamp","Event","borrow","borrow_mut","clone","clone_into","clone_to_uninit","code","data","deref","deref_mut","drop","fmt","from","init","into","into_cbor_value","module","to_owned","try_from","try_from_cbor_value","try_into","type_id","vzip","Always","Call","Call","CallResult","Failed","Message","Never","NotifyReply","Ok","OnError","OnSuccess","Reply","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","eq","equivalent","fmt","fmt","fmt","fmt","from","from","from","from","from","init","init","init","init","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","is_success","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","code","module","body","data","id","max_gas","method","reply","data","id","result","contracts","InstantiateResult","borrow","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref_mut","drop","fmt","from","id","init","into","into_cbor_value","to_owned","try_default","try_from","try_from_cbor_value","try_into","type_id","vzip","Confidential","Public","StoreKind","borrow","borrow_mut","clone","clone_into","clone_to_uninit","clone_to_uninit","deref","deref_mut","drop","from","init","into","prefix","to_owned","try_from","try_from","try_into","type_id","vzip","addresses","alice","bob","charlie","dave","address","address","address","address","BaseUnits","Denomination","Error","MAX_LENGTH","NATIVE","NameTooLong","amount","as_ref","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","cmp","cmp","compare","compare","default","default","denomination","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","encode_hex","encode_hex_upper","eq","eq","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from_str","init","init","init","into","into","into","into_cbor_value","into_cbor_value","into_vec","is_native","new","partial_cmp","partial_cmp","to_owned","to_owned","to_string","to_string","to_string","try_default","try_default","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","length"],"q":[[0,"oasis_contract_sdk_types"],[166,"oasis_contract_sdk_types::ExecutionResult"],[169,"oasis_contract_sdk_types::address"],[223,"oasis_contract_sdk_types::crypto"],[245,"oasis_contract_sdk_types::env"],[334,"oasis_contract_sdk_types::env::AccountsQuery"],[336,"oasis_contract_sdk_types::env::AccountsResponse"],[337,"oasis_contract_sdk_types::env::QueryResponse"],[343,"oasis_contract_sdk_types::event"],[366,"oasis_contract_sdk_types::message"],[459,"oasis_contract_sdk_types::message::CallResult"],[461,"oasis_contract_sdk_types::message::Message"],[467,"oasis_contract_sdk_types::message::Reply"],[470,"oasis_contract_sdk_types::modules"],[471,"oasis_contract_sdk_types::modules::contracts"],[494,"oasis_contract_sdk_types::storage"],[516,"oasis_contract_sdk_types::testing"],[517,"oasis_contract_sdk_types::testing::addresses"],[521,"oasis_contract_sdk_types::testing::addresses::alice"],[522,"oasis_contract_sdk_types::testing::addresses::bob"],[523,"oasis_contract_sdk_types::testing::addresses::charlie"],[524,"oasis_contract_sdk_types::testing::addresses::dave"],[525,"oasis_contract_sdk_types::token"],[615,"oasis_contract_sdk_types::token::Error"],[616,"core::fmt"],[617,"oasis_runtime_sdk::types::transaction"],[618,"oasis_cbor_value::values"],[619,"oasis_cbor"],[620,"core::result"],[621,"core::any"],[622,"core::cmp"],[623,"core::iter::traits::collect"],[624,"oasis_runtime_sdk::types::address"],[625,"core::option"],[626,"alloc::string"],[627,"oasis_runtime_sdk::module"],[628,"oasis_runtime_sdk::types::token"],[629,"alloc::vec"]],"i":[0,0,6,0,0,0,7,0,7,6,0,1,4,1,4,6,10,7,8,1,4,6,10,7,8,10,10,1,4,6,7,8,1,4,6,7,8,1,1,4,4,6,6,7,8,0,8,1,4,6,10,8,10,1,4,6,10,7,8,1,4,6,10,7,8,1,4,6,10,7,8,0,1,4,6,1,4,6,0,8,1,4,6,10,7,8,1,1,4,4,6,6,10,7,8,1,4,1,4,6,10,7,8,10,10,1,4,6,10,7,8,1,4,6,10,7,8,0,8,0,10,0,0,1,4,6,7,8,1,4,0,1,4,6,10,8,1,4,6,10,7,8,1,4,6,10,7,8,1,4,6,10,7,8,1,4,6,10,7,8,1,4,6,10,7,8,53,53,53,0,0,27,22,22,27,22,27,22,22,22,22,22,22,22,22,27,22,27,22,27,22,22,22,22,22,27,27,22,27,22,22,22,22,27,22,27,22,22,22,22,22,27,22,27,22,22,22,27,22,27,22,27,22,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,34,35,0,0,36,37,34,35,35,0,0,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,34,35,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,34,35,36,37,54,54,55,56,57,56,56,57,57,0,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,40,39,41,0,42,0,40,0,42,40,40,0,39,40,41,42,39,40,41,42,39,40,41,42,39,40,41,42,39,40,40,41,42,39,40,41,42,39,40,41,42,39,40,41,42,40,40,39,40,41,42,39,40,41,42,42,39,40,41,42,39,40,41,42,39,40,41,42,42,39,40,41,42,39,40,41,42,39,40,41,42,39,40,41,42,39,40,41,42,39,40,41,42,58,58,59,59,59,59,59,59,60,60,60,0,0,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,45,45,0,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,0,0,0,0,0,0,0,0,0,0,0,0,48,48,49,46,48,48,49,46,48,49,46,48,46,48,46,48,46,48,46,48,46,48,46,46,48,49,46,48,49,46,48,49,46,48,48,48,46,48,46,48,48,49,49,46,46,48,48,49,46,46,46,48,48,49,46,48,49,46,48,46,48,48,46,48,46,48,46,48,49,46,48,46,48,48,49,46,48,46,48,49,46,48,49,46,48,49,46,61],"f":"```````````{{{d{b}}}f}{{{d{h}}}f}{{{d{c}}}{{d{e}}}{}{}}00000{{{d{jc}}}{{d{je}}}{}{}}00000``{{{d{b}}}b}{{{d{h}}}h}{{{d{l}}}l}{{{d{n}}}n}{{{d{A`}}}A`}{{{d{c}}{d{je}}}Ab{}{}}0000{{{d{c}}}Ab{}}0000000``{{}b}{{}h}{{}l}{{}Ad}{{}A`}`{Af{{d{c}}}{}}00000{Af{{d{jc}}}{}}00000{AfAb}00000`{{{d{b}}{d{b}}}Ah}{{{d{h}}{d{h}}}Ah}{{{d{l}}{d{l}}}Ah}{{{d{c}}{d{e}}}Ah{}{}}00``{{{d{b}}{d{jAj}}}Al}{{{d{h}}{d{jAj}}}Al}{{{d{l}}{d{jAj}}}Al}{{{d{Ad}}{d{jAj}}}Al}{{{d{n}}{d{jAj}}}Al}{{{d{A`}}{d{jAj}}}Al}{cc{}}{fb}1{fh}2{Anl}333{{{d{b}}}b}{{{d{h}}}h}{{}Af}00000``{ce{}{}}00000{bB`}{hB`}{lB`}{AdB`}{nB`}{A`B`}``````{{{d{c}}}e{}{}}0000{b{{Bd{Bb}}}}{h{{Bd{Bb}}}}`{{}{{Bh{bBf}}}}{{}{{Bh{hBf}}}}{{}{{Bh{lBf}}}}{{}{{Bh{AdBf}}}}{{}{{Bh{A`Bf}}}}{c{{Bh{e}}}{}{}}00000{B`{{Bh{bBf}}}}{B`{{Bh{hBf}}}}{B`{{Bh{lBf}}}}{B`{{Bh{AdBf}}}}{B`{{Bh{nBf}}}}{B`{{Bh{A`Bf}}}}666666{{{d{c}}}Bj{}}00000{ce{}{}}00000```````{{{d{Bl}}}{{d{{Bn{Bb}}}}}}{{{d{c}}}{{d{e}}}{}{}}0{{{d{jc}}}{{d{je}}}{}{}}0{{{d{Bl}}}Bl}{{{d{c}}{d{je}}}Ab{}{}}{{{d{c}}}Ab{}}0{{{d{Bl}}{d{Bl}}}C`}{{{d{c}}{d{e}}}C`{}{}}{{}Bl}{Af{{d{c}}}{}}0{Af{{d{jc}}}{}}0{AfAb}0{{{d{c}}}e{}{{Cd{Cb}}}}0{{{d{Bl}}{d{Bl}}}Ah}{{{d{c}}{d{e}}}Ah{}{}}{{{d{Cf}}{d{jAj}}}Al}0{{{d{Bl}}{d{jAj}}}Al}{cc{}}0{ChBl}{{{d{Cj}}}{{Bh{BlCf}}}}{{{d{{Bn{Bb}}}}}{{Bh{BlCf}}}}{{}Af}0{ce{}{}}0{BlB`}{{{d{Bl}}{d{Bl}}}{{Cl{C`}}}}{BlCn}{{{d{c}}}e{}{}}{{{d{c}}}Cn{}}{{}{{Bh{BlBf}}}}{c{{Bh{e}}}{}{}}{{{d{{Bn{Bb}}}}}{{Bh{Blc}}}{}}1{B`{{Bh{BlBf}}}}22{{{d{c}}}Bj{}}0::````{{{d{c}}}{{d{e}}}{}{}}{{{d{jc}}}{{d{je}}}{}{}}{{{d{D`}}}D`}{{{d{c}}{d{je}}}Ab{}{}}{{{d{c}}}Ab{}}0{Af{{d{c}}}{}}{Af{{d{jc}}}{}}{AfAb}{cc{}}{{}Af}{ce{}{}}{{{d{c}}}e{}{}}{Db{{Bh{D`c}}}{}}{c{{Bh{e}}}{}{}}0>3```````````====<<<<{{{d{Dd}}}Dd}{{{d{Df}}}Df}{{{d{Dh}}}Dh}{{{d{Dj}}}Dj}>>>>====<<<<;;;;::::{{{d{Dd}}{d{jAj}}}Al}{{{d{Df}}{d{jAj}}}Al}{{{d{Dh}}{d{jAj}}}Al}{{{d{Dj}}{d{jAj}}}Al}{DhDd}>>{DjDf}??>>>>===={DdB`}{DfB`}{DhB`}{DjB`}{{{d{c}}}e{}{}}000????{B`{{Bh{DdBf}}}}{B`{{Bh{DfBf}}}}{B`{{Bh{DhBf}}}}{B`{{Bh{DjBf}}}}{c{{Bh{e}}}{}{}}000{{{d{c}}}Bj{}}000{ce{}{}}000``````````{{{d{c}}}{{d{e}}}{}{}}{{{d{jc}}}{{d{je}}}{}{}}{{{d{Dl}}}Dl}{{{d{c}}{d{je}}}Ab{}{}}{{{d{c}}}Ab{}}``{Af{{d{c}}}{}}{Af{{d{jc}}}{}}{AfAb}{{{d{Dl}}{d{jAj}}}Al}{cc{}}{{}Af};{DlB`}`{{{d{c}}}e{}{}}?{B`{{Bh{DlBf}}}}{c{{Bh{e}}}{}{}}{{{d{c}}}Bj{}}{ce{}{}}````````````{{{d{c}}}{{d{e}}}{}{}}000{{{d{jc}}}{{d{je}}}{}{}}000{{{d{Dn}}}Dn}{{{d{E`}}}E`}{{{d{Eb}}}Eb}{{{d{Ed}}}Ed}{{{d{c}}{d{je}}}Ab{}{}}000{{{d{c}}}Ab{}}0000{Af{{d{c}}}{}}000{Af{{d{jc}}}{}}000{AfAb}000{{{d{E`}}{d{E`}}}Ah}{{{d{c}}{d{e}}}Ah{}{}}{{{d{Dn}}{d{jAj}}}Al}{{{d{E`}}{d{jAj}}}Al}{{{d{Eb}}{d{jAj}}}Al}{{{d{Ed}}{d{jAj}}}Al}{cc{}}000{EfEd}{{}Af}000{ce{}{}}000{DnB`}{E`B`}{EbB`}{EdB`}{{{d{Ed}}}Ah}{{{d{c}}}e{}{}}000{c{{Bh{e}}}{}{}}000{B`{{Bh{DnBf}}}}{B`{{Bh{E`Bf}}}}{B`{{Bh{EbBf}}}}{B`{{Bh{EdBf}}}}4444{{{d{c}}}Bj{}}000<<<<`````````````{{{d{c}}}{{d{e}}}{}{}}{{{d{jc}}}{{d{je}}}{}{}}{{{d{Eh}}}Eh}{{{d{c}}{d{je}}}Ab{}{}}{{{d{c}}}Ab{}}{{}Eh}{Af{{d{c}}}{}}{Af{{d{jc}}}{}}{AfAb}{{{d{Eh}}{d{jAj}}}Al}{cc{}}`{{}Af}{ce{}{}}{EhB`}{{{d{c}}}e{}{}}{{}{{Bh{EhBf}}}}{c{{Bh{e}}}{}{}}{B`{{Bh{EhBf}}}}1{{{d{c}}}Bj{}}6```{{{d{c}}}{{d{e}}}{}{}}{{{d{jc}}}{{d{je}}}{}{}}{{{d{Ej}}}Ej}{{{d{c}}{d{je}}}Ab{}{}}{{{d{c}}}Ab{}}0{Af{{d{c}}}{}}{Af{{d{jc}}}{}}{AfAb}{cc{}}{{}Af}{ce{}{}}{{{d{Ej}}}{{d{{Bn{Bb}}}}}}{{{d{c}}}e{}{}}{Db{{Bh{Ejc}}}{}}{c{{Bh{e}}}{}{}}0?4`````{{}Bl}000``````{{{d{El}}}En}{{{d{F`}}}{{d{{Bn{Bb}}}}}}{{{d{c}}}{{d{e}}}{}{}}00{{{d{jc}}}{{d{je}}}{}{}}00{{{d{F`}}}F`}{{{d{El}}}El}{{{d{c}}{d{je}}}Ab{}{}}0{{{d{c}}}Ab{}}0{{{d{F`}}{d{F`}}}C`}{{{d{El}}{d{El}}}C`}{{{d{c}}{d{e}}}C`{}{}}0{{}F`}{{}El}{{{d{El}}}{{d{F`}}}}{Af{{d{c}}}{}}00{Af{{d{jc}}}{}}00{AfAb}00{{{d{c}}}e{}{{Cd{Cb}}}}0{{{d{F`}}{d{F`}}}Ah}{{{d{El}}{d{El}}}Ah}{{{d{c}}{d{e}}}Ah{}{}}0{{{d{F`}}{d{jAj}}}Al}0{{{d{Fb}}{d{jAj}}}Al}0{{{d{El}}{d{jAj}}}Al}0{cc{}}{FdF`}1{FfEl}{{{d{Ff}}}El}3{{{d{Cj}}}{{Bh{F`c}}}{}}{{}Af}00{ce{}{}}00{F`B`}{ElB`}{F`{{Fh{Bb}}}}{{{d{F`}}}Ah}{{EnF`}El}{{{d{F`}}{d{F`}}}{{Cl{C`}}}}{{{d{El}}{d{El}}}{{Cl{C`}}}}{{{d{c}}}e{}{}}0{{{d{c}}}Cn{}}00{{}{{Bh{F`Bf}}}}{{}{{Bh{ElBf}}}}{c{{Bh{e}}}{}{}}{{{d{{Bn{Bb}}}}}{{Bh{F`c}}}{}}11{B`{{Bh{F`Bf}}}}{B`{{Bh{ElBf}}}}333{{{d{c}}}Bj{}}00{ce{}{}}00`","D":"Ob","p":[[5,"CodeId",0],[1,"reference"],[1,"u64"],[5,"InstanceId",0],[0,"mut"],[6,"CallFormat",0],[6,"ExecutionResult",0],[5,"ExecutionOk",0],[1,"unit"],[5,"ExecutionContext",0],[1,"usize"],[1,"bool"],[5,"Formatter",616],[8,"Result",616],[6,"CallFormat",617],[6,"Value",618],[1,"u8"],[1,"array"],[6,"DecodeError",619],[6,"Result",620],[5,"TypeId",621],[5,"Address",169],[1,"slice"],[6,"Ordering",622],[1,"char"],[10,"FromIterator",623],[6,"Error",169],[5,"Address",624],[1,"str"],[6,"Option",625],[5,"String",626],[6,"SignatureKind",223],[1,"u32"],[6,"QueryRequest",245],[6,"QueryResponse",245],[6,"AccountsQuery",245],[6,"AccountsResponse",245],[5,"Event",343],[6,"Message",366],[6,"NotifyReply",366],[6,"Reply",366],[6,"CallResult",366],[6,"CallResult",627],[5,"InstantiateResult",471],[6,"StoreKind",494],[5,"BaseUnits",525],[1,"u128"],[5,"Denomination",525],[6,"Error",525],[5,"Denomination",628],[5,"BaseUnits",628],[5,"Vec",629],[15,"Failed",166],[15,"Balance",334],[15,"Balance",336],[15,"Error",337],[15,"BlockInfo",337],[15,"Failed",459],[15,"Call",461],[15,"Call",467],[15,"NameTooLong",615]],"r":[],"b":[[195,"impl-Display-for-Error"],[196,"impl-Debug-for-Error"],[567,"impl-Debug-for-Denomination"],[568,"impl-Display-for-Denomination"],[569,"impl-Debug-for-Error"],[570,"impl-Display-for-Error"],[571,"impl-Display-for-BaseUnits"],[572,"impl-Debug-for-BaseUnits"],[576,"impl-From%3CBaseUnits%3E-for-BaseUnits"],[577,"impl-From%3C%26BaseUnits%3E-for-BaseUnits"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAO8BNwAHAAAACQAAAA4ACwAcABEAMAAEADYAEQBJAAUAUQAFAFgAAABaAAAAXAAAAGIABQBwAAUAfAAEAIQAJQCsAAAArgAYAMkAAADMAAEA0AABANMADgDjAAkA7gAAAPAABQABASQAKAEAACsBAwAzASQAWQEEAGABAwBlAQAAZwEAAGkBBgBzAQAAdQEAAHcBAgB7ASYApgEEAK8BAwC0ASMA2QEJAOUBAADnAQkA8gEIAPwBAAD/AQ4AEAIAABMCAAAVAhIAKQIUAD8CAABBAgEARAIDAEsCAQBQAhgA"}],\ +["oasis_core_runtime",{"t":"FFPEEEPPGECNNNNNNCEQCCCNNNNNNNNCNNNCNNNNNNNCCCQCNNNNNNOQQQCCOECOCNNNNNNNNNCQNNNKFNNNNNNNNNNHNNNNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCCCCCCCCCCCCCCCFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCFSSKSNNHMHNNNNHNNNNNNNNNNNNSFSNNNNNNNNNNNNNNNNNNNNNFFFFFFKNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNOMNOOHHONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNSSFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKKNMMNMMNMMMHHSFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFNNNNNNNNNNNNNHFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFPSFFPGFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCOONNNNNNNNNNNNNNNNNNNNOONNCOOHCONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHFSIFOONNNNONNNNNNNNNNNNONNNNNNNNNNONNNNNNOONNNNNNNNNNNNHNNPTPPGTPPPPPTTPFFPFTFPPPPPPFFPFFPPPPPPPNONNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOONNNNOONNOOOOOONNNNNOOOOHOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOHHHHHSFFNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNOONOOONNNNNNNNNNNNNNSFNNNNNNNNNNNNNNONNNNNNNNONFFNNNNOONNNNNNNNNNNNNNONNNNNNNNOONNONNNNNNONNFGSFSSPCCNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNCONNNNNNNNNCOCCCCCOCNNNCNNNNNNNNNNNNNNCNNNFFFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNSIFNNNNNNNNNONNNNNONNNNNNNNNNPFFFPPFFFGPNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNONNNNNNNNNNNNNNNNNNNNNOONOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOONNNNNNNFFFFGPFFFFNNNNNNNNNNNNNNNNNNOCONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNOOOONNOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFGPPFFFGONNNNNNNNNNNNOONNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNOOOONNNNNNNNNNNNNNNNNOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNSFFFFFSFFFFFFPPPPPPPSSSFFFFFFTTTTTTTTFFFFGGFGGFFFGPPFFFPPPPFFFFFOONOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONOOOONOOOOOOOOOOOOOOOONONOOOONOOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOONNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOPPFPPFSPFPSPGFGFPPPPGFGFPPPPPPGFKPPPKPPPKFPPPGPFFPGPPPPPPPNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNOOOOONNOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOMNNNOONOOOMNONNNMOOONOOOONNONOOOOOMNNNNNNNNNNNNNNNNNNMNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNONNNNNNNNNNNNNNNNNNPFGFPPPGPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNOOONNNNNNNNNNNNNNNNNONNNNNFPFFFFFFFPFFFGFFPPPPPPPFFPPPFFGFIFPGFFFFFOOOOOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOONNOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOFGPCNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNCCNCNNNNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFNNNNOCNNNNNNNNNNNNNNNNOONNNNNOONNOOOONNNNNNNNNNNNNFNNNNNNNNNNNNNNFNNNNNNNNNNNNNNNNFNNNNNNNNNNNNNNNNNFNNNNNNNNNNNNNNNNNNNNNNNSFSNNHNNNHNNNHNNNNNCOHNNNNNOCNSFONNNNNNNNNONNNOONNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFIIFSIFFOOONNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNOONNNNNNNNNNNNOOOOOONNNNNNNNNNNNNNNNNNNNNNNNPPGPPPPFPPKNNNNONNNNNNNNNNNNMNNNNNOONNNNNMMONMMNNNNNNNNNNMMMHNNFKFFONNNNNNONNNNNNNNNNNNNOMNNNNNNNONOONNNNNNNONNNNNNECCCCCCCPPPPPFFGPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFNNNNNNNNNONNNNFGPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFKIIFFKKNNNNNNNNNNNNNNNNNNMNNNNNNNNMMNNNNNNNNOMONNNNNNNNNNNNNNNNFGFFPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNONNNNNNOOOOOOOOGPFIFFINNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPGPFPPFPGPGPGFPFPFPPONONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONONONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNHHPGKPFFFONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNOOOMOOOONMNNNNNNNNNNNNNNNNNNNNOFNNNNNNNNNNNNNNNNNNNNNNNNNHPPPPPPPFGPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPFPPPPPPFGFGPPNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNONNNNNNNNNNNNNNNNNNNNNNNNNKEFNNNNNNNMNNMNNCNNNNNPIKPKPPPKIPFGKGFIFFFGPFINNNNNNNNNNNNNNNNNNNNMMNNNOONNNNNNNNNNNNNNNNNNNMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNMMMNNNNNMNMMMNNNNNMNNNOONNNNNNNNNNMMNNNNNNNNNNNNNNNNNNMMMMNNNNNONCNNONNNMONNMMMNNNNMMNNNNMOMMCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNKMMFFFFFFFFFFKFGFPNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOHNNNNOOOOONMNNNOMNNNOMNNNONNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNECCCCCCFNNOOONNNONONNONOOONNNNKFFFONNNNNNMNNNNNNNNNNNMNNNNNONNNNNNNNOONONNNONNNNNNONNNNNNFIFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNONNNNNNNNNNNNNNOFINNNNNNNNNNNNNONNNNONONSFNNNNNNNNNNNNNNNNNFNNNNNNNNNNNNNNNNNNNNNNNNNNNNGFFFPPFPGPGFFPPPPPFPFPPPPPPPPPPPPPPPPPGPPPPPPPFGPFPPPPPPPPPPPPPPPPPPPPPPPFPFPPPPPPPFPPPPPPPPPPGFGPPPOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOONOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO","n":["BUILD_INFO","BuildInfo","None","Protocol","RpcDemux","RpcDispatcher","Sgx","Tdx","TeeType","TxnDispatcher","app","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cache","cbor","classify_noderef","common","config","consensus","default","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","dispatcher","drop","drop","drop","enclave_rpc","eq","equivalent","fmt","fmt","from","from","from","future","host","identity","impl_bytes","init","init","init","init","into","into","into","is_secure","key_format","noderef_as","noderef_as_mut","policy","protocol","protocol_version","start_runtime","storage","tee_type","transaction","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","types","version_from_cargo","vzip","vzip","vzip","App","NoopApp","borrow","borrow_mut","deref","deref_mut","drop","from","init","into","is_rofl","is_rofl","new","on_init","on_runtime_block","on_runtime_event","query","quote_policy","try_from","try_into","type_id","vzip","Cache","CacheSet","borrow","borrow","borrow_mut","borrow_mut","check","clone","clone_into","clone_to_uninit","commit","deref","deref","deref_mut","deref_mut","drop","drop","execute","from","from","init","init","into","into","new","query","to_owned","tree","tree_mut","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","bytes","crypto","key_format","logger","namespace","panic","process","quantity","sgx","time","version","versioned","hash","mrae","signature","x25519","Hash","as_ref","borrow","borrow_mut","clone","clone_into","clone_to_uninit","clone_to_uninit","cmp","compare","decode_atom","default","deref","deref_mut","digest_bytes","digest_bytes_list","drop","empty_hash","encode_atom","encode_hex","encode_hex_upper","eq","equivalent","fmt","fmt","fmt","from","from","from","from","from_str","hash","init","into","into_cbor_value","is_empty","len","partial_cmp","size","to_owned","to_string","truncated","try_default","try_from","try_from_cbor_value","try_into","type_id","vzip","zeroize","deoxysii","nonce","DeoxysII","KEY_SIZE","NONCE_SIZE","Opener","TAG_SIZE","borrow","borrow_mut","box_open","box_open","box_seal","deref","deref_mut","drop","from","generate_key_pair","init","into","new","open","open_into","seal","seal_into","try_from","try_into","type_id","vzip","zeroize","NONCE_SIZE","Nonce","TAG_SIZE","borrow","borrow_mut","clone","clone_into","clone_to_uninit","deref","deref","deref_mut","drop","fmt","from","generate","increment","init","into","new","to_owned","try_from","try_into","type_id","vzip","MultiSigned","PrivateKey","PublicKey","Signature","SignatureBundle","Signed","Signer","as_ref","as_ref","blob","blob","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","cmp","compare","compare","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","encode_hex","encode_hex","encode_hex_upper","encode_hex_upper","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from_bytes","from_str","from_str","from_test_seed","generate","hash","hash","hash","hash","hash","init","init","init","init","init","init","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","len","len","partial_cmp","partial_cmp","public","public","public_key","public_key","sign","sign","signature","signature","signature_context_with_chain_separation","signature_context_with_runtime_separation","signatures","to_bytes","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","verify","verify","verify","verify_raw","vzip","vzip","vzip","vzip","vzip","vzip","zeroize","zeroize","PRIVATE_KEY_LENGTH","PUBLIC_KEY_LENGTH","PrivateKey","PublicKey","as_ref","as_ref","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","deref","deref","deref_mut","deref_mut","drop","drop","drop","encode_hex","encode_hex","encode_hex_upper","encode_hex_upper","eq","equivalent","fmt","from","from","from","from","from","from","from","from_test_seed","generate","hash","init","init","into","into","into_cbor_value","into_cbor_value","public_key","to_owned","to_owned","try_default","try_default","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","zeroize","KeyFormat","KeyFormatAtom","decode","decode_atom","decode_atoms","encode","encode_atom","encode_atoms","encode_partial","prefix","size","size","get_logger","init_logger","NAMESPACE_SIZE","Namespace","as_ref","borrow","borrow_mut","clone","clone_into","clone_to_uninit","clone_to_uninit","cmp","compare","default","deref","deref_mut","drop","encode_hex","encode_hex_upper","eq","equivalent","fmt","fmt","fmt","from","from","from","from","from_str","hash","init","into","into_cbor_value","len","partial_cmp","to_owned","to_string","try_default","try_from","try_from_cbor_value","try_into","type_id","vzip","zeroize","AbortOnPanic","borrow","borrow_mut","deref","deref_mut","drop","drop","from","init","into","try_from","try_into","type_id","vzip","abort","Quantity","add","add","add","add_assign","add_assign","add_assign","borrow","borrow_mut","checked_div","checked_sub","clone","clone_into","clone_to_uninit","cmp","compare","default","deref","deref_mut","drop","eq","equivalent","fmt","fmt","from","from","from","from","from","from","hash","init","into","into_cbor_value","is_empty","is_zero","mul","mul","mul","mul_assign","mul_assign","mul_assign","partial_cmp","to_owned","to_string","try_default","try_from","try_from_cbor_value","try_into","type_id","vzip","zero","EnclaveIdentity","Ias","MAX_QUOTE_AGE","MrEnclave","MrSigner","Pcs","Quote","QuotePolicy","VerifiedQuote","as_ref","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","cmp","compare","compare","current","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","egetkey","encode_hex","encode_hex","encode_hex_upper","encode_hex_upper","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fortanix_test","from","from","from","from","from","from","from","from","from","from","from","from","from_str","from_str","hash","hash","hash","ias","ias","identity","init","init","init","init","init","init","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","is_fresh","len","len","mr_enclave","mr_signer","partial_cmp","partial_cmp","pcs","pcs","report_data","report_for","seal","timestamp","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","verify","vzip","vzip","vzip","vzip","vzip","vzip","zeroize","zeroize","egetkey","AVR","QUOTE_CONTEXT_LEN","QuoteContext","QuotePolicy","allowed_quote_statuses","body","borrow","borrow","borrow_mut","borrow_mut","certificate_chain","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","default","default","deref","deref","deref_mut","deref_mut","disabled","drop","drop","eq","eq","equivalent","equivalent","fmt","fmt","from","from","gid_blacklist","init","init","into","into","into_cbor_value","into_cbor_value","min_tcb_evaluation_data_number","signature","to_owned","to_owned","try_default","try_default","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","type_id","type_id","verify","vzip","vzip","BlacklistedFMSPC","DEBUG","DebugEnclave","Disabled","Error","KL","MalformedCertificationData","MalformedPCK","MalformedQEReport","MalformedReport","Other","PERFMON","PKS","ProductionEnclave","Quote","QuoteBundle","QuoteParseError","QuotePolicy","SEPT_VE_DISABLE","TCBBundle","TCBEvaluationDataNumberInvalid","TCBExpired","TCBMismatch","TCBOutOfDate","TCBParseError","TCBVerificationFailed","TdAttributes","TdReport","TdxModuleNotAllowed","TdxModulePolicy","TdxQuotePolicy","TeeTypeNotAllowed","UnexpectedCertificateChain","UnexpectedCertificationData","UnsupportedAttestationKeyType","UnsupportedQEVendor","UnsupportedTeeType","VerificationFailed","all","allowed_tdx_modules","as_enclave_identity","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","certificates","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","complement","contains","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","difference","disabled","drop","drop","drop","drop","drop","drop","drop","drop","drop","empty","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","extend","fmspc_blacklist","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from_bits","from_bits_retain","from_bits_retain","from_bits_truncate","from_iter","from_name","header","init","init","init","init","init","init","init","init","init","insert","intersection","intersects","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_iter","is_all","is_empty","is_expired","iter","iter_names","matches","min_tcb_evaluation_data_number","mr_config_id","mr_owner","mr_owner_config","mr_seam","mr_seam","mr_signer_seam","mr_signer_seam","mr_td","not","parse","parse","parse","qe_identity","quote","remove","report_body","report_data","rtmr0","rtmr1","rtmr2","rtmr3","seam_attributes","set","source","sub","sub_assign","symmetric_difference","tcb","tcb_info","tcb_validity_period","td_attributes","td_enclave_identity","tdx","tee_tcb_svn","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","toggle","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","union","verify","verify","verify","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","xfam","new_deoxysii","seal","unseal","insecure_posix_system_time","insecure_posix_time","PROTOCOL_VERSION","ProtocolVersions","Version","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","consensus_protocol","default","default","deref","deref","deref_mut","deref_mut","drop","drop","eq","eq","equivalent","equivalent","fmt","fmt","from","from","from","hash","hash","init","init","into","into","into_cbor_value","into_cbor_value","is_compatible_with","major","minor","new","patch","runtime_committee_protocol","runtime_host_protocol","to_owned","to_owned","try_default","try_default","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","VERSION_KEY","Versioned","borrow","borrow_mut","clone","clone_into","clone_to_uninit","deref","deref_mut","drop","eq","equivalent","fmt","from","hash","init","inner","into","into_cbor_value","new","to_owned","try_from","try_from_cbor_value","try_into","type_id","version","vzip","Config","Storage","borrow","borrow","borrow_mut","borrow_mut","cache_node_capacity","cache_value_capacity","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","default","default","deref","deref","deref_mut","deref_mut","drop","drop","features","fmt","fmt","from","from","init","init","into","into","persist_check_tx_state","storage","to_owned","to_owned","trust_root","try_from","try_from","try_into","try_into","type_id","type_id","version","vzip","vzip","BlockMetadata","Event","HEIGHT_LATEST","LightBlock","METHOD_META","MODULE_NAME","Staking","address","beacon","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","eq","equivalent","events_root","fmt","fmt","fmt","from","from","from","governance","height","init","init","init","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","keymanager","meta","registry","roothash","scheduler","staking","state","state_root","tendermint","to_owned","to_owned","to_owned","transaction","try_default","try_default","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","type_id","type_id","type_id","verifier","vzip","vzip","vzip","Address","COMMON_POOL_ADDRESS","FEE_ACC_ADDRESS","GOVERNANCE_DEPOSITS_ADDRESS","as_ref","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","cmp","compare","decode_atom","default","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","encode_atom","encode_hex","encode_hex_upper","eq","equivalent","fmt","fmt","from","from","from","from","from","from","from_bech32","from_pk","from_runtime_id","hash","init","init","init","init","into","into","into","into","into_cbor_value","new","partial_cmp","size","to_bech32","to_owned","try_default","try_from","try_from","try_from","try_from","try_from_cbor_value","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","EPOCH_INVALID","EpochTime","EpochTimeState","borrow","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref_mut","drop","epoch","eq","equivalent","fmt","from","hash","height","init","into","into_cbor_value","to_owned","try_default","try_from","try_from_cbor_value","try_into","type_id","vzip","Abstain","CancelUpgradeProposal","ChangeParametersProposal","ConsensusParameterChanges","Invalid","No","ProposalContent","ProposalVote","UpgradeProposal","Vote","Yes","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cancel_upgrade","change_parameters","changes","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","compare","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","enable_change_parameters_proposal","epoch","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","gas_costs","handler","hash","hash","hash","hash","hash","id","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","min_proposal_deposit","module","partial_cmp","proposal_id","stake_threshold","target","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","upgrade","upgrade_cancel_min_epoch_diff","upgrade_min_epoch_diff","v","vote","voting_period","vzip","vzip","vzip","vzip","vzip","vzip","vzip","EnclavePolicySGX","EncryptedEphemeralSecret","EncryptedMasterSecret","EncryptedSecret","Error","InvalidSignature","PolicySGX","SignedEncryptedEphemeralSecret","SignedEncryptedMasterSecret","SignedPolicySGX","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","checksum","churp","ciphertexts","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","enclaves","epoch","epoch","eq","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","generation","id","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","master_secret_rotation_interval","max_ephemeral_secret_age","may_query","may_replicate","new","new","policy","pub_key","runtime_id","runtime_id","secret","secret","secret","secret","serial","signature","signature","signatures","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","verify","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","Application","Error","InvalidSignature","NistP384Sha3_384","PolicySGX","SignedPolicySGX","Status","SuiteId","applications","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","checksum","checksum","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","committee","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","extra_shares","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","handoff","handoff_interval","id","id","init","init","init","init","init","init","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","may_join","may_query","may_share","next_checksum","next_handoff","policy","policy","reconstructed","runtime_id","runtime_id","serial","signatures","suite_id","threshold","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","verify","vzip","vzip","vzip","vzip","vzip","vzip","ATTESTATION_SIGNATURE_CONTEXT","AnyNodeRuntimeAdmissionPolicy","Capabilities","CapabilityTEE","ConsensusAddress","ConsensusInfo","ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT","EndorsedCapabilityTEE","EntityWhitelistConfig","EntityWhitelistRoleAdmissionPolicy","EntityWhitelistRoleConfig","EntityWhitelistRuntimeAdmissionPolicy","ExecutorParameters","GovernanceConsensus","GovernanceEntity","GovernanceInvalid","GovernanceRuntime","KindCompute","KindInvalid","KindKeyManager","LATEST_RUNTIME_DESCRIPTOR_VERSION","METHOD_PROVE_FRESHNESS","MODULE_NAME","MaxNodesConstraint","MinPoolSizeConstraint","Node","NodeRuntime","P2PInfo","PerRoleAdmissionPolicy","ROLES_RESERVED","ROLE_COMPUTE_WORKER","ROLE_EMPTY","ROLE_KEY_MANAGER","ROLE_OBSERVER","ROLE_RESERVED_3","ROLE_STORAGE_RPC","ROLE_VALIDATOR","RolesMask","Runtime","RuntimeAdmissionPolicy","RuntimeGenesis","RuntimeGovernanceModel","RuntimeKind","RuntimeStakingParameters","SGXAttestation","SGXConstraints","SchedulingConstraints","StorageParameters","TCPAddress","TEEHardware","TEEHardwareIntelSGX","TEEHardwareInvalid","TLSAddress","TLSInfo","TxnSchedulerParameters","V0","V0","V1","V1","VRFInfo","ValidatorSetConstraint","VerifiedAttestation","VerifiedEndorsedCapabilityTEE","VersionInfo","_deprecated_addresses","_deprecated_next_pub_key","active_deployment","address","address","addresses","addresses","admission_policy","allowed_stragglers","any_node","attestation","batch_flush_timeout","bitand","bitor","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","bundle_checksum","capabilities","capability_tee","checkpoint_chunk_size","checkpoint_interval","checkpoint_num_kept","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","compare","consensus","constraints","contains","contains_enclave","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","deployment_for_version","deployments","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","enclaves","entities","entities","entity_id","entity_id","entity_whitelist","entity_whitelist","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","executor","expiration","extra_info","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","genesis","get_runtime","governance_model","group_backup_size","group_size","hardware","has_roles","has_tee","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","height","id","id","id","id","id","id","id","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","ip","is_single_role","key_manager","kind","limit","limit","matches","max_batch_size","max_batch_size_bytes","max_in_messages","max_liveness_fails","max_messages","max_missed_proposals_percent","max_nodes","max_nodes","max_nodes","min_in_message_fee","min_live_rounds_eval","min_live_rounds_percent","min_pool_size","node_endorsement","node_id","p2p","partial_cmp","per_role","policy","port","propose_batch_timeout","pub_key","pub_key","quote","quote","rak","rek","reward_bad_results","reward_equivocation","roles","round","round_timeout","runtimes","slashing","software_version","staking","state_root","storage","tee","tee","tee_hardware","thresholds","tls","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_decode_attestation","try_decode_tee","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","txn_scheduler","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","v","v","valid_from","validator_set","verified_attestation","verify","verify","verify","verify_endorsement","version","version","vrf","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","zone","height","quote","signature","allowed_quote_statuses","enclaves","enclaves","max_attestation_age","policy","AddEscrow","AlreadyCommitted","AnnotatedBlock","BadExecutorCommitment","BadProposerCommitment","Block","COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT","CastVote","ComputeResultsHeader","DiscrepancyDetected","EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT","EpochTransition","Error","ExecutorCommitment","ExecutorCommitmentFailure","ExecutorCommitmentHeader","FailureNone","FailureStateUnavailable","FailureUnknown","Governance","GovernanceMessage","Header","HeaderType","IncomingMessage","InsufficientVotes","Invalid","InvalidCommitteeKind","InvalidMessages","InvalidRound","InvalidRuntime","Message","MessageEvent","MessageValidator","NoCommittee","NoProposerCommitment","NoRuntime","NodeLookup","Normal","NotBasedOnCorrectBlock","NotInCommittee","OpenCommitment","Pool","RakSigInvalid","ReclaimEscrow","Registry","RegistryMessage","RoundFailed","RoundResults","RoundRoots","Staking","StakingMessage","State","StillWaiting","SubmitProposal","Suspended","Transfer","UpdateRuntime","Withdraw","add_executor_commitment","bad_compute_entities","block","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","caller","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","consensus_height","data","default","default","default","default","default","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","encoded_hash","encoded_hash","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","failure","fee","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","good_compute_entities","hash","hash","hash","hash","hash","hash","hash","hash","hash","header","header","header","header_type","id","in_messages_hash","in_messages_hash","in_msgs_count","in_msgs_hash","in_msgs_hash","index","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","io_root","io_root","io_root","is_indicating_failure","is_indicating_failure","is_parent_of","is_success","messages","messages","messages_hash","messages_hash","messages_hash","module","mostly_equal","mostly_equal","namespace","new","new_empty_block","new_genesis_block","node","node_id","previous_hash","previous_hash","process_commitments","rak_signature","result","round","round","sign","sign","signature","source","state_root","state_root","state_root","tag","timestamp","to_dd_result","to_dd_result","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_vote","to_vote","tokens","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","validate","validate_basic","validate_basic","validate_basic","validate_basic","validate_basic","verify","verify_rak","version","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","BackupWorker","Committee","CommitteeKind","CommitteeNode","ComputeExecutor","Invalid","Invalid","Role","Worker","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","cmp","cmp","compare","compare","default","default","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","eq","eq","equivalent","equivalent","fmt","fmt","from","from","from","from","hash","hash","init","init","init","init","into","into","into","into","into_cbor_value","into_cbor_value","kind","members","partial_cmp","partial_cmp","public_key","role","runtime_id","to_owned","to_owned","transaction_scheduler","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","valid_for","vzip","vzip","vzip","vzip","workers","Account","Add","AddEscrowResult","AllowanceChangeEvent","BurnEvent","CommissionRateBoundStep","CommissionRateStep","CommissionSchedule","DebondingDelegation","DebondingStart","Delegation","Escrow","EscrowAccount","EscrowEvent","Event","GeneralAccount","KindEntity","KindNodeCompute","KindNodeKeyManager","KindNodeValidator","KindRuntimeCompute","KindRuntimeKeyManager","Reclaim","ReclaimEscrow","ReclaimEscrowResult","RuntimeEquivocation","RuntimeIncorrectResults","RuntimeLiveness","SharePool","Slash","SlashReason","StakeAccumulator","StakeClaim","StakeThreshold","Take","ThresholdKind","Transfer","TransferEvent","TransferResult","Withdraw","WithdrawResult","account","account","active","allowance","allowance","allowance_change","allowances","amount","amount","amount","amount","amount","amount","amount","amount","amount","amount_change","amount_change","balance","balance","beneficiary","beneficiary","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","bounds","burn","claims","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","cmp","commission_schedule","compare","compare","constant","debond_end_time","debond_end_time","debonding","debonding_shares","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","escrow","escrow","escrow","escrow","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","freeze_interval","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","general","global","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","hash","height","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","negative","new_shares","nonce","owner","owner","owner","owner","owner","partial_cmp","partial_cmp","rate","rate_max","rate_min","rates","remaining_shares","shares","shares","shares","stake_accumulator","start","start","to","to","to","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","total_shares","transfer","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_hash","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","active_shares","amount","amount","amount","amount","debond_end_time","debonding_amount","debonding_shares","escrow","escrow","escrow","new_shares","owner","owner","owner","owner","shares","ConsensusState","StateError","Unavailable","beacon","borrow","borrow","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","drop","fmt","fmt","from","from","from","from_protocol","get","get","get_proof","get_proof","height","init","init","into","into","iter","iter","keymanager","new","prefetch_prefixes","prefetch_prefixes","registry","roothash","source","staking","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","ImmutableState","MutableState","borrow","borrow","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","drop","epoch","epoch_state","from","from","future_epoch","future_epoch_state","init","init","into","into","new","set_epoch_state","set_future_epoch_state","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","ImmutableState","Status","borrow","borrow","borrow_mut","borrow_mut","checksum","churp","clone","clone_into","clone_to_uninit","default","deref","deref","deref_mut","deref_mut","drop","drop","ephemeral_secret","eq","equivalent","fmt","from","from","generation","id","init","init","into","into","into_cbor_value","is_initialized","is_secure","master_secret","new","nodes","policy","rotation_epoch","rsk","status","statuses","to_owned","try_default","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","ImmutableState","borrow","borrow_mut","deref","deref_mut","drop","from","init","into","new","status","try_from","try_into","type_id","vzip","ImmutableState","borrow","borrow_mut","deref","deref_mut","drop","from","init","into","new","node","nodes","runtime","try_from","try_into","type_id","vzip","ImmutableState","borrow","borrow_mut","deref","deref_mut","drop","from","init","into","last_round_results","new","past_round_roots","round_roots","state_root","try_from","try_into","type_id","vzip","ImmutableState","account","addresses","borrow","borrow_mut","common_pool","debonding_delegation","debonding_delegations","delegation","delegations","deref","deref_mut","drop","from","governance_deposits","init","into","last_block_fees","new","total_supply","try_from","try_into","type_id","vzip","BACKEND_NAME","LightBlockMeta","TENDERMINT_CONTEXT","borrow","borrow_mut","chain_id","clone","clone_into","clone_to_uninit","decode_light_block","deref","deref_mut","drop","encode_light_block","fmt","from","get_state_root","init","into","merkle","signed_header","state_root_from_header","to_owned","try_from","try_from","try_into","type_id","validators","verifier","vzip","MAX_AUNTS","Proof","aunts","borrow","borrow_mut","compute_root_hash","default","deref","deref_mut","drop","fmt","from","index","init","into","into_cbor_value","leaf_hash","total","try_default","try_from","try_from_cbor_value","try_into","type_id","verify","vzip","NopVerifier","Verifier","borrow","borrow","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","drop","events_at","from","from","handle","init","init","into","into","latest_height","latest_state","new","new","start","start","state_at","sync","try_from","try_from","try_into","try_into","type_id","type_id","unverified_state","verify","verify_for_query","vzip","vzip","Fee","Gas","MethodName","Proof","SIGNATURE_CONTEXT","SignedTransaction","SignedTransactionWithProof","Transaction","amount","blob","body","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","default","default","default","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","fee","fmt","fmt","fmt","fmt","from","from","from","from","gas","height","init","init","init","init","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","method","nonce","proof","raw_proof","signature","signed_tx","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","verify","vzip","vzip","vzip","vzip","Builder","ChainContextTransitionFailed","Error","FreshnessVerificationFailed","Internal","StateRoot","TransactionVerificationFailed","TrustRoot","TrustedStateLoadingFailed","VerificationFailed","Verifier","borrow","borrow","borrow_mut","borrow_mut","chain_context","clone","clone_into","clone_to_uninit","default","deref","deref","deref_mut","deref_mut","drop","drop","eq","equivalent","events_at","fmt","fmt","fmt","from","from","hash","height","init","init","into","into","into_cbor_value","latest_height","latest_state","runtime_id","source","state_at","sync","to_owned","to_string","try_default","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","unverified_state","verify","verify_for_query","verify_state_freshness","vzip","vzip","Dispatcher","Initializer","PostInitState","PreInitState","app","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","consensus_verifier","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","from","from","from","identity","init","init","init","init","into","into","into","new","protocol","queue_request","rpc_demux","rpc_dispatcher","start","try_from","try_from","try_from","try_into","try_into","try_into","txn_dispatcher","type_id","type_id","type_id","vzip","vzip","vzip","Context","client","context","demux","dispatcher","session","sessions","types","CallFailed","DecodeError","Dropped","ExpectedCloseMessage","ExpectedResponseMessage","Response","RpcClient","RpcClientError","SessionsError","Transport","Unknown","UnsupportedRpcKind","bad_peer","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","failure","fmt","fmt","from","from","from","from","from","from","init","init","init","insecure_call","into","into","into","into_result","into_result_with_feedback","new_runtime","result","secure_call","source","success","to_string","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","update_enclaves","update_quote_policy","update_runtime_id","vzip","vzip","vzip","Context","borrow","borrow_mut","deref","deref_mut","drop","from","init","into","new","session_info","try_from","try_into","type_id","vzip","Demux","Error","MalformedPayload","MalformedRequestMethod","Other","SessionsError","borrow","borrow","borrow_mut","borrow_mut","close","deref","deref","deref_mut","deref_mut","drop","drop","fmt","fmt","from","from","from","from","from","init","init","into","into","new","process_frame","reset","set_session_builder","source","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","Dispatcher","Handler","KeyManagerQuotePolicyHandler","KeyManagerStatusHandler","Method","MethodDescriptor","MethodHandler","MethodHandlerDispatch","add_method","add_methods","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","dispatch","dispatch","drop","drop","drop","fmt","from","from","from","get_descriptor","handle","handle_km_quote_policy_update","handle_km_status_update","init","init","init","into","into","into","kind","methods","name","new","set_keymanager_quote_policy_update_handler","set_keymanager_status_update_handler","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","Builder","RAKBinding","Session","SessionInfo","V0","V1","V2","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build_initiator","build_responder","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","close","consensus_verifier","default","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","endorsed_by","fmt","from","from","from","from","get_local_identity","get_quote_policy","get_remote_enclaves","get_remote_node","get_remote_runtime_id","init","init","init","init","into","into","into","into","into_cbor_value","is_closed","is_connected","is_connected_to","is_unauthenticated","local_identity","process_data","quote_policy","rak_binding","rak_pub","remote_enclaves","remote_runtime_id","session_info","set_remote_node","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from_cbor_value","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","use_endorsement","verified_attestation","verify","vzip","vzip","vzip","vzip","write_message","avr","binding","binding","binding","ect","quote","rak_pub","rak_pub","Error","MaxConcurrentSessions","MultiplexedSession","SessionByTimeKey","SessionMeta","Sessions","SharedSession","add","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","close","create_initiator","create_responder","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drain","drop","drop","drop","drop","find","find_any","find_one","fmt","fmt","from","from","from","from","get","get_peer_id","get_remote_node","get_session_id","info","init","init","init","init","into","into","into","into","is_closed","is_connected","is_unauthenticated","new","process_data","remove","remove_for","remove_from","remove_one","set_builder","set_peer_id","set_remote_node","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","update_enclaves","update_quote_policy","update_runtime_id","vzip","vzip","vzip","vzip","write_message","BadPeer","Body","Close","Error","Error","Failure","Frame","InsecureQuery","Kind","LocalQuery","Message","NoiseSession","PeerFeedback","Request","Request","Response","Response","SessionID","Success","Success","args","as_ref","body","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","compare","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","encode_hex","encode_hex_upper","eq","eq","eq","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from_str","hash","hash","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","len","message","method","partial_cmp","payload","random","session","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","untrusted_plaintext","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","zeroize","block_on","new_tokio_runtime","BadResponse","Error","Host","Other","RegisterNotifyOpts","SubmitTxOpts","TxResult","batch_order","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","default","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","identity","init","init","init","init","into","into","into","into","output","proof","prove","register_notify","round","runtime_block","runtime_event","runtime_id","source","submit_tx","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","wait","Identity","borrow","borrow_mut","box_open","default","deref","deref_mut","drop","endorsed_capability_tee","from","init","into","new","node_identity","public","public_rak","public_rek","quote","quote_policy","rak_matches","sign","try_from","try_into","type_id","verify_binding","vzip","start_runtime","BadTEEConstraints","HardwareMismatch","MissingRuntimeDescriptor","NoDeployment","NoKeyManager","PolicyMismatch","PolicyNotPublished","PolicyVerifier","PolicyVerifierError","StatusMismatch","StatusNotPublished","borrow","borrow","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","drop","fmt","fmt","from","from","init","init","into","into","key_manager","key_manager_policy","key_manager_status","new","quote_policy","to_string","try_from","try_from","try_into","try_into","type_id","type_id","verify_key_manager_policy","verify_key_manager_status","verify_quote_policy","vzip","vzip","AlreadyInitialized","AttestationRequired","ChannelClosed","HostInfo","HostInfoNotConfigured","IncompatibleConsensusBackend","InvalidResponse","InvalidRuntimeId","MessageTooLarge","MethodNotSupported","Protocol","ProtocolError","ProtocolUntrustedLocalStorage","Stream","Tcp","Unix","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call_host","call_host_async","clone","clone_into","clone_to_uninit","consensus_backend","consensus_chain_context","consensus_protocol_version","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","ensure_initialized","flush","fmt","fmt","fmt","from","from","from","from","from","get","get_config","get_host_info","get_identity","get_runtime_id","identity","init","init","init","init","init","insert","into","into","into","into","into","local_config","new","read","register_notify","runtime_id","send_response","submit_tx","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","write","KeyValue","MKVS","UntrustedInMemoryStorage","borrow","borrow_mut","default","deref","deref_mut","drop","from","get","get","init","insert","insert","into","mkvs","new","try_from","try_into","type_id","vzip","Delete","Depth","FallibleMKVS","IO","ImmutableMKVS","Insert","Internal","Invalid","Iterator","Key","Leaf","LogEntry","LogEntryKind","MKVS","NodeBox","NodePointer","NodePtrRef","OverlayTree","Prefix","Root","RootType","State","Tree","WriteLog","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","builder","cache_contains_key","cache_contains_key","cache_contains_key","cache_contains_key","cache_contains_key","cache_extra","clean","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","commit","commit","commit","commit","commit","commit","commit_both","compact_marshal_binary","compare","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","encode_hex","encode_hex_upper","eq","eq","eq","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","error","extract","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from_node","get","get","get","get","get","get","get","get","get_key","get_node","get_proof","get_proof","get_proof","get_proof","get_proof","get_proof","get_proof","get_proof","get_value","has_node","hash","hash","hash","hash","hash_ptr","init","init","init","init","init","init","init","init","init","insert","insert","insert","insert","insert","insert","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","is_null","is_valid","iter","iter","iter","iter","iter","iter","iter","iter","key","kind","marshal","marshal_binary","marshal_binary","namespace","new","new","new","next","node","null_ptr","partial_cmp","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","remove","remove","remove","remove","remove","remove","rewind","root_type","seek","set_prefetch","sync","to_owned","to_owned","to_owned","to_owned","to_owned","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","unmarshal_binary","unmarshal_binary","value","version","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","Marshal","marshal_binary","unmarshal_binary","GetPrefixesRequest","GetRequest","HostReadSyncer","IterateRequest","NoopReadSyncer","Proof","ProofBuilder","ProofResponse","ProofVerifier","RawProofEntry","ReadSync","StatsCollector","SyncerError","TreeID","Unsupported","arbitrary","arbitrary_take_rest","as_any","as_any","as_any","as_any","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","encode_hex","encode_hex_upper","entries","eq","eq","eq","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","include","include_siblings","init","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","key","key","limit","merge_verified_subtree","new","new","new","new_with_version","position","prefetch","prefixes","proof","root","size_hint","sync_get","sync_get","sync_get","sync_get","sync_get_count","sync_get_prefixes","sync_get_prefixes","sync_get_prefixes","sync_get_prefixes","sync_get_prefixes_count","sync_iterate","sync_iterate","sync_iterate","sync_iterate","sync_iterate_count","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","tree","tree","tree","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","untrusted_root","v","verify_proof","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","Context","context","dispatcher","rwset","tags","tree","types","Context","borrow","borrow_mut","check_only","consensus_block","consensus_state","deref","deref_mut","drop","epoch","from","header","init","into","max_messages","new","protocol","round_results","runtime_state","try_from","try_into","type_id","vzip","Dispatcher","ExecuteBatchResult","ExecuteTxResult","NoopDispatcher","block_tags","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","check_batch","check_batch","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","execute_batch","execute_batch","finalize","from","from","from","in_msgs_count","init","init","init","into","into","into","is_supported","is_supported","messages","output","query","results","schedule_and_execute_batch","schedule_and_execute_batch","set_abort_batch_flag","tags","try_from","try_from","try_from","try_into","try_into","try_into","tx_reject_hashes","type_id","type_id","type_id","vzip","vzip","vzip","CoarsenedKey","CoarsenedSet","ReadWriteSet","as_ref","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","default","default","deref","deref","deref_mut","deref_mut","drop","drop","encode_hex","encode_hex_upper","eq","eq","equivalent","equivalent","fmt","fmt","from","from","from","granularity","init","init","into","into","into_cbor_value","into_cbor_value","read_set","to_owned","to_owned","try_default","try_default","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","write_set","Tag","Tags","borrow","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref_mut","drop","fmt","from","init","into","key","new","to_owned","try_from","try_into","tx_hash","type_id","value","vzip","TAG_BLOCK_TX_HASH","Tree","add_block_tags","add_input","add_output","borrow","borrow_mut","commit","deref","deref_mut","drop","from","init","into","new","try_from","try_into","type_id","vzip","TxnBatch","borrow","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref","deref_mut","deref_mut","drop","eq","equivalent","fmt","from","from","from","init","into","into_cbor_value","new","to_owned","try_default","try_from","try_from_cbor_value","try_into","type_id","vzip","Body","CheckTxMetadata","CheckTxResult","ComputedBatch","Consensus","Empty","Error","Error","EventKind","Execute","ExecutionMode","FeatureScheduleControl","Features","Governance","HostFetchBlockMetadataTxRequest","HostFetchBlockMetadataTxResponse","HostFetchConsensusBlockRequest","HostFetchConsensusBlockResponse","HostFetchConsensusEventsRequest","HostFetchConsensusEventsRequest","HostFetchConsensusEventsResponse","HostFetchConsensusEventsResponse","HostFetchGenesisHeightRequest","HostFetchGenesisHeightResponse","HostFetchTxBatchRequest","HostFetchTxBatchResponse","HostIdentityRequest","HostIdentityResponse","HostLocalStorageGetRequest","HostLocalStorageGetResponse","HostLocalStorageSetRequest","HostLocalStorageSetResponse","HostProveFreshnessRequest","HostProveFreshnessResponse","HostRPCCallRequest","HostRPCCallResponse","HostRegisterNotifyRequest","HostRegisterNotifyResponse","HostStorageEndpoint","HostStorageSyncRequest","HostStorageSyncResponse","HostSubmitPeerFeedbackRequest","HostSubmitPeerFeedbackResponse","HostSubmitTxRequest","HostSubmitTxResponse","Invalid","Message","MessageType","ProofResponse","RegisterNotifyRuntimeEvent","Registry","Request","Response","RootHash","Runtime","RuntimeAbortRequest","RuntimeAbortResponse","RuntimeCapabilityTEERakAvrRequest","RuntimeCapabilityTEERakAvrResponse","RuntimeCapabilityTEERakInitRequest","RuntimeCapabilityTEERakInitResponse","RuntimeCapabilityTEERakQuoteRequest","RuntimeCapabilityTEERakQuoteResponse","RuntimeCapabilityTEERakReportRequest","RuntimeCapabilityTEERakReportResponse","RuntimeCapabilityTEEUpdateEndorsementRequest","RuntimeCapabilityTEEUpdateEndorsementResponse","RuntimeCheckTxBatchRequest","RuntimeCheckTxBatchResponse","RuntimeConsensusSyncRequest","RuntimeConsensusSyncResponse","RuntimeExecuteTxBatchRequest","RuntimeExecuteTxBatchResponse","RuntimeInfoRequest","RuntimeInfoRequest","RuntimeInfoResponse","RuntimeInfoResponse","RuntimeKeyManagerQuotePolicyUpdateRequest","RuntimeKeyManagerQuotePolicyUpdateResponse","RuntimeKeyManagerStatusUpdateRequest","RuntimeKeyManagerStatusUpdateResponse","RuntimeLocalRPCCallRequest","RuntimeLocalRPCCallResponse","RuntimeNotifyEvent","RuntimeNotifyRequest","RuntimeNotifyResponse","RuntimePingRequest","RuntimeQueryRequest","RuntimeQueryResponse","RuntimeRPCCallRequest","RuntimeRPCCallResponse","RuntimeShutdownRequest","Schedule","Staking","StorageSyncRequest","StorageSyncRequestWithEndpoint","StorageSyncResponse","SyncGet","SyncGetPrefixes","SyncIterate","block","body","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","consensus_backend","consensus_chain_context","consensus_protocol_version","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","endorsed_capability_tee","endpoint","eq","eq","equivalent","equivalent","error","events","features","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","hash","header","height","id","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","initial_batch_size","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","io_write_log","key_manager_quote_policy_updates","key_manager_status_updates","kind","local_config","message","message_type","messages","meta","module","new","priority","protocol_version","rak_sig","request","runtime_id","runtime_version","schedule_control","sender","sender_seq","sender_state_seq","state_write_log","tags","tags","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","args","avr","batch","batch","batch_order","blob","block","block","block","consensus_block","consensus_block","consensus_block","data","data","ect","endpoint","endpoint","epoch","epoch","epoch","header","height","height","height","height","height","in_msgs","inputs","inputs","io_root","key","key","kind","kind","limit","max_messages","max_messages","max_messages","method","mode","node","node_id","nodes","nonce","offset","output","peer_feedback","peer_id","policy","proof","proof","proof","prove","quote","rak_pub","rek_pub","report","request","request","request","request_id","request_id","response","response","response","results","round","round_results","runtime_block","runtime_block","runtime_event","runtime_event","runtime_id","signature","signed_tx","signed_tx","status","target_info","tx_hashes","tx_input_root","tx_input_write_log","tx_reject_hashes","value","value","wait"],"q":[[0,"oasis_core_runtime"],[79,"oasis_core_runtime::app"],[101,"oasis_core_runtime::cache"],[138,"oasis_core_runtime::common"],[150,"oasis_core_runtime::common::crypto"],[154,"oasis_core_runtime::common::crypto::hash"],[203,"oasis_core_runtime::common::crypto::mrae"],[205,"oasis_core_runtime::common::crypto::mrae::deoxysii"],[232,"oasis_core_runtime::common::crypto::mrae::nonce"],[256,"oasis_core_runtime::common::crypto::signature"],[448,"oasis_core_runtime::common::crypto::x25519"],[513,"oasis_core_runtime::common::key_format"],[525,"oasis_core_runtime::common::logger"],[527,"oasis_core_runtime::common::namespace"],[569,"oasis_core_runtime::common::panic"],[583,"oasis_core_runtime::common::process"],[584,"oasis_core_runtime::common::quantity"],[636,"oasis_core_runtime::common::sgx"],[827,"oasis_core_runtime::common::sgx::egetkey"],[828,"oasis_core_runtime::common::sgx::ias"],[886,"oasis_core_runtime::common::sgx::pcs"],[1186,"oasis_core_runtime::common::sgx::seal"],[1189,"oasis_core_runtime::common::time"],[1191,"oasis_core_runtime::common::version"],[1252,"oasis_core_runtime::common::versioned"],[1279,"oasis_core_runtime::config"],[1324,"oasis_core_runtime::consensus"],[1410,"oasis_core_runtime::consensus::address"],[1494,"oasis_core_runtime::consensus::beacon"],[1523,"oasis_core_runtime::consensus::governance"],[1721,"oasis_core_runtime::consensus::keymanager"],[1957,"oasis_core_runtime::consensus::keymanager::churp"],[2118,"oasis_core_runtime::consensus::registry"],[3193,"oasis_core_runtime::consensus::registry::SGXAttestation"],[3196,"oasis_core_runtime::consensus::registry::SGXConstraints"],[3201,"oasis_core_runtime::consensus::roothash"],[3728,"oasis_core_runtime::consensus::scheduler"],[3821,"oasis_core_runtime::consensus::staking"],[4577,"oasis_core_runtime::consensus::staking::EscrowEvent"],[4594,"oasis_core_runtime::consensus::state"],[4642,"oasis_core_runtime::consensus::state::beacon"],[4675,"oasis_core_runtime::consensus::state::keymanager"],[4727,"oasis_core_runtime::consensus::state::keymanager::churp"],[4742,"oasis_core_runtime::consensus::state::registry"],[4759,"oasis_core_runtime::consensus::state::roothash"],[4777,"oasis_core_runtime::consensus::state::staking"],[4801,"oasis_core_runtime::consensus::tendermint"],[4831,"oasis_core_runtime::consensus::tendermint::merkle"],[4856,"oasis_core_runtime::consensus::tendermint::verifier"],[4895,"oasis_core_runtime::consensus::transaction"],[4982,"oasis_core_runtime::consensus::verifier"],[5045,"oasis_core_runtime::dispatcher"],[5097,"oasis_core_runtime::enclave_rpc"],[5105,"oasis_core_runtime::enclave_rpc::client"],[5173,"oasis_core_runtime::enclave_rpc::context"],[5188,"oasis_core_runtime::enclave_rpc::demux"],[5230,"oasis_core_runtime::enclave_rpc::dispatcher"],[5294,"oasis_core_runtime::enclave_rpc::session"],[5388,"oasis_core_runtime::enclave_rpc::session::RAKBinding"],[5396,"oasis_core_runtime::enclave_rpc::sessions"],[5483,"oasis_core_runtime::enclave_rpc::types"],[5716,"oasis_core_runtime::future"],[5718,"oasis_core_runtime::host"],[5808,"oasis_core_runtime::identity"],[5834,"oasis_core_runtime::init"],[5835,"oasis_core_runtime::policy"],[5881,"oasis_core_runtime::protocol"],[5987,"oasis_core_runtime::storage"],[6009,"oasis_core_runtime::storage::mkvs"],[6306,"oasis_core_runtime::storage::mkvs::marshal"],[6309,"oasis_core_runtime::storage::mkvs::sync"],[6603,"oasis_core_runtime::transaction"],[6610,"oasis_core_runtime::transaction::context"],[6633,"oasis_core_runtime::transaction::dispatcher"],[6692,"oasis_core_runtime::transaction::rwset"],[6748,"oasis_core_runtime::transaction::tags"],[6772,"oasis_core_runtime::transaction::tree"],[6791,"oasis_core_runtime::transaction::types"],[6820,"oasis_core_runtime::types"],[7382,"oasis_core_runtime::types::Body"],[7467,"core::fmt"],[7468,"core::result"],[7469,"core::any"],[7470,"alloc::boxed"],[7471,"alloc::sync"],[7472,"anyhow"],[7473,"core::future::future"],[7474,"core::pin"],[7475,"alloc::vec"],[7476,"oasis_core_runtime::storage::mkvs::tree::node"],[7477,"std::sync::mutex"],[7478,"core::cell"],[7479,"alloc::rc"],[7480,"oasis_core_runtime::storage::mkvs::tree"],[7481,"core::cmp"],[7482,"core::iter::traits::collect"],[7483,"rustc_hex"],[7484,"core::hash"],[7485,"oasis_cbor_value::values"],[7486,"core::option"],[7487,"alloc::string"],[7488,"oasis_cbor"],[7489,"x25519_dalek::x25519"],[7490,"deoxysii"],[7491,"core::convert"],[7492,"slog"],[7493,"log"],[7494,"sgx_isa"],[7495,"oasis_core_runtime::common::sgx::pcs::report"],[7496,"oasis_core_runtime::common::sgx::pcs::policy"],[7497,"oasis_core_runtime::common::sgx::pcs::quote"],[7498,"oasis_core_runtime::common::sgx::pcs::tcb"],[7499,"bitflags::iter"],[7500,"alloc::borrow"],[7501,"core::error"],[7502,"chrono::offset::utc"],[7503,"chrono::datetime"],[7504,"std::time"],[7505,"core::clone"],[7506,"oasis_cbor::encode"],[7507,"oasis_cbor::decode"],[7508,"oasis_core_runtime::consensus::roothash::commitment::pool"],[7509,"oasis_core_runtime::consensus::roothash::block"],[7510,"oasis_core_runtime::consensus::roothash::commitment::executor"],[7511,"oasis_core_runtime::consensus::roothash::message"],[7512,"oasis_core_runtime::consensus::roothash::commitment"],[7513,"oasis_core_runtime::storage::mkvs::sync::proof"],[7514,"alloc::collections::btree::map"],[7515,"tendermint::chain::id"],[7516,"tendermint::block::signed_header"],[7517,"tendermint_proto::tendermint::v0_38::types"],[7518,"tendermint::merkle"],[7519,"oasis_core_runtime::consensus::tendermint::verifier::noop"],[7520,"tokio::runtime::handle"],[7521,"core::marker"],[7522,"std::collections::hash::set"],[7523,"tokio::sync::mutex"],[7524,"std::io"],[7525,"tokio::runtime::runtime"],[7526,"std::io::error"],[7527,"oasis_core_runtime::storage::mkvs::tree::overlay"],[7528,"arbitrary::unstructured"],[7529,"arbitrary::error"],[7530,"oasis_core_runtime::storage::mkvs::sync::host"],[7531,"oasis_core_runtime::storage::mkvs::sync::noop"],[7532,"oasis_core_runtime::storage::mkvs::sync::stats"],[7533,"oasis_core_runtime::storage::mkvs::sync::errors"],[7534,"core::sync::atomic"],[7535,"alloc::collections::vec_deque"],[7536,"tokio::runtime::task::error"],[7537,"oasis_core_runtime::storage::mkvs::sync::merge"]],"i":[0,0,3,0,0,0,3,3,0,0,0,4,3,5,4,3,5,0,0,0,0,0,0,3,4,4,3,5,4,3,5,0,4,3,5,0,3,3,3,5,4,3,5,0,0,0,0,0,4,3,5,4,3,5,5,0,0,0,0,0,5,0,0,5,0,4,3,5,4,3,5,4,3,5,0,0,4,3,5,0,0,13,13,13,13,13,13,13,13,13,14,0,14,14,14,14,14,13,13,13,13,0,0,29,27,29,27,27,27,27,27,29,29,27,29,27,29,27,27,29,27,29,27,29,27,27,27,27,29,29,29,27,29,27,29,27,29,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,0,0,0,0,0,0,51,51,0,49,0,51,51,51,51,0,51,51,51,51,51,51,51,51,51,51,51,51,0,0,0,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,0,0,0,0,0,0,0,57,58,59,60,62,57,58,59,60,61,62,57,58,59,60,61,57,58,59,60,61,57,58,59,60,61,57,57,58,58,59,60,61,57,58,57,58,57,58,59,60,61,62,57,58,59,60,61,62,57,58,59,60,61,62,57,58,59,60,61,57,58,57,58,57,58,59,60,61,57,58,59,60,61,57,57,57,58,58,58,59,60,61,62,57,57,57,57,58,58,58,58,59,60,61,62,57,58,62,62,57,58,59,60,61,62,57,58,59,60,61,62,57,58,59,60,61,57,58,59,60,61,57,58,57,58,63,62,62,61,63,62,59,61,0,0,60,62,57,58,59,60,61,57,58,57,58,59,60,61,62,57,58,59,60,61,57,58,59,60,61,62,57,58,59,60,61,62,57,58,59,60,61,58,59,61,58,62,57,58,59,60,61,57,58,0,0,0,0,65,66,65,66,65,66,65,66,65,66,65,66,66,65,66,65,66,65,66,65,65,66,65,66,65,66,66,66,66,65,65,65,66,66,66,66,65,65,66,65,66,65,66,65,66,65,65,66,65,66,65,66,65,66,65,66,65,66,65,66,65,0,0,67,68,67,67,68,67,67,67,67,68,0,0,0,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,0,71,71,71,71,71,71,71,71,71,71,71,71,71,0,0,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,0,80,0,0,0,80,0,0,0,77,78,77,78,79,80,81,82,77,78,79,80,81,82,77,78,79,80,81,82,77,78,79,80,81,82,77,77,78,78,79,80,81,82,77,78,77,78,79,77,78,79,81,82,77,78,79,80,81,82,77,78,79,80,81,82,77,78,79,80,81,82,0,77,78,77,78,77,78,79,80,81,77,78,79,80,81,77,77,77,78,78,78,79,80,81,82,79,77,77,77,77,78,78,78,78,79,80,81,82,77,78,77,78,79,0,81,82,77,78,79,80,81,82,77,78,79,80,81,82,77,78,79,80,81,80,77,78,79,79,77,78,0,81,82,0,0,82,77,78,79,80,81,82,77,78,77,78,79,81,77,78,79,80,81,82,77,78,79,80,81,77,78,79,80,81,82,77,78,79,80,81,82,80,77,78,79,80,81,82,77,78,0,0,0,0,0,87,88,87,88,87,88,88,87,88,87,88,87,88,87,88,87,88,87,88,87,87,88,87,88,87,88,87,88,87,88,87,87,88,87,88,87,88,87,88,87,88,87,88,87,88,87,88,87,88,87,88,0,87,88,99,89,99,99,0,89,99,99,99,99,99,89,89,99,0,0,99,0,89,0,99,99,99,99,99,99,0,0,99,0,0,99,99,99,99,99,99,99,89,92,90,89,89,89,89,89,89,89,89,91,92,93,94,98,90,89,95,99,91,92,93,94,98,90,89,95,99,95,91,92,93,94,90,89,95,91,92,93,94,90,89,95,91,92,93,94,90,89,89,95,89,89,91,92,94,95,91,92,93,94,98,90,89,95,99,91,92,93,94,98,90,89,95,99,89,91,91,92,93,94,98,90,89,95,99,89,91,92,93,94,90,89,95,91,92,93,94,90,89,95,89,91,91,92,93,94,98,90,89,89,89,89,89,95,99,99,91,92,93,94,98,90,89,95,99,99,89,89,89,89,89,89,98,91,92,93,94,98,90,89,95,99,89,89,89,91,92,93,94,98,90,89,95,99,91,92,93,94,95,89,89,89,91,89,89,93,91,90,90,90,93,90,93,90,90,89,98,90,89,95,94,89,98,90,90,90,90,90,90,89,99,89,89,89,94,95,91,90,0,91,90,91,92,93,94,90,89,95,99,89,91,92,94,95,91,92,93,94,98,90,89,95,99,91,92,93,94,95,91,92,93,94,98,90,89,95,99,91,92,93,94,98,90,89,95,99,89,92,94,98,91,92,93,94,98,90,89,95,99,90,0,0,0,0,0,0,0,0,109,110,109,110,109,110,109,110,109,109,110,110,109,110,109,110,109,110,109,110,109,110,109,110,109,110,109,109,110,109,110,109,110,109,110,109,110,109,109,109,109,109,110,110,109,110,109,110,109,110,109,110,109,110,109,110,109,110,0,0,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,0,0,118,119,118,119,119,119,118,119,118,119,118,119,118,119,118,119,118,119,118,119,118,118,119,118,119,118,119,118,119,118,118,118,119,118,118,119,118,119,118,119,118,118,119,0,0,0,0,0,0,121,0,0,120,121,122,120,121,122,120,121,122,120,121,122,120,121,122,120,122,120,121,122,120,121,122,120,121,122,122,122,122,120,121,122,120,121,122,0,120,120,121,122,120,121,122,120,121,122,0,120,0,0,0,0,0,122,0,120,121,122,0,120,122,120,121,122,120,121,122,120,121,122,120,121,122,0,120,121,122,0,0,0,0,123,124,125,126,123,124,125,126,123,123,123,123,123,123,123,123,124,124,125,125,126,126,123,124,125,126,123,124,125,126,123,123,123,123,123,123,123,123,124,125,126,123,123,123,123,123,123,123,124,125,126,123,124,125,126,123,123,123,123,123,123,123,123,124,125,126,123,123,124,125,126,123,124,125,126,123,124,125,126,123,0,0,0,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,128,0,0,0,128,128,0,0,0,0,128,128,129,130,131,132,133,134,128,129,130,131,132,133,134,133,133,132,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,128,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,134,130,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,134,130,128,129,130,131,134,129,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,134,132,128,131,134,130,128,129,130,131,132,133,134,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,128,129,130,131,132,133,134,133,134,134,130,129,134,128,129,130,131,132,133,134,0,0,0,0,0,143,0,0,0,0,143,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,138,0,138,135,136,137,138,139,140,141,142,135,136,137,138,139,140,141,142,135,136,137,138,139,140,141,142,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,135,139,140,135,136,137,138,139,140,141,142,135,136,137,138,139,140,141,142,143,143,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,139,135,143,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,135,136,137,138,139,140,141,142,135,135,136,136,141,142,137,138,139,140,139,140,141,142,135,141,142,137,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,143,135,136,137,138,139,140,141,142,137,143,135,136,137,138,139,140,141,142,0,0,149,144,0,0,0,0,145,149,144,145,146,147,148,149,144,145,146,147,148,145,146,144,145,146,147,148,144,145,146,147,148,144,145,146,147,148,145,144,145,146,147,148,149,144,145,146,147,148,149,144,145,146,147,148,149,144,145,146,147,148,144,145,146,147,148,144,145,146,147,148,145,149,149,144,145,146,147,148,149,144,145,146,147,148,145,145,145,147,149,144,145,146,147,148,149,144,145,146,147,148,144,145,146,147,148,147,147,147,145,145,145,148,146,145,147,147,148,145,145,144,145,146,147,148,149,145,146,147,148,149,144,145,146,147,148,144,145,146,147,148,149,144,145,146,147,148,149,144,145,146,147,148,148,149,144,145,146,147,148,0,0,0,0,0,0,0,0,0,0,0,0,0,183,183,183,183,167,167,167,0,0,0,0,0,0,0,0,0,153,153,153,153,153,153,153,153,0,0,0,0,0,0,0,0,0,0,0,0,0,187,187,0,0,0,184,186,184,186,0,0,0,0,0,156,156,150,155,158,157,159,150,168,182,161,169,153,153,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,152,165,162,170,170,170,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,163,164,165,153,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,153,153,166,150,153,184,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,185,187,150,188,150,150,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,184,176,179,166,150,180,182,154,155,156,157,158,159,160,161,162,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,187,150,188,154,155,156,157,158,159,160,161,162,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,187,150,188,150,166,165,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,163,163,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,185,186,187,150,188,150,166,150,168,168,161,166,166,154,155,156,157,158,159,160,161,162,164,165,153,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,186,187,150,188,185,157,158,159,160,165,166,150,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,186,187,150,188,154,153,150,150,173,174,161,169,169,169,168,168,168,171,177,178,175,168,168,171,162,163,166,153,182,184,154,169,155,156,186,185,161,161,175,175,166,188,168,166,175,166,150,188,150,164,152,150,175,166,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,161,152,154,155,156,157,158,159,160,161,162,164,165,153,166,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,152,150,188,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,155,156,157,158,159,160,161,162,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,186,187,150,188,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,150,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,166,150,152,171,163,161,162,186,162,165,152,166,154,155,156,157,158,159,160,161,162,163,164,165,153,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,152,184,185,186,187,150,188,154,390,390,390,391,391,392,392,392,201,208,0,208,208,0,0,203,0,208,0,195,0,0,0,0,198,198,198,200,0,0,0,0,208,195,208,208,208,208,0,0,0,208,208,208,0,195,208,208,0,0,208,201,200,0,195,0,0,200,0,208,208,203,195,201,202,201,190,206,20,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,204,191,195,196,197,198,199,192,200,201,202,203,204,20,205,206,207,191,195,196,197,198,199,192,200,201,202,203,204,20,205,206,207,191,195,196,197,198,199,192,200,201,202,203,204,20,205,206,207,205,20,204,191,195,196,197,198,199,192,204,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,196,197,191,195,196,197,198,199,192,200,201,202,203,204,20,205,206,207,191,195,196,197,198,199,192,200,201,202,203,204,20,205,206,207,199,204,191,195,196,197,198,199,192,200,201,202,203,204,208,208,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,208,20,205,206,207,206,191,195,196,197,201,202,204,20,207,191,199,192,196,204,200,204,197,196,197,205,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,191,195,196,197,198,199,192,200,201,202,203,204,20,205,206,207,196,197,207,210,192,197,205,192,206,200,196,197,205,210,192,196,190,191,191,193,192,196,197,190,199,205,196,197,199,192,192,208,196,197,207,204,196,210,192,191,195,196,197,198,199,192,200,201,202,203,204,20,205,206,207,208,210,192,204,191,196,197,199,192,204,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,191,195,196,197,198,199,192,200,201,202,203,204,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,194,192,200,201,202,203,192,199,196,190,191,195,196,197,198,199,192,200,201,202,203,204,208,20,205,206,207,213,0,0,0,214,213,214,0,213,215,211,213,214,215,211,213,214,213,214,213,214,213,214,213,214,213,214,213,214,215,211,213,214,215,211,213,214,215,211,213,214,213,214,213,214,213,214,215,211,213,214,213,214,215,211,213,214,215,211,213,214,213,214,211,211,213,214,215,215,211,213,214,211,215,211,213,214,213,214,215,211,213,214,215,211,213,214,211,215,211,213,214,211,0,241,0,0,0,0,0,0,0,241,0,0,0,0,0,0,220,220,220,220,220,220,241,0,0,232,232,232,0,0,0,0,0,0,241,0,0,0,0,0,0,218,219,223,237,242,238,222,216,217,218,233,234,235,236,239,240,237,242,222,224,237,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,225,238,228,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,220,232,223,220,232,229,231,236,223,236,216,217,218,219,221,222,223,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,221,235,236,238,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,233,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,217,234,239,221,229,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,238,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,242,235,222,235,236,237,240,242,220,232,226,227,227,225,236,219,230,231,223,226,227,216,234,239,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,224,238,216,217,218,219,221,222,223,224,225,226,227,228,229,230,231,233,234,235,236,237,238,239,240,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,238,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,393,394,395,393,396,393,395,393,394,393,396,394,394,395,393,396,396,0,0,209,0,243,209,243,209,243,209,243,209,243,209,209,209,243,209,209,243,243,243,243,243,243,243,209,243,209,243,243,0,243,243,243,0,0,209,0,209,243,209,243,209,243,209,243,209,0,0,247,397,247,397,247,397,247,397,247,397,247,247,247,397,247,247,247,397,247,397,247,397,397,247,397,247,397,247,397,247,397,0,0,251,250,251,250,250,0,250,250,250,250,251,250,251,250,251,250,251,250,250,250,251,250,250,250,251,250,251,250,250,250,250,251,251,250,250,250,250,251,251,250,250,251,250,250,251,250,251,250,251,250,0,252,252,252,252,252,252,252,252,252,252,252,252,252,252,0,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,0,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,0,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,0,0,0,258,258,0,258,258,258,0,258,258,258,0,258,258,258,258,258,0,258,0,258,258,258,258,258,258,0,258,0,0,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,261,0,0,263,265,263,265,263,265,263,265,263,265,263,263,265,265,263,265,263,265,263,263,263,265,263,265,263,263,263,265,263,265,263,265,263,263,263,263,265,0,0,0,0,0,0,0,0,269,273,272,272,269,270,271,272,269,270,271,269,270,271,272,269,270,271,272,269,270,271,272,269,270,271,272,272,269,270,271,272,269,270,271,269,270,272,269,270,271,272,269,270,271,272,269,270,271,272,272,271,270,273,271,269,270,271,272,269,270,271,272,269,270,271,272,269,270,271,272,269,270,271,273,272,269,270,271,274,274,0,274,274,274,274,0,274,274,0,274,268,274,268,268,268,268,268,268,274,268,274,268,274,268,268,268,266,274,274,268,274,268,268,268,274,268,274,268,268,266,266,268,274,266,266,268,274,268,274,268,268,274,268,274,268,266,266,266,0,274,268,0,0,0,0,275,276,277,275,276,277,275,276,275,276,277,275,276,277,275,276,277,275,276,277,275,276,16,276,277,275,276,277,275,277,276,277,276,276,277,276,277,275,276,277,275,275,276,277,275,276,277,275,0,0,0,0,0,0,0,0,281,281,281,281,281,0,0,0,281,281,281,281,279,279,280,281,279,280,281,279,280,281,279,280,281,279,280,280,281,279,281,281,279,280,281,281,281,281,279,280,281,280,279,280,281,279,279,280,279,280,281,279,281,279,280,281,279,280,281,279,280,281,280,280,280,279,280,281,0,288,288,288,288,288,288,288,288,288,288,288,288,288,288,0,0,292,292,292,292,289,292,289,292,289,289,292,289,292,289,292,292,292,289,292,292,292,292,289,292,289,292,289,289,289,289,292,292,289,292,289,292,289,292,289,292,0,0,0,0,0,0,0,0,295,295,296,297,295,296,297,295,297,297,297,295,296,297,295,296,297,295,298,295,296,297,295,297,296,297,295,298,302,295,295,296,297,295,296,297,295,297,303,297,296,295,295,297,296,297,295,296,297,295,296,297,295,296,297,295,0,0,0,0,308,308,308,287,307,308,285,287,307,308,285,285,285,308,285,308,285,308,285,307,285,285,287,307,308,285,287,307,308,285,287,307,308,285,287,308,287,307,308,285,285,285,285,307,285,287,307,308,285,287,307,308,285,308,307,307,307,307,285,307,285,287,308,285,285,307,307,308,285,287,307,308,285,308,287,307,308,285,287,307,308,285,285,287,308,287,307,308,285,307,398,398,399,400,400,399,398,399,0,282,0,0,0,0,0,309,290,401,309,282,290,401,309,282,290,309,309,290,401,309,282,290,401,309,282,309,290,401,309,282,309,309,309,282,282,290,401,309,282,309,290,290,290,290,290,401,309,282,290,401,309,282,290,290,290,309,290,309,309,309,309,309,290,290,282,290,401,309,282,290,401,309,282,290,401,309,282,309,309,309,290,401,309,282,290,316,0,294,0,315,316,0,301,0,301,0,301,0,0,294,0,294,0,315,316,299,312,300,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,312,301,301,313,299,314,315,300,294,316,316,312,312,312,301,313,314,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,312,312,301,316,312,301,316,312,312,312,301,313,299,314,315,300,294,316,312,312,312,312,301,313,299,314,315,300,294,316,312,312,301,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,314,299,312,313,312,313,312,301,313,299,314,315,300,294,316,312,312,301,313,314,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,312,301,313,299,314,315,300,294,316,313,312,301,313,299,314,315,300,294,316,312,0,0,321,0,0,321,0,0,0,319,321,318,319,320,321,318,319,320,318,319,320,318,319,320,318,319,320,318,319,320,321,318,319,320,321,318,319,320,321,318,319,320,321,321,318,319,320,321,321,318,319,320,17,321,318,319,320,321,318,319,320,319,319,318,17,319,320,320,318,321,17,318,319,320,321,321,318,319,320,321,318,319,320,321,318,319,320,321,318,319,320,318,0,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,0,323,323,323,323,323,323,323,0,0,323,323,324,323,324,323,324,323,324,323,324,323,323,323,324,323,324,323,324,323,324,324,324,324,324,323,324,323,324,323,324,323,324,324,324,324,323,328,328,328,0,328,328,328,328,328,328,0,0,0,0,326,326,326,33,329,328,325,326,33,329,328,325,33,33,325,325,325,325,325,325,326,33,329,328,325,326,33,329,328,325,326,33,329,328,325,33,326,328,328,325,326,33,329,328,325,329,33,33,33,33,33,326,33,329,328,325,329,326,33,329,328,325,325,329,326,33,325,33,33,325,328,326,33,329,328,325,326,33,329,328,325,326,33,329,328,325,326,33,329,328,325,326,0,0,0,330,330,330,330,330,330,330,331,330,330,331,330,330,0,330,330,330,330,330,335,0,0,334,0,335,338,334,0,0,338,0,0,0,0,0,0,0,0,0,0,334,0,0,246,333,36,334,28,338,339,335,336,246,333,36,334,28,338,339,335,336,246,36,332,249,333,36,36,339,339,334,28,335,336,246,334,28,335,336,246,334,334,28,28,335,335,336,246,246,332,249,333,333,36,36,333,338,246,334,28,338,339,336,246,333,36,334,28,338,339,335,336,246,246,333,36,334,28,338,339,335,336,246,246,333,36,334,28,338,339,335,336,246,246,246,334,28,338,339,335,336,246,334,28,338,339,335,336,246,245,339,36,334,28,338,339,335,336,246,333,36,334,28,338,339,335,336,246,246,339,332,249,248,333,333,36,36,36,245,339,332,249,248,333,333,36,36,36,245,339,334,336,28,339,339,333,36,334,28,338,339,335,336,246,332,249,333,333,36,36,333,36,334,28,338,339,335,336,246,334,28,336,246,339,245,332,249,248,333,333,36,36,36,336,336,0,342,338,28,333,36,336,245,339,339,246,332,249,248,333,36,36,36,332,249,333,333,36,36,245,28,245,245,0,334,28,335,336,246,28,336,246,333,36,334,28,338,339,335,336,246,334,28,336,246,333,36,334,28,338,339,335,336,246,333,36,334,28,338,339,335,336,246,342,338,336,28,333,36,334,28,338,339,335,336,246,0,344,344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,357,346,346,343,348,349,350,346,348,349,351,359,350,357,346,244,352,353,354,355,356,348,349,351,359,350,357,346,244,352,353,354,355,356,351,346,244,352,353,354,355,356,346,244,352,353,354,355,356,346,244,352,353,354,355,356,346,244,352,353,354,355,356,348,349,351,359,350,357,346,346,244,352,353,354,355,356,348,349,351,359,350,357,346,346,244,352,353,354,355,356,348,349,351,359,350,357,346,244,352,353,354,355,356,346,346,244,346,244,352,346,244,352,357,357,346,244,352,353,354,355,356,348,349,351,359,350,357,346,346,244,352,353,354,355,356,351,353,348,349,351,359,350,357,346,244,352,353,354,355,356,348,349,351,359,350,357,346,244,352,353,354,355,356,346,244,352,353,354,355,356,353,355,354,0,348,351,350,351,352,355,354,356,352,346,343,348,349,350,350,343,348,349,350,350,343,348,349,350,350,346,244,352,353,354,355,356,357,353,354,355,346,244,352,353,354,355,356,348,349,351,359,350,357,346,244,352,353,354,355,356,346,244,352,353,354,355,356,348,349,351,359,350,357,346,244,352,353,354,355,356,348,349,351,359,350,357,346,244,352,353,354,355,356,244,244,359,348,349,351,359,350,357,346,244,352,353,354,355,356,0,0,0,0,0,0,0,0,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,0,0,0,0,365,402,365,364,402,365,364,361,364,364,402,365,364,402,365,364,402,365,364,361,364,361,402,365,364,365,402,365,364,402,365,364,361,364,365,402,361,365,361,364,361,402,402,365,364,402,365,364,365,402,365,364,402,365,364,0,0,0,367,367,368,367,368,367,368,367,368,367,368,367,368,367,368,367,368,367,368,367,367,367,368,367,368,367,368,367,367,368,368,367,368,367,368,367,368,368,367,368,367,368,367,368,367,368,367,368,367,368,367,368,368,0,0,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,369,0,0,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,370,0,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,362,0,0,0,0,358,278,0,278,0,378,0,0,0,264,278,278,278,278,0,278,0,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,0,278,278,278,278,278,278,384,0,0,388,0,264,384,384,264,358,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,0,278,0,278,278,278,278,278,278,278,0,278,278,278,278,278,278,278,278,378,264,0,0,0,386,386,386,383,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,358,322,374,375,376,377,378,363,379,264,380,381,382,383,384,373,358,322,374,375,376,377,378,363,379,264,380,381,382,383,384,373,358,358,322,374,375,376,377,378,363,379,264,264,380,381,382,383,384,384,322,374,374,374,373,278,322,374,375,376,377,378,363,379,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,375,387,358,378,358,378,363,381,377,373,386,387,388,358,278,322,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,322,322,322,322,322,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,358,373,380,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,376,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,375,375,380,374,322,385,373,363,322,322,379,377,373,387,374,377,375,379,379,379,373,382,383,373,358,322,374,375,376,377,378,363,379,264,380,381,382,383,384,322,373,322,374,375,376,377,378,363,379,381,382,383,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,373,386,387,388,358,278,322,374,375,376,377,378,363,379,264,380,381,382,383,384,385,403,404,405,406,407,408,409,410,411,409,410,403,412,413,414,415,416,409,410,403,403,417,418,419,420,421,410,409,410,410,422,423,424,415,425,409,410,403,403,410,426,427,415,428,425,407,416,424,429,430,431,407,413,432,428,428,428,424,433,415,415,416,434,435,426,436,407,410,437,438,437,438,413,417,430,431,439,440,405,405,405,405,441,423,413],"f":"```````````{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00``````{{}f}{{{b{h}}}{{b{j}}}}{l{{b{c}}}{}}00{l{{b{dc}}}{}}00`{ln}00`{{{b{f}}{b{f}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{f}}{b{dAb}}}Ad}{{{b{j}}{b{dAb}}}Ad}{cc{}}00`````{{}l}00{ce{}{}}00```````````{c{{Af{e}}}{}{}}00000{{{b{c}}}Ah{}}00``222``?>;:9432{{{b{Aj}}}A`}{{{b{Al}}}A`}{{{An{Al}}}{{An{B`}}}}{{{b{dAl}}{Bd{Bb}}}{{Bf{n}}}}{{{b{Al}}{b{Bh}}}{{Bl{{An{Bj}}}}}}{{{b{Al}}{b{Bh}}{b{{Cb{{C`{Bn}}}}}}}{{Bl{{An{Bj}}}}}}{{{b{Al}}{b{Cd}}{C`{Bn}}}{{Bl{{An{Bj}}}}}}{{{b{Al}}}{{Bl{{An{Bj}}}}}}998:``{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{Cf}}Ch}{{Cl{Cj}}}}{{{b{Cf}}}Cf}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{{b{dCj}}CnD`}n}{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}07{cc{}}0{{}l}0{ce{}{}}0{{{Bd{Db}}}Cf}{{{b{Cf}}Ch}{{Df{{Dd{Cj}}}}}}{{{b{c}}}e{}{}}{{{b{Cj}}}{{b{Dh}}}}{{{b{dCj}}}{{b{dDh}}}}{c{{Af{e}}}{}{}}000{{{b{c}}}Ah{}}077`````````````````{{{b{D`}}}{{b{{Cb{Bn}}}}}}{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{D`}}}D`}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}0{{{b{D`}}{b{D`}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}{{{b{{Cb{Bn}}}}}D`}{{}D`}{l{{b{c}}}{}}{l{{b{dc}}}{}}3{{{b{{Cb{{b{{Cb{Bn}}}}}}}}}D`}{ln}4{D`{{C`{Bn}}}}{{{b{c}}}e{}{{Dn{Dl}}}}0{{{b{D`}}{b{D`}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{D`}}{b{dAb}}}Ad}00:{{{b{Cd}}}D`}{{{C`{Bn}}}D`}{cc{}}{{{b{Cd}}}{{Af{D`E`}}}}{{{b{D`}}{b{dc}}}nEb}{{}l}{ce{}{}}{D`Ed}{{{b{D`}}}A`}3{{{b{D`}}{b{D`}}}{{Ef{Dj}}}}4{{{b{c}}}e{}{}}{{{b{c}}}Eh{}}{{{b{D`}}l}{{b{{Cb{Bn}}}}}}{{}{{Af{D`Ej}}}}{c{{Af{e}}}{}{}}{Ed{{Af{D`Ej}}}}1{{{b{c}}}Ah{}}:{{{b{dD`}}}n}```````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{{El{Bn}}}}{C`{Bn}}{C`{Bn}}{b{En}}{b{F`}}}{{Bf{{C`{Bn}}}}}}{{{b{Fb}}{b{{El{Bn}}}}{C`{Bn}}{C`{Bn}}{b{En}}}{{Bf{{C`{Bn}}}}}}1{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{cc{}}{{}{{Fd{EnF`}}}}{{}l}{ce{}{}}{{{b{{El{Bn}}}}}Ff}{{{b{Ff}}{b{{El{Bn}}}}ce}{{Af{{C`{Bn}}Fh}}}{{Fj{{Cb{Bn}}}}}{{Fl{{Cb{Bn}}}}}}{{{b{Ff}}{b{{El{Bn}}}}{b{d{Cb{Bn}}}}{b{{Cb{Bn}}}}{b{d{Cb{Bn}}}}}{{Af{lFh}}}}{{{b{Ff}}{b{{El{Bn}}}}ce}{{C`{Bn}}}{{Fl{{Cb{Bn}}}}}{{Fl{{Cb{Bn}}}}}}{{{b{Ff}}{b{{El{Bn}}}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}{b{d{Cb{Bn}}}}}{{Af{lFn}}}}{c{{Af{e}}}{}{}}0{{{b{c}}}Ah{}}7{{{b{dFf}}}n}```{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{G`}}}G`}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{l{{b{c}}}{}}{{{b{G`}}}{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{{{b{G`}}{b{dAb}}}Ad}{cc{}}{{}G`}{{{b{dG`}}}{{Bf{n}}}}{{}l}{ce{}{}}{{{El{Bn}}}G`}{{{b{c}}}e{}{}}{c{{Af{e}}}{}{}}0{{{b{c}}}Ah{}}4```````{{{b{Gb}}}{{b{{Cb{Bn}}}}}}{{{b{Gd}}}{{b{{Cb{Bn}}}}}}``{{{b{c}}}{{b{e}}}{}{}}00000{{{b{dc}}}{{b{de}}}{}{}}00000{{{b{Gb}}}Gb}{{{b{Gd}}}Gd}{{{b{Gf}}}Gf}{{{b{Gh}}}Gh}{{{b{Gj}}}Gj}{{{b{c}}{b{de}}}n{}{}}0000{{{b{c}}}n{}}000000{{{b{Gb}}{b{Gb}}}Dj}{{{b{Gd}}{b{Gd}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}0{{}Gb}{{}Gd}{{}Gf}{{}Gh}{{}Gj}{l{{b{c}}}{}}00000{l{{b{dc}}}{}}00000{ln}00000{{{b{c}}}e{}{{Dn{Dl}}}}000{{{b{Gb}}{b{Gb}}}A`}{{{b{Gd}}{b{Gd}}}A`}{{{b{Gf}}{b{Gf}}}A`}{{{b{Gh}}{b{Gh}}}A`}{{{b{Gj}}{b{Gj}}}A`}{{{b{c}}{b{e}}}A`{}{}}0000{{{b{Gb}}{b{dAb}}}Ad}00{{{b{Gd}}{b{dAb}}}Ad}00{{{b{Gf}}{b{dAb}}}Ad}{{{b{Gh}}{b{dAb}}}Ad}{{{b{Gj}}{b{dAb}}}Ad}{cc{}}{{{C`{Bn}}}Gb}{{{b{{Cb{Bn}}}}}Gb}2{{{b{Cd}}}Gb}{{{b{Cd}}}Gd}{{{b{{Cb{Bn}}}}}Gd}{{{C`{Bn}}}Gd}6666{{{C`{Bn}}}Gl}{{{b{Cd}}}{{Bf{GbE`}}}}{{{b{Cd}}}{{Bf{GdE`}}}}{EhGl}{{}Gl}{{{b{Gb}}{b{dc}}}nEb}{{{b{Gd}}{b{dc}}}nEb}{{{b{Gf}}{b{dc}}}nEb}{{{b{Gh}}{b{dc}}}nEb}{{{b{Gj}}{b{dc}}}nEb}{{}l}00000{ce{}{}}00000{GbEd}{GdEd}{GfEd}{GhEd}{GjEd}66{{{b{Gb}}{b{Gb}}}{{Ef{Dj}}}}{{{b{Gd}}{b{Gd}}}{{Ef{Dj}}}}{{{b{Gn}}}Gb}{{{b{Gl}}}Gb}0`{{{b{Gn}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Bf{Gd}}}}{{{b{Gl}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Bf{Gd}}}}``{{{C`{Bn}}{b{Eh}}}{{C`{Bn}}}}{{{C`{Bn}}{b{H`}}}{{C`{Bn}}}}`{{{b{Gl}}}{{C`{Bn}}}}{{{b{c}}}e{}{}}0000{{{b{c}}}Eh{}}0{{}{{Bf{GbEj}}}}{{}{{Bf{GdEj}}}}{{}{{Af{GfEj}}}}{{}{{Af{GhEj}}}}{{}{{Af{GjEj}}}}{c{{Af{e}}}{}{}}00000{Ed{{Bf{GbEj}}}}{Ed{{Bf{GdEj}}}}{Ed{{Af{GfEj}}}}{Ed{{Af{GhEj}}}}{Ed{{Af{GjEj}}}}555555{{{b{c}}}Ah{}}00000{{{b{Gd}}{b{Gb}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Bf{n}}}}{{{b{Gf}}{b{Eh}}}A`}{{{b{Gj}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}A`}{{{b{Gd}}{b{Gb}}{b{{Cb{Bn}}}}}{{Bf{n}}}}{ce{}{}}00000{{{b{dGb}}}n}{{{b{dGd}}}n}````{{{b{Hb}}}{{b{{Cb{Bn}}}}}}{{{b{Hd}}}{{b{{Cb{Bn}}}}}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{Hb}}}Hb}{{{b{Hd}}}Hd}{{{b{c}}{b{de}}}n{}{}}0{{{b{c}}}n{}}00{{}Hb}{{}Hd}{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}{{{b{dHb}}}n}1{{{b{c}}}e{}{{Dn{Dl}}}}000{{{b{Hd}}{b{Hd}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{Hd}}{b{dAb}}}Ad}{{{El{Bn}}}Hb}{cc{}}{F`Hb}{{{b{Hb}}}Hd}{{{El{Bn}}}Hd}3{EnHd}{EhHb}{{}Hb}{{{b{Hd}}{b{dc}}}nEb}{{}l}0{ce{}{}}0{HbEd}{HdEd}9{{{b{c}}}e{}{}}0{{}{{Bf{HbEj}}}}{{}{{Bf{HdEj}}}}{c{{Af{e}}}{}{}}0{Ed{{Bf{HbEj}}}}{Ed{{Bf{HdEj}}}}22{{{b{c}}}Ah{}}099{{{b{dHb}}}n}``{{{b{{Cb{Bn}}}}}{{Ef{Hf}}}}{{{b{{Cb{Bn}}}}}Hh}{{{b{{Cb{Bn}}}}}Hf}{Hf{{C`{Bn}}}}{Hh{{C`{Bn}}}}{{Hf{b{d{C`{{C`{Bn}}}}}}}n}{{Hfl}{{C`{Bn}}}}{{}Bn}{{}l}0{{{b{Cd}}}Hj}{Hln}``{{{b{H`}}}{{b{{Cb{Bn}}}}}}{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{H`}}}H`}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}0{{{b{H`}}{b{H`}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}{{}H`}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{{{b{c}}}e{}{{Dn{Dl}}}}0{{{b{H`}}{b{H`}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{H`}}{b{dAb}}}Ad}00{cc{}}{{{C`{Bn}}}H`}{{{b{Cd}}}H`}{{{b{{Cb{Bn}}}}}H`}{{{b{Cd}}}{{Af{H`E`}}}}{{{b{H`}}{b{dc}}}nEb}{{}l}{ce{}{}}{H`Ed}2{{{b{H`}}{b{H`}}}{{Ef{Dj}}}}{{{b{c}}}e{}{}}{{{b{c}}}Eh{}}{{}{{Af{H`Ej}}}}{c{{Af{e}}}{}{}}{Ed{{Af{H`Ej}}}}1{{{b{c}}}Ah{}}8{{{b{dH`}}}n}`{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{{{b{dHn}}}n}{cc{}}{{}l}{ce{}{}}<<:0{{}I`}`{{Ib{b{Ib}}}Ib}{{IbIb}Ib}{{IbCn}Ib}{{{b{dIb}}Cn}n}{{{b{dIb}}{b{Ib}}}n}{{{b{dIb}}Ib}n}?>{{{b{Ib}}{b{Ib}}}{{Ef{Ib}}}}0{{{b{Ib}}}Ib}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{{b{Ib}}{b{Ib}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}{{}Ib}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{{{b{Ib}}{b{Ib}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{Ib}}{b{dAb}}}Ad}0{IdIb}{IfIb}{BnIb}{cc{}}{IhIb}{CnIb}{{{b{Ib}}{b{dc}}}nEb}{{}l}{ce{}{}}{IbEd}{{{b{Ib}}}A`}0{{Ib{b{Ib}}}Ib}{{IbCn}Ib}{{IbIb}Ib}{{{b{dIb}}{b{Ib}}}n}{{{b{dIb}}Cn}n}{{{b{dIb}}Ib}n}{{{b{Ib}}{b{Ib}}}{{Ef{Dj}}}}{{{b{c}}}e{}{}}{{{b{c}}}Eh{}}{{}{{Af{IbEj}}}}{c{{Af{e}}}{}{}}{Ed{{Af{IbEj}}}}1{{{b{c}}}Ah{}}?{{}Ib}`````````{{{b{Ij}}}{{b{{Cb{Bn}}}}}}{{{b{Il}}}{{b{{Cb{Bn}}}}}}{{{b{c}}}{{b{e}}}{}{}}00000{{{b{dc}}}{{b{de}}}{}{}}00000{{{b{Ij}}}Ij}{{{b{Il}}}Il}{{{b{In}}}In}{{{b{J`}}}J`}{{{b{Jb}}}Jb}{{{b{Jd}}}Jd}{{{b{c}}{b{de}}}n{}{}}00000{{{b{c}}}n{}}0000000{{{b{Ij}}{b{Ij}}}Dj}{{{b{Il}}{b{Il}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}0{{}{{Ef{In}}}}{{}Ij}{{}Il}{{}In}{{}Jb}{{}Jd}{l{{b{c}}}{}}00000{l{{b{dc}}}{}}00000{ln}00000`{{{b{c}}}e{}{{Dn{Dl}}}}000{{{b{Ij}}{b{Ij}}}A`}{{{b{Il}}{b{Il}}}A`}{{{b{In}}{b{In}}}A`}{{{b{J`}}{b{J`}}}A`}{{{b{Jb}}{b{Jb}}}A`}{{{b{c}}{b{e}}}A`{}{}}0000{{{b{Ij}}{b{dAb}}}Ad}00{{{b{Il}}{b{dAb}}}Ad}00{{{b{In}}{b{dAb}}}Ad}{{{b{J`}}{b{dAb}}}Ad}{{{b{Jb}}{b{dAb}}}Ad}{{{b{Jd}}{b{dAb}}}Ad}{IjIn}{{{b{Cd}}}Ij}{cc{}}{{{b{{Cb{Bn}}}}}Ij}{{{C`{Bn}}}Ij}{{{C`{Bn}}}Il}3{{{b{Cd}}}Il}{{{b{{Cb{Bn}}}}}Il}5555{{{b{Cd}}}{{Bf{IjE`}}}}{{{b{Cd}}}{{Bf{IlE`}}}}{{{b{Ij}}{b{dc}}}nEb}{{{b{Il}}{b{dc}}}nEb}{{{b{In}}{b{dc}}}nEb}```{{}l}00000{ce{}{}}00000{IjEd}{IlEd}{InEd}{J`Ed}{JbEd}{{{b{J`}}JfJf{b{Jb}}}A`}77``{{{b{Ij}}{b{Ij}}}{{Ef{Dj}}}}{{{b{Il}}{b{Il}}}{{Ef{Dj}}}}```{{{b{Jh}}{b{{El{Bn}}}}}Jj}``{{{b{c}}}e{}{}}00000{{{b{c}}}Eh{}}0{{}{{Bf{IjEj}}}}{{}{{Bf{IlEj}}}}{{}{{Af{InEj}}}}{{}{{Af{JbEj}}}}{c{{Af{e}}}{}{}}00000{Ed{{Bf{IjEj}}}}{Ed{{Bf{IlEj}}}}{Ed{{Af{InEj}}}}{Ed{{Af{J`Ej}}}}{Ed{{Af{JbEj}}}}555555{{{b{c}}}Ah{}}00000{{{b{J`}}{b{Jb}}}{{Bf{Jd}}}}{ce{}{}}00000{{{b{dIj}}}n}{{{b{dIl}}}n}{{Jl{b{{Cb{Bn}}}}}{{El{Bn}}}}``````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0`{{{b{Jn}}}Jn}{{{b{K`}}}K`}{{{b{c}}{b{de}}}n{}{}}0{{{b{c}}}n{}}0{{}Jn}{{}K`}{l{{b{c}}}{}}0{l{{b{dc}}}{}}0`{ln}0{{{b{Jn}}{b{Jn}}}A`}{{{b{K`}}{b{K`}}}A`}{{{b{c}}{b{e}}}A`{}{}}0{{{b{Jn}}{b{dAb}}}Ad}{{{b{K`}}{b{dAb}}}Ad}{cc{}}0`{{}l}0{ce{}{}}0{JnEd}{K`Ed}``{{{b{c}}}e{}{}}0{{}{{Af{JnEj}}}}{{}{{Af{K`Ej}}}}{c{{Af{e}}}{}{}}0{Ed{{Af{JnEj}}}}{Ed{{Af{K`Ej}}}}22{{{b{c}}}Ah{}}0{{{b{K`}}{b{Jn}}}{{Bf{Jd}}}}::``````````````````````````````````````{{}Kb}`{{{b{Kd}}}In}{{KbKb}Kb}{{{b{dKb}}Kb}n}10{{{b{Kb}}}Cn}021{{{b{c}}}{{b{e}}}{}{}}00000000{{{b{dc}}}{{b{de}}}{}{}}00000000`{{{b{Kf}}}Kf}{{{b{Kh}}}Kh}{{{b{Kj}}}Kj}{{{b{Kl}}}Kl}{{{b{Kd}}}Kd}{{{b{Kb}}}Kb}{{{b{Kn}}}Kn}{{{b{c}}{b{de}}}n{}{}}000000{{{b{c}}}n{}}0000000{KbKb}{{{b{Kb}}Kb}A`}{{}Kf}{{}Kh}{{}Kl}{{}Kn}{l{{b{c}}}{}}00000000{l{{b{dc}}}{}}00000000{{KbKb}Kb}`{ln}00000000{{}Kb}{{{b{Kf}}{b{Kf}}}A`}{{{b{Kh}}{b{Kh}}}A`}{{{b{Kj}}{b{Kj}}}A`}{{{b{Kl}}{b{Kl}}}A`}{{{b{Kd}}{b{Kd}}}A`}{{{b{Kb}}{b{Kb}}}A`}{{{b{Kn}}{b{Kn}}}A`}{{{b{c}}{b{e}}}A`{}{}}000000{{{b{dKb}}c}n{{Lb{}{{L`{Kb}}}}}}`{{{b{Kf}}{b{dAb}}}Ad}{{{b{Kh}}{b{dAb}}}Ad}{{{b{Kj}}{b{dAb}}}Ad}{{{b{Kl}}{b{dAb}}}Ad}{{{b{Ld}}{b{dAb}}}Ad}{{{b{Kd}}{b{dAb}}}Ad}{{{b{Kb}}{b{dAb}}}Ad}0000{{{b{Kn}}{b{dAb}}}Ad}{{{b{Lf}}{b{dAb}}}Ad}0{cc{}}0000000{LhLf}1{Cn{{Ef{Kb}}}}{CnKb}00{cKb{{Lb{}{{L`{Kb}}}}}}{{{b{Cd}}}{{Ef{Kb}}}}{{{b{Ld}}}{{b{`}}}}{{}l}00000000{{{b{dKb}}Kb}n}{{KbKb}Kb}{{{b{Kb}}Kb}A`}{ce{}{}}00000000{KfEd}{KhEd}{KjEd}{KlEd}{KnEd}{Kbc{}}{{{b{Kb}}}A`}0{{{b{Kf}}JfJf}A`}{{{b{Kb}}}{{Lj{Kb}}}}{{{b{Kb}}}{{Ll{Kb}}}}{{{b{Kj}}{b{Kd}}}A`}`````````{KbKb}{c{{Af{LdLf}}}{{M`{{Ln{{Cb{Bn}}}}}}}}{{{b{{Cb{Bn}}}}}{{Af{KdLf}}}}{{{b{{Cb{Bn}}}}}{{Af{KbLf}}}}``{{{b{dKb}}Kb}n}{{{b{Ld}}}{{b{`}}}}``````{{{b{dKb}}KbA`}n}{{{b{Lf}}}{{Ef{{b{Mb}}}}}}{{KbKb}Kb}40````{{{b{{El{Bn}}}}{b{{El{Bn}}}}{b{{El{Bn}}}}{b{{El{Bn}}}}{b{{El{Bn}}}}}In}``{{{b{c}}}e{}{}}000000{{{b{c}}}Eh{}}7{{}{{Af{KfEj}}}}{{}{{Af{KhEj}}}}{{}{{Af{KlEj}}}}{{}{{Af{KnEj}}}}{c{{Af{e}}}{}{}}00000000{Ed{{Af{KfEj}}}}{Ed{{Af{KhEj}}}}{Ed{{Af{KjEj}}}}{Ed{{Af{KlEj}}}}{Ed{{Af{KnEj}}}}555555555{{{b{c}}}Ah{}}00000000>{{{b{Kh}}{b{Kd}}}{{Af{nLf}}}}{{{b{Kl}}{b{Kf}}{Mf{Md}}}{{Af{JdLf}}}}`{ce{}{}}00000000`{{Jl{b{{Cb{Bn}}}}}Ff}{{Jl{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{C`{Bn}}}}{{Jl{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Af{{Ef{{C`{Bn}}}}Lh}}}}{{}Mh}{{}Jf}```{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{Mj}}}Mj}{{{b{Ml}}}Ml}{{{b{c}}{b{de}}}n{}{}}0{{{b{c}}}n{}}00`{{}Mj}{{}Ml}{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}0{{{b{Mj}}{b{Mj}}}A`}{{{b{Ml}}{b{Ml}}}A`}{{{b{c}}{b{e}}}A`{}{}}0{{{b{Mj}}{b{dAb}}}Ad}{{{b{Ml}}{b{dAb}}}Ad}{CnMj}{cc{}}0{{{b{Mj}}{b{dc}}}nEb}{{{b{Ml}}{b{dc}}}nEb}{{}l}0{ce{}{}}0{MjEd}{MlEd}<``{{IfIfIf}Mj}```{{{b{c}}}e{}{}}0{{}{{Af{MjEj}}}}{{}{{Af{MlEj}}}}{c{{Af{e}}}{}{}}0{Ed{{Af{MjEj}}}}{Ed{{Af{MlEj}}}}22{{{b{c}}}Ah{}}0::``{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{{Mn{c}}}}}{{Mn{c}}}N`}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{{{b{{Mn{c}}}}{b{{Mn{c}}}}}A`Nb}{{{b{c}}{b{e}}}A`{}{}}{{{b{{Mn{c}}}}{b{dAb}}}AdNd}{cc{}}{{{b{{Mn{c}}}}{b{de}}}nNfEb}{{}l}`{ce{}{}}{{{Mn{c}}}EdNh}{{Ifc}{{Mn{c}}}{}}{{{b{c}}}e{}{}}{c{{Af{e}}}{}{}}{Ed{{Af{{Mn{c}}Ej}}}Nj}1{{{b{c}}}Ah{}}`6``{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0``{{{b{Nl}}}Nl}{{{b{Nn}}}Nn}{{{b{c}}{b{de}}}n{}{}}0{{{b{c}}}n{}}0{{}Nl}{{}Nn}{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}0`{{{b{Nl}}{b{dAb}}}Ad}{{{b{Nn}}{b{dAb}}}Ad}{cc{}}0{{}l}0{ce{}{}}0``{{{b{c}}}e{}{}}0`{c{{Af{e}}}{}{}}000{{{b{c}}}Ah{}}0`33`````````{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{O`}}}O`}{{{b{Ob}}}Ob}{{{b{Od}}}Od}{{{b{c}}{b{de}}}n{}{}}00{{{b{c}}}n{}}00{{}O`}{{}Od}{l{{b{c}}}{}}00{l{{b{dc}}}{}}00{ln}00{{{b{Od}}{b{Od}}}A`}{{{b{c}}{b{e}}}A`{}{}}`{{{b{O`}}{b{dAb}}}Ad}{{{b{Ob}}{b{dAb}}}Ad}{{{b{Od}}{b{dAb}}}Ad}{cc{}}00``{{}l}00{ce{}{}}00{O`Ed}{ObEd}{OdEd}`````````{{{b{c}}}e{}{}}00`{{}{{Af{O`Ej}}}}{{}{{Af{OdEj}}}}{c{{Af{e}}}{}{}}00{Ed{{Af{O`Ej}}}}{Ed{{Af{ObEj}}}}{Ed{{Af{OdEj}}}}333{{{b{c}}}Ah{}}00`;;;````{{{b{Of}}}{{b{{Cb{Bn}}}}}}{{{b{c}}}{{b{e}}}{}{}}000{{{b{dc}}}{{b{de}}}{}{}}000{{{b{Of}}}Of}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{{b{Of}}{b{Of}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}{{{b{{Cb{Bn}}}}}Of}{{}Of}{l{{b{c}}}{}}{{{b{Oh}}}{{b{Of}}}}{{{b{Oj}}}{{b{Of}}}}22{{{b{Ol}}}{{b{Of}}}}3{l{{b{dc}}}{}}000{ln}000{Of{{C`{Bn}}}}{{{b{c}}}e{}{{Dn{Dl}}}}0{{{b{Of}}{b{Of}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{Of}}{b{dAb}}}Ad}0{cc{}}00{{{b{{El{Bn}}}}}Of}1{{{b{Cd}}}Of}{{{b{Cd}}}{{Bf{Of}}}}{{{b{Gb}}}Of}{{{b{H`}}}Of}{{{b{Of}}{b{dc}}}nEb}{{}l}000{ce{}{}}000{OfEd}{{{b{{Cb{Bn}}}}Bn{b{{Cb{Bn}}}}}Of}{{{b{Of}}{b{Of}}}{{Ef{Dj}}}}4{{{b{Of}}}Eh}{{{b{c}}}e{}{}}{{}{{Bf{OfEj}}}}{c{{Af{e}}}{}{}}000{Ed{{Bf{OfEj}}}}1111{{{b{c}}}Ah{}}0009999```{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{On}}}On}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{}On}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}`{{{b{On}}{b{On}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{On}}{b{dAb}}}Ad}{cc{}}{{{b{On}}{b{dc}}}nEb}`{{}l}{ce{}{}}{OnEd}{{{b{c}}}e{}{}}{{}{{Af{OnEj}}}}{c{{Af{e}}}{}{}}{Ed{{Af{OnEj}}}}1{{{b{c}}}Ah{}}6```````````{{{b{c}}}{{b{e}}}{}{}}000000{{{b{dc}}}{{b{de}}}{}{}}000000```{{{b{A@`}}}A@`}{{{b{A@b}}}A@b}{{{b{A@d}}}A@d}{{{b{A@f}}}A@f}{{{b{A@h}}}A@h}{{{b{A@j}}}A@j}{{{b{A@l}}}A@l}{{{b{c}}{b{de}}}n{}{}}000000{{{b{c}}}n{}}000000{{{b{A@`}}{b{A@`}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}{{}A@`}{{}A@b}{{}A@d}{{}A@f}{{}A@h}{{}A@j}{{}A@l}{l{{b{c}}}{}}000000{l{{b{dc}}}{}}000000{ln}000000``{{{b{A@`}}{b{A@`}}}A`}{{{b{A@b}}{b{A@b}}}A`}{{{b{A@d}}{b{A@d}}}A`}{{{b{A@f}}{b{A@f}}}A`}{{{b{A@h}}{b{A@h}}}A`}{{{b{A@j}}{b{A@j}}}A`}{{{b{A@l}}{b{A@l}}}A`}{{{b{c}}{b{e}}}A`{}{}}000000{{{b{A@`}}{b{dAb}}}Ad}{{{b{A@b}}{b{dAb}}}Ad}{{{b{A@d}}{b{dAb}}}Ad}{{{b{A@f}}{b{dAb}}}Ad}{{{b{A@h}}{b{dAb}}}Ad}{{{b{A@j}}{b{dAb}}}Ad}{{{b{A@l}}{b{dAb}}}Ad}{cc{}}000000``{{{b{A@`}}{b{dc}}}nEb}{{{b{A@b}}{b{dc}}}nEb}{{{b{A@d}}{b{dc}}}nEb}{{{b{A@f}}{b{dc}}}nEb}{{{b{A@l}}{b{dc}}}nEb}`{{}l}000000{ce{}{}}000000{A@`Ed}{A@bEd}{A@dEd}{A@fEd}{A@hEd}{A@jEd}{A@lEd}``{{{b{A@`}}{b{A@`}}}{{Ef{Dj}}}}```{{{b{c}}}e{}{}}000000{{}{{Af{A@bEj}}}}{{}{{Af{A@dEj}}}}{{}{{Af{A@fEj}}}}{{}{{Af{A@hEj}}}}{{}{{Af{A@jEj}}}}{{}{{Af{A@lEj}}}}{c{{Af{e}}}{}{}}000000{Ed{{Af{A@`Ej}}}}{Ed{{Af{A@bEj}}}}{Ed{{Af{A@dEj}}}}{Ed{{Af{A@fEj}}}}{Ed{{Af{A@hEj}}}}{Ed{{Af{A@jEj}}}}{Ed{{Af{A@lEj}}}}7777777{{{b{c}}}Ah{}}000000``````{ce{}{}}000000``````````{{{b{c}}}{{b{e}}}{}{}}00000000{{{b{dc}}}{{b{de}}}{}{}}00000000```{{{b{A@n}}}A@n}{{{b{AA`}}}AA`}{{{b{AAb}}}AAb}{{{b{AAd}}}AAd}{{{b{AAf}}}AAf}{{{b{AAh}}}AAh}{{{b{AAj}}}AAj}{{{b{AAl}}}AAl}{{{b{c}}{b{de}}}n{}{}}0000000{{{b{c}}}n{}}0000000{{}A@n}{{}AA`}{{}AAb}{{}AAd}{{}AAf}{{}AAh}{{}AAj}{{}AAl}{l{{b{c}}}{}}00000000{l{{b{dc}}}{}}00000000{ln}00000000```{{{b{A@n}}{b{A@n}}}A`}{{{b{AA`}}{b{AA`}}}A`}{{{b{AAb}}{b{AAb}}}A`}{{{b{AAd}}{b{AAd}}}A`}{{{b{AAf}}{b{AAf}}}A`}{{{b{AAh}}{b{AAh}}}A`}{{{b{AAj}}{b{AAj}}}A`}{{{b{AAl}}{b{AAl}}}A`}{{{b{c}}{b{e}}}A`{}{}}0000000{{{b{AAn}}{b{dAb}}}Ad}0{{{b{A@n}}{b{dAb}}}Ad}{{{b{AA`}}{b{dAb}}}Ad}{{{b{AAb}}{b{dAb}}}Ad}{{{b{AAd}}{b{dAb}}}Ad}{{{b{AAf}}{b{dAb}}}Ad}{{{b{AAh}}{b{dAb}}}Ad}{{{b{AAj}}{b{dAb}}}Ad}{{{b{AAl}}{b{dAb}}}Ad}{cc{}}00000000``{{}l}00000000{ce{}{}}00000000{A@nEd}{AA`Ed}{AAbEd}{AAdEd}{AAfEd}{AAhEd}{AAjEd}{AAlEd}````{{AAf{b{{Bd{Gn}}}}}{{Bf{AAj}}}}{{AAh{b{{Bd{Gn}}}}}{{Bf{AAl}}}}````````````{{{b{c}}}e{}{}}0000000{{{b{c}}}Eh{}}{{}{{Af{A@nEj}}}}{{}{{Af{AA`Ej}}}}{{}{{Af{AAbEj}}}}{{}{{Af{AAdEj}}}}{{}{{Af{AAfEj}}}}{{}{{Af{AAhEj}}}}{{}{{Af{AAjEj}}}}{{}{{Af{AAlEj}}}}{c{{Af{e}}}{}{}}00000000{Ed{{Af{A@nEj}}}}{Ed{{Af{AA`Ej}}}}{Ed{{Af{AAbEj}}}}{Ed{{Af{AAdEj}}}}{Ed{{Af{AAfEj}}}}{Ed{{Af{AAhEj}}}}{Ed{{Af{AAjEj}}}}{Ed{{Af{AAlEj}}}}888888888{{{b{c}}}Ah{}}00000000{{{b{AAb}}}{{Bf{{b{A@n}}}}}}{ce{}{}}00000000`````````{{{b{c}}}{{b{e}}}{}{}}00000{{{b{dc}}}{{b{de}}}{}{}}00000``{{{b{AB`}}}AB`}{{{b{ABb}}}ABb}{{{b{ABd}}}ABd}{{{b{ABf}}}ABf}{{{b{ABh}}}ABh}{{{b{c}}{b{de}}}n{}{}}0000{{{b{c}}}n{}}0000`{{}AB`}{{}ABb}{{}ABd}{{}ABf}{{}ABh}{l{{b{c}}}{}}00000{l{{b{dc}}}{}}00000{ln}00000{{{b{AB`}}{b{AB`}}}A`}{{{b{ABb}}{b{ABb}}}A`}{{{b{ABd}}{b{ABd}}}A`}{{{b{ABf}}{b{ABf}}}A`}{{{b{ABh}}{b{ABh}}}A`}{{{b{c}}{b{e}}}A`{}{}}0000`{{{b{ABj}}{b{dAb}}}Ad}0{{{b{AB`}}{b{dAb}}}Ad}{{{b{ABb}}{b{dAb}}}Ad}{{{b{ABd}}{b{dAb}}}Ad}{{{b{ABf}}{b{dAb}}}Ad}{{{b{ABh}}{b{dAb}}}Ad}{cc{}}00000````{{}l}00000{ce{}{}}00000{AB`Ed}{ABbEd}{ABdEd}{ABfEd}{ABhEd}``````````````{{{b{c}}}e{}{}}0000{{{b{c}}}Eh{}}{{}{{Af{ABbEj}}}}{{}{{Af{ABdEj}}}}{{}{{Af{ABfEj}}}}{{}{{Af{ABhEj}}}}{c{{Af{e}}}{}{}}00000{Ed{{Af{AB`Ej}}}}{Ed{{Af{ABbEj}}}}{Ed{{Af{ABdEj}}}}{Ed{{Af{ABfEj}}}}{Ed{{Af{ABhEj}}}}555555{{{b{c}}}Ah{}}00000{{{b{ABh}}}{{Bf{{b{ABf}}}}}}{ce{}{}}00000``````````````````````````````````````````````````````````````````{{{b{ABl}}ABn}{{Ef{AC`}}}}`````````{{ACbACb}c{}}0{{{b{c}}}{{b{e}}}{}{}}0000000000000000000000000000000000000{{{b{dc}}}{{b{de}}}{}{}}0000000000000000000000000000000000000``````{{{b{ACd}}}ACd}{{{b{ACf}}}ACf}{{{b{ACh}}}ACh}{{{b{ACj}}}ACj}{{{b{ACl}}}ACl}{{{b{ACn}}}ACn}{{{b{AD`}}}AD`}{{{b{ADb}}}ADb}{{{b{ADd}}}ADd}{{{b{ADf}}}ADf}{{{b{ADh}}}ADh}{{{b{ADj}}}ADj}{{{b{ACb}}}ACb}{{{b{ADl}}}ADl}{{{b{ADn}}}ADn}{{{b{AE`}}}AE`}{{{b{AEb}}}AEb}{{{b{AEd}}}AEd}{{{b{AEf}}}AEf}{{{b{AEh}}}AEh}{{{b{AEj}}}AEj}{{{b{AEl}}}AEl}{{{b{AEn}}}AEn}{{{b{AF`}}}AF`}{{{b{AFb}}}AFb}{{{b{AFd}}}AFd}{{{b{AFf}}}AFf}{{{b{AFh}}}AFh}{{{b{AFj}}}AFj}{{{b{AFl}}}AFl}{{{b{AFn}}}AFn}{{{b{AC`}}}AC`}{{{b{AG`}}}AG`}{{{b{AGb}}}AGb}{{{b{AGd}}}AGd}{{{b{AGf}}}AGf}{{{b{ABl}}}ABl}{{{b{AGh}}}AGh}{{{b{c}}{b{de}}}n{}{}}0000000000000000000000000000000000000{{{b{c}}}n{}}00000000000000000000000000000000000000{{{b{ACb}}{b{ACb}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}``{{{b{ACb}}ACb}A`}{{{b{AG`}}{b{In}}}A`}{{}ACd}{{}ACf}{{}ACh}{{}ACj}{{}ACl}{{}ACn}{{}AD`}{{}ADb}{{}ADd}{{}ADf}{{}ADh}{{}ADj}{{}ACb}{{}ADl}{{}ADn}{{}AE`}{{}AEb}{{}AEd}{{}AEf}{{}AEh}{{}AEj}{{}AEl}{{}AEn}{{}AF`}{{}AFb}{{}AFd}{{}AFf}{{}AFh}{{}AFj}{{}AFl}{{}AFn}{{}AC`}{{}AGb}{{}AGf}{{}ABl}{{}AGh}{{{b{ABl}}Mj}{{Ef{AC`}}}}`{l{{b{c}}}{}}0000000000000000000000000000000000000{l{{b{dc}}}{}}0000000000000000000000000000000000000{ln}0000000000000000000000000000000000000{{{b{AG`}}}{{b{{C`{In}}}}}}``````{{{b{ACd}}{b{ACd}}}A`}{{{b{ACf}}{b{ACf}}}A`}{{{b{ACh}}{b{ACh}}}A`}{{{b{ACj}}{b{ACj}}}A`}{{{b{ACl}}{b{ACl}}}A`}{{{b{ACn}}{b{ACn}}}A`}{{{b{AD`}}{b{AD`}}}A`}{{{b{ADb}}{b{ADb}}}A`}{{{b{ADd}}{b{ADd}}}A`}{{{b{ADh}}{b{ADh}}}A`}{{{b{ADj}}{b{ADj}}}A`}{{{b{ACb}}{b{ACb}}}A`}{{{b{ADl}}{b{ADl}}}A`}{{{b{ADn}}{b{ADn}}}A`}{{{b{AE`}}{b{AE`}}}A`}{{{b{AEb}}{b{AEb}}}A`}{{{b{AEd}}{b{AEd}}}A`}{{{b{AEf}}{b{AEf}}}A`}{{{b{AEh}}{b{AEh}}}A`}{{{b{AEj}}{b{AEj}}}A`}{{{b{AEl}}{b{AEl}}}A`}{{{b{AEn}}{b{AEn}}}A`}{{{b{AF`}}{b{AF`}}}A`}{{{b{AFb}}{b{AFb}}}A`}{{{b{AFd}}{b{AFd}}}A`}{{{b{AFf}}{b{AFf}}}A`}{{{b{AFh}}{b{AFh}}}A`}{{{b{AFj}}{b{AFj}}}A`}{{{b{AFl}}{b{AFl}}}A`}{{{b{AFn}}{b{AFn}}}A`}{{{b{AC`}}{b{AC`}}}A`}{{{b{AGf}}{b{AGf}}}A`}{{{b{ABl}}{b{ABl}}}A`}{{{b{AGh}}{b{AGh}}}A`}{{{b{c}}{b{e}}}A`{}{}}000000000000000000000000000000000```{{{b{ACd}}{b{dAb}}}Ad}{{{b{ACf}}{b{dAb}}}Ad}{{{b{ACh}}{b{dAb}}}Ad}{{{b{ACj}}{b{dAb}}}Ad}{{{b{ACl}}{b{dAb}}}Ad}{{{b{ACn}}{b{dAb}}}Ad}{{{b{AD`}}{b{dAb}}}Ad}{{{b{ADb}}{b{dAb}}}Ad}{{{b{ADd}}{b{dAb}}}Ad}{{{b{ADf}}{b{dAb}}}Ad}{{{b{ADh}}{b{dAb}}}Ad}{{{b{ADj}}{b{dAb}}}Ad}{{{b{ACb}}{b{dAb}}}Ad}{{{b{ADl}}{b{dAb}}}Ad}{{{b{ADn}}{b{dAb}}}Ad}{{{b{AE`}}{b{dAb}}}Ad}{{{b{AEb}}{b{dAb}}}Ad}{{{b{AEd}}{b{dAb}}}Ad}{{{b{AEf}}{b{dAb}}}Ad}{{{b{AEh}}{b{dAb}}}Ad}{{{b{AEj}}{b{dAb}}}Ad}{{{b{AEl}}{b{dAb}}}Ad}{{{b{AEn}}{b{dAb}}}Ad}{{{b{AF`}}{b{dAb}}}Ad}{{{b{AFb}}{b{dAb}}}Ad}{{{b{AFd}}{b{dAb}}}Ad}{{{b{AFf}}{b{dAb}}}Ad}{{{b{AFh}}{b{dAb}}}Ad}{{{b{AFj}}{b{dAb}}}Ad}{{{b{AFl}}{b{dAb}}}Ad}{{{b{AFn}}{b{dAb}}}Ad}{{{b{AC`}}{b{dAb}}}Ad}{{{b{AG`}}{b{dAb}}}Ad}{{{b{AGb}}{b{dAb}}}Ad}{{{b{AGd}}{b{dAb}}}Ad}{{{b{AGf}}{b{dAb}}}Ad}{{{b{ABl}}{b{dAb}}}Ad}{{{b{AGh}}{b{dAb}}}Ad}{cc{}}00000000{JdADf}{AGbADf}2222222222222222222222222{JdAGb}3333`{{{b{ADl}}{b{H`}}{b{Mj}}}{{Ef{ADj}}}}````{{{b{ADl}}ACb}A`}{{{b{ADl}}{b{AGj}}{b{H`}}{b{Mj}}}A`}{{{b{ACd}}{b{dc}}}nEb}{{{b{ACf}}{b{dc}}}nEb}{{{b{ACh}}{b{dc}}}nEb}{{{b{ACj}}{b{dc}}}nEb}{{{b{ACl}}{b{dc}}}nEb}{{{b{ACn}}{b{dc}}}nEb}{{{b{AD`}}{b{dc}}}nEb}{{{b{ADb}}{b{dc}}}nEb}{{{b{ADd}}{b{dc}}}nEb}{{{b{ADh}}{b{dc}}}nEb}{{{b{ADj}}{b{dc}}}nEb}{{{b{ACb}}{b{dc}}}nEb}{{{b{ADn}}{b{dc}}}nEb}{{{b{AE`}}{b{dc}}}nEb}{{{b{AEb}}{b{dc}}}nEb}{{{b{AEd}}{b{dc}}}nEb}{{{b{AEf}}{b{dc}}}nEb}{{{b{AEh}}{b{dc}}}nEb}{{{b{AEj}}{b{dc}}}nEb}{{{b{AEl}}{b{dc}}}nEb}{{{b{AEn}}{b{dc}}}nEb}{{{b{AF`}}{b{dc}}}nEb}{{{b{AFb}}{b{dc}}}nEb}{{{b{AFd}}{b{dc}}}nEb}{{{b{AFf}}{b{dc}}}nEb}{{{b{AFh}}{b{dc}}}nEb}{{{b{AFj}}{b{dc}}}nEb}{{{b{AFl}}{b{dc}}}nEb}{{{b{AFn}}{b{dc}}}nEb}{{{b{AC`}}{b{dc}}}nEb}{{{b{{Cb{Bn}}}}{b{Gb}}Cn{b{Hd}}}{{El{Bn}}}}{{{b{AGf}}{b{dc}}}nEb}{{{b{ABl}}{b{dc}}}nEb}{{{b{AGh}}{b{dc}}}nEb}````````{{}l}0000000000000000000000000000000000000{ce{}{}}0000000000000000000000000000000000000{ACdEd}{ACfEd}{AChEd}{ACjEd}{AClEd}{ACnEd}{AD`Ed}{ADbEd}{ADdEd}{ADhEd}{ADjEd}{ACbEd}{ADlEd}{ADnEd}{AE`Ed}{AEbEd}{AEdEd}{AEfEd}{AEhEd}{AEjEd}{AElEd}{AEnEd}{AF`Ed}{AFbEd}{AFdEd}{AFfEd}{AFhEd}{AFjEd}{AFlEd}{AFnEd}{AC`Ed}{AG`Ed}{AGdEd}{AGfEd}{ABlEd}{AGhEd}`{{{b{ACb}}}A`}````{{{b{ADb}}{b{AGj}}}A`}````````````````{{{b{ACb}}{b{ACb}}}{{Ef{Dj}}}}`{{{b{AG`}}}Jb}````{{{b{AGd}}}J`}```````````````````{{{b{c}}}e{}{}}0000000000000000000000000000000000000{{{b{ADb}}}{{Af{cEj}}}Nj}{{{b{AC`}}}{{Af{cEj}}}Nj}{{}{{Af{ACdEj}}}}{{}{{Af{ACfEj}}}}{{}{{Af{AChEj}}}}{{}{{Af{ACjEj}}}}{{}{{Af{AClEj}}}}{{}{{Af{ACnEj}}}}{{}{{Af{AD`Ej}}}}{{}{{Af{ADbEj}}}}{{}{{Af{ADdEj}}}}{{}{{Af{ADhEj}}}}{{}{{Af{ADjEj}}}}{{}{{Af{ACbEj}}}}{{}{{Af{ADlEj}}}}{{}{{Af{AE`Ej}}}}{{}{{Af{AEbEj}}}}{{}{{Af{AEdEj}}}}{{}{{Af{AEfEj}}}}{{}{{Af{AEhEj}}}}{{}{{Af{AEjEj}}}}{{}{{Af{AElEj}}}}{{}{{Af{AEnEj}}}}{{}{{Af{AF`Ej}}}}{{}{{Af{AFbEj}}}}{{}{{Af{AFdEj}}}}{{}{{Af{AFfEj}}}}{{}{{Af{AFhEj}}}}{{}{{Af{AFjEj}}}}{{}{{Af{AFlEj}}}}{{}{{Af{AC`Ej}}}}{{}{{Af{ABlEj}}}}{{}{{Af{AGhEj}}}}{c{{Af{e}}}{}{}}0000000000000000000000000000000000000{Ed{{Af{ACdEj}}}}{Ed{{Af{ACfEj}}}}{Ed{{Af{AChEj}}}}{Ed{{Af{ACjEj}}}}{Ed{{Af{AClEj}}}}{Ed{{Af{ACnEj}}}}{Ed{{Af{AD`Ej}}}}{Ed{{Af{ADbEj}}}}{Ed{{Af{ADdEj}}}}{Ed{{Af{ADhEj}}}}{Ed{{Af{ADjEj}}}}{Ed{{Af{ACbEj}}}}{Ed{{Af{ADlEj}}}}{Ed{{Af{ADnEj}}}}{Ed{{Af{AE`Ej}}}}{Ed{{Af{AEbEj}}}}{Ed{{Af{AEdEj}}}}{Ed{{Af{AEfEj}}}}{Ed{{Af{AEhEj}}}}{Ed{{Af{AEjEj}}}}{Ed{{Af{AElEj}}}}{Ed{{Af{AEnEj}}}}{Ed{{Af{AF`Ej}}}}{Ed{{Af{AFbEj}}}}{Ed{{Af{AFdEj}}}}{Ed{{Af{AFfEj}}}}{Ed{{Af{AFhEj}}}}{Ed{{Af{AFjEj}}}}{Ed{{Af{AFlEj}}}}{Ed{{Af{AFnEj}}}}{Ed{{Af{AC`Ej}}}}{Ed{{Af{AG`Ej}}}}{Ed{{Af{AGdEj}}}}{Ed{{Af{AGfEj}}}}{Ed{{Af{ABlEj}}}}{Ed{{Af{AGhEj}}}}{c{{Af{e}}}{}{}}0000000000000000000000000000000000000`{{{b{c}}}Ah{}}0000000000000000000000000000000000000`````{{{b{ADb}}{b{Jb}}{b{Gb}}}{{Bf{AGb}}}}{{{b{ADd}}{b{Jb}}}{{Bf{ADf}}}}{{{b{AGd}}{b{Jb}}{b{Gb}}{b{Gb}}{b{Hd}}}{{Bf{AGb}}}}{{{b{ADd}}}{{Bf{n}}}}```{ce{}{}}0000000000000000000000000000000000000```````````````````````````````````````````````````````````````````{{{b{dAGl}}{b{AGn}}{b{c}}AH`{b{e}}{b{Eh}}}{{Bf{n}}}AHbAHd}``{{{b{c}}}{{b{e}}}{}{}}00000000000000000{{{b{dc}}}{{b{de}}}{}{}}00000000000000000`{{{b{AGn}}}AGn}{{{b{AHf}}}AHf}{{{b{AHh}}}AHh}{{{b{AHj}}}AHj}{{{b{AHl}}}AHl}{{{b{AHn}}}AHn}{{{b{AH`}}}AH`}{{{b{AI`}}}AI`}{{{b{AIb}}}AIb}{{{b{AId}}}AId}{{{b{AIf}}}AIf}{{{b{AIh}}}AIh}{{{b{Bh}}}Bh}{{{b{AIj}}}AIj}{{{b{AIl}}}AIl}{{{b{AIn}}}AIn}{{{b{c}}{b{de}}}n{}{}}000000000000000{{{b{c}}}n{}}000000000000000```{{}AGn}{{}AHf}{{}AHh}{{}AHj}{{}AHl}{{}AHn}{{}AH`}{{}AIh}{{}Bh}{{}AIj}{{}AIl}{{}AIn}{l{{b{c}}}{}}00000000000000000{l{{b{dc}}}{}}00000000000000000{ln}00000000000000000{{{b{AHh}}}D`}{{{b{AHj}}}D`}{{{b{AGn}}{b{AGn}}}A`}{{{b{AHf}}{b{AHf}}}A`}{{{b{AHh}}{b{AHh}}}A`}{{{b{AHj}}{b{AHj}}}A`}{{{b{AHl}}{b{AHl}}}A`}{{{b{AHn}}{b{AHn}}}A`}{{{b{AH`}}{b{AH`}}}A`}{{{b{AI`}}{b{AI`}}}A`}{{{b{AIb}}{b{AIb}}}A`}{{{b{AId}}{b{AId}}}A`}{{{b{AIf}}{b{AIf}}}A`}{{{b{AIh}}{b{AIh}}}A`}{{{b{Bh}}{b{Bh}}}A`}{{{b{AIj}}{b{AIj}}}A`}{{{b{AIl}}{b{AIl}}}A`}{{{b{AIn}}{b{AIn}}}A`}{{{b{c}}{b{e}}}A`{}{}}000000000000000``{{{b{AGn}}{b{dAb}}}Ad}{{{b{AHf}}{b{dAb}}}Ad}{{{b{AHh}}{b{dAb}}}Ad}{{{b{AHj}}{b{dAb}}}Ad}{{{b{AHl}}{b{dAb}}}Ad}{{{b{AHn}}{b{dAb}}}Ad}{{{b{AH`}}{b{dAb}}}Ad}{{{b{AI`}}{b{dAb}}}Ad}{{{b{AIb}}{b{dAb}}}Ad}{{{b{AId}}{b{dAb}}}Ad}{{{b{AIf}}{b{dAb}}}Ad}{{{b{AIh}}{b{dAb}}}Ad}{{{b{AJ`}}{b{dAb}}}Ad}0{{{b{Bh}}{b{dAb}}}Ad}{{{b{AIj}}{b{dAb}}}Ad}{{{b{AIl}}{b{dAb}}}Ad}{{{b{AIn}}{b{dAb}}}Ad}{cc{}}0000000000000{AJbAJ`}1111`{{{b{AGn}}{b{dc}}}nEb}{{{b{AHf}}{b{dc}}}nEb}{{{b{AHh}}{b{dc}}}nEb}{{{b{AHj}}{b{dc}}}nEb}{{{b{AIb}}{b{dc}}}nEb}{{{b{AId}}{b{dc}}}nEb}{{{b{AIh}}{b{dc}}}nEb}{{{b{Bh}}{b{dc}}}nEb}{{{b{AIn}}{b{dc}}}nEb}`````{{{b{{Cb{AIh}}}}}D`}0````{{}l}00000000000000000{ce{}{}}00000000000000000{AGnEd}{AHfEd}{AHhEd}{AHjEd}{AHlEd}{AHnEd}{AH`Ed}{AI`Ed}{AIbEd}{AIdEd}{AIfEd}{AIhEd}{BhEd}{AIjEd}{AIlEd}{AInEd}```{{{b{AJd}}}A`}{{{b{AH`}}}A`}{{{b{AHj}}{b{AHh}}}A`}{{{b{AIj}}}A`}``{{{b{{Cb{AI`}}}}}D`}```{{{b{AJd}}{b{AJd}}}A`}{{{b{AH`}}{b{AH`}}}A`}`{{ABlAJfCn}AGl}{{{b{AGn}}CnAHf}AGn}{{H`Cn}AGn}{{{b{AHb}}Gb}{{Bf{ADlAJ`}}}}```{{{b{dAGl}}A`}{{Bf{{b{AJd}}}}}}````{{{b{AHn}}{b{c}}{b{H`}}{b{Eh}}}{{Bf{Gd}}}Gn}{{{b{dAH`}}{b{c}}{b{H`}}{b{Eh}}}{{Bf{n}}}Gn}`{{{b{AJ`}}}{{Ef{{b{Mb}}}}}}`````{{{b{AJd}}}{{b{AJh}}}}{{{b{AH`}}}{{b{AJh}}}}{{{b{c}}}e{}{}}000000000000000{{{b{c}}}Eh{}}{{{b{AJd}}}D`}{{{b{AH`}}}D`}`{{}{{Af{AGnEj}}}}{{}{{Af{AHhEj}}}}{{}{{Af{AHjEj}}}}{{}{{Af{AHnEj}}}}{{}{{Af{AH`Ej}}}}{{}{{Af{AIhEj}}}}{{}{{Af{BhEj}}}}{{}{{Af{AIjEj}}}}{{}{{Af{AIlEj}}}}{{}{{Af{AInEj}}}}{c{{Af{e}}}{}{}}00000000000000000{Ed{{Af{AGnEj}}}}{Ed{{Af{AHfEj}}}}{Ed{{Af{AHhEj}}}}{Ed{{Af{AHjEj}}}}{Ed{{Af{AHlEj}}}}{Ed{{Af{AHnEj}}}}{Ed{{Af{AH`Ej}}}}{Ed{{Af{AI`Ej}}}}{Ed{{Af{AIbEj}}}}{Ed{{Af{AIdEj}}}}{Ed{{Af{AIfEj}}}}{Ed{{Af{AIhEj}}}}{Ed{{Af{BhEj}}}}{Ed{{Af{AIjEj}}}}{Ed{{Af{AIlEj}}}}{Ed{{Af{AInEj}}}}{c{{Af{e}}}{}{}}00000000000000000{{{b{c}}}Ah{}}00000000000000000{{{b{AHd}}{b{{Cb{AI`}}}}}{{Bf{n}}}}{{{b{AH`}}}{{Bf{n}}}}{{{b{AI`}}}{{Bf{n}}}}{{{b{AIb}}}{{Bf{n}}}}{{{b{AId}}}{{Bf{n}}}}{{{b{AIf}}}{{Bf{n}}}}{{{b{AH`}}{b{H`}}{b{Eh}}}{{Bf{n}}}}{{{b{AHn}}Gb}{{Bf{n}}}}`{ce{}{}}00000000000000000`````````{{{b{c}}}{{b{e}}}{}{}}000{{{b{dc}}}{{b{de}}}{}{}}000{{{b{AJj}}}AJj}{{{b{AJl}}}AJl}{{{b{c}}{b{de}}}n{}{}}0{{{b{c}}}n{}}0{{{b{AJj}}{b{AJj}}}Dj}{{{b{AJl}}{b{AJl}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}0{{}AJj}{{}AJl}{l{{b{c}}}{}}000{l{{b{dc}}}{}}000{ln}000{{{b{AJj}}{b{AJj}}}A`}{{{b{AJl}}{b{AJl}}}A`}{{{b{c}}{b{e}}}A`{}{}}0{{{b{AJj}}{b{dAb}}}Ad}{{{b{AJl}}{b{dAb}}}Ad}{cc{}}000{{{b{AJj}}{b{dc}}}nEb}{{{b{AJl}}{b{dc}}}nEb}{{}l}000{ce{}{}}000{AJjEd}{AJlEd}``{{{b{AJj}}{b{AJj}}}{{Ef{Dj}}}}{{{b{AJl}}{b{AJl}}}{{Ef{Dj}}}}```{{{b{c}}}e{}{}}0{{{b{AJf}}Cn}{{Bf{{b{AJn}}}}}}{c{{Af{e}}}{}{}}000{Ed{{Af{AJjEj}}}}{Ed{{Af{AJlEj}}}}2222{{{b{c}}}Ah{}}000`::::{{{b{AJf}}}{{C`{{b{AJn}}}}}}```````````````````````````````````````````````````````````````{{{b{c}}}{{b{e}}}{}{}}00000000000000000000000000{{{b{dc}}}{{b{de}}}{}{}}00000000000000000000000000```{{{b{AK`}}}AK`}{{{b{AKb}}}AKb}{{{b{AKd}}}AKd}{{{b{AKf}}}AKf}{{{b{AKh}}}AKh}{{{b{AKj}}}AKj}{{{b{AKl}}}AKl}{{{b{AKn}}}AKn}{{{b{AL`}}}AL`}{{{b{ALb}}}ALb}{{{b{ALd}}}ALd}{{{b{ALf}}}ALf}{{{b{ALh}}}ALh}{{{b{ALj}}}ALj}{{{b{ALl}}}ALl}{{{b{ALn}}}ALn}{{{b{AM`}}}AM`}{{{b{AMb}}}AMb}{{{b{AMd}}}AMd}{{{b{AMf}}}AMf}{{{b{AMh}}}AMh}{{{b{AMj}}}AMj}{{{b{AMl}}}AMl}{{{b{AMn}}}AMn}{{{b{AN`}}}AN`}{{{b{ANb}}}ANb}{{{b{ANd}}}ANd}{{{b{c}}{b{de}}}n{}{}}00000000000000000000000000{{{b{c}}}n{}}00000000000000000000000000{{{b{AKh}}{b{AKh}}}Dj}{{{b{AM`}}{b{AM`}}}Dj}`{{{b{c}}{b{e}}}Dj{}{}}0`````{{}AK`}{{}AKb}{{}AKd}{{}AKf}{{}AKj}{{}AKl}{{}AKn}{{}AL`}{{}ALb}{{}ALd}{{}ALf}{{}ALh}{{}ALj}{{}ALl}{{}ALn}{{}AMb}{{}AMd}{{}AMf}{{}AMh}{{}AMj}{{}AMl}{{}AMn}{{}AN`}{{}ANd}{l{{b{c}}}{}}00000000000000000000000000{l{{b{dc}}}{}}00000000000000000000000000{ln}00000000000000000000000000{{{b{AK`}}{b{AK`}}}A`}{{{b{AKb}}{b{AKb}}}A`}{{{b{AKd}}{b{AKd}}}A`}{{{b{AKf}}{b{AKf}}}A`}{{{b{AKh}}{b{AKh}}}A`}{{{b{AKj}}{b{AKj}}}A`}{{{b{AKl}}{b{AKl}}}A`}{{{b{AKn}}{b{AKn}}}A`}{{{b{AL`}}{b{AL`}}}A`}{{{b{ALb}}{b{ALb}}}A`}{{{b{ALd}}{b{ALd}}}A`}{{{b{ALf}}{b{ALf}}}A`}{{{b{ALh}}{b{ALh}}}A`}{{{b{ALj}}{b{ALj}}}A`}{{{b{ALl}}{b{ALl}}}A`}{{{b{ALn}}{b{ALn}}}A`}{{{b{AM`}}{b{AM`}}}A`}{{{b{AMb}}{b{AMb}}}A`}{{{b{AMd}}{b{AMd}}}A`}{{{b{AMf}}{b{AMf}}}A`}{{{b{AMh}}{b{AMh}}}A`}{{{b{AMj}}{b{AMj}}}A`}{{{b{AMl}}{b{AMl}}}A`}{{{b{AMn}}{b{AMn}}}A`}{{{b{AN`}}{b{AN`}}}A`}{{{b{ANb}}{b{ANb}}}A`}{{{b{ANd}}{b{ANd}}}A`}{{{b{c}}{b{e}}}A`{}{}}00000000000000000000000000````{{{b{AK`}}{b{dAb}}}Ad}{{{b{AKb}}{b{dAb}}}Ad}{{{b{AKd}}{b{dAb}}}Ad}{{{b{AKf}}{b{dAb}}}Ad}{{{b{AKh}}{b{dAb}}}Ad}{{{b{AKj}}{b{dAb}}}Ad}{{{b{AKl}}{b{dAb}}}Ad}{{{b{AKn}}{b{dAb}}}Ad}{{{b{AL`}}{b{dAb}}}Ad}{{{b{ALb}}{b{dAb}}}Ad}{{{b{ALd}}{b{dAb}}}Ad}{{{b{ALf}}{b{dAb}}}Ad}{{{b{ALh}}{b{dAb}}}Ad}{{{b{ALj}}{b{dAb}}}Ad}{{{b{ALl}}{b{dAb}}}Ad}{{{b{ALn}}{b{dAb}}}Ad}{{{b{AM`}}{b{dAb}}}Ad}{{{b{AMb}}{b{dAb}}}Ad}{{{b{AMd}}{b{dAb}}}Ad}{{{b{AMf}}{b{dAb}}}Ad}{{{b{AMh}}{b{dAb}}}Ad}{{{b{AMj}}{b{dAb}}}Ad}{{{b{AMl}}{b{dAb}}}Ad}{{{b{AMn}}{b{dAb}}}Ad}{{{b{AN`}}{b{dAb}}}Ad}{{{b{ANb}}{b{dAb}}}Ad}{{{b{ANd}}{b{dAb}}}Ad}`{cc{}}00000000000000000000000000`````{{{b{AK`}}{b{dc}}}nEb}{{{b{AKb}}{b{dc}}}nEb}{{{b{AKd}}{b{dc}}}nEb}{{{b{AKf}}{b{dc}}}nEb}{{{b{AKh}}{b{dc}}}nEb}{{{b{AKj}}{b{dc}}}nEb}{{{b{AKl}}{b{dc}}}nEb}{{{b{AKn}}{b{dc}}}nEb}{{{b{AL`}}{b{dc}}}nEb}{{{b{ALb}}{b{dc}}}nEb}{{{b{ALd}}{b{dc}}}nEb}{{{b{ALf}}{b{dc}}}nEb}{{{b{ALh}}{b{dc}}}nEb}{{{b{ALj}}{b{dc}}}nEb}{{{b{ALl}}{b{dc}}}nEb}{{{b{ALn}}{b{dc}}}nEb}{{{b{AM`}}{b{dc}}}nEb}{{{b{AMb}}{b{dc}}}nEb}{{{b{AMd}}{b{dc}}}nEb}{{{b{AMf}}{b{dc}}}nEb}{{{b{AMh}}{b{dc}}}nEb}{{{b{AMj}}{b{dc}}}nEb}{{{b{AMl}}{b{dc}}}nEb}{{{b{AMn}}{b{dc}}}nEb}{{{b{AN`}}{b{dc}}}nEb}{{{b{ANb}}{b{dc}}}nEb}{{{b{ANd}}{b{dc}}}nEb}`{{}l}00000000000000000000000000{ce{}{}}00000000000000000000000000{AK`Ed}{AKbEd}{AKdEd}{AKfEd}{AKhEd}{AKjEd}{AKlEd}{AKnEd}{AL`Ed}{ALbEd}{ALdEd}{ALfEd}{ALhEd}{ALjEd}{ALlEd}{ALnEd}{AM`Ed}{AMbEd}{AMdEd}{AMfEd}{AMhEd}{AMjEd}{AMlEd}{AMnEd}{AN`Ed}{ANbEd}{ANdEd}````````{{{b{AKh}}{b{AKh}}}{{Ef{Dj}}}}{{{b{AM`}}{b{AM`}}}{{Ef{Dj}}}}``````````````{{{b{c}}}e{}{}}00000000000000000000000000``{{}{{Af{AK`Ej}}}}{{}{{Af{AKbEj}}}}{{}{{Af{AKdEj}}}}{{}{{Af{AKfEj}}}}{{}{{Af{AKjEj}}}}{{}{{Af{AKlEj}}}}{{}{{Af{AKnEj}}}}{{}{{Af{AL`Ej}}}}{{}{{Af{ALbEj}}}}{{}{{Af{ALdEj}}}}{{}{{Af{ALfEj}}}}{{}{{Af{ALhEj}}}}{{}{{Af{ALjEj}}}}{{}{{Af{ALlEj}}}}{{}{{Af{ALnEj}}}}{{}{{Af{AMbEj}}}}{{}{{Af{AMdEj}}}}{{}{{Af{AMfEj}}}}{{}{{Af{AMhEj}}}}{{}{{Af{AMjEj}}}}{{}{{Af{AMlEj}}}}{{}{{Af{AMnEj}}}}{{}{{Af{AN`Ej}}}}{{}{{Af{ANdEj}}}}{c{{Af{e}}}{}{}}00000000000000000000000000{Ed{{Af{AK`Ej}}}}{Ed{{Af{AKbEj}}}}{Ed{{Af{AKdEj}}}}{Ed{{Af{AKfEj}}}}{Ed{{Af{AKhEj}}}}{Ed{{Af{AKjEj}}}}{Ed{{Af{AKlEj}}}}{Ed{{Af{AKnEj}}}}{Ed{{Af{AL`Ej}}}}{Ed{{Af{ALbEj}}}}{Ed{{Af{ALdEj}}}}{Ed{{Af{ALfEj}}}}{Ed{{Af{ALhEj}}}}{Ed{{Af{ALjEj}}}}{Ed{{Af{ALlEj}}}}{Ed{{Af{ALnEj}}}}{Ed{{Af{AM`Ej}}}}{Ed{{Af{AMbEj}}}}{Ed{{Af{AMdEj}}}}{Ed{{Af{AMfEj}}}}{Ed{{Af{AMhEj}}}}{Ed{{Af{AMjEj}}}}{Ed{{Af{AMlEj}}}}{Ed{{Af{AMnEj}}}}{Ed{{Af{AN`Ej}}}}{Ed{{Af{ANbEj}}}}{Ed{{Af{ANdEj}}}}{c{{Af{e}}}{}{}}00000000000000000000000000`{{{b{c}}}Ah{}}00000000000000000000000000{ce{}{}}00000000000000000000000000`````````````````````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}0{{{b{AJb}}{b{dAb}}}Ad}0{cc{}}0{LhAJb}{{{Bd{Db}}CnCh}ANf}{{{b{{b{ANf}}}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}{{{b{ANf}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}{{{b{ANf}}{b{{Cb{Bn}}}}}{{Bf{{Ef{ANh}}}}}}{{{b{{b{ANf}}}}{b{{Cb{Bn}}}}}{{Bf{{Ef{ANh}}}}}}{{{b{ANf}}}Cn}{{}l}0??{{{b{ANf}}}{{An{ANj}}}}{{{b{{b{ANf}}}}}{{An{ANj}}}}`{{CnDh}ANf}{{{b{ANf}}{b{{Cb{ANl}}}}If}{{Bf{n}}}}{{{b{{b{ANf}}}}{b{{Cb{ANl}}}}If}{{Bf{n}}}}``{{{b{AJb}}}{{Ef{{b{Mb}}}}}}`{{{b{c}}}Eh{}}{c{{Af{e}}}{}{}}000{{{b{c}}}Ah{}}0{ce{}{}}0``{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}0{{{b{{ANn{c}}}}}{{Af{ABnAJb}}}AO`}{{{b{{ANn{c}}}}}{{Af{OnAJb}}}AO`}{cc{}}021{{}l}099{{{b{c}}}{{ANn{c}}}AO`}{{{b{dc}}On}{{Af{nAJb}}}AOb}0====<<;;``::99``{{{b{AOd}}}AOd}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{}AOd}<<;;::{{{b{{AOf{c}}}}H`}{{Af{{Ef{AAl}}AJb}}}AO`}{{{b{AOd}}{b{AOd}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{AOd}}{b{dAb}}}Ad};;``::{ce{}{}}0{AOdEd}``{{{b{{AOf{c}}}}H`}{{Af{{Ef{AAj}}AJb}}}AO`}{{{b{c}}}{{AOf{c}}}AO`}````{{{b{{AOf{c}}}}H`}{{Af{{Ef{AOd}}AJb}}}AO`}{{{b{{AOf{c}}}}}{{Af{{C`{AOd}}AJb}}}AO`}{{{b{c}}}e{}{}}{{}{{Af{AOdEj}}}}{c{{Af{e}}}{}{}}0{Ed{{Af{AOdEj}}}}11{{{b{c}}}Ah{}}0::`{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{cc{}}{{}l}{ce{}{}}{{{b{c}}}{{AOh{c}}}AO`}{{{b{{AOh{c}}}}H`Bn}{{Af{{Ef{ABb}}AJb}}}AO`}<<:2`98765432{{{b{c}}}{{AOj{c}}}AO`}{{{b{{AOj{c}}}}{b{Gb}}}{{Af{{Ef{ADl}}AJb}}}AO`}{{{b{{AOj{c}}}}}{{Af{{C`{ADl}}AJb}}}AO`}{{{b{{AOj{c}}}}{b{H`}}}{{Af{{Ef{ABl}}AJb}}}AO`}{c{{Af{e}}}{}{}}0?7`>=<;:987{{{b{{AOl{c}}}}H`}{{Af{AIlAJ`}}}AO`}{{{b{c}}}{{AOl{c}}}AO`}{{{b{{AOl{c}}}}H`}{{Af{{AOn{CnAIn}}AJb}}}AO`}{{{b{{AOl{c}}}}H`Cn}{{Af{{Ef{AIn}}AJb}}}AO`}{{{b{{AOl{c}}}}H`}{{Af{D`AJ`}}}AO`}55{{{b{c}}}Ah{}}=`{{{b{{B@`{c}}}}Of}{{Af{AKjAJb}}}AO`}{{{b{{B@`{c}}}}}{{Af{{C`{Of}}AJb}}}AO`}{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{{B@`{c}}}}}{{Af{IbAJb}}}AO`}{{{b{{B@`{c}}}}OfOfABn}{{Af{ALnAJb}}}AO`}{{{b{{B@`{c}}}}}{{Af{{AOn{Of{AOn{Of{C`{ALn}}}}}}AJb}}}AO`}{{{b{{B@`{c}}}}OfOf}{{Af{ALlAJb}}}AO`}{{{b{{B@`{c}}}}}{{Af{{AOn{Of{AOn{OfALl}}}}AJb}}}AO`}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{cc{}}8{{}l}{ce{}{}}:{{{b{c}}}{{B@`{c}}}AO`};{c{{Af{e}}}{}{}}0{{{b{c}}}Ah{}}3```?>{{{b{Cd}}}B@b}{{{b{B@d}}}B@d}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{O`{{Bf{B@d}}}}=<;{B@d{{Bf{O`}}}}{{{b{B@d}}{b{dAb}}}Ad}<{{{b{B@d}}}Ch}<;``{{{b{B@f}}}Ch}{{{b{c}}}e{}{}};{B@h{{Bf{B@d}}}}<;``>```{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{B@j}}}{{Ef{B@l}}}}{{}B@j}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{{{b{B@j}}{b{dAb}}}Ad}{cc{}}`{{}l}{ce{}{}}{B@jEd}``{{}{{Af{B@jEj}}}}{c{{Af{e}}}{}{}}{Ed{{Af{B@jEj}}}}1{{{b{c}}}Ah{}}{{{b{B@j}}B@lB@l}{{Bf{n}}}}6``{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0>>==<<{{{b{B@n}}CnBA`}{{Bl{{An{Bj}}}}}};;{{{b{BAb}}}{{`{BAd}}}};;::{{{b{B@n}}}{{Bl{{An{Bj}}}}}}0{{{Bd{Db}}}B@n}{{{Bd{Db}}BAfBAhH`Eh}BAb}{{{b{B@n}}}n}{BAbn}{{{b{B@n}}Cn}{{Bl{{An{Bj}}}}}}0====;;{{{b{B@n}}O`}{{Bl{{An{Bj}}}}}}{{{b{B@n}}O`AHhABn}{{Bl{{An{Bj}}}}}}0{ce{}{}}0```````````<<<<;;;;{{}BAj}{{}BAl}{{}BAn}{l{{b{c}}}{}}000{l{{b{dc}}}{}}000{ln}000`{{{b{BB`}}{b{dAb}}}Ad}{{{b{BAj}}{b{dAb}}}Ad}{{{b{BAl}}{b{dAb}}}Ad}{{{b{BAn}}{b{dAb}}}Ad}{cc{}}000``{{}l}000<<<<{BB`Ed}{BAjEd}{BAlEd}{BAnEd}``````{{}{{Af{BAjEj}}}}{{}{{Af{BAlEj}}}}{{}{{Af{BAnEj}}}}{c{{Af{e}}}{}{}}000{Ed{{Af{BB`Ej}}}}{Ed{{Af{BAjEj}}}}{Ed{{Af{BAlEj}}}}{Ed{{Af{BAnEj}}}}4444{{{b{c}}}Ah{}}000{{{b{BBb}}{b{Eh}}}A`}{ce{}{}}000```````````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0`{{{b{BAh}}}BAh}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{}BAh}{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}0{{{b{BAh}}{b{BAh}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{BAd}}CnBA`}{{Bl{{An{Bj}}}}}}{{{b{BBd}}{b{dAb}}}Ad}0{{{b{BAh}}{b{dAb}}}Ad}{cc{}}0``{{}l}0{ce{}{}}0{BAhEd}{{{b{BAd}}}{{Bl{{An{Bj}}}}}}0`{{{b{BBd}}}{{Ef{{b{Mb}}}}}}{{{b{BAd}}Cn}{{Bl{{An{Bj}}}}}}0{{{b{c}}}e{}{}}{{{b{c}}}Eh{}}{{}{{Af{BAhEj}}}}{c{{Af{e}}}{}{}}0{Ed{{Af{BAhEj}}}}11{{{b{c}}}Ah{}}0{{{b{BAd}}O`}{{Bl{{An{Bj}}}}}}{{{b{BAd}}O`AHhABn}{{Bl{{An{Bj}}}}}}0{{{b{ANf}}{b{AGj}}{b{H`}}{b{Mj}}{b{Gb}}}{{Af{nBBd}}}}==`````{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00`{{}BBf}{l{{b{c}}}{}}00{l{{b{dc}}}{}}00{ln}00{cc{}}00`{{{An{B`}}BBh}BBf}{{}l}00{ce{}{}}00{{BAf{An{B`}}{Bd{AGj}}}{{Bd{BBj}}}}`{{{b{BBj}}CnBBl}{{Bf{n}}}}``{{{b{BBj}}{Bd{Db}}{An{BAd}}}n}{c{{Af{e}}}{}{}}00000`{{{b{c}}}Ah{}}00555````````````````````{{{b{d{BBn{c}}}}}n{}}???>>><<<;;;:{{{b{dBC`}}}n};;1{{{b{BCb}}{b{dAb}}}Ad}0;;{EjBCb}{LhBCb}{BCdBCb}><<<{{{b{BC`}}{b{Cd}}c{C`{Gb}}}{{BBn{e}}}BCf{NjBCh}}<<<{{{BBn{c}}}{{Af{cBCb}}}{}}0{{{Bd{Db}}{b{Cd}}BCjllJf}BC`}{{{b{{BBn{c}}}}}{{b{{Af{cBCb}}}}}{}}3{{{b{BCb}}}{{Ef{{b{Mb}}}}}}:{{{b{c}}}Eh{}}======<<<{{{b{BC`}}{Ef{{BCl{In}}}}}n}{{{b{BC`}}Jb}n}{{{b{BC`}}{Ef{H`}}}n}{ce{}{}}00`{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{cc{}}{{}l}7{{{Ef{{Bd{BCn}}}}}BD`}`{c{{Af{e}}}{}{}}0{{{b{c}}}Ah{}}:``````9988{{{b{BDb}}{BDf{{BDd{{C`{Bn}}}}}}c}{{Af{nBDh}}}BDj}887766{{{b{BDh}}{b{dAb}}}Ad}066{BCdBDh}{LhBDh}{EjBDh}88??{{BCjllJf}BDb}{{{b{BDb}}{C`{Bn}}{C`{Bn}}c}{{Af{{Fd{{BDf{{BDd{{C`{Bn}}}}}}{Ef{BDl}}}}BDh}}}BDj}{{{b{BDb}}}n}{{{b{BDb}}BCj}n}{{{b{BDh}}}{{Ef{{b{Mb}}}}}}{{{b{c}}}Eh{}}<<<<;;{ce{}{}}0````````{{{b{dBDn}}BE`}n}{{{b{dBDn}}{C`{BE`}}}n}{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{BEb}}}BEb}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{}BDn}{l{{b{c}}}{}}00{l{{b{dc}}}{}}00{{{b{BEd}}{b{BD`}}BEf}{{Bf{BEh}}}}{{{b{BDn}}BD`BEfBEj}BEh}{ln}00{{{b{BEb}}{b{dAb}}}Ad}{cc{}}00{{{b{BEd}}}{{b{BEb}}}}{{{b{BEl}}{b{BD`}}{b{c}}}{{Bf{e}}}{}{}}{{{b{BDn}}Jb}n}{{{b{BDn}}AOd}n}{{}l}00{ce{}{}}00`{{{b{BEn}}}{{C`{BE`}}}}`{{BEbg}BE`NjBCf{{BEl{ce}}BChBF`}}{{{b{dBDn}}{Ef{{An{BFb}}}}}n}{{{b{dBDn}}{Ef{{An{BFd}}}}}n}{{{b{c}}}e{}{}}{c{{Af{e}}}{}{}}00000{{{b{c}}}Ah{}}00777```````{{{b{c}}}{{b{e}}}{}{}}000{{{b{dc}}}{{b{de}}}{}{}}000{BCjBFf}0{{{b{BFh}}}BFh}{{{b{BCj}}}BCj}{{{b{c}}{b{de}}}n{}{}}0{{{b{c}}}n{}}0{{{b{dBFf}}}n}{{BCj{Ef{{Bd{BAd}}}}}BCj}{{}BCj}{l{{b{c}}}{}}000{l{{b{dc}}}{}}000{ln}000`{{{b{BFh}}{b{dAb}}}Ad}{cc{}}000{{{b{BCj}}}{{b{{Ef{{Bd{AGj}}}}}}}}{{{b{BCj}}}{{b{{Ef{{Bd{Jb}}}}}}}}{{{b{BCj}}}{{b{{Ef{{BCl{In}}}}}}}}{{{b{BFf}}}{{Bf{Gb}}}}{{{b{BCj}}}{{b{{Ef{H`}}}}}}{{}l}000{ce{}{}}000{BFhEd}{{{b{BFf}}}A`}0{{{b{BFf}}{b{{C`{Gb}}}}}A`}1{{BCj{Bd{AGj}}}BCj}{{{b{dBFf}}{b{{Cb{Bn}}}}c}{{Bf{{Ef{BDl}}}}}BDj}{{BCj{Ef{{Bd{Jb}}}}}BCj}`{{{b{BFh}}}Gb}{{BCj{Ef{{BCl{In}}}}}BCj}{{BCj{Ef{H`}}}BCj}{{{b{BFf}}}{{Ef{{Bd{BCn}}}}}}{{{b{dBFf}}Gb}{{Bf{n}}}}{{{b{c}}}e{}{}}0{c{{Af{e}}}{}{}}000{Ed{{Af{BFhEj}}}}1111{{{b{c}}}Ah{}}000{{BCjA`}BCj}`{{{b{BFh}}{b{{Cb{Bn}}}}{b{{Ef{{BCl{In}}}}}}{b{Jb}}}{{Bf{ADf}}}}{ce{}{}}000{{{b{dBFf}}BDlc}{{Bf{n}}}BDj}```````````````{{{b{d{BFj{c}}}}{BDd{c}}Jf}{{Bf{{BFl{c}}BCd}}}{N`BFnNf}}{{{b{c}}}{{b{e}}}{}{}}000{{{b{dc}}}{{b{de}}}{}{}}000{{{b{d{BDd{c}}}}}n{}}{{{b{{BFj{c}}}}c}{{BDd{c}}}{N`BFnNf}}{{{b{d{BFj{c}}}}cBG`}{{BDd{c}}}{N`BFnNf}}{l{{b{c}}}{}}000{l{{b{dc}}}{}}000{{{b{d{BFj{c}}}}}{{C`{{BFl{c}}}}}{N`BFnNf}}{ln}000{{{b{d{BFj{c}}}}{b{{Cb{c}}}}}{{Ef{{BFl{c}}}}}{N`BFnNf}}{{{b{d{BFj{c}}}}}{{Ef{{BFl{c}}}}}{N`BFnNf}}1{{{b{BCd}}{b{dAb}}}Ad}0{cc{}}000{{{b{d{BFj{c}}}}{b{c}}{b{BG`}}}{{Ef{{BFl{c}}}}}{N`BFnNf}}{{{b{{BDd{c}}}}}{{b{c}}}{}}{{{b{{BDd{c}}}}}{{Bf{Gb}}}{}}{{{b{{BDd{c}}}}}{{b{BG`}}}{}}{{{b{{BDd{c}}}}}{{Ef{{Bd{BCn}}}}}{}}{{}l}000{ce{}{}}000{{{b{{BDd{c}}}}}A`{}}00{{BCjllJf}{{BFj{c}}}{N`BFnNf}}{{{b{d{BDd{c}}}}{b{{Cb{Bn}}}}e}{{Bf{{Ef{BDl}}}}}{}BDj}{{{b{d{BFj{c}}}}{b{{BDf{{BDd{c}}}}}}}n{N`BFnNf}}{{{b{d{BFj{c}}}}{b{c}}Jf}{{Bf{{Ef{{BDf{{BDd{c}}}}}}BCd}}}{N`BFnNf}}{{{b{d{BFj{c}}}}{b{c}}}{{Bf{{Ef{{BDf{{BDd{c}}}}}}BCd}}}{N`BFnNf}}{{{b{d{BFj{c}}}}Jf}{{Bf{{Ef{{BDf{{BDd{c}}}}}}BCd}}}{N`BFnNf}}{{{b{d{BFj{c}}}}BCj}n{N`BFnNf}}{{{b{d{BDd{c}}}}c}n{}}{{{b{d{BDd{c}}}}Gb}{{Bf{n}}}{}}{{{b{c}}}Eh{}}{c{{Af{e}}}{}{}}0000000{{{b{c}}}Ah{}}000{{{b{d{BFj{c}}}}{Ef{{BCl{In}}}}}{{C`{{BFl{c}}}}}{N`BFnNf}}{{{b{d{BFj{c}}}}Jb}{{C`{{BFl{c}}}}}{N`BFnNf}}{{{b{d{BFj{c}}}}{Ef{H`}}}{{C`{{BFl{c}}}}}{N`BFnNf}}{ce{}{}}000{{{b{d{BDd{c}}}}BDle}{{Bf{n}}}{}BDj}`````````````````````{{{b{BG`}}}{{b{{Cb{Bn}}}}}}`{{{b{c}}}{{b{e}}}{}{}}00000000{{{b{dc}}}{{b{de}}}{}{}}00000000{{{b{BG`}}}BG`}{{{b{BEj}}}BEj}{{{b{BGb}}}BGb}{{{b{BEf}}}BEf}{{{b{BGd}}}BGd}{{{b{BGf}}}BGf}{{{b{BEh}}}BEh}{{{b{BDl}}}BDl}{{{b{BGh}}}BGh}{{{b{c}}{b{de}}}n{}{}}00000000{{{b{c}}}n{}}00000000000{{{b{BG`}}{b{BG`}}}Dj}{{{b{c}}{b{e}}}Dj{}{}}{{}BG`}{{}BEj}{{}BGb}{{}BGd}{l{{b{c}}}{}}00000000{l{{b{dc}}}{}}00000000{ln}00000000{{{b{c}}}e{}{{Dn{Dl}}}}0{{{b{BG`}}{b{BG`}}}A`}{{{b{BEj}}{b{BEj}}}A`}{{{b{BGh}}{b{BGh}}}A`}{{{b{c}}{b{e}}}A`{}{}}00{{{b{BG`}}{b{dAb}}}Ad}00{{{b{BEj}}{b{dAb}}}Ad}{{{b{BGb}}{b{dAb}}}Ad}{{{b{BEf}}{b{dAb}}}Ad}{{{b{BGd}}{b{dAb}}}Ad}{{{b{BGf}}{b{dAb}}}Ad}{{{b{BEh}}{b{dAb}}}Ad}{{{b{BDl}}{b{dAb}}}Ad}{{{b{BGh}}{b{dAb}}}Ad}{{{b{Cd}}}BG`}{cc{}}{{{b{{Cb{Bn}}}}}BG`}{{{C`{Bn}}}BG`}22222222{{{b{Cd}}}{{Af{BG`E`}}}}{{{b{BG`}}{b{dc}}}nEb}{{{b{BEj}}{b{dc}}}nEb}{{}l}00000000{ce{}{}}00000000{BG`Ed}{BEjEd}{BGbEd}{BEfEd}{BGdEd}{BGfEd}{BEhEd}{BDlEd}{BGhEd}:``{{{b{BG`}}{b{BG`}}}{{Ef{Dj}}}}`{{}BG`}`{{{b{c}}}e{}{}}00000000{{{b{c}}}Eh{}}{{}{{Af{BG`Ej}}}}{{}{{Af{BEjEj}}}}{{}{{Af{BGbEj}}}}{{}{{Af{BGdEj}}}}{c{{Af{e}}}{}{}}00000000{Ed{{Af{BG`Ej}}}}{Ed{{Af{BEjEj}}}}{Ed{{Af{BGbEj}}}}{Ed{{Af{BEfEj}}}}{Ed{{Af{BGdEj}}}}{Ed{{Af{BGfEj}}}}{Ed{{Af{BEhEj}}}}{Ed{{Af{BDlEj}}}}{Ed{{Af{BGhEj}}}}999999999{{{b{c}}}Ah{}}00000000`{ce{}{}}00000000{{{b{dBG`}}}n}{c{}Bj}{{}BGj}````````{{{b{c}}}{{b{e}}}{}{}}000{{{b{dc}}}{{b{de}}}{}{}}000{{{b{BGl}}}BGl}{{{b{BGn}}}BGn}{{{b{BH`}}}BH`}{{{b{c}}{b{de}}}n{}{}}00{{{b{c}}}n{}}00{{}BGl}{{}BGn}{{}BH`}{l{{b{c}}}{}}000{l{{b{dc}}}{}}000{ln}000{{{b{BHb}}{b{dAb}}}Ad}0{{{b{BGl}}{b{dAb}}}Ad}{{{b{BGn}}{b{dAb}}}Ad}{{{b{BH`}}{b{dAb}}}Ad}{BHdBHb}{cc{}}000{{{b{Bb}}}{{Bl{{An{Bj}}}}}}{{}l}000{ce{}{}}000```{{{b{Bb}}BH`}{{Bl{{An{Bj}}}}}}````{{{b{BHb}}}{{Ef{{b{Mb}}}}}}{{{b{Bb}}{C`{Bn}}BGl}{{Bl{{An{Bj}}}}}}{{{b{c}}}e{}{}}00{{{b{c}}}Eh{}}{c{{Af{e}}}{}{}}0000000{{{b{c}}}Ah{}}0007777``{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{AGj}}{b{{El{Bn}}}}{C`{Bn}}{C`{Bn}}{b{En}}}{{Bf{{C`{Bn}}}}}}{{}AGj}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{{{b{AGj}}}{{Ef{ADd}}}}{cc{}}{{}l}{ce{}{}}7{{{b{AGj}}}{{Ef{Gb}}}}{{{b{AGj}}}Gb}0{{{b{AGj}}}Hd}{{{b{AGj}}}{{Ef{{Bd{J`}}}}}}{{{b{AGj}}}{{Ef{{Bd{Jb}}}}}}{{{b{AGj}}{b{Gb}}{b{J`}}}A`}{{{b{AGj}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Bf{Gd}}}}{c{{Af{e}}}{}{}}0{{{b{c}}}Ah{}}{{{b{Jd}}{b{Gb}}}{{Bf{n}}}}:{{{An{B`}}Nl}n}```````````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}0{{{b{BHf}}{b{dAb}}}Ad}0{cc{}}0{{}l}0{ce{}{}}0{{{b{BHh}}{b{H`}}}{{Bf{H`}}}}{{{b{BHh}}H`}{{Bf{AAb}}}}{{{b{BHh}}H`}{{Bf{AOd}}}}{{{Bd{BAd}}}BHh}{{{b{BHh}}{b{H`}}{Ef{Mj}}}{{Bf{Jb}}}}{{{b{c}}}Eh{}}{c{{Af{e}}}{}{}}000{{{b{c}}}Ah{}}0{{{b{BHh}}AAbH`}{{Bf{AAb}}}}{{{b{BHh}}AOdH`}{{Bf{AOd}}}}{{{b{BHh}}Jb{b{H`}}{Ef{Mj}}}{{Bf{Jb}}}};;````````````````{{{b{c}}}{{b{e}}}{}{}}0000{{{b{dc}}}{{b{de}}}{}{}}0000{{{b{Db}}BBl}{{Af{BBlBHd}}}}0{{{b{BHj}}}BHj}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}```{l{{b{c}}}{}}0000{l{{b{dc}}}{}}0000{ln}0000{{{b{Db}}}{{Bf{n}}}}{{{b{d{b{BHl}}}}}{{BHn{n}}}}{{{b{BI`}}{b{dAb}}}Ad}0{{{b{BHj}}{b{dAb}}}Ad}{cc{}}0000{{{b{BIb}}{C`{Bn}}}{{Af{{C`{Bn}}BHd}}}}{{{b{Db}}}{{b{Nl}}}}{{{b{Db}}}BHj}{{{b{Db}}}{{Ef{{b{{Bd{AGj}}}}}}}}{{{b{Db}}}H`}{{{b{Db}}}{{Bl{{An{Bj}}}}}}{{}l}0000{{{b{BIb}}{C`{Bn}}{C`{Bn}}}{{Af{nBHd}}}}{ce{}{}}0000`{{{Bd{Db}}}BIb}{{{b{d{b{BHl}}}}{b{d{Cb{Bn}}}}}{{BHn{l}}}}{{{b{Db}}BH`}{{Bl{{An{Bj}}}}}}`{{{b{Db}}CnBBl}{{Bf{n}}}}{{{b{Db}}{C`{Bn}}BGl}{{Bl{{An{Bj}}}}}}{{{b{c}}}e{}{}}{{{b{c}}}Eh{}}{c{{Af{e}}}{}{}}000000000{{{b{c}}}Ah{}}000099999{{{b{d{b{BHl}}}}{b{{Cb{Bn}}}}}{{BHn{l}}}}```{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{}BId}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{cc{}}{{{b{BIf}}{C`{Bn}}}{{Af{{C`{Bn}}BHd}}}}{{{b{BId}}{C`{Bn}}}{{Af{{C`{Bn}}BHd}}}}{{}l}{{{b{BIf}}{C`{Bn}}{C`{Bn}}}{{Af{nBHd}}}}{{{b{BId}}{C`{Bn}}{C`{Bn}}}{{Af{nBHd}}}}{ce{}{}}`:??>0````````````````````````{{{b{ANl}}}{{b{{Cb{Bn}}}}}}=========<<<<<<<<<`{{{b{BIh}}{b{{Cb{Bn}}}}}A`}{{{b{AOb}}{b{{Cb{Bn}}}}}A`}{{{b{{BIj{c}}}}{b{{Cb{Bn}}}}}A`AOb}{{{b{Dh}}{b{{Cb{Bn}}}}}A`}0``{{{b{BIl}}}BIl}{{{b{Ch}}}Ch}{{{b{BIn}}}BIn}{{{b{BJ`}}}BJ`}{{{b{ANl}}}ANl}{{{b{c}}{b{de}}}n{}{}}0000{{{b{c}}}n{}}0000000{{{b{ANl}}{b{ANl}}}Dj}{{{b{dBIh}}H`Cn}{{Bf{{Fd{BJbD`}}}}}}{{{b{dAOb}}H`Cn}{{Bf{D`}}}}{{{b{d{BIj{c}}}}H`Cn}{{Bf{{Fd{BJbD`}}}}}AOb}{{{b{d{BIj{c}}}}}{{Bf{BJb}}}AOb}{{{b{dDh}}H`Cn}{{Bf{D`}}}}02{{{b{BJd}}If}{{Bf{{C`{Bn}}}}}}{{{b{c}}{b{e}}}Dj{}{}}{{}BIl}{{}Ch}{{}BJd}{{}BJf}{{}BJ`}{{}ANl}{l{{b{c}}}{}}00000000{{{b{ANl}}}{{b{c}}}{}}{l{{b{dc}}}{}}0000000{{{b{dANl}}}{{b{dc}}}{}}1{ln}00000000{{{b{c}}}e{}{{Dn{Dl}}}}0{{{b{BIl}}{b{BIl}}}A`}{{{b{Ch}}{b{Ch}}}A`}{{{b{BJd}}{b{BJd}}}A`}{{{b{BJf}}{b{BJf}}}A`}{{{b{BIn}}{b{BIn}}}A`}{{{b{BJ`}}{b{BJ`}}}A`}{{{b{ANl}}{b{ANl}}}A`}{{{b{c}}{b{e}}}A`{}{}}000000{{{b{ANj}}}{{b{{Ef{Lh}}}}}}{{{b{BJf}}}BJh}{{{b{Dh}}{b{dAb}}}{{Bf{nBJj}}}}{{{b{BIl}}{b{dAb}}}Ad}{{{b{Ch}}{b{dAb}}}Ad}{{{b{BJd}}{b{dAb}}}Ad}{{{b{BJf}}{b{dAb}}}Ad}{{{b{BIn}}{b{dAb}}}Ad}{{{b{BJ`}}{b{dAb}}}Ad}{{{b{ANl}}{b{dAb}}}Ad}{cc{}}00000000{{{C`{Bn}}}ANl}{BJdBJh}{{{b{BIh}}{b{{Cb{Bn}}}}}{{Ef{{C`{Bn}}}}}}{{{b{AOb}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}{{{b{AO`}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}{{{b{{BIj{c}}}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}AOb}{{{b{{BIj{c}}}}{b{{Cb{Bn}}}}}{{Ef{{C`{Bn}}}}}AOb}{{{b{c}}{b{{Cb{Bn}}}}}{{Af{{Ef{{C`{Bn}}}}Lh}}}{}}{{{b{Dh}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}0{{{b{ANj}}}{{b{{Ef{BJl}}}}}}{{{b{BJf}}}{{Df{{Dd{BJd}}}}}}{{{b{BIh}}{b{{Cb{Bn}}}}}{{Ef{ANh}}}}{{{b{AOb}}{b{{Cb{Bn}}}}}{{Bf{{Ef{ANh}}}}}}{{{b{AO`}}{b{{Cb{Bn}}}}}{{Bf{{Ef{ANh}}}}}}{{{b{{BIj{c}}}}{b{{Cb{Bn}}}}}{{Bf{{Ef{ANh}}}}}AOb}{{{b{{BIj{c}}}}{b{{Cb{Bn}}}}}{{Ef{ANh}}}AOb}{{{b{Dh}}{b{{Cb{Bn}}}}}{{Bf{{Ef{ANh}}}}}}0{{{b{c}}{b{{Cb{Bn}}}}}{{Af{{Ef{ANh}}Lh}}}{}}{{{b{ANj}}}{{b{{Ef{{C`{Bn}}}}}}}}{{{b{BJf}}}A`}{{{b{BIl}}{b{dc}}}nEb}{{{b{BJ`}}{b{dc}}}nEb}``{D`BJh}{{}l}00000000{{{b{dBIh}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Ef{{C`{Bn}}}}}}{{{b{dAOb}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}{{{b{d{BIj{c}}}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}AOb}{{{b{d{BIj{c}}}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Ef{{C`{Bn}}}}}AOb}{{{b{dDh}}{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}0{ce{}{}}00000000{BIlEd}{ChEd}{BJ`Ed}{ANlEd}>{{{b{ANj}}}A`}{{{b{BIh}}}{{An{ANj}}}}{{{b{AOb}}}{{An{ANj}}}}{{{b{AO`}}}{{An{ANj}}}}{{{b{{BIj{c}}}}}{{`{c}}}AOb}{{{b{{BIj{c}}}}}{{An{ANj}}}AOb}{{{b{c}}}{{An{ANj}}}{}}{{{b{Dh}}}{{An{ANj}}}}``{{{b{BJ`}}}BIn}`{{{b{BJl}}}{{Bf{{C`{Bn}}}}}}{{{b{BJd}}}{{Bf{{C`{Bn}}}}}}`{c{{BIj{c}}}AOb}{{{An{BJn}}{b{`}}}Dh}{{{b{{Cb{Bn}}}}{b{{Cb{Bn}}}}}BJ`}{{{b{dANj}}}n}`{{}BJh}{{{b{ANl}}{b{ANl}}}{{Ef{Dj}}}}{{{b{BIh}}{b{{Cb{ANl}}}}If}n}{{{b{AOb}}{b{{Cb{ANl}}}}If}{{Bf{n}}}}{{{b{AO`}}{b{{Cb{ANl}}}}If}{{Bf{n}}}}{{{b{{BIj{c}}}}{b{{Cb{ANl}}}}If}nAOb}{{{b{Dh}}{b{{Cb{ANl}}}}If}{{Bf{n}}}}{{{b{c}}{b{{Cb{ANl}}}}If}{{Af{nLh}}}{}}1{{{b{dBIh}}{b{{Cb{Bn}}}}}{{Ef{{C`{Bn}}}}}}{{{b{dAOb}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}{{{b{d{BIj{c}}}}{b{{Cb{Bn}}}}}{{Ef{{C`{Bn}}}}}AOb}{{{b{d{BIj{c}}}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}AOb}{{{b{dDh}}{b{{Cb{Bn}}}}}{{Bf{{Ef{{C`{Bn}}}}}}}}0=`{{{b{dANj}}{b{{Cb{Bn}}}}}n}{{{b{dANj}}l}n}`{{{b{c}}}e{}{}}0000{{}{{Af{ChEj}}}}{{}{{Af{BJ`Ej}}}}{{}{{Af{ANlEj}}}}{c{{Af{e}}}{}{}}00000000{Ed{{Af{BIlEj}}}}{Ed{{Af{ChEj}}}}{Ed{{Af{BJ`Ej}}}}{Ed{{Af{ANlEj}}}}444444444{{{b{c}}}Ah{}}00000000{{{b{dBJl}}{b{{Cb{Bn}}}}}{{Bf{l}}}}{{{b{dBJd}}{b{{Cb{Bn}}}}}{{Bf{l}}}}``{ce{}{}}00000000`{{{b{BK`}}}{{Bf{{C`{Bn}}}}}}{{{b{dBK`}}{b{{Cb{Bn}}}}}{{Bf{l}}}}```````````````{{{b{dBKb}}}{{BKf{BKd}}}}{BKb{{BKf{BKd}}}}{{{b{BJn}}}{{b{AJh}}}}{{{b{BKh}}}{{b{AJh}}}}{{{b{BKj}}}{{b{AJh}}}}{{{b{BKl}}}{{b{AJh}}}}{{{b{BKd}}}{{b{{Cb{Bn}}}}}}{{{b{c}}}{{b{e}}}{}{}}000000000000{{{b{dc}}}{{b{de}}}{}{}}000000000000{{{b{BKn}}}ANh}{{{b{BKd}}}BKd}{{{b{ANh}}}ANh}{{{b{BL`}}}BL`}{{{b{BLb}}}BLb}{{{b{BLd}}}BLd}{{{b{BLf}}}BLf}{{{b{BLh}}}BLh}{{{b{c}}{b{de}}}n{}{}}000000{{{b{c}}}n{}}000000{{}BKd}{{}ANh}{{}BL`}{{}BLb}{{}BLd}{{}BLf}{{}BLh}{l{{b{c}}}{}}00000{{{b{BKd}}}{{b{c}}}{}}1111111{l{{b{dc}}}{}}000000{{{b{dBKd}}}{{b{dc}}}{}}111111{ln}000000000000{{{b{c}}}e{}{{Dn{Dl}}}}0`{{{b{BKd}}{b{BKd}}}A`}{{{b{ANh}}{b{ANh}}}A`}{{{b{BL`}}{b{BL`}}}A`}{{{b{c}}{b{e}}}A`{}{}}00{{{b{BLj}}{b{dAb}}}Ad}0{{{b{BKd}}{b{dAb}}}Ad}{{{b{ANh}}{b{dAb}}}Ad}{{{b{BL`}}{b{dAb}}}Ad}{{{b{BLb}}{b{dAb}}}Ad}{{{b{BLd}}{b{dAb}}}Ad}{{{b{BLf}}{b{dAb}}}Ad}{{{b{BLh}}{b{dAb}}}Ad}{cc{}}00000{{{C`{Bn}}}BKd}1111111{{{b{dBKn}}{b{BJd}}}n}`{{}l}000000000000{ce{}{}}000000000000{BKdEd}{ANhEd}{BL`Ed}{BLbEd}{BLdEd}{BLfEd}{BLhEd}```{{BJhBJh{b{d{C`{BJh}}}}}{{Bf{n}}}}{{{Bd{Db}}BLl}BKh}{D`BKn}{{{An{BJn}}}BKl}{{D`If}{{Bf{BKn}}}}`````{l{{Fd{l{Ef{l}}}}}}{{{b{dBJn}}BLb}{{Bf{BLh}}}}{{{b{dBKh}}BLb}{{Bf{BLh}}}}{{{b{dBKj}}BLb}{{Bf{BLh}}}}{{{b{dBKl}}BLb}{{Bf{BLh}}}}`{{{b{dBJn}}BLd}{{Bf{BLh}}}}{{{b{dBKh}}BLd}{{Bf{BLh}}}}{{{b{dBKj}}BLd}{{Bf{BLh}}}}{{{b{dBKl}}BLd}{{Bf{BLh}}}}`{{{b{dBJn}}BLf}{{Bf{BLh}}}}{{{b{dBKh}}BLf}{{Bf{BLh}}}}{{{b{dBKj}}BLf}{{Bf{BLh}}}}{{{b{dBKl}}BLf}{{Bf{BLh}}}}`{{{b{c}}}e{}{}}000000{{{b{c}}}Eh{}}```{{}{{Af{BKdEj}}}}{{}{{Af{ANhEj}}}}{{}{{Af{BL`Ej}}}}{{}{{Af{BLbEj}}}}{{}{{Af{BLdEj}}}}{{}{{Af{BLfEj}}}}{{}{{Af{BLhEj}}}}{c{{Af{e}}}{}{}}000000000000{Ed{{Af{BKdEj}}}}{Ed{{Af{ANhEj}}}}{Ed{{Af{BL`Ej}}}}{Ed{{Af{BLbEj}}}}{Ed{{Af{BLdEj}}}}{Ed{{Af{BLfEj}}}}{Ed{{Af{BLhEj}}}}7777777777777{{{b{c}}}Ah{}}000000000000``{{{b{BLn}}D`{b{ANh}}}{{Bf{BJh}}}}{ce{}{}}000000000000````````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}```{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}`{cc{}}`{{}l}7`{{{Bd{Db}}{b{O`}}ANf{b{dBIh}}{b{AHh}}ABn{b{AIl}}IdA`}BM`}```{c{{Af{e}}}{}{}}0;9`````888777{{{b{BMb}}BM`{b{BMd}}}{{Af{{C`{BMf}}BHd}}}}{{{b{BMh}}BM`{b{BMd}}}{{Af{{C`{BMf}}BHd}}}}{{}BMh}999888777{{{b{BMb}}BM`{b{BMd}}{b{{Cb{AIh}}}}}{{Af{BMjBHd}}}}{{{b{BMh}}BM`{b{BMd}}{b{{Cb{AIh}}}}}{{Af{BMjBHd}}}}{{{b{BMb}}D`}n}999`888???{{{b{BMb}}}A`}{{{b{BMh}}}A`}``{{{b{BMb}}BM`{b{Cd}}{C`{Bn}}}{{Af{{C`{Bn}}BHd}}}}`{{{b{BMb}}BM`{b{dBMd}}{b{{Cb{AIh}}}}}{{Af{BMjBHd}}}}{{{b{BMh}}BM`{b{dBMd}}{b{{Cb{AIh}}}}}{{Af{BMjBHd}}}}{{{b{dBMb}}{Bd{BMl}}}n}`<<<<<<`{{{b{c}}}Ah{}}00{ce{}{}}00```{{{b{BMn}}}{{b{{Cb{Bn}}}}}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{BMn}}}BMn}{{{b{BN`}}}BN`}{{{b{c}}{b{de}}}n{}{}}0{{{b{c}}}n{}}0{{}BMn}{{}BN`}{l{{b{c}}}{}}0{l{{b{dc}}}{}}0{ln}0{{{b{c}}}e{}{{Dn{Dl}}}}0{{{b{BMn}}{b{BMn}}}A`}{{{b{BN`}}{b{BN`}}}A`}{{{b{c}}{b{e}}}A`{}{}}0{{{b{BMn}}{b{dAb}}}Ad}{{{b{BN`}}{b{dAb}}}Ad}{{{C`{Bn}}}BMn}{cc{}}0`{{}l}0{ce{}{}}0{BMnEd}{BN`Ed}`{{{b{c}}}e{}{}}0{{}{{Af{BMnEj}}}}{{}{{Af{BN`Ej}}}}{c{{Af{e}}}{}{}}0{Ed{{Af{BMnEj}}}}{Ed{{Af{BN`Ej}}}}22{{{b{c}}}Ah{}}099```{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{BNb}}}BNb}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{}BNb}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}{{{b{BNb}}{b{dAb}}}Ad}{cc{}}{{}l}{ce{}{}}`{{{C`{Bn}}{C`{Bn}}}BNb}{{{b{c}}}e{}{}}{c{{Af{e}}}{}{}}0`{{{b{c}}}Ah{}}`4``{{{b{dBNd}}BNf}{{Bf{n}}}}{{{b{dBNd}}{C`{Bn}}Id}{{Bf{n}}}}{{{b{dBNd}}D`{C`{Bn}}BNf}{{Bf{n}}}}{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{dBNd}}}{{Bf{{Fd{BJbD`}}}}}}{l{{b{c}}}{}}{l{{b{dc}}}{}}{ln}?>={{{An{BJn}}Ch}BNd};;:>`65{{{b{BMd}}}BMd}{{{b{c}}{b{de}}}n{}{}}{{{b{c}}}n{}}{{}BMd}{{{b{BMd}}}{{b{c}}}{}}87{{{b{dBMd}}}{{b{dc}}}{}}7{{{b{BMd}}{b{BMd}}}A`}{{{b{c}}{b{e}}}A`{}{}}{{{b{BMd}}{b{dAb}}}Ad}{{{C`{{C`{Bn}}}}}BMd}{cc{}}{{{BNh{{C`{Bn}}}}}BMd}{{}l}{ce{}{}}{BMdEd}5{{{b{c}}}e{}{}}{{}{{Af{BMdEj}}}}{c{{Af{e}}}{}{}}{Ed{{Af{BMdEj}}}}1{{{b{c}}}Ah{}}6``````````````````````````````````````````````````````````````````````````````````````````````````````{{{b{c}}}{{b{e}}}{}{}}00000000000000000000{{{b{dc}}}{{b{de}}}{}{}}00000000000000000000{{{b{BNj}}}BNj}{{{b{BLl}}}BLl}{{{b{BHd}}}BHd}{{{b{BNl}}}BNl}{{{b{BNn}}}BNn}{{{b{BO`}}}BO`}{{{b{BOb}}}BOb}{{{b{BOd}}}BOd}{{{b{BMf}}}BMf}{{{b{BOf}}}BOf}{{{b{BA`}}}BA`}{{{b{BOh}}}BOh}{{{b{BOj}}}BOj}{{{b{BOl}}}BOl}{{{b{BOn}}}BOn}{{{b{C@`}}}C@`}{{{b{c}}{b{de}}}n{}{}}000000000000000{{{b{c}}}n{}}000000000000000000````{{}BNj}{{}BBl}{{}BHd}{{}BNl}{{}BNn}{{}BO`}{{}BOb}{{}BOd}{{}BMf}{{}BOf}{{}BOj}{{}BOl}{{}BOn}{{}C@`}{{}C@b}{l{{b{c}}}{}}00000000000000000000{l{{b{dc}}}{}}00000000000000000000{ln}00000000000000000000``{{{b{BLl}}{b{BLl}}}A`}{{{b{BOd}}{b{BOd}}}A`}{{{b{c}}{b{e}}}A`{}{}}0```{{{b{BNj}}{b{dAb}}}Ad}{{{b{C@d}}{b{dAb}}}Ad}{{{b{C@f}}{b{dAb}}}Ad}{{{b{C@h}}{b{dAb}}}Ad}{{{b{BLl}}{b{dAb}}}Ad}{{{b{BBl}}{b{dAb}}}Ad}{{{b{BHd}}{b{dAb}}}Ad}0{{{b{BNl}}{b{dAb}}}Ad}{{{b{BNn}}{b{dAb}}}Ad}{{{b{BO`}}{b{dAb}}}Ad}{{{b{BOb}}{b{dAb}}}Ad}{{{b{BOd}}{b{dAb}}}Ad}{{{b{BMf}}{b{dAb}}}Ad}{{{b{BOf}}{b{dAb}}}Ad}{{{b{BA`}}{b{dAb}}}Ad}{{{b{BOh}}{b{dAb}}}Ad}{{{b{BOj}}{b{dAb}}}Ad}{{{b{BOl}}{b{dAb}}}Ad}{{{b{BOn}}{b{dAb}}}Ad}{{{b{C@`}}{b{dAb}}}Ad}{{{b{C@b}}{b{dAb}}}Ad}{cc{}}00000{BBdBHd}1{AJbBHd}{LhBHd}{C@jBHd}{BI`BHd}{BDhBHd}66666666666666{{{b{BLl}}{b{dc}}}nEb}```{{}l}00000000000000000000`{ce{}{}}00000000000000000000{BNjEd}{C@dEd}{C@fEd}{C@hEd}{BLlEd}{BBlEd}{BHdEd}{BNlEd}{BNnEd}{BO`Ed}{BObEd}{BOdEd}{BMfEd}{BOfEd}{BA`Ed}{BOhEd}{BOjEd}{BOlEd}{BOnEd}{C@`Ed}{C@bEd}``````````{{{b{Cd}}Id{b{Cd}}}BHd}`````````````{{{b{c}}}e{}{}}000000000000000{{{b{c}}}Eh{}}{{}{{Af{BNjEj}}}}{{}{{Af{BHdEj}}}}{{}{{Af{BNlEj}}}}{{}{{Af{BNnEj}}}}{{}{{Af{BO`Ej}}}}{{}{{Af{BObEj}}}}{{}{{Af{BOdEj}}}}{{}{{Af{BMfEj}}}}{{}{{Af{BOfEj}}}}{{}{{Af{BOjEj}}}}{{}{{Af{BOlEj}}}}{{}{{Af{BOnEj}}}}{{}{{Af{C@bEj}}}}{c{{Af{e}}}{}{}}00000000000000000000{Ed{{Af{BNjEj}}}}{Ed{{Af{C@dEj}}}}{Ed{{Af{C@fEj}}}}{Ed{{Af{C@hEj}}}}{Ed{{Af{BLlEj}}}}{Ed{{Af{BBlEj}}}}{Ed{{Af{BHdEj}}}}{Ed{{Af{BNlEj}}}}{Ed{{Af{BNnEj}}}}{Ed{{Af{BO`Ej}}}}{Ed{{Af{BObEj}}}}{Ed{{Af{BOdEj}}}}{Ed{{Af{BMfEj}}}}{Ed{{Af{BOfEj}}}}{Ed{{Af{BA`Ej}}}}{Ed{{Af{BOhEj}}}}{Ed{{Af{BOjEj}}}}{Ed{{Af{BOlEj}}}}{Ed{{Af{BOnEj}}}}{Ed{{Af{C@`Ej}}}}{Ed{{Af{C@bEj}}}}{c{{Af{e}}}{}{}}00000000000000000000{{{b{c}}}Ah{}}00000000000000000000{ce{}{}}00000000000000000000`````````````````````````````````````````````````````````````````````````````````````","D":"MKl","p":[[1,"reference"],[0,"mut"],[6,"TeeType",0],[5,"BUILD_INFO",0],[5,"BuildInfo",0],[1,"usize"],[1,"unit"],[1,"bool"],[5,"Formatter",7467],[8,"Result",7467],[6,"Result",7468],[5,"TypeId",7469],[5,"NoopApp",79],[10,"App",79],[5,"Box",7470],[10,"Initializer",5045],[10,"Host",5718],[5,"Arc",7471],[8,"Result",7472],[5,"AnnotatedBlock",3201],[10,"Future",7473],[5,"Pin",7474],[1,"u8"],[5,"Vec",7475],[1,"slice"],[1,"str"],[5,"CacheSet",101],[5,"Root",6009,7476],[5,"Cache",101],[5,"MutexGuard",7477],[1,"u64"],[5,"Hash",154],[5,"Protocol",5881],[5,"RefCell",7478],[5,"Rc",7479],[5,"Tree",6009,7480],[6,"Ordering",7481],[1,"char"],[10,"FromIterator",7482],[6,"FromHexError",7483],[10,"Hasher",7484],[6,"Value",7485],[6,"Option",7486],[5,"String",7487],[6,"DecodeError",7488],[1,"array"],[5,"PublicKey",7489],[5,"StaticSecret",7489],[10,"Opener",205],[1,"tuple"],[5,"DeoxysII",205,7490],[6,"DecryptionError",7490],[10,"AsMut",7491],[10,"AsRef",7491],[6,"EncryptionError",7490],[5,"Nonce",232],[5,"PublicKey",256],[5,"Signature",256],[5,"Signed",256],[5,"MultiSigned",256],[5,"SignatureBundle",256],[5,"PrivateKey",256],[10,"Signer",256],[5,"Namespace",527],[5,"PrivateKey",448],[5,"PublicKey",448],[10,"KeyFormat",513],[10,"KeyFormatAtom",513],[5,"Logger",7492],[6,"Level",7493],[5,"AbortOnPanic",569],[1,"never"],[5,"Quantity",584],[1,"u32"],[1,"u16"],[1,"u128"],[5,"MrEnclave",636],[5,"MrSigner",636],[5,"EnclaveIdentity",636],[6,"Quote",636],[5,"QuotePolicy",636],[5,"VerifiedQuote",636],[1,"i64"],[5,"Targetinfo",7494],[5,"Report",7494],[5,"Keypolicy",7494],[5,"QuotePolicy",828],[5,"AVR",828],[5,"TdAttributes",886,7495],[5,"TdReport",886,7495],[5,"QuotePolicy",886,7496],[5,"TdxQuotePolicy",886,7496],[5,"TdxModulePolicy",886,7496],[5,"QuoteBundle",886,7497],[5,"TCBBundle",886,7498],[17,"Item"],[10,"IntoIterator",7482],[5,"Quote",886,7497],[6,"Error",886],[5,"Error",7472],[5,"Iter",7499],[5,"IterNames",7499],[6,"Cow",7500],[10,"Into",7491],[10,"Error",7501],[5,"Utc",7502],[5,"DateTime",7503],[5,"SystemTime",7504],[5,"Version",1191],[5,"ProtocolVersions",1191],[5,"Versioned",1252],[10,"Clone",7505],[10,"PartialEq",7481],[10,"Debug",7467],[10,"Hash",7484],[10,"EncodeAsMap",7506],[10,"Decode",7507],[5,"Config",1279],[5,"Storage",1279],[5,"LightBlock",1324],[6,"Event",1324],[5,"BlockMetadata",1324],[5,"Address",1410],[5,"COMMON_POOL_ADDRESS",1410],[5,"FEE_ACC_ADDRESS",1410],[5,"GOVERNANCE_DEPOSITS_ADDRESS",1410],[5,"EpochTimeState",1494],[6,"Vote",1523],[5,"ProposalVote",1523],[5,"UpgradeProposal",1523],[5,"CancelUpgradeProposal",1523],[5,"ChangeParametersProposal",1523],[5,"ProposalContent",1523],[5,"ConsensusParameterChanges",1523],[5,"PolicySGX",1721],[5,"EnclavePolicySGX",1721],[5,"SignedPolicySGX",1721],[5,"EncryptedSecret",1721],[5,"EncryptedMasterSecret",1721],[5,"EncryptedEphemeralSecret",1721],[5,"SignedEncryptedMasterSecret",1721],[5,"SignedEncryptedEphemeralSecret",1721],[6,"Error",1721],[6,"SuiteId",1957],[5,"Status",1957],[5,"Application",1957],[5,"PolicySGX",1957],[5,"SignedPolicySGX",1957],[6,"Error",1957],[5,"Runtime",2118],[8,"EpochTime",1494],[5,"VersionInfo",2118],[5,"RolesMask",2118],[5,"TCPAddress",2118],[5,"TLSAddress",2118],[5,"TLSInfo",2118],[5,"P2PInfo",2118],[5,"ConsensusAddress",2118],[5,"ConsensusInfo",2118],[5,"VRFInfo",2118],[5,"CapabilityTEE",2118],[5,"EndorsedCapabilityTEE",2118],[5,"VerifiedEndorsedCapabilityTEE",2118],[5,"Capabilities",2118],[5,"NodeRuntime",2118],[5,"Node",2118],[6,"RuntimeKind",2118],[5,"ExecutorParameters",2118],[5,"TxnSchedulerParameters",2118],[5,"StorageParameters",2118],[5,"SchedulingConstraints",2118],[5,"ValidatorSetConstraint",2118],[5,"MaxNodesConstraint",2118],[5,"MinPoolSizeConstraint",2118],[5,"RuntimeStakingParameters",2118],[5,"EntityWhitelistRuntimeAdmissionPolicy",2118],[5,"EntityWhitelistConfig",2118],[5,"EntityWhitelistRoleConfig",2118],[5,"EntityWhitelistRoleAdmissionPolicy",2118],[5,"PerRoleAdmissionPolicy",2118],[5,"AnyNodeRuntimeAdmissionPolicy",2118],[5,"RuntimeAdmissionPolicy",2118],[6,"RuntimeGovernanceModel",2118],[6,"SGXConstraints",2118],[5,"VerifiedAttestation",2118],[6,"SGXAttestation",2118],[6,"TEEHardware",2118],[5,"RuntimeGenesis",2118],[5,"Identity",5808],[5,"Pool",3201,7508],[5,"Block",3201,7509],[5,"ExecutorCommitment",3201,7510],[10,"NodeLookup",3201,7508],[10,"MessageValidator",3201,7508],[6,"HeaderType",3201,7509],[5,"Header",3201,7509],[5,"ComputeResultsHeader",3201,7510],[6,"ExecutorCommitmentFailure",3201,7510],[5,"ExecutorCommitmentHeader",3201,7510],[6,"Message",3201,7511],[6,"StakingMessage",3201,7511],[6,"RegistryMessage",3201,7511],[6,"GovernanceMessage",3201,7511],[5,"IncomingMessage",3201,7511],[5,"MessageEvent",3201],[5,"RoundResults",3201],[5,"RoundRoots",3201],[6,"Error",3201],[6,"StateError",4594],[10,"OpenCommitment",3201,7512],[5,"Committee",3728],[10,"Any",7469],[6,"Role",3728],[6,"CommitteeKind",3728],[5,"CommitteeNode",3728],[5,"Transfer",3821],[5,"Withdraw",3821],[5,"Escrow",3821],[5,"ReclaimEscrow",3821],[6,"ThresholdKind",3821],[5,"Account",3821],[5,"GeneralAccount",3821],[5,"EscrowAccount",3821],[5,"SharePool",3821],[5,"CommissionSchedule",3821],[5,"CommissionRateStep",3821],[5,"CommissionRateBoundStep",3821],[5,"StakeAccumulator",3821],[5,"StakeThreshold",3821],[5,"Delegation",3821],[5,"DebondingDelegation",3821],[6,"SlashReason",3821],[5,"Slash",3821],[5,"TransferResult",3821],[5,"AddEscrowResult",3821],[5,"ReclaimEscrowResult",3821],[5,"WithdrawResult",3821],[5,"Event",3821],[5,"TransferEvent",3821],[5,"BurnEvent",3821],[6,"EscrowEvent",3821],[5,"AllowanceChangeEvent",3821],[5,"ConsensusState",4594],[5,"Proof",6309,7513],[10,"Iterator",6009],[5,"Prefix",6009],[5,"ImmutableState",4642],[10,"ImmutableMKVS",6009],[10,"FallibleMKVS",6009],[5,"Status",4675],[5,"ImmutableState",4675],[5,"ImmutableState",4727],[5,"ImmutableState",4742],[5,"ImmutableState",4759],[5,"BTreeMap",7514],[5,"ImmutableState",4777],[5,"Id",7515],[5,"LightBlockMeta",4801],[5,"SignedHeader",7516],[5,"LightBlock",7517],[5,"Proof",4831],[8,"Hash",7518],[5,"NopVerifier",4856,7519],[6,"EventKind",6820],[5,"Verifier",4856],[10,"Verifier",4982],[5,"Handle",7520],[5,"TrustRoot",4982],[5,"Fee",4895],[5,"Proof",4895],[5,"SignedTransactionWithProof",4895],[5,"Transaction",4895],[8,"SignedTransaction",4895],[6,"Error",4982],[5,"PostInitState",5045],[5,"PreInitState",5045],[5,"Dispatcher",5045],[6,"Body",6820],[5,"Response",5105],[5,"RpcClient",5105],[6,"RpcClientError",5105],[6,"Error",5396],[10,"Encode",7506],[10,"Send",7521],[5,"Builder",5294],[5,"HashSet",7522],[5,"SessionInfo",5294],[5,"Context",5173],[5,"Demux",5188],[5,"MultiplexedSession",5396],[5,"OwnedMutexGuard",7523],[6,"Error",5188],[10,"Write",7524],[6,"Message",5483],[5,"Dispatcher",5230],[5,"Method",5230],[5,"MethodDescriptor",5230],[10,"MethodHandlerDispatch",5230],[5,"Request",5483],[5,"Response",5483],[6,"Kind",5483],[10,"MethodHandler",5230],[10,"Handler",5230],[10,"Sync",7521],[8,"KeyManagerQuotePolicyHandler",5230],[8,"KeyManagerStatusHandler",5230],[5,"Session",5294],[6,"RAKBinding",5294],[5,"Sessions",5396],[8,"SharedSession",5396],[10,"Ord",7481],[5,"SessionID",5483],[5,"Frame",5483],[5,"Error",5483],[6,"Body",5483],[6,"PeerFeedback",5483],[5,"Runtime",7525],[5,"SubmitTxOpts",5718],[5,"TxResult",5718],[5,"RegisterNotifyOpts",5718],[6,"Error",5718],[5,"Error",6820],[6,"PolicyVerifierError",5835],[5,"PolicyVerifier",5835],[5,"HostInfo",5881],[6,"Stream",5881],[8,"Result",7526],[6,"ProtocolError",5881],[5,"ProtocolUntrustedLocalStorage",5881],[5,"UntrustedInMemoryStorage",5987],[10,"KeyValue",5987],[10,"MKVS",6009],[5,"OverlayTree",6009,7527],[6,"RootType",6009,7476],[6,"LogEntryKind",6009],[5,"LogEntry",6009],[8,"WriteLog",6009],[6,"NodeBox",6009,7476],[5,"NodePointer",6009,7476],[8,"NodePtrRef",6009,7476],[5,"Error",7467],[8,"Key",6009,7476],[10,"ReadSync",6309],[10,"Marshal",6306],[5,"Unstructured",7528],[5,"RawProofEntry",6309,7513],[8,"Result",7529],[5,"HostReadSyncer",6309,7530],[5,"NoopReadSyncer",6309,7531],[5,"StatsCollector",6309,7532],[5,"ProofBuilder",6309,7513],[5,"TreeID",6309],[5,"GetRequest",6309],[5,"GetPrefixesRequest",6309],[5,"IterateRequest",6309],[5,"ProofResponse",6309],[6,"SyncerError",6309,7533],[6,"HostStorageEndpoint",6820],[5,"ProofVerifier",6309,7513],[5,"Context",6610],[10,"Dispatcher",6633],[5,"TxnBatch",6791],[5,"CheckTxResult",6820],[5,"NoopDispatcher",6633],[5,"ExecuteBatchResult",6633],[5,"AtomicBool",7534],[5,"CoarsenedKey",6692],[5,"ReadWriteSet",6692],[5,"Tag",6748],[5,"Tree",6772],[8,"Tags",6748],[5,"VecDeque",7535],[5,"ComputedBatch",6820],[5,"RuntimeInfoRequest",6820],[5,"Features",6820],[5,"FeatureScheduleControl",6820],[5,"RuntimeInfoResponse",6820],[6,"ExecutionMode",6820],[5,"CheckTxMetadata",6820],[5,"HostFetchConsensusEventsRequest",6820],[5,"HostFetchConsensusEventsResponse",6820],[5,"RegisterNotifyRuntimeEvent",6820],[5,"RuntimeNotifyEvent",6820],[6,"MessageType",6820],[5,"Message",6820],[6,"StorageSyncRequest",6820],[5,"StorageSyncRequestWithEndpoint",6820],[6,"StorageSyncResponse",6820],[5,"JoinError",7536],[15,"V1",3193],[15,"V0",3196],[15,"V1",3196],[15,"DebondingStart",4577],[15,"Add",4577],[15,"Take",4577],[15,"Reclaim",4577],[5,"MutableState",4642],[15,"V0",5388],[15,"V1",5388],[15,"V2",5388],[5,"SessionMeta",5396],[5,"ExecuteTxResult",6633],[15,"RuntimeQueryRequest",7382],[15,"RuntimeCapabilityTEERakAvrRequest",7382],[15,"RuntimeExecuteTxBatchResponse",7382],[15,"HostFetchTxBatchResponse",7382],[15,"HostSubmitTxResponse",7382],[15,"HostProveFreshnessRequest",7382],[15,"RuntimeCheckTxBatchRequest",7382],[15,"RuntimeExecuteTxBatchRequest",7382],[15,"HostFetchConsensusBlockResponse",7382],[15,"RuntimeQueryResponse",7382],[15,"HostSubmitTxRequest",7382],[15,"RuntimeCapabilityTEEUpdateEndorsementRequest",7382],[15,"HostRPCCallRequest",7382],[15,"HostSubmitPeerFeedbackRequest",7382],[15,"RuntimeCapabilityTEERakQuoteResponse",7382],[15,"RuntimeConsensusSyncRequest",7382],[15,"HostFetchConsensusBlockRequest",7382],[15,"HostFetchBlockMetadataTxRequest",7382],[15,"HostFetchGenesisHeightResponse",7382],[15,"HostLocalStorageGetRequest",7382],[15,"HostLocalStorageSetRequest",7382],[15,"RuntimeRPCCallRequest",7382],[15,"HostFetchTxBatchRequest",7382],[15,"HostRPCCallResponse",7382],[15,"HostIdentityResponse",7382],[15,"RuntimeCapabilityTEERakReportResponse",7382],[15,"RuntimeKeyManagerQuotePolicyUpdateRequest",7382],[15,"HostFetchBlockMetadataTxResponse",7382],[15,"HostProveFreshnessResponse",7382],[15,"RuntimeCapabilityTEERakQuoteRequest",7382],[15,"RuntimeLocalRPCCallRequest",7382],[15,"RuntimeRPCCallResponse",7382],[15,"RuntimeLocalRPCCallResponse",7382],[15,"RuntimeCheckTxBatchResponse",7382],[15,"RuntimeNotifyRequest",7382],[15,"HostRegisterNotifyRequest",7382],[15,"RuntimeKeyManagerStatusUpdateRequest",7382],[15,"RuntimeCapabilityTEERakInitRequest",7382],[15,"HostLocalStorageGetResponse",7382]],"r":[[3,5881],[61,5834],[205,7490],[206,7490],[207,7490],[209,7490],[232,7490],[900,7497],[901,7497],[903,7496],[905,7498],[912,7495],[913,7495],[915,7496],[916,7496],[1124,7495],[3206,7509],[3207,7510],[3209,7510],[3211,7510],[3214,7510],[3215,7510],[3216,7510],[3221,7511],[3222,7509],[3223,7509],[3224,7511],[3231,7511],[3233,7508],[3237,7508],[3241,7512],[3242,7508],[3246,7511],[3251,7511],[4856,7519],[5097,5173],[5988,6009],[6010,7476],[6018,7476],[6023,7476],[6024,7476],[6025,7476],[6026,7527],[6028,7476],[6029,7476],[6031,7480],[6311,7530],[6313,7531],[6314,7513],[6315,7513],[6317,7513],[6318,7513],[6320,7532],[6321,7533],[6497,7537],[6603,6610]],"b":[[177,"impl-Debug-for-Hash"],[178,"impl-LowerHex-for-Hash"],[179,"impl-Display-for-Hash"],[180,"impl-From%3C%26%5Bu8%5D%3E-for-Hash"],[181,"impl-From%3C%26str%3E-for-Hash"],[182,"impl-From%3CVec%3Cu8%3E%3E-for-Hash"],[337,"impl-LowerHex-for-PublicKey"],[338,"impl-Debug-for-PublicKey"],[339,"impl-Display-for-PublicKey"],[340,"impl-Debug-for-Signature"],[341,"impl-LowerHex-for-Signature"],[342,"impl-Display-for-Signature"],[347,"impl-From%3CVec%3Cu8%3E%3E-for-PublicKey"],[348,"impl-From%3C%26%5Bu8%5D%3E-for-PublicKey"],[350,"impl-From%3C%26str%3E-for-PublicKey"],[351,"impl-From%3C%26str%3E-for-Signature"],[352,"impl-From%3C%26%5Bu8%5D%3E-for-Signature"],[353,"impl-From%3CVec%3Cu8%3E%3E-for-Signature"],[481,"impl-From%3C%5Bu8;+PRIVATE_KEY_LENGTH%5D%3E-for-PrivateKey"],[483,"impl-From%3CStaticSecret%3E-for-PrivateKey"],[484,"impl-From%3C%26PrivateKey%3E-for-PublicKey"],[485,"impl-From%3C%5Bu8;+PUBLIC_KEY_LENGTH%5D%3E-for-PublicKey"],[487,"impl-From%3CPublicKey%3E-for-PublicKey"],[546,"impl-LowerHex-for-Namespace"],[547,"impl-Display-for-Namespace"],[548,"impl-Debug-for-Namespace"],[550,"impl-From%3CVec%3Cu8%3E%3E-for-Namespace"],[551,"impl-From%3C%26str%3E-for-Namespace"],[552,"impl-From%3C%26%5Bu8%5D%3E-for-Namespace"],[585,"impl-Add%3C%26Quantity%3E-for-Quantity"],[586,"impl-Add-for-Quantity"],[587,"impl-Add%3Cu64%3E-for-Quantity"],[588,"impl-AddAssign%3Cu64%3E-for-Quantity"],[589,"impl-AddAssign%3C%26Quantity%3E-for-Quantity"],[590,"impl-AddAssign-for-Quantity"],[606,"impl-Debug-for-Quantity"],[607,"impl-Display-for-Quantity"],[608,"impl-From%3Cu32%3E-for-Quantity"],[609,"impl-From%3Cu16%3E-for-Quantity"],[610,"impl-From%3Cu8%3E-for-Quantity"],[612,"impl-From%3Cu128%3E-for-Quantity"],[613,"impl-From%3Cu64%3E-for-Quantity"],[620,"impl-Mul%3C%26Quantity%3E-for-Quantity"],[621,"impl-Mul%3Cu64%3E-for-Quantity"],[622,"impl-Mul-for-Quantity"],[623,"impl-MulAssign%3C%26Quantity%3E-for-Quantity"],[624,"impl-MulAssign%3Cu64%3E-for-Quantity"],[625,"impl-MulAssign-for-Quantity"],[722,"impl-Debug-for-MrEnclave"],[723,"impl-Display-for-MrEnclave"],[724,"impl-LowerHex-for-MrEnclave"],[725,"impl-LowerHex-for-MrSigner"],[726,"impl-Display-for-MrSigner"],[727,"impl-Debug-for-MrSigner"],[733,"impl-From%3C%26str%3E-for-MrEnclave"],[735,"impl-From%3C%26%5Bu8%5D%3E-for-MrEnclave"],[736,"impl-From%3CVec%3Cu8%3E%3E-for-MrEnclave"],[737,"impl-From%3CVec%3Cu8%3E%3E-for-MrSigner"],[739,"impl-From%3C%26str%3E-for-MrSigner"],[740,"impl-From%3C%26%5Bu8%5D%3E-for-MrSigner"],[931,"impl-TdAttributes"],[932,"impl-Flags-for-TdAttributes"],[1034,"impl-UpperHex-for-TdAttributes"],[1035,"impl-LowerHex-for-TdAttributes"],[1036,"impl-Binary-for-TdAttributes"],[1037,"impl-Debug-for-TdAttributes"],[1038,"impl-Octal-for-TdAttributes"],[1040,"impl-Debug-for-Error"],[1041,"impl-Display-for-Error"],[1053,"impl-TdAttributes"],[1054,"impl-Flags-for-TdAttributes"],[1450,"impl-LowerHex-for-Address"],[1451,"impl-Debug-for-Address"],[1455,"impl-From%3C%26%5Bu8;+ADDRESS_SIZE%5D%3E-for-Address"],[1457,"impl-From%3C%26str%3E-for-Address"],[1830,"impl-Display-for-Error"],[1831,"impl-Debug-for-Error"],[2030,"impl-Display-for-Error"],[2031,"impl-Debug-for-Error"],[2676,"impl-From%3CVerifiedQuote%3E-for-VerifiedEndorsedCapabilityTEE"],[2677,"impl-From%3CVerifiedAttestation%3E-for-VerifiedEndorsedCapabilityTEE"],[3464,"impl-Debug-for-Error"],[3465,"impl-Display-for-Error"],[4608,"impl-Display-for-StateError"],[4609,"impl-Debug-for-StateError"],[4614,"impl-ImmutableMKVS-for-%26ConsensusState"],[4615,"impl-ImmutableMKVS-for-ConsensusState"],[4616,"impl-ImmutableMKVS-for-ConsensusState"],[4617,"impl-ImmutableMKVS-for-%26ConsensusState"],[4623,"impl-ImmutableMKVS-for-ConsensusState"],[4624,"impl-ImmutableMKVS-for-%26ConsensusState"],[4627,"impl-ImmutableMKVS-for-ConsensusState"],[4628,"impl-ImmutableMKVS-for-%26ConsensusState"],[5011,"impl-Debug-for-Error"],[5012,"impl-Display-for-Error"],[5135,"impl-Display-for-RpcClientError"],[5136,"impl-Debug-for-RpcClientError"],[5139,"impl-From%3CDecodeError%3E-for-RpcClientError"],[5140,"impl-From%3CError%3E-for-RpcClientError"],[5141,"impl-From%3CError%3E-for-RpcClientError"],[5205,"impl-Debug-for-Error"],[5206,"impl-Display-for-Error"],[5209,"impl-From%3CError%3E-for-Error"],[5210,"impl-From%3CError%3E-for-Error"],[5211,"impl-From%3CDecodeError%3E-for-Error"],[5431,"impl-Debug-for-Error"],[5432,"impl-Display-for-Error"],[5595,"impl-Display-for-SessionID"],[5596,"impl-LowerHex-for-SessionID"],[5597,"impl-Debug-for-SessionID"],[5606,"impl-From%3C%26str%3E-for-SessionID"],[5608,"impl-From%3C%26%5Bu8%5D%3E-for-SessionID"],[5609,"impl-From%3CVec%3Cu8%3E%3E-for-SessionID"],[5758,"impl-Debug-for-Error"],[5759,"impl-Display-for-Error"],[5856,"impl-Debug-for-PolicyVerifierError"],[5857,"impl-Display-for-PolicyVerifierError"],[5932,"impl-Debug-for-ProtocolError"],[5933,"impl-Display-for-ProtocolError"],[6056,"impl-FallibleMKVS-for-Tree"],[6057,"impl-Tree"],[6081,"impl-MKVS-for-OverlayTree%3CT%3E"],[6082,"impl-OverlayTree%3CT%3E"],[6083,"impl-Tree"],[6084,"impl-FallibleMKVS-for-Tree"],[6163,"impl-OverlayTree%3CT%3E"],[6164,"impl-MKVS-for-OverlayTree%3CT%3E"],[6166,"impl-FallibleMKVS-for-Tree"],[6167,"impl-Tree"],[6173,"impl-OverlayTree%3CT%3E"],[6174,"impl-MKVS-for-OverlayTree%3CT%3E"],[6175,"impl-FallibleMKVS-for-Tree"],[6176,"impl-Tree"],[6196,"impl-OverlayTree%3CT%3E"],[6197,"impl-MKVS-for-OverlayTree%3CT%3E"],[6198,"impl-FallibleMKVS-for-Tree"],[6199,"impl-Tree"],[6218,"impl-OverlayTree%3CT%3E"],[6219,"impl-MKVS-for-OverlayTree%3CT%3E"],[6221,"impl-FallibleMKVS-for-Tree"],[6222,"impl-Tree"],[6240,"impl-FallibleMKVS-for-Tree"],[6242,"impl-Tree"],[6245,"impl-MKVS-for-OverlayTree%3CT%3E"],[6246,"impl-OverlayTree%3CT%3E"],[6247,"impl-Tree"],[6248,"impl-FallibleMKVS-for-Tree"],[6436,"impl-Display-for-SyncerError"],[6437,"impl-Debug-for-SyncerError"],[6806,"impl-From%3CVec%3CVec%3Cu8%3E%3E%3E-for-TxnBatch"],[6808,"impl-From%3CVecDeque%3CVec%3Cu8%3E%3E%3E-for-TxnBatch"],[7112,"impl-Debug-for-Error"],[7113,"impl-Display-for-Error"],[7134,"impl-From%3CError%3E-for-Error"],[7136,"impl-From%3CStateError%3E-for-Error"],[7137,"impl-From%3CError%3E-for-Error"],[7138,"impl-From%3CJoinError%3E-for-Error"],[7139,"impl-From%3CProtocolError%3E-for-Error"],[7140,"impl-From%3CError%3E-for-Error"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAE0W7wEBAAAAAwAFAAoAAAAMAAUAEwABABgABwAhAAIAJQADADEAAgA5AAEAPgAAAEIACABMAAMAUgAEAFgAAABaAAAAYgADAGgAAwBtAAIAcQAFAHoAAQCAAAAAgwAHAI0AAACWAAAAnAAMAKsAAACtAAoAuQACAL0AAADAAAMAxQAGANMAAQDYAAIA3QAAAOQABADsAAkA+QAAAPwABAAIAQEADAFOAFwBAQBfAQMAaAEBAGwBCgB9AQQAhAEBAIcBAACLAQAAkgEiALkBBwDFARwA5AEAAOgBAADrAQIA8AEBAPMBDgAFAgAACAIAAA0CAAASAhMAJwIFAC4CAAAwAgkAOwIFAEICAABEAgMASgIHAFQCDwBlAgMAagISAH4CAACCAgAAhgIlAK0CFgDFAhcA3gIAAOACAgDkAgEA6gIEAPACBwD+AgQABgMDAAsDAQAPAyMANAMHAD4DAABCAxEAVQMHAGADAQBkAwEAZwMMAHUDAgB5AwEAfQMEAIQDAACHAwAAiwMFAJMDAACWAwYApQMAAKgDKADTAxUA6wMIAPUDDQAFBA0AGwQAAB8EAAAkBAgAOQQFAE8EAABSBAEAXQQAAGEEAQBoBAcAcQQjAJkECACmBAAAqAQAAKsEGgDIBAMAzgQBANEEAQDUBBAA5wQKAPMEAgD3BAAA+QQGAAIFAwAIBQ0AFwUBABsFAQAhBQEAJAUFACsFAQAxBQAAMwUAADUFIABaBQMAYQUEAG0FEQCABQIAhwUlALAFAACyBQAAtgUEAL8FAADBBQEAxAUSANoFDADoBQIA7AUHAPcFAAD/BVoAYQYGAGkGBgB3BjkAsgYHAL8GAADEBhEA2QY7ABcHGQA7BwkATgcJAFoHAgBkBwAAZwc0AJ0HCACoBwAArwcLAL0HDgDNByAA7wcGAAAIBQAMCAQAHwggAEEIBQBkCAAAhwgBAJMITQDnCHQAYAkjAIYJcQD6CQAA/QkAAP8JQwBGCiUAdQoBAJAKAACdCh0AvAoCAMcKJQATCyQAOwsBAEQLAABGCwAASgsAAE4LAABRCwAAaQslAJELjgAhDCUASgwAAFMMJgCCDAEAhQwBAIkMAACLDAAAjQwAAJUMAQCaDAUAowwCAKcMAgCsDAQAswwIAL8MIwDkDDAAFw1BAFsNHwB9DREAnQ0AAKMNCACuDQAAtg0SANsNDwDtDQAA7w0AAPINAAD3DQAA+Q0AAP4NAQADDgEACQ4BAA0OAAARDhEAJA4AACYOUQB/DhEAmg4lAMQOBQDODgEA0g4BANcOAQDaDg0A6Q4DABcPaAGbEDsA8hAAAfQRAQD3EQsABRIAAAcSAwAMEgEAEBIBABQSAQAYEgAAGhIIACUSCQA1EgEAPBIHAEYSAwBMEgkAVxICAF4SAQBiEgAAbRIKAHkSBAB/EgAAgxIDAIgSBACOEgAAlBIDAJkSBACfEgAAoxIBAKYSAwCtEgEAtBICALkSAAC+EgMAxRIBAMgSAgDMEgIA0BIAANMSAADWEgAA2BIFAN8SAADiEgIA5hIEAOwSAQDvEgcA+BIAAPsSCgAJEwEADRMBABMTDAAkEwAAKxMWAEMTAwBNEwMAVRMDAF8TEgBzEwoAfxMBAIITAwCHEwsAlBMCAJsTAQCfEwAAoxMAAKYTCQC0EwEAuxMFAMITCQDREwIA3RMFAOQTBgDyEwQA+hMDAP8TDwAQFAEAFBQCABgUAgAkFAAAJhQJADMUAgA3FAQAPRQAAEEUAwBHFAcAUBQHAFoUBABlFAkAeRQPAIsUAwCWFAIAohQMALYUBwDAFAUAyBQMANYUAADgFAMA6BQAAPYUDgAIFQMADRUHABYVAAAdFQcAKBUHADEVAwA4FQEAQxUDAFcVDABnFQMAbBUFAHkVAwB+FWkA6RUBAPMVCwAIFggAEhYDABcWPQBXFgAAWhYAAF8WJQCKFgMAmhYAAJwWEwCyFgYAuxYAAL8WAADFFgMAyhYAAMwWBgDVFg0A5RYBAO4WBgD4FgQA/hYFAAUXAAAIFwsAFhcCABwXDgAsFwMANRcAADoXBgBHFwIATBcXAGUXAABnFwUAbxcBAHIXAAB1FwYAfxcBAIMXAQCSFxIAqBcBAKsXFADCFwAAxRcAAMcXNAD+FwcADxgAABUYAgAeGAQAJRgBACgYAAAqGAgANhgBAEIYAwBMGAIAURgDAFgYAABaGAAAXBgAAGAYAgBmGAAAaRgAAG8YKACaGAgAshgAALQYAgC4GB0A1xhGAB8ZDgA0GQAAPRkNAFgZCQBoGQIAbBkAAG4ZAgBzGQIAeBkCAHwZPwC9GQAAvxkNANQZAQDZGQIA3xkAAOYZAwDvGQUA9hkKAAIaAAAIGgIADxoAABUaAAAYGgUAHxoFACgaGwBHGgEASxoBAE4aDQBfGgkAahoAAG4aAgByGgAAdBoAAHoaAQB9GgIAgRoAAIQaAwCJGg4AmRoBAJwaCACpGgEArBoAALIaBAC4GgAAuhoQAMwaBQDUGgEA1xoAANoaEwDvGgAA8RoGAPkaBwACGwAABBsAAAYbAgALG64AuxsGAMMbFQDfGwAA4RsEAPQbAAD2GwAA+BsUACMcFAA7HAIAQBwBAEMcAABGHAEAShwCAFAc2wA="}],\ +["oasis_runtime_sdk",{"t":"EEYYEEFNNCENNNNCCECNNNCNCNNCCNNNXNCNNNNCOXOCCNOCCXCCCCCNNNNNNCQNPPGNNHHNNNHHHNNHNNNNNNOOOFONNNNNNNNONOONNNNKRFNNMNMNNNNMNNMNMNMNNNNNMNNMNNMNNMNNNNNNCCCFGPPPIIFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNOFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPPPGPPPPPGGPPPPPPPPPPPFGKPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNMNNNNMNMCCCMNNMNCMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHHFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPFFFGPPPNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNONNONONONONNNNNNNNNOOONNNNNNNNSFONNNNNNNNNNNNNNOONNNNNNNKFNNNNNMONNNNNNNNNNNNNNNNNNNNNNNNNNNNOOMNNNNNNNNNKFIKNNNNNMNNNHNNNNNMNOMNNNNONGPPKNNNMMNNNNNNNNNNNNNNNPPPPPPPPPPPPPSKFGFFPPPPPPPPPPPPPPPFPPFPPFPNNMNOOMNNNNNNNONHMNMNMNMNNONOMNMNOOOONNNNNPGKGPGRRRPKRPKKKKKTPKRTPKPTNNNNNNNNNNNNNNNNNNNNNNNNNHNNHNNNNNNNNNNNNNNNNNNNNNMNNNNMNNNNNNNNNNNNNNNNOOOCCCCCCCKGTFPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNIPGPGINNNNNNNNNNNNNNNNNNNNNNNNNNNNJJKPPPGGPFFPPPFPGFPONNNONNNNNNNNNNNNNNMNMNNMNNNNNNNNNNNNONNNONNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNOMNMNMNMNMNMNMNNNNNNNNNNNNNNNNNNNNNNNMNNNNONMNMNMNMNNCNMNNNNNNOMNMNONNNNNNNNNNNNNNNNNNNNONNNNNNNCMNNNNNNNNNOOOOOOOFFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNONNNNNNNNNNNNNNNSSSFFFFFFFFOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKPPPGGFFPPPPFGFPPPMNMNMNNNNNNNNNNNNNNNNNNNNNNNNNNMNOONNNMNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNMNNNNNNNNNNNNNNNNNNNOMNNNNNNNNNNNNNNNNNNNNNNONNNOMNOMNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNMNPGFPNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNJJKPPPPGGPFFPPPFFPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNMNMNNNNNNNNNNNNNOOOONNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNONNCONONNNNNNNNNNNNNNNNNNNNNNOOOONNNNNNCMNNNNNNNMNOOOOOOOOOOOOOOOOOOOOOOOOOSSSSFHHNNNNNONOHHHHHNNHHHHONNNNNFFFFFFFFFPFFFFFPFGFFPPFFFOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNTKPPKRTTFTTGGPPPPTTFPPPFPPPPPPPPPFTSPPPFPPPPPGFPPPFNNNOONNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNMNONNNNNNNNNNNNNNNNNNNNNNNNOMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNOOOOOMNOOONNNNNONMNMNMNMNNCONMNMNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNCMNMNMNMNNNNNNNNNNNNOSSSSPFFFFPFFGFPFSNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNOONNNNNNNNNJGFPPPFGFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOONCNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNSFPPGFGFPONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNJKPPPPPKPGGPPTTTTTTTTTTTTTTTTFPFPPPGFPTTPPPPCCONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNMNMNMNMNNNNNNNNNNNNNNNNNNMNNNNNOCNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNOOOKEFFTNNNNNNNNNNNNMNNNNNNNNNNMNNNNNNNNNCNNNNNNNNNNNNNNNNNEEFEPPIFFNNNNNNNNNNNNXNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNONONNNNNNNNNNNNNNONNNNNNNNNNNNNNNONNENNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNSFGPTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGPFPPPGPPPNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNONNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNFNNNNNNNNNNNHNNNNHHHHNNNOOHHHNNNNNNHNFFFFPPGFFFFFOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNOOOONNNNNNNNNNNNNNNNNNNNOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNRRRRTKTTTNMNNNNNNNGPKNNNNNNMNNNNNNNNNNNNFONNNNNNNNNNNNNNNNONNNONNPPFFPGFPPPFFGFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONONNNNNNNNNONNNNNNNNNNNNNNNNNNONNNNNONNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNEEFFRFKFFFKFNNNNNNNNNNNNNNNNNNNMNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNMNNNNNNNNNMNNNNNNNNNNNNNNMNNNNNNNNNNNNNNMNNMNNNNNMNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFPPPGSNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFFKONNNNNNHOONNNNNNNNNNNNNNNNNOHNNNNNNOOONNNNNNNNNNMNNNNCCCPPPPPPPPPPPPPGFFPPPPFPPPPPPPPPPPFPPFPPFPNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNONNNNNNNOONOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCCCCCCHHHHHHHHHHHHHHHHHHHHHHHHHHHHFFFFFNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNHOOONNNNNNNOONNNNNNNNNNONNOONNHNNNNNNNNNNNNNNNNNNNNNCCCCCSSSSSSSSSFPGPTPGPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNSFFNNNNNNNNNNOONNNNNNNNONNNNNNNNNNOOONNNNNNNNNNNNNNIFFNNNNNNNNNNOONNNNNNONNNNOONNNNNONOONNNNNNNNNNNFFGTTPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOPGFGFGGGPGPPPFFPPSPPPPPPSPPFPFFPPFNNOONNNNONONNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNONONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNOOONNONONNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNOOO","n":["Context","CurrentState","Error","Event","Module","Runtime","Version","borrow","borrow_mut","callformat","cbor","clone","clone_into","clone_to_uninit","clone_to_uninit","config","context","core","crypto","default","deref","deref_mut","dispatcher","drop","enclave_rpc","eq","equivalent","error","event","fmt","from","from","handler","hash","history","init","into","into_cbor_value","is_compatible_with","keymanager","major","migration","minor","module","modules","new","patch","runtime","schedule_control","sdk_derive","sender","state","storage","subcall","testing","to_owned","try_default","try_from","try_from_cbor_value","try_into","type_id","types","version_from_cargo","vzip","Empty","EncryptedX25519DeoxysII","Metadata","borrow","borrow_mut","decode_call","decode_call_ex","deref","deref_mut","drop","encode_result","encode_result_ex","encrypt_result_x25519_deoxysii","fmt","from","get_key_pair_id","init","into","try_from","try_into","type_id","vzip","index","pk","sk","ScheduleControl","batch_size","borrow","borrow_mut","default","deref","deref_mut","drop","from","init","initial_batch_size","into","max_tx_count","min_remaining_gas","try_from","try_into","type_id","vzip","Context","Runtime","RuntimeBatchContext","borrow","borrow_mut","clone","clone","consensus_state","consensus_state","deref","deref_mut","drop","epoch","epoch","from","get_logger","get_logger","history","history","host_info","host_info","init","into","is_allowed_query","is_confidential","key_manager","key_manager","local_config","max_messages","max_messages","new","runtime_header","runtime_header","runtime_id","runtime_round_results","runtime_round_results","should_execute_contracts","try_from","try_into","type_id","vzip","multisig","random","signature","Config","Error","InsufficientWeight","InvalidConfig","InvalidSignatureSet","SignatureSet","SignatureSetOwned","Signer","batch","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","fmt","fmt","fmt","fmt","from","from","from","init","init","init","into","into","into","into_cbor_value","into_cbor_value","public_key","signers","threshold","to_owned","to_owned","to_string","try_default","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","type_id","type_id","type_id","validate_basic","vzip","vzip","vzip","weight","LeafRng","RootRng","append_local_entropy","append_subcontext","append_tx","as_rngcore","borrow","borrow","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","drop","fill_bytes","fork","from","from","gen_bigint","gen_bigint_range","gen_biguint","gen_biguint_below","gen_biguint_range","gen_prime","init","init","into","into","invalid","new","next_u32","next_u64","try_fill_bytes","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","Ed25519","Ed25519","Ed25519_Oasis","Ed25519_PrehashedSha512","Ed25519_Pure","Error","InvalidArgument","InvalidDigestLength","MalformedPrivateKey","MalformedPublicKey","MalformedSignature","MemorySigner","PublicKey","Secp256k1","Secp256k1","Secp256k1_Oasis","Secp256k1_PrehashedKeccak256","Secp256k1_PrehashedSha256","Secp256r1","Secp256r1","Secp256r1_PrehashedSha256","Secp384r1","Secp384r1","Secp384r1_PrehashedSha384","Signature","SignatureType","Signer","SigningError","Sr25519","Sr25519","VerificationFailed","as_bytes","as_int","as_ref","as_ref","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","cmp","compare","compare","context","default","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","ed25519","encode_hex","encode_hex","encode_hex_upper","encode_hex_upper","eq","eq","eq","eq","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from_bytes","from_bytes","from_bytes","hash","hash","init","init","init","init","init","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","is_ed25519_variant","is_prehashed","is_secp256k1_variant","is_secp256r1_variant","is_secp384r1_variant","key_type","new_from_seed","new_from_seed","new_test","partial_cmp","partial_cmp","public_key","public_key","random","secp256k1","secp256r1","secp384r1","sign","sign","sign_by_type","sign_raw","sign_raw","sr25519","to_bytes","to_bytes","to_owned","to_owned","to_owned","to_string","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","verify","verify_batch_multisig","verify_by_type","verify_raw","vzip","vzip","vzip","vzip","vzip","get_chain_context_for","set_chain_context","MemorySigner","PublicKey","as_bytes","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","cmp","compare","deref","deref","deref_mut","deref_mut","drop","drop","eq","equivalent","fmt","from","from","from","from","from","from_bytes","from_bytes","hash","init","init","into","into","into_cbor_value","new_from_seed","partial_cmp","public_key","random","sign","sign_digest","sign_raw","to_bytes","to_owned","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","verify","verify_digest","verify_raw","vzip","vzip","MemorySigner","PublicKey","as_bytes","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","cmp","compare","deref","deref","deref_mut","deref_mut","drop","drop","eq","equivalent","fmt","from","from","from","from_bytes","from_bytes","hash","init","init","into","into","into_cbor_value","new_from_seed","partial_cmp","public_key","random","sign","sign_digest","sign_raw","to_bytes","to_eth_address","to_owned","to_uncompressed_untagged_bytes","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","verify","verify_digest","verify_raw","vzip","vzip","MemorySigner","PublicKey","as_bytes","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","cmp","compare","deref","deref","deref_mut","deref_mut","drop","drop","eq","equivalent","fmt","from","from","from","from_bytes","from_bytes","hash","init","init","into","into","into_cbor_value","new_from_seed","partial_cmp","public_key","random","sign","sign_digest","sign_raw","to_bytes","to_owned","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","verify","verify_digest","verify_raw","vzip","vzip","MemorySigner","PublicKey","as_bytes","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","cmp","compare","deref","deref","deref_mut","deref_mut","drop","drop","eq","equivalent","fmt","from","from","from","from_bytes","from_bytes","hash","init","init","into","into","into_cbor_value","new_from_seed","partial_cmp","public_key","random","sign","sign_digest","sign_raw","to_bytes","to_owned","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","verify","verify_digest","verify_raw","vzip","vzip","PublicKey","as_bytes","borrow","borrow_mut","clone","clone_into","clone_to_uninit","cmp","compare","deref","deref_mut","drop","eq","equivalent","fmt","from","from","from_bytes","hash","init","into","into_cbor_value","partial_cmp","to_owned","try_from","try_from_cbor_value","try_into","type_id","verify","vzip","Aborted","BatchOutOfGas","DispatchOptions","DispatchResult","Dispatcher","Error","KeyManagerFailure","MalformedTransactionInBatch","QueryAborted","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call_format_metadata","check_batch","check_tx","code","decode_tx","default","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","dispatch_query","dispatch_tx","dispatch_tx_call","dispatch_tx_opts","drop","drop","drop","drop","execute_batch","execute_tx","execute_tx_opts","fmt","fmt","fmt","from","from","from","from","from","from","init","init","init","init","into","into","into","into","into_abort","method_authorizer","module_name","prefetch_tx","priority","query","register_enclaverpc","result","schedule_and_execute_batch","sender_metadata","set_abort_batch_flag","skip_authentication","source","tags","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","tx_hash","tx_index","tx_size","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","METHOD_QUERY","QueryRequest","args","borrow","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref_mut","drop","fmt","from","init","into","into_cbor_value","method","round","to_owned","try_default","try_from","try_from_cbor_value","try_into","type_id","vzip","Error","RuntimeError","borrow","borrow_mut","clone","clone_into","clone_to_uninit","code","code","default","deref","deref_mut","drop","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","init","into","into_abort","into_call_result","into_cbor_value","message","module","module_name","new","to_owned","to_string","try_default","try_from","try_from_cbor_value","try_into","type_id","vzip","Event","EventTag","EventTags","IntoTags","borrow","borrow_mut","clone","clone_into","clone_to_uninit","code","deref","deref_mut","drop","etag_for_event","fmt","from","init","into","into_event_tag","into_tags","into_tags","key","module_name","to_owned","try_from","try_into","type_id","value","vzip","Error","FailedToFetchBlock","FailedToFetchEvents","HistoryHost","borrow","borrow_mut","code","consensus_events_at","consensus_state_at","deref","deref_mut","drop","fmt","fmt","from","init","into","into_abort","module_name","to_string","try_from","try_into","type_id","vzip","ActiveDeploymentNotFound","EphemeralSecretChecksumMismatch","EphemeralSecretNotFound","EphemeralSecretNotPublished","EphemeralSecretNotReplicated","GenerationFromFuture","HeightNotFresh","InsufficientKeyShares","InsufficientSignatures","InvalidCiphertext","InvalidEpoch","InvalidGeneration","InvalidSignature","KEY_PAIR_ID_CONTEXT","KeyManager","KeyManagerClientWithContext","KeyManagerError","KeyPair","KeyPairId","MasterSecretChecksumMismatch","MasterSecretNotFound","MasterSecretNotPublished","MasterSecretNotReplicated","NotAuthenticated","NotAuthorized","NotInitialized","Other","PolicyChanged","PolicyInvalidRuntime","PolicyRequired","PolicyRollback","REKNotPublished","RSKMissing","RuntimeMismatch","SignedPublicKey","StateCorrupted","StateError","StateKey","StatusNotFound","StorageCorrupted","TrustedSigners","VerificationError","borrow","borrow_mut","box_clone","box_clone","checksum","checksum","clear_cache","clear_cache","clone","clone_into","clone_to_uninit","deref","deref_mut","drop","expiration","from","get_key_pair_id","get_or_create_ephemeral_keys","get_or_create_ephemeral_keys","get_or_create_keys","get_or_create_keys","get_public_ephemeral_key","get_public_ephemeral_key","get_public_key","get_public_key","init","input_keypair","into","key","runtime_id","runtime_id","runtime_signing_key","runtime_signing_key","signature","signers","state_key","threshold","to_owned","try_from","try_into","type_id","vzip","Aborted","AuthDecision","BlockHandler","CallResult","Continue","DispatchResult","Error","Error","Event","Failed","FeeProxyHandler","Genesis","Handled","InvariantHandler","MethodHandler","MigrationHandler","Module","ModuleInfoHandler","NAME","Ok","Parameters","Parameters","STORE_KEY","Stop","TransactionHandler","Unhandled","VERSION","after_dispatch_tx","after_handle_call","approve_raw_tx","approve_unverified_tx","authenticate_tx","before_authorized_call_dispatch","before_handle_call","begin_block","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","check_invariants","clone","clone_into","clone_to_uninit","decode_tx","deref","deref","deref","deref_mut","deref_mut","deref_mut","dispatch_call","dispatch_call","dispatch_message_result","dispatch_query","dispatch_query","drop","drop","drop","end_block","fmt","fmt","from","from","from","init","init","init","init_or_migrate","into","into","into","is_allowed_interactive_call","is_allowed_private_km_query","is_expensive_query","is_success","module_info","ok_or","ok_or_else","params","prefetch","resolve_payer","set_params","supported_methods","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","validate_basic","vzip","vzip","vzip","code","message","module","access","accounts","consensus","consensus_accounts","core","rewards","rofl","Config","Error","METHOD_AUTHORIZATIONS","Module","NotAuthorized","before_authorized_call_dispatch","borrow","borrow","borrow_mut","borrow_mut","code","deref","deref","deref_mut","deref_mut","dispatch_query","drop","drop","fmt","fmt","from","from","init","init","init_or_migrate","into","into","into_abort","module_info","module_name","to_string","try_from","try_from","try_into","try_into","type_id","type_id","types","vzip","vzip","Addresses","AllowFrom","Authorization","FilterOnly","MethodAuthorization","Methods","allow_from","borrow","borrow","borrow_mut","borrow_mut","default","deref","deref","deref_mut","deref_mut","drop","drop","from","from","init","init","into","into","new","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","with_filtered_methods","ADDRESS_COMMON_POOL","ADDRESS_FEE_ACCUMULATOR","API","Burn","Core","DebugOptionUsed","Error","Event","Forbidden","GasCosts","Genesis","InsufficientBalance","InvalidArgument","Mint","Module","NotFound","ParameterValidationError","Parameters","Transfer","accounts","after_dispatch_tx","after_handle_call","authenticate_tx","balances","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","burn","burn","charge_tx_fee","charge_tx_fee","check_invariants","check_signer_nonces","check_signer_nonces","clone","clone","clone","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","code","debug_disable_nonce_check","default","default","default","denomination_infos","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","dispatch_call","dispatch_query","drop","drop","drop","drop","drop","drop","drop","end_block","ensure_balance","fee","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","gas_costs","get_addresses","get_addresses","get_balance","get_balance","get_balances","get_balances","get_denomination_info","get_denomination_info","get_nonce","get_nonce","get_total_supplies","get_total_supplies","inc_nonce","inc_nonce","init","init","init","init","init","init","init","init","init_or_migrate","into","into","into","into","into","into","into","into_abort","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","is_expensive_query","mint","mint","module_info","module_name","module_name","parameters","prefetch","set_balance","set_balance","set_nonce","set_nonce","set_refund_unused_tx_fee","set_refund_unused_tx_fee","set_total_supply","set_total_supply","source","state","supported_methods","take_refund_unused_tx_fee","take_refund_unused_tx_fee","to_owned","to_owned","to_owned","to_string","to_string","total_supplies","transfer","transfer","transfer_silent","transfer_silent","transfers_disabled","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_transfer","type_id","type_id","type_id","type_id","type_id","type_id","type_id","types","update_signer_nonces","update_signer_nonces","validate_basic","vzip","vzip","vzip","vzip","vzip","vzip","vzip","amount","amount","amount","from","owner","owner","to","FeeManager","FeeUpdates","TransactionFee","amount","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","commit_block","commit_tx","default","default","denomination","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","fmt","fmt","from","from","from","init","init","init","into","into","into","new","payer","payer","record_fee","record_refund","refund","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","tx_fee","type_id","type_id","type_id","vzip","vzip","vzip","ACCOUNTS","BALANCES","TOTAL_SUPPLY","Account","AccountBalances","AddressesQuery","BalancesQuery","DenominationInfo","DenominationInfoQuery","NonceQuery","Transfer","address","address","amount","balances","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","decimals","default","default","default","default","default","default","default","default","denomination","denomination","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","nonce","to","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","API","AmountNotRepresentable","ConsensusIncompatibleSigner","Core","Error","Event","GasCosts","Genesis","History","InternalStateError","InvalidArgument","InvalidDenomination","Module","ParameterValidationError","Parameters","ScalingFactorNotPowerOf10","UnderMinDelegationAmount","ZeroScalingFactor","account","account","amount_from_consensus","amount_from_consensus","amount_to_consensus","amount_to_consensus","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","code","consensus_denomination","consensus_denomination","consensus_denomination","consensus_scaling_factor","default","default","default","delegation","delegation","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","dispatch_call","dispatch_query","drop","drop","drop","drop","drop","drop","drop","ensure_compatible_tx_signer","ensure_compatible_tx_signer","eq","eq","equivalent","equivalent","escrow","escrow","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","gas_costs","height_for_epoch","height_for_epoch","init","init","init","init","init","init","init","init","init_or_migrate","into","into","into","into","into","into","into","into_abort","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","min_delegate_amount","module_info","module_name","module_name","parameters","reclaim_escrow","reclaim_escrow","round_root","round_roots","round_roots","source","supported_methods","to_owned","to_owned","to_owned","to_string","to_string","transfer","transfer","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","types","validate_basic","vzip","vzip","vzip","vzip","vzip","vzip","vzip","withdraw","withdraw","IO","RootKind","RoundRootBody","State","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","deref","deref","deref_mut","deref_mut","drop","drop","fmt","fmt","from","from","init","init","into","into","into_cbor_value","into_cbor_value","kind","round","runtime_id","to_owned","to_owned","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","ADDRESS_PENDING_DELEGATION","ADDRESS_PENDING_WITHDRAWAL","API","Consensus","Core","Delegate","Deposit","Error","Event","Forbidden","GasCosts","Genesis","InsufficientBalance","InvalidArgument","InvalidDenomination","Module","Parameters","UndelegateDone","UndelegateStart","Withdraw","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","check_invariants","clone","clone","clone","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","code","default","default","default","delegate","delegate","deposit","deposit","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","disable_delegate","disable_deposit","disable_undelegate","disable_withdraw","dispatch_call","dispatch_message_result","dispatch_query","drop","drop","drop","drop","drop","drop","end_block","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","gas_costs","init","init","init","init","init","init","init","init_or_migrate","into","into","into","into","into","into","into_abort","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","module_info","module_name","module_name","parameters","prefetch","source","state","store_receipt","supported_methods","take_receipt","to_owned","to_owned","to_owned","to_string","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","tx_delegate","tx_deposit","tx_undelegate","tx_withdraw","type_id","type_id","type_id","type_id","type_id","type_id","types","undelegate","undelegate","vzip","vzip","vzip","vzip","vzip","vzip","withdraw","withdraw","amount","amount","amount","amount","debond_end_time","error","error","error","error","from","from","from","from","from","nonce","nonce","nonce","nonce","shares","shares","to","to","to","to","to","DELEGATIONS","RECEIPTS","UNDELEGATIONS","UNDELEGATION_QUEUE","Undelegation","add_delegation","add_undelegation","borrow","borrow_mut","deref","deref_mut","drop","epoch","from","from","get_delegation","get_delegations","get_delegations_by_destination","get_queued_undelegations","get_undelegations","init","into","set_receipt","sub_delegation","take_receipt","take_undelegation","to","try_from","try_from","try_into","type_id","vzip","AccountBalance","BalanceQuery","ConsensusAccountQuery","ConsensusDelegateContext","ConsensusError","ConsensusTransferContext","ConsensusUndelegateContext","ConsensusWithdrawContext","Delegate","Delegate","DelegationInfo","DelegationQuery","DelegationsQuery","Deposit","ExtendedDelegationInfo","Invalid","Receipt","ReceiptKind","TakeReceipt","Undelegate","UndelegateDone","UndelegateStart","UndelegationInfo","UndelegationsQuery","Withdraw","address","address","address","address","amount","amount","amount","amount","amount","amount","amount","balance","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","epoch","epoch","eq","equivalent","error","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","id","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","is_valid","kind","module","nonce","nonce","nonce","nonce","receipt","receipt","receipt","receipt","receipt","receipt","shares","shares","shares","shares","shares","shares","to","to","to","to","to","to","to","to","to","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","ALLOW_INTERACTIVE_READ_ONLY_TRANSACTIONS","API","Abort","CallDepthExceeded","Config","Config","DEFAULT_LOCAL_ESTIMATE_GAS_SEARCH_MAX_ITERS","DEFAULT_LOCAL_MIN_GAS_PRICE","DynamicMinGasPrice","EMIT_GAS_USED_EVENTS","ESTIMATE_GAS_EXTRA_FAIL","Error","Event","ExpiredTransaction","Forbidden","ForbiddenInSecureBuild","FutureNonce","GAS_COST_CALL_CALLDATA_PUBLIC_KEY","GAS_COST_CALL_CURRENT_EPOCH","GasCosts","GasOverflow","GasPriceTooLow","GasUsed","Genesis","InsufficientFeeBalance","InvalidArgument","InvalidCallFormat","InvalidMethod","InvalidMinPriceMaxChangeDenominator","InvalidNonce","InvalidTargetBlockGasUsagePercentage","InvalidTransaction","InvariantViolation","LocalConfig","MIN_GAS_PRICE_EXEMPT_METHODS","MODULE_NAME","MalformedTransaction","MessageHandlerMissing","MessageHandlerNotInvoked","Module","MultisigTooManySigners","NotAuthenticated","OutOfGas","OutOfMessageSlots","OversizedTransaction","ParameterValidationError","Parameters","ReadOnlyTransaction","TooManyAuth","TxSimulationFailed","TxSimulationFailure","after_handle_call","approve_raw_tx","approve_unverified_tx","auth_multisig_signer","auth_signature","authenticate_tx","before_handle_call","begin_block","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","callformat_x25519_deoxysii","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","code","code","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","dispatch_call","dispatch_query","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","dynamic_min_gas_price","enabled","end_block","eq","equivalent","estimate_gas_search_max_iters","estimate_gas_search_max_iters","estimate_gas_search_max_iters","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","gas_costs","has_epoch_changed","has_epoch_changed","init","init","init","init","init","init","init","init","init","init","init","init_or_migrate","into","into","into","into","into","into","into","into","into","into","into_abort","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","is_allowed_private_km_query","is_error_core_out_of_gas","is_expensive_query","max_batch_gas","max_batch_gas","max_batch_gas","max_estimated_gas","max_multisig_signers","max_tx_signers","max_tx_size","min_gas_price","min_gas_price","min_gas_price","min_gas_price","min_price_max_change_denominator","module_info","module_name","module_name","module_name","out_of_gas","parameters","query_estimate_gas","remaining_batch_gas","remaining_batch_gas","remaining_tx_gas","remaining_tx_gas","set_priority","set_priority","set_sender_meta","set_sender_meta","source","state","storage_byte","supported_methods","take_priority","take_priority","take_sender_meta","take_sender_meta","target_block_gas_usage_percentage","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_byte","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","types","use_batch_gas","use_batch_gas","use_tx_gas","use_tx_gas","used_batch_gas","used_batch_gas","used_tx_gas","used_tx_gas","validate_basic","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","amount","DYNAMIC_MIN_GAS_PRICE","LAST_EPOCH","MESSAGE_HANDLERS","METADATA","Call","CallDataPublicKeyQueryResponse","EstimateGasQuery","ExecuteReadOnlyTxQuery","ExecuteReadOnlyTxResponse","MessageResult","Metadata","MethodHandlerInfo","MethodHandlerKind","ModuleInfo","Query","RuntimeInfoResponse","VERSION_GLOBAL_KEY","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","caller","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","epoch","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","kind","methods","modules","name","params","propagate_failures","public_key","result","runtime_version","state_version","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx","tx","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","version","versions","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","ADDRESS_REWARD_POOL","Error","Genesis","InvalidArgument","InvalidParticipationThreshold","InvalidSchedule","Module","ParameterValidationError","Parameters","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","code","default","default","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","dispatch_query","drop","drop","drop","drop","drop","end_block","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","init","init","init","init","init","init_or_migrate","into","into","into","into","into","into_abort","into_cbor_value","into_cbor_value","module_info","module_name","parameters","participation_threshold_denominator","participation_threshold_numerator","schedule","source","state","to_owned","to_owned","to_string","to_string","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","types","validate_basic","vzip","vzip","vzip","vzip","vzip","REWARDS","EpochRewards","NoReward","Reward","RewardAction","RewardSchedule","RewardScheduleError","RewardStep","StepsNotSorted","amount","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","default","default","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","eq","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","for_disbursement","for_epoch","forbid","from","from","from","from","from","increment","init","init","init","init","init","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","pending","steps","to_owned","to_owned","to_owned","to_owned","to_string","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","until","validate_basic","value","vzip","vzip","vzip","vzip","vzip","ADDRESS_APP_STAKE_POOL","API","Accounts","AppAlreadyExists","AppCreated","AppRemoved","AppUpdated","Config","Core","Error","Event","ExtraKeyUpdateNotAllowed","Forbidden","GAS_COST_CALL_AUTHORIZED_ORIGIN_ENTITY","GAS_COST_CALL_AUTHORIZED_ORIGIN_ENTITY","GAS_COST_CALL_AUTHORIZED_ORIGIN_NODE","GAS_COST_CALL_AUTHORIZED_ORIGIN_NODE","GAS_COST_CALL_CREATE","GAS_COST_CALL_CREATE","GAS_COST_CALL_IS_AUTHORIZED_ORIGIN","GAS_COST_CALL_IS_AUTHORIZED_ORIGIN","GAS_COST_CALL_REGISTER","GAS_COST_CALL_REGISTER","GAS_COST_CALL_REMOVE","GAS_COST_CALL_REMOVE","GAS_COST_CALL_STAKE_THRESHOLDS","GAS_COST_CALL_STAKE_THRESHOLDS","GAS_COST_CALL_UPDATE","GAS_COST_CALL_UPDATE","Genesis","InvalidArgument","Module","NodeNotAllowed","NotSignedByExtraKey","NotSignedByRAK","ParameterValidationError","Parameters","RegistrationExpired","STAKE_APP_CREATE","STAKE_APP_CREATE","UnknownApp","UnknownEnclave","UnknownInstance","UnknownNode","app","app_id","apps","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","code","code","default","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","dispatch_call","dispatch_query","drop","drop","drop","drop","drop","drop","end_block","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","get_app","get_app","get_instances","get_instances","get_origin_rak","get_origin_rak","get_origin_registration","get_origin_registration","get_registration","get_registration","init","init","init","init","init","init","init_or_migrate","into","into","into","into","into","into","into_abort","into_cbor_value","into_cbor_value","into_cbor_value","is_authorized_origin","is_authorized_origin","is_expensive_query","module_info","module_name","module_name","parameters","policy","resolve_payer","source","state","supported_methods","to_owned","to_owned","to_string","to_string","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","types","validate_basic","vzip","vzip","vzip","vzip","vzip","vzip","id","id","id","App","AppId","Client","Environment","VERSION","account_nonce","borrow","borrow","borrow_mut","borrow_mut","client","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","consensus_trust_root","deref","deref","deref_mut","deref_mut","drop","drop","estimate_gas","from","from","gas_price","id","init","init","into","into","latest_round","multi_sign_and_submit_tx","multi_sign_and_submit_tx_opts","new_transaction","on_runtime_block","prelude","query","run","sign_and_submit_tx","signer","start","store_for_round","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","with_store_for_round","App","AppId","Arc","Environment","Err","Ok","Result","TrustRoot","Version","allocator","arbitrary","arbitrary","arbitrary","arbitrary_take_rest","as_fd","as_ptr","as_ptr","as_raw_fd","as_ref","assume_init","assume_init","async_trait","borrow","borrow","borrow","borrow_mut","borrow_mut","cause","chain_context","check_batch","churp_bivariate_share","churp_share_distribution_point","churp_share_reduction_point","churp_state_key","churp_verification_matrix","clear_cache","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","cmp","compare","consensus_events_at","consensus_state_at","decrement_strong_count","decrement_strong_count_in","default","default","default","default","default","deref","deref","deref","deref_mut","deref_mut","description","downcast","downcast_unchecked","downgrade","drop","drop","drop","enabled","encode_hex","encode_hex_upper","eq","eq","equivalent","equivalent","events_at","execute_batch","finalize","flush","flush","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_bytes","from_iter","from_ptr","from_raw","from_raw_in","ge","get","get_mut","get_mut_unchecked","get_or_create_ephemeral_keys","get_or_create_keys","get_public_ephemeral_key","get_public_key","gt","hash","hash","height","increment_strong_count","increment_strong_count_in","init","init","insert","into","into","into_cbor_value","into_inner","into_ptr","into_raw","into_raw_with_allocator","is_enabled","is_read_vectored","is_write_vectored","latest_height","latest_state","le","load","load","log","log","lt","major","make_mut","minor","ne","new","new_cyclic","new_from_seed","new_in","new_uninit","new_uninit_in","new_uninit_slice","new_uninit_slice_in","new_zeroed","new_zeroed_in","new_zeroed_slice","new_zeroed_slice_in","partial_cmp","patch","pin","pin_in","provide","ptr_eq","public_key","query","random","read","read_buf","read_to_end","read_to_string","read_vectored","replicate_ephemeral_secret","replicate_master_secret","runtime_id","runtime_id","runtime_signing_key","schedule_and_execute_batch","sdk","seek","serialize","serialize","set_abort_batch_flag","sign","sign_raw","size_hint","size_hint","size_hint","source","spawn_local_obj","spawn_obj","state_at","status","status_local","strong_count","sync","to_bytes","to_owned","to_owned","to_string","try_default","try_from","try_from","try_from","try_from_cbor_value","try_into","try_into","try_new","try_new_in","try_new_uninit","try_new_uninit_in","try_new_zeroed","try_new_zeroed_in","try_pin","try_pin_in","try_unwrap","type_id","type_id","unverified_state","unwrap_or_clone","verify","verify_for_query","vzip","vzip","weak_count","write","write","write_vectored","APP_ID_BECH32_HRP","AppId","Error","MalformedIdentifier","SIZE","as_ref","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","clone_to_uninit","cmp","compare","default","deref","deref","deref_mut","deref_mut","drop","drop","encode_hex","encode_hex_upper","eq","equivalent","fmt","fmt","fmt","fmt","fmt","from","from","from","from_bech32","from_bytes","from_creator_nonce","from_creator_round_index","from_global_name","hash","init","init","into","into","into_bytes","into_cbor_value","partial_cmp","serialize","to_bech32","to_owned","to_string","to_string","try_default","try_from","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","AllowedEndorsement","Any","AppAuthPolicy","ComputeRole","EndorsingNodePays","Entity","FeePolicy","InstancePays","Node","ObserverRole","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","enclaves","endorsements","eq","eq","eq","equivalent","equivalent","equivalent","fees","fmt","fmt","fmt","from","from","from","init","init","init","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","max_expiration","quotes","to_owned","to_owned","to_owned","try_default","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","KeyEndorsementInfo","borrow","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref_mut","drop","eq","equivalent","expire_registrations","fmt","for_extra_key","for_rak","from","get_app","get_endorser","get_registration","get_registrations_for_app","init","into","into_cbor_value","node_id","rak","remove_app","remove_registration","set_app","to_owned","try_default","try_from","try_from_cbor_value","try_into","type_id","update_registration","vzip","AppConfig","AppInstanceQuery","AppQuery","Create","CreatorNonce","CreatorRoundIndex","IdentifierScheme","Register","Registration","Remove","StakeThresholds","Update","admin","admin","app","app","app","app_create","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","default","default","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","ect","entity_id","eq","equivalent","expiration","expiration","extra_keys","extra_keys","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","id","id","id","id","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","node_id","policy","policy","policy","rak","rak","rek","scheme","stake","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","Accounts","Core","FeeProxy","Modules","PREFETCH_LIMIT","Runtime","SCHEDULE_CONTROL","STATE_VERSION","VERSION","consensus_trust_root","genesis_state","is_allowed_interactive_call","is_allowed_private_km_query","is_allowed_query","migrate","migrate_state","start","trusted_signers","Error","FailedToFetchBatch","ScheduleControlHost","borrow","borrow_mut","code","deref","deref_mut","drop","fetch_tx_batch","fmt","fmt","from","init","into","into_abort","module_name","to_string","try_from","try_into","type_id","vzip","SenderMeta","address","borrow","borrow_mut","clone","clone_into","clone_to_uninit","default","deref","deref_mut","drop","eq","equivalent","fmt","from","id","init","into","state_nonce","to_owned","try_from","try_into","tx_nonce","type_id","vzip","Check","Commit","CurrentState","Environment","Execute","Mode","Options","PreSchedule","Rollback","Simulate","State","StateValue","TransactionResult","TransactionWithMeta","block_value","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","commit","commit_transaction","data","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","emit_event","emit_event_raw","emit_message","emit_unconditional_event","emitted_messages_count","emitted_messages_local_count","emitted_messages_max","enter","enter_opts","env","env_origin","eq","equivalent","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","get","get_mut","has_pending_store_updates","hash","hide_block_values","index","init","init","init","init","init","init","init","init","internal","internal","into","into","into","into","into","into","into","into","is_check_only","is_execute","is_internal","is_pre_schedule","is_read_only","is_simulation","is_transaction","level","local_value","mode","mode","new","open","or_default","pending_store_update_byte_size","rng","rng_local_entropy","rollback","rollback_transaction","set","size","start_transaction","store","take","take_all_events","take_events","take_messages","take_unconditional_events","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx","tx_auth_info","tx_call_format","tx_caller_address","tx_caller_public_key","tx_index","tx_size","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","with","with_env","with_env_origin","with_internal","with_mode","with_rng_local_entropy","with_store","with_transaction","with_transaction_opts","with_tx","ConfidentialStore","ConfidentialStoreError","HashedStore","HostStore","Inner","MKVSStore","NestedStore","OverlayStore","Prefix","PrefixStore","Store","TypedStore","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","cmp","commit","commit","commit","compare","confidential","default","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","encode_hex","encode_hex_upper","eq","equivalent","fmt","from","from","from","from","from","from","from","from","get","get","get","get","get","get","get","has_pending_updates","has_pending_updates","has_pending_updates","init","init","init","init","init","init","init","insert","insert","insert","insert","insert","insert","insert","into","into","into","into","into","into","into","into_cbor_value","iter","iter","iter","iter","iter","iter","iter","new","new","new","new","new","new","new_for_round","partial_cmp","pending_update_byte_size","pending_update_byte_size","pending_update_byte_size","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","prefetch_prefixes","remove","remove","remove","remove","remove","remove","remove","rollback","rollback","rollback","to_owned","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","vzip","vzip","ConfidentialStore","CorruptKey","CorruptValue","DecryptionFailure","Error","KEY_SIZE","borrow","borrow","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","drop","fmt","fmt","from","from","get","init","init","insert","into","into","iter","new_with_key","prefetch_prefixes","remove","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","zeroize","AllowAllValidator","SubcallInfo","SubcallResult","Validator","body","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","call","call_result","caller","clone","clone_into","clone_to_uninit","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","fmt","fmt","from","from","from","gas_used","get_current_subcall_depth","init","init","init","into","into","into","max_depth","max_gas","method","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","validate","validate","vzip","vzip","vzip","keymanager","keys","mock","ActiveDeploymentNotFound","EphemeralSecretChecksumMismatch","EphemeralSecretNotFound","EphemeralSecretNotPublished","EphemeralSecretNotReplicated","GenerationFromFuture","HeightNotFresh","InsufficientKeyShares","InsufficientSignatures","InvalidCiphertext","InvalidEpoch","InvalidGeneration","InvalidSignature","KeyManagerError","KeyPair","KeyPairId","MasterSecretChecksumMismatch","MasterSecretNotFound","MasterSecretNotPublished","MasterSecretNotReplicated","MockKeyManagerClient","NotAuthenticated","NotAuthorized","NotInitialized","Other","PolicyChanged","PolicyInvalidRuntime","PolicyRequired","PolicyRollback","REKNotPublished","RSKMissing","RuntimeMismatch","SignedPublicKey","StateCorrupted","StateError","StateKey","StatusNotFound","StorageCorrupted","TrustedSigners","VerificationError","as_ref","as_ref","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","box_clone","checksum","checksum","clear_cache","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","compare","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","encode_hex","encode_hex","encode_hex_upper","encode_hex_upper","eq","eq","equivalent","equivalent","expiration","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from_public_key","from_str","generate_mock","get_or_create_ephemeral_keys","get_or_create_keys","get_public_ephemeral_key","get_public_key","hash","init","init","init","init","init","init","init","input_keypair","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","key","len","new","new","new","partial_cmp","runtime_id","runtime_signing_key","signature","signers","source","state_key","threshold","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","verify","verify","vzip","vzip","vzip","vzip","vzip","vzip","vzip","zeroize","zeroize","alice","bob","charlie","dave","erin","frank","grace","address","pk","pk_ed25519","sigspec","address","pk","pk_ed25519","sigspec","address","pk","pk_ed25519","sigspec","address","pk","pk_secp256k1","sigspec","address","pk","pk_secp256k1","sigspec","address","pk","pk_sr25519","sigspec","address","pk","pk_sr25519","sigspec","CallOptions","Config","EmptyRuntime","Mock","Signer","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call","call_opts","clone","clone_into","clone_to_uninit","consensus_state","create_ctx","create_ctx_for_runtime","default","default","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","empty_store","encrypted","epoch","fee","fmt","from","from","from","from","from","genesis_state","history","host_info","init","init","init","init","init","into","into","into","into","into","max_messages","new","query","runtime_header","runtime_round_results","sigspec","to_owned","transaction","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip","with_local_config","address","callformat","message","token","transaction","ADDRESS_BECH32_HRP","ADDRESS_RUNTIME_V0_CONTEXT","ADDRESS_RUNTIME_V0_VERSION","ADDRESS_V0_ED25519_CONTEXT","ADDRESS_V0_MODULE_CONTEXT","ADDRESS_V0_MULTISIG_CONTEXT","ADDRESS_V0_SECP256K1ETH_CONTEXT","ADDRESS_V0_SR25519_CONTEXT","ADDRESS_V0_VERSION","Address","Ed25519","Error","MalformedAddress","SIZE","Secp256k1Eth","SignatureAddressSpec","Sr25519","as_ref","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","compare","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","encode_hex","encode_hex_upper","eq","eq","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from_bech32","from_bytes","from_consensus_pk","from_eth","from_module","from_module_raw","from_multisig","from_runtime_id","from_sigspec","hash","init","init","init","into","into","into","into_bytes","into_cbor_value","into_cbor_value","new","partial_cmp","public_key","serialize","to_bech32","to_owned","to_owned","to_string","to_string","try_default","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_pk","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE","CallEnvelopeX25519DeoxysII","ResultEnvelopeX25519DeoxysII","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","data","data","default","default","deref","deref","deref_mut","deref_mut","drop","drop","epoch","fmt","fmt","from","from","init","init","into","into","into_cbor_value","into_cbor_value","nonce","nonce","pk","to_owned","to_owned","try_default","try_default","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","MessageEvent","MessageEventHookInvocation","MessageResult","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","code","context","deref","deref","deref_mut","deref_mut","drop","drop","event","fmt","fmt","from","from","hook_name","index","init","init","into","into","into_cbor_value","module","new","payload","result","to_owned","to_owned","try_from","try_from","try_from_cbor_value","try_into","try_into","type_id","type_id","vzip","vzip","BaseUnits","Denomination","Error","MAX_LENGTH","NATIVE","NameTooLong","amount","as_ref","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","cmp","cmp","compare","compare","default","default","denomination","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","encode_hex","encode_hex_upper","eq","eq","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from_str","hash","init","init","init","into","into","into","into_cbor_value","into_cbor_value","into_vec","is_native","new","partial_cmp","partial_cmp","to_owned","to_owned","to_string","to_string","to_string","try_default","try_default","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","type_id","type_id","type_id","vzip","vzip","vzip","length","Address","AddressSpec","AuthInfo","AuthProof","Call","CallFormat","CallResult","CallerAddress","EncryptedX25519DeoxysII","Error","EthAddress","Failed","FailedToSign","Fee","FeeProxy","Internal","Invalid","LATEST_TRANSACTION_VERSION","MalformedTransaction","Module","Multisig","Multisig","Ok","Plain","SIGNATURE_CONTEXT_BASE","Signature","Signature","SignerInfo","SignerNotFound","Transaction","TransactionSigner","Unknown","UnsupportedVersion","UnverifiedTransaction","address","address","address_spec","amount","append_auth_multisig","append_auth_signature","append_sign","append_signer_info","auth_info","batch","body","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call","caller_address","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","consensus_messages","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","eq","equivalent","fee","fee_amount","fee_gas","finalize","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","format","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","gas","gas_price","id","init","init","init","init","init","init","init","init","init","init","init","init","init","init","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","is_success","method","module","new","new","new_multisig","new_sigspec","nonce","not_after","not_before","ok","prepare_for_signing","proxy","public_key","read_only","set_fee_amount","set_fee_gas","set_fee_proxy","signer_info","source","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","validate_basic","verify","version","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","zeroized","code","message","module"],"q":[[0,"oasis_runtime_sdk"],[64,"oasis_runtime_sdk::callformat"],[86,"oasis_runtime_sdk::callformat::Metadata"],[89,"oasis_runtime_sdk::config"],[107,"oasis_runtime_sdk::context"],[148,"oasis_runtime_sdk::crypto"],[151,"oasis_runtime_sdk::crypto::multisig"],[220,"oasis_runtime_sdk::crypto::random"],[263,"oasis_runtime_sdk::crypto::signature"],[439,"oasis_runtime_sdk::crypto::signature::context"],[441,"oasis_runtime_sdk::crypto::signature::ed25519"],[496,"oasis_runtime_sdk::crypto::signature::secp256k1"],[551,"oasis_runtime_sdk::crypto::signature::secp256r1"],[604,"oasis_runtime_sdk::crypto::signature::secp384r1"],[657,"oasis_runtime_sdk::crypto::signature::sr25519"],[687,"oasis_runtime_sdk::dispatcher"],[780,"oasis_runtime_sdk::enclave_rpc"],[806,"oasis_runtime_sdk::error"],[855,"oasis_runtime_sdk::event"],[884,"oasis_runtime_sdk::history"],[908,"oasis_runtime_sdk::keymanager"],[992,"oasis_runtime_sdk::module"],[1091,"oasis_runtime_sdk::module::CallResult"],[1094,"oasis_runtime_sdk::modules"],[1101,"oasis_runtime_sdk::modules::access"],[1141,"oasis_runtime_sdk::modules::access::types"],[1175,"oasis_runtime_sdk::modules::accounts"],[1385,"oasis_runtime_sdk::modules::accounts::Event"],[1392,"oasis_runtime_sdk::modules::accounts::fee"],[1454,"oasis_runtime_sdk::modules::accounts::state"],[1457,"oasis_runtime_sdk::modules::accounts::types"],[1642,"oasis_runtime_sdk::modules::consensus"],[1830,"oasis_runtime_sdk::modules::consensus::types"],[1875,"oasis_runtime_sdk::modules::consensus_accounts"],[2039,"oasis_runtime_sdk::modules::consensus_accounts::Event"],[2064,"oasis_runtime_sdk::modules::consensus_accounts::state"],[2096,"oasis_runtime_sdk::modules::consensus_accounts::types"],[2616,"oasis_runtime_sdk::modules::core"],[2924,"oasis_runtime_sdk::modules::core::Event"],[2925,"oasis_runtime_sdk::modules::core::state"],[2929,"oasis_runtime_sdk::modules::core::types"],[3138,"oasis_runtime_sdk::modules::rewards"],[3247,"oasis_runtime_sdk::modules::rewards::state"],[3248,"oasis_runtime_sdk::modules::rewards::types"],[3367,"oasis_runtime_sdk::modules::rofl"],[3545,"oasis_runtime_sdk::modules::rofl::Event"],[3548,"oasis_runtime_sdk::modules::rofl::app"],[3604,"oasis_runtime_sdk::modules::rofl::app::prelude"],[3829,"oasis_runtime_sdk::modules::rofl::app_id"],[3893,"oasis_runtime_sdk::modules::rofl::policy"],[3974,"oasis_runtime_sdk::modules::rofl::state"],[4011,"oasis_runtime_sdk::modules::rofl::types"],[4258,"oasis_runtime_sdk::runtime"],[4276,"oasis_runtime_sdk::schedule_control"],[4298,"oasis_runtime_sdk::sender"],[4323,"oasis_runtime_sdk::state"],[4531,"oasis_runtime_sdk::storage"],[4701,"oasis_runtime_sdk::storage::confidential"],[4741,"oasis_runtime_sdk::subcall"],[4798,"oasis_runtime_sdk::testing"],[4801,"oasis_runtime_sdk::testing::keymanager"],[5030,"oasis_runtime_sdk::testing::keys"],[5037,"oasis_runtime_sdk::testing::keys::alice"],[5041,"oasis_runtime_sdk::testing::keys::bob"],[5045,"oasis_runtime_sdk::testing::keys::charlie"],[5049,"oasis_runtime_sdk::testing::keys::dave"],[5053,"oasis_runtime_sdk::testing::keys::erin"],[5057,"oasis_runtime_sdk::testing::keys::frank"],[5061,"oasis_runtime_sdk::testing::keys::grace"],[5065,"oasis_runtime_sdk::testing::mock"],[5157,"oasis_runtime_sdk::types"],[5162,"oasis_runtime_sdk::types::address"],[5266,"oasis_runtime_sdk::types::callformat"],[5317,"oasis_runtime_sdk::types::message"],[5365,"oasis_runtime_sdk::types::token"],[5453,"oasis_runtime_sdk::types::token::Error"],[5454,"oasis_runtime_sdk::types::transaction"],[5806,"oasis_runtime_sdk::types::transaction::CallResult"],[5809,"oasis_core_runtime::common::version"],[5810,"core::fmt"],[5811,"core::result"],[5812,"core::hash"],[5813,"oasis_cbor_value::values"],[5814,"oasis_cbor"],[5815,"core::any"],[5816,"core::option"],[5817,"oasis_core_runtime::common::crypto::x25519"],[5818,"oasis_core_runtime::consensus::beacon"],[5819,"oasis_core_keymanager::crypto::types"],[5820,"oasis_core_runtime::consensus::state"],[5821,"slog"],[5822,"oasis_core_runtime::protocol"],[5823,"oasis_cbor::decode"],[5824,"alloc::boxed"],[5825,"oasis_core_runtime::consensus::roothash::block"],[5826,"oasis_core_runtime::consensus::roothash"],[5827,"oasis_core_runtime::common::namespace"],[5828,"alloc::vec"],[5829,"alloc::string"],[5830,"oasis_core_runtime::common::crypto::hash"],[5831,"rand_core"],[5832,"core::marker"],[5833,"num_bigint_dig::bigint"],[5834,"num_bigint_dig::biguint"],[5835,"rand_core::error"],[5836,"core::cmp"],[5837,"core::iter::traits::collect"],[5838,"oasis_core_runtime::common::crypto::signature"],[5839,"typenum::generated::consts"],[5840,"digest::digest"],[5841,"digest"],[5842,"crypto_common"],[5843,"oasis_core_runtime::transaction::context"],[5844,"oasis_core_runtime::transaction::types"],[5845,"oasis_core_runtime::types"],[5846,"oasis_core_runtime::consensus::roothash::message"],[5847,"oasis_core_runtime::transaction::dispatcher"],[5848,"oasis_core_runtime::transaction::tags"],[5849,"oasis_core_keymanager::api::errors"],[5850,"oasis_core_runtime::storage::mkvs"],[5851,"alloc::collections::btree::set"],[5852,"oasis_core_runtime::enclave_rpc::dispatcher"],[5853,"core::sync::atomic"],[5854,"alloc::sync"],[5855,"core::error"],[5856,"anyhow"],[5857,"oasis_core_runtime::consensus::verifier"],[5858,"oasis_runtime_sdk::modules::rofl::error"],[5859,"tokio::runtime::task::error"],[5860,"oasis_core_runtime::enclave_rpc::demux"],[5861,"oasis_core_runtime::consensus"],[5862,"oasis_cbor::encode"],[5863,"core::ops::function"],[5864,"alloc::collections::btree::map"],[5865,"core::convert"],[5866,"oasis_core_runtime::consensus::staking"],[5867,"core::iter::traits::iterator"],[5868,"oasis_runtime_sdk::modules::rofl::event"],[5869,"oasis_runtime_sdk::modules::rofl::app::client"],[5870,"oasis_runtime_sdk::modules::rofl::app::env"],[5871,"core::future::future"],[5872,"core::pin"],[5873,"oasis_runtime_sdk::storage::host"],[5874,"core::alloc"],[5875,"arbitrary::unstructured"],[5876,"arbitrary::error"],[5877,"arbitrary"],[5878,"std::os::fd::owned"],[5879,"std::os::fd::raw"],[5880,"core::mem::maybe_uninit"],[5881,"oasis_core_keymanager::client::interface"],[5882,"core::clone"],[5883,"core::ffi::c_str"],[5884,"core::default"],[5885,"log"],[5886,"std::fs"],[5887,"std::io::error"],[5888,"std::ffi::os_str"],[5889,"alloc::borrow"],[5890,"std::path"],[5891,"alloc::ffi::c_str"],[5892,"oasis_core_runtime::storage"],[5893,"arc_swap::access"],[5894,"core::io::borrowed_buf"],[5895,"std::io"],[5896,"futures_task::future_obj"],[5897,"futures_task::spawn"],[5898,"der::error"],[5899,"slog::key::static_"],[5900,"oasis_core_keymanager::policy::signers"],[5901,"oasis_runtime_sdk::storage::mkvs"],[5902,"oasis_runtime_sdk::storage::overlay"],[5903,"oasis_runtime_sdk::storage::hashed"],[5904,"oasis_runtime_sdk::storage::prefix"],[5905,"oasis_runtime_sdk::storage::typed"],[5906,"oasis_core_runtime::storage::mkvs::tree::node"],[5907,"rustc_hex"],[5908,"oasis_core_runtime::storage::mkvs::tree"],[5909,"oasis_core_runtime::storage::mkvs::tree::overlay"],[5910,"oasis_runtime_sdk_macros"],[5911,"oasis_runtime_sdk::modules::rofl::config"],[5912,"async_trait"],[5913,"deoxysii"]],"i":[0,0,0,0,0,0,0,3,3,0,0,3,3,3,3,0,0,0,0,3,3,3,0,3,0,3,3,0,0,3,3,3,0,3,0,3,3,3,3,0,3,0,3,0,0,3,3,0,0,0,0,0,0,0,0,3,3,3,3,3,3,0,0,3,17,17,0,17,17,0,0,17,17,17,0,0,0,17,17,0,17,17,17,17,17,17,382,382,382,0,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,0,21,0,32,32,21,32,21,32,32,32,32,21,32,32,21,32,21,32,21,32,32,32,21,21,21,32,21,21,32,32,21,32,21,21,32,21,32,32,32,32,0,0,0,0,0,50,50,50,0,0,0,45,50,51,45,50,51,45,51,45,51,45,51,45,45,50,51,45,50,51,45,50,51,45,50,50,51,45,50,51,45,50,51,45,50,51,45,51,45,51,45,45,51,45,50,45,50,51,45,51,45,50,51,45,50,51,45,45,50,51,45,51,0,0,53,53,53,56,53,56,53,56,53,56,53,56,53,56,56,53,53,56,56,56,56,56,56,56,53,56,53,56,53,53,56,56,56,53,56,53,56,53,56,53,56,71,47,64,64,64,0,69,69,69,69,69,0,0,71,47,64,64,64,71,47,64,71,47,64,0,0,0,69,64,47,69,47,64,47,49,71,64,47,69,49,71,64,47,69,49,64,47,49,64,47,49,64,64,47,49,64,47,64,47,0,49,71,64,47,69,49,71,64,47,69,49,71,64,47,69,49,0,47,49,47,49,64,47,47,49,64,47,49,64,47,69,69,49,71,64,47,47,69,49,49,70,71,47,64,47,71,64,47,69,49,71,64,47,69,49,64,47,49,64,64,64,64,64,47,70,71,71,64,47,70,71,70,0,0,0,70,71,71,70,71,0,70,71,64,47,49,69,49,71,64,64,47,69,49,64,47,49,71,64,47,69,49,71,64,47,69,49,47,47,47,47,71,64,47,69,49,0,0,0,0,72,73,72,73,72,72,72,72,72,72,73,72,73,72,73,72,72,72,72,73,72,72,72,72,73,72,72,73,72,73,72,72,73,72,73,73,73,73,73,73,72,73,72,72,73,72,73,72,72,72,72,73,72,0,0,77,78,77,78,77,77,77,77,77,77,78,77,78,77,78,77,77,77,77,78,77,77,78,77,77,78,77,78,77,77,78,77,78,78,78,78,78,78,77,77,77,78,77,77,78,77,78,77,77,77,77,78,77,0,0,81,82,81,82,81,81,81,81,81,81,82,81,82,81,82,81,81,81,81,82,81,81,82,81,81,82,81,82,81,81,82,81,82,82,82,82,82,82,81,82,81,81,82,81,82,81,81,81,81,82,81,0,0,85,86,85,86,85,85,85,85,85,85,86,85,86,85,86,85,85,85,85,86,85,85,86,85,85,86,85,86,85,85,86,85,86,86,86,86,86,86,85,86,85,85,86,85,86,85,85,85,85,86,85,0,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,97,97,0,0,0,0,97,97,97,89,97,99,98,89,97,99,98,99,89,89,97,89,98,89,97,99,98,89,97,99,98,89,89,89,89,89,97,99,98,89,89,89,97,97,99,89,97,97,99,99,98,89,97,99,98,89,97,99,98,97,98,97,89,99,89,89,99,89,99,89,98,97,99,97,89,97,99,98,89,97,99,98,98,98,98,89,97,99,98,89,97,99,98,0,0,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,111,0,0,93,93,93,93,93,112,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93,112,112,93,93,93,112,93,93,93,93,93,93,93,93,93,0,0,0,0,127,127,127,127,127,128,127,127,127,0,127,127,127,127,128,129,130,127,128,127,127,127,127,127,127,0,124,124,0,124,124,124,36,36,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,104,104,104,104,104,104,104,104,104,104,104,104,104,0,0,0,0,0,0,104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,0,104,104,0,104,104,0,104,133,133,38,133,136,137,38,133,133,133,133,133,133,133,137,133,0,38,133,38,133,38,133,38,133,133,136,133,137,38,133,38,133,137,329,136,329,133,133,133,133,133,22,0,0,0,140,0,383,152,383,22,0,384,141,0,0,0,0,0,383,22,0,383,152,140,0,141,383,385,385,385,385,385,385,385,386,141,22,140,141,22,140,387,140,140,140,385,141,22,140,141,22,140,0,388,388,0,388,141,22,140,386,22,140,141,22,140,141,22,140,384,141,22,140,388,388,388,22,389,141,141,383,388,390,383,388,140,141,22,140,141,22,140,141,22,140,152,141,22,140,391,391,391,0,0,0,0,0,0,0,0,0,392,0,123,393,393,123,393,123,123,393,123,393,123,393,393,123,123,123,393,123,393,123,393,393,123,123,393,123,123,393,123,393,123,393,123,0,393,123,0,153,0,154,0,0,153,153,154,153,154,154,153,154,153,154,153,154,153,154,153,154,153,154,154,153,154,153,154,153,154,153,154,154,0,0,0,160,114,161,0,0,114,0,0,114,114,160,0,114,0,0,160,159,394,394,394,159,394,114,160,157,158,161,159,394,114,160,157,158,161,159,395,394,395,394,394,395,394,157,158,159,157,158,159,157,158,159,114,160,158,157,158,159,158,394,114,160,157,158,161,159,394,114,160,157,158,161,159,394,394,394,114,160,157,158,161,159,394,395,0,114,114,160,157,158,161,161,159,394,114,114,160,157,158,161,159,158,395,394,395,394,395,394,395,394,395,394,395,394,395,394,394,394,114,160,157,158,161,159,394,394,114,160,157,158,161,159,114,160,157,158,159,394,395,394,394,114,160,159,394,395,394,395,394,395,394,395,394,114,0,394,395,394,157,158,159,114,161,159,395,394,395,394,158,157,158,159,394,114,160,157,158,161,159,157,158,159,394,114,160,157,158,161,159,157,394,114,160,157,158,161,159,0,395,394,158,394,114,160,157,158,161,159,396,397,398,396,397,398,396,0,0,0,166,168,167,166,168,167,166,167,166,167,166,167,166,167,167,167,166,166,168,167,166,168,167,166,168,167,166,167,166,168,167,166,168,167,166,168,167,166,167,166,168,167,167,168,167,166,168,167,166,168,167,166,167,168,167,166,168,167,166,0,0,0,0,0,0,0,0,0,0,0,171,173,169,164,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,165,169,170,171,172,173,164,174,165,172,174,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,170,169,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,169,170,171,172,173,164,174,165,0,116,116,116,0,0,0,0,116,116,116,116,0,0,0,182,116,182,399,400,399,400,399,400,400,176,177,182,179,178,116,400,176,177,182,179,178,116,176,177,178,176,177,178,176,177,178,179,116,399,400,177,177,176,177,178,399,400,400,176,177,182,179,178,116,400,176,177,182,179,178,116,400,400,400,176,177,182,179,178,116,399,400,176,177,176,177,399,400,176,177,182,182,179,178,116,116,400,176,177,182,179,178,116,116,116,116,177,399,400,400,400,176,177,182,179,178,116,400,400,176,177,182,179,178,116,116,176,177,179,178,177,400,179,116,178,399,400,176,399,400,116,400,176,177,178,182,116,399,400,176,177,178,400,176,177,182,179,178,116,176,177,178,400,176,177,182,179,178,116,400,176,177,182,179,178,116,0,177,400,176,177,182,179,178,116,399,400,184,0,0,184,184,185,184,185,184,185,184,185,184,185,184,185,184,185,184,185,184,185,184,185,184,185,184,185,184,185,185,185,185,184,185,184,185,184,185,184,185,184,185,184,185,0,0,0,115,115,189,189,0,0,115,0,0,115,115,115,0,0,189,189,189,401,115,186,187,189,188,401,115,186,187,189,188,401,186,187,188,186,187,188,186,187,188,115,189,186,187,188,402,401,402,401,401,115,186,187,189,188,401,115,186,187,189,188,187,187,187,187,401,401,401,401,115,186,187,189,188,401,115,115,186,187,189,188,401,115,115,115,186,187,189,188,187,401,401,115,186,187,189,188,401,401,115,186,187,189,188,115,186,187,189,188,401,115,189,188,401,115,0,186,401,186,186,187,188,115,186,187,188,401,115,186,187,189,188,186,187,188,401,115,186,187,189,188,186,186,186,186,401,115,186,187,189,188,0,402,401,401,115,186,187,189,188,402,401,403,404,405,406,407,403,404,405,407,403,404,405,407,406,403,404,405,407,407,406,403,404,405,407,406,0,0,0,0,0,0,0,192,192,192,192,192,192,192,192,0,0,0,0,0,192,192,0,0,0,0,192,192,192,192,192,192,0,0,0,0,0,0,0,0,0,194,0,0,0,0,0,194,0,0,0,0,194,194,0,0,0,201,202,207,208,196,197,198,195,207,208,209,206,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,195,193,211,211,195,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,211,199,203,204,193,208,209,210,200,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,194,200,211,207,208,209,210,198,199,195,190,209,210,199,195,190,191,193,210,196,197,198,203,205,191,207,209,210,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,196,197,198,199,194,200,195,201,202,203,204,205,206,190,191,193,207,208,209,210,211,408,0,20,20,0,409,408,408,0,408,408,0,0,20,20,20,20,408,408,0,20,20,219,0,20,20,20,20,220,20,220,20,20,0,408,0,20,20,20,0,20,20,20,20,20,0,0,20,20,20,0,410,410,410,213,213,410,410,410,410,20,218,219,213,214,220,215,216,217,410,20,218,219,213,214,220,215,216,217,213,213,214,215,216,217,213,214,215,216,217,213,214,215,216,217,20,218,219,213,214,215,216,217,410,20,218,219,213,214,220,215,216,217,410,20,218,219,213,214,220,215,216,217,410,410,410,20,218,219,213,214,220,215,216,217,215,214,410,219,219,409,410,217,20,20,218,218,219,213,214,220,220,215,216,217,410,20,20,20,218,219,213,214,220,215,216,217,215,409,410,410,410,20,218,219,213,214,220,215,216,217,410,410,20,218,219,213,214,220,215,216,217,20,219,213,214,215,216,217,410,218,410,409,410,215,217,215,215,215,409,410,215,217,214,410,20,218,219,20,216,410,409,410,409,410,409,410,409,410,20,0,213,410,409,410,409,410,214,213,214,215,216,217,20,218,220,213,214,215,216,217,410,20,218,218,219,213,214,220,215,216,217,213,214,215,216,217,410,20,218,219,213,214,220,215,216,217,213,410,20,218,219,213,214,220,215,216,217,0,409,410,409,410,409,410,409,410,215,410,20,218,219,213,214,220,215,216,217,411,0,0,0,0,225,0,0,0,0,225,0,0,0,0,225,0,0,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,222,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,146,222,224,225,225,150,147,226,227,228,146,224,227,228,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,224,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,150,147,226,150,147,222,224,228,226,226,146,222,224,225,150,147,226,227,228,146,224,227,228,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,146,222,224,225,150,147,226,227,228,222,227,146,222,224,225,150,147,226,227,228,147,146,146,222,224,225,150,147,226,227,228,0,0,0,126,231,231,0,0,0,412,126,229,231,230,412,126,229,231,230,229,230,229,230,229,230,126,229,230,412,126,229,231,230,412,126,229,231,230,412,412,126,229,231,230,412,126,126,229,231,231,230,412,126,229,231,231,230,412,126,229,231,230,412,412,126,229,231,230,126,229,230,412,126,230,229,229,229,231,0,229,230,126,231,229,230,412,126,229,231,230,229,230,412,126,229,231,230,412,126,229,231,230,0,229,412,126,229,231,230,0,0,235,235,0,0,0,0,232,233,233,234,232,235,236,233,234,232,235,236,233,234,235,236,233,234,235,236,233,234,235,236,233,234,235,236,233,234,232,235,236,233,234,232,235,236,233,234,232,235,236,235,235,233,234,232,232,235,236,236,234,235,233,234,232,235,236,235,233,234,232,235,236,233,234,232,235,236,233,234,235,236,236,234,233,234,235,236,232,233,234,235,236,233,234,232,235,236,233,234,235,236,233,234,232,235,236,233,234,232,235,236,233,234,235,233,234,232,235,236,0,0,119,119,240,240,240,0,119,0,0,119,119,413,413,413,413,413,413,413,413,413,413,413,413,413,413,413,413,0,119,0,119,119,119,0,0,119,413,413,119,119,119,119,0,0,239,414,119,240,238,241,239,414,119,240,238,241,239,238,239,238,239,238,239,119,240,238,239,414,119,240,238,241,239,414,119,240,238,241,239,414,414,414,119,240,238,241,239,414,119,119,240,238,241,241,239,414,119,119,119,240,238,241,239,415,414,415,414,415,414,415,414,415,414,414,119,240,238,241,239,414,414,119,240,238,241,239,119,240,238,239,415,414,414,414,119,240,239,0,414,119,0,414,238,239,119,241,238,239,414,119,240,238,241,239,238,239,414,119,240,238,241,239,414,119,240,238,241,239,0,238,414,119,240,238,241,239,416,417,418,0,0,0,0,247,245,245,248,245,248,248,245,248,245,248,245,248,247,245,248,245,248,245,248,245,245,248,245,247,245,248,245,248,245,245,245,247,247,0,245,247,245,248,247,245,245,248,245,248,245,248,245,248,245,248,245,0,0,0,0,246,246,0,0,0,109,109,109,109,109,109,109,109,109,109,109,109,0,109,109,249,109,249,109,249,109,109,109,109,109,109,109,109,249,109,249,109,249,109,109,109,109,109,109,109,109,109,109,249,109,109,249,109,249,109,109,109,109,109,109,249,109,109,109,109,249,109,249,109,109,109,109,109,109,109,109,249,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,249,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,249,249,109,109,109,249,109,109,249,249,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,3,109,3,109,109,109,109,109,109,109,109,109,109,109,109,109,109,3,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,249,109,109,0,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,249,109,249,109,109,249,249,109,249,109,109,109,109,109,109,109,109,109,109,249,109,109,109,109,109,249,109,109,109,109,0,0,0,314,242,242,314,242,314,242,242,242,242,242,242,242,242,314,242,314,242,314,242,242,242,242,242,314,314,242,242,242,314,242,242,242,242,242,242,242,242,314,242,314,242,242,242,242,242,242,242,314,242,242,314,242,242,242,314,242,314,242,314,242,0,318,0,318,319,318,0,319,318,318,317,318,319,317,318,319,317,318,319,317,318,319,317,318,319,317,319,317,318,319,317,318,319,317,318,319,317,317,317,318,319,317,318,319,317,317,318,319,317,318,319,317,318,319,317,318,319,317,318,319,317,317,317,318,319,317,317,318,319,317,318,319,317,318,319,317,318,319,317,318,319,0,320,320,320,320,320,320,320,320,320,320,320,0,320,320,320,320,0,0,0,0,320,320,320,320,320,0,0,0,320,320,320,320,320,320,0,320,0,0,0,0,322,322,0,0,0,0,0,0,323,243,325,244,327,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,321,322,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,325,244,244,244,325,244,325,244,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,323,324,243,326,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,244,321,323,243,244,327,244,321,243,321,322,323,324,243,325,244,326,327,328,321,323,324,243,325,244,326,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,321,322,323,324,243,325,244,326,327,328,31,31,31,31,31,0,31,31,31,31,31,31,31,31,31,31,31,31,0,113,0,113,113,113,113,113,113,330,113,113,113,113,113,113,113,113,113,113,113,113,0,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,223,62,338,0,0,62,0,0,62,338,62,0,0,0,0,331,331,338,419,332,62,333,334,335,331,338,419,332,62,333,334,335,62,333,334,335,62,333,334,335,62,62,333,334,335,331,419,334,62,333,335,331,338,419,332,62,333,334,335,331,338,419,332,62,333,334,335,331,338,419,332,62,333,334,335,331,331,331,331,331,331,331,419,419,331,331,62,62,62,62,333,334,335,331,338,338,338,419,332,62,333,334,335,332,332,331,334,331,334,331,338,419,332,62,333,334,335,334,335,331,338,419,332,62,333,334,335,333,333,333,333,333,333,333,331,331,333,335,335,331,332,331,331,335,331,419,332,334,419,331,332,331,331,331,331,62,333,334,335,62,331,338,419,332,62,333,334,335,331,338,419,332,62,333,334,335,335,333,333,333,333,333,333,331,338,419,332,62,333,334,335,331,338,419,332,62,333,334,335,419,419,419,335,335,335,419,419,419,335,0,0,0,0,342,0,0,0,0,0,0,0,105,346,252,343,345,347,348,105,346,252,343,345,347,348,105,105,105,105,105,342,343,345,105,0,105,346,252,343,345,347,348,105,105,346,252,343,345,347,348,105,105,346,252,343,345,347,348,105,105,105,105,105,105,346,252,343,345,347,348,105,105,337,346,252,343,345,347,348,342,343,345,346,252,343,345,347,348,105,337,346,252,343,345,347,348,346,252,343,345,347,348,105,105,337,346,252,343,345,347,348,346,252,343,345,347,348,252,105,342,343,345,337,346,252,343,345,347,337,346,252,343,345,347,348,342,343,345,105,105,346,252,343,345,347,348,105,105,346,252,343,345,347,348,105,346,252,343,345,347,348,105,346,252,343,345,347,348,105,0,353,353,353,0,0,354,353,354,353,354,353,354,353,354,353,353,353,354,353,354,354,353,354,354,353,354,354,354,354,353,354,353,354,353,354,353,354,353,354,0,0,0,0,355,358,355,356,358,355,356,0,356,355,355,355,355,358,355,356,358,355,356,358,355,356,355,356,358,355,356,356,0,358,355,356,358,355,356,355,355,355,355,358,355,356,358,355,356,358,355,356,357,358,358,355,356,0,0,0,104,104,104,104,104,104,104,104,104,104,104,104,104,0,0,0,104,104,104,104,0,104,104,104,104,104,104,104,104,104,104,104,0,104,104,0,104,104,0,104,28,359,104,28,359,136,137,329,360,104,28,359,136,137,329,360,360,136,137,360,28,359,136,137,329,360,28,359,136,137,329,360,28,28,359,136,137,329,360,28,28,28,359,136,137,329,360,104,28,359,136,137,329,360,104,28,359,136,137,329,360,104,28,359,359,136,137,329,360,28,359,28,359,28,137,28,137,137,104,104,28,28,28,137,329,104,104,104,104,28,28,28,28,359,136,137,329,360,136,28,136,360,360,360,360,28,104,28,359,136,137,329,360,136,104,28,359,136,137,329,360,28,359,136,137,329,137,28,136,137,360,28,360,360,137,329,104,136,329,28,359,136,137,329,360,104,28,28,359,136,137,329,104,28,359,136,137,329,360,28,359,136,137,329,104,28,359,136,137,329,360,104,28,359,136,137,329,360,137,329,104,28,359,136,137,329,360,28,359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,420,368,367,365,366,420,368,367,365,366,365,365,366,366,366,367,367,367,367,366,420,368,367,365,366,420,368,367,365,366,420,368,367,365,366,0,366,367,366,366,420,368,367,365,366,368,367,367,420,368,367,365,366,420,368,367,365,366,367,365,365,367,367,365,366,0,420,368,367,365,366,420,368,367,365,366,420,368,367,365,366,420,368,367,365,366,367,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,364,0,371,149,364,0,364,149,364,371,149,364,371,149,364,149,364,149,364,149,149,149,149,149,364,371,149,364,371,149,364,371,149,149,149,364,149,364,149,364,371,371,149,149,149,364,371,149,149,149,149,149,149,149,149,149,149,149,149,364,371,149,364,371,149,149,364,149,149,149,364,149,149,364,149,371,149,149,364,371,149,149,364,149,364,364,371,149,364,371,149,364,371,149,0,0,0,372,373,372,373,372,373,372,373,372,373,372,373,372,373,372,373,372,373,372,373,372,372,373,372,373,372,373,372,373,372,373,372,373,372,372,373,372,373,372,373,372,373,372,373,372,373,372,373,0,0,0,181,145,181,145,181,145,181,145,181,145,212,145,181,145,181,145,181,145,145,181,145,181,145,181,212,181,145,181,145,181,212,181,181,212,181,145,181,145,181,181,145,181,145,181,145,0,0,0,162,162,374,156,162,162,374,156,162,374,156,162,156,162,156,162,156,162,156,162,156,162,156,156,162,374,156,162,374,156,162,374,156,162,162,162,156,162,156,162,162,374,374,156,156,162,374,156,162,162,162,374,156,162,374,156,162,156,162,162,156,162,156,162,156,162,374,156,162,156,162,162,374,156,162,156,162,374,156,162,374,156,162,374,156,421,375,0,0,0,0,0,0,0,339,0,375,23,221,0,0,376,378,0,221,378,378,376,23,339,0,378,376,0,221,0,0,23,221,0,375,376,381,379,96,96,377,96,96,376,16,377,221,378,139,96,339,16,138,379,380,375,376,381,23,377,221,378,139,96,339,16,138,379,380,375,376,381,23,96,376,378,139,96,339,16,138,379,380,375,376,381,23,378,139,96,339,16,138,379,380,375,376,381,23,378,139,96,339,339,16,138,379,380,375,376,381,23,379,378,339,16,138,379,380,23,377,221,378,139,96,339,16,138,379,380,375,376,381,23,377,221,378,139,96,339,16,138,379,380,375,376,381,23,377,221,378,139,96,339,16,138,379,380,375,376,381,23,339,339,138,96,96,377,221,221,378,139,96,339,16,138,379,380,375,376,381,23,16,377,221,221,378,139,96,339,16,138,379,380,375,376,381,23,23,379,379,380,377,221,378,139,96,339,16,138,379,380,375,376,381,23,377,221,378,139,96,339,16,138,379,380,375,376,381,23,378,139,96,339,16,138,379,380,375,376,381,23,23,16,380,377,96,381,381,381,138,138,23,96,379,376,16,96,96,96,138,221,378,139,96,339,16,138,379,380,375,376,381,23,221,339,16,138,379,380,377,221,378,139,96,339,16,138,379,380,375,376,381,23,378,139,96,339,16,138,379,380,375,376,381,23,377,221,378,139,96,339,16,138,379,380,375,376,381,23,377,221,378,139,96,339,16,138,379,380,375,376,381,23,96,139,96,377,221,378,139,96,339,16,138,379,380,375,376,381,23,375,422,422,422],"f":"```````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}``{{{b{f}}}f}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}0````{{}f}{j{{b{c}}}{}}{j{{b{dc}}}{}}`{jh}`{{{b{f}}{b{f}}}l}{{{b{c}}{b{e}}}l{}{}}``{{{b{f}}{b{dn}}}{{Ab{hA`}}}}{cc{}}{Adf}`{{{b{f}}{b{dc}}}hAf}`{{}j}{ce{}{}}{fAh}8``````{{AjAjAj}f}`````````{{{b{c}}}e{}{}}{{}{{Ab{fAl}}}}{c{{Ab{e}}}{}{}}{Ah{{Ab{fAl}}}}1{{{b{c}}}An{}}``7```{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{c}}B`j}{{Ab{{Bf{{Bd{B`Bb}}}}Bh}}}Bj}{{{b{c}}B`jl}{{Ab{{Bf{{Bd{B`Bb}}}}Bh}}}Bj}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{c}}BlBb}BnBj}{{{b{c}}BlBbl}BnBj}{{{b{c}}BnC`Cbj}AhBj}{{{b{Bb}}{b{dn}}}Cd}{cc{}}{CfCh}{{}j}{ce{}{}}{c{{Ab{e}}}{}{}}0{{{b{c}}}An{}}2`````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{}Cj}?>=86`5``4435```21{{{b{{Bj{}{{Cl{c}}}}}}}{{Bj{}{{Cl{c}}}}}Cn}{{{b{{D`{c}}}}}{{D`{c}}}Cn}{{{b{{Bj{}{{Cl{c}}}}}}}{{b{Db}}}Cn}{{{b{{D`{c}}}}}{{b{Db}}}Cn}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{{Bj{}{{Cl{c}}}}}}}CfCn}{{{b{{D`{c}}}}}CfCn}{cc{}}{{{b{{Bj{}{{Cl{c}}}}}}{b{Dd}}}DfCn}{{{b{{D`{c}}}}{b{Dd}}}DfCn}{{{b{{Bj{}{{Cl{c}}}}}}}{{b{Dh}}}Cn}{{{b{{D`{c}}}}}{{b{Dh}}}Cn}{{{b{{Bj{}{{Cl{c}}}}}}}{{b{Dj}}}Cn}{{{b{{D`{c}}}}}{{b{Dj}}}Cn}{{}j}{ce{}{}}{{{b{{Bj{}{{Cl{c}}}}}}{b{Dd}}}lCn}{{{b{{Bj{}{{Cl{c}}}}}}}lCn}{{{b{{Bj{}{{Cl{c}}}}}}}{{Bf{{b{Dl}}}}}Cn}{{{b{{D`{c}}}}}{{Bf{{b{Dl}}}}}Cn}{{{b{{Bj{}{{Cl{c}}}}}}{b{Dd}}}{{Bf{e}}}CnDn}{{{b{{Bj{}{{Cl{c}}}}}}}E`Cn}{{{b{{D`{c}}}}}E`Cn}{{{b{Dj}}{Bf{{Eb{Dl}}}}{b{Ed}}{b{Ef}}{b{Db}}{b{Dh}}CfE`}{{D`{c}}}Cn}{{{b{{Bj{}{{Cl{c}}}}}}}{{b{Ed}}}Cn}{{{b{{D`{c}}}}}{{b{Ed}}}Cn}{{{b{{Bj{}{{Cl{c}}}}}}}{{b{Eh}}}Cn}{{{b{{Bj{}{{Cl{c}}}}}}}{{b{Ef}}}Cn}{{{b{{D`{c}}}}}{{b{Ef}}}Cn};{c{{Ab{e}}}{}{}}0{{{b{c}}}An{}}?```````````{{{b{Ej}}{b{El}}}{{Ab{{Bd{{F`{En}}{F`{Fb}}}}Fd}}}}{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{Ff}}}Ff}{{{b{Ej}}}Ej}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0{{}Ej}{j{{b{c}}}{}}00{j{{b{dc}}}{}}00{jh}00{{{b{Fd}}{b{dn}}}Cd}0{{{b{Ff}}{b{dn}}}Cd}{{{b{Ej}}{b{dn}}}Cd}{cc{}}00{{}j}00{ce{}{}}00{FfAh}{EjAh}```{{{b{c}}}e{}{}}0{{{b{c}}}Fh{}}{{}{{Ab{EjAl}}}}{c{{Ab{e}}}{}{}}00{Ah{{Ab{FfAl}}}}{Ah{{Ab{EjAl}}}}222{{{b{c}}}An{}}00{{{b{Ej}}}{{Ab{hFd}}}}:::```{{{b{Fj}}}h}0{{{b{Fj}}Fl}h}{{{b{dc}}}{{b{dFn}}}{}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{dG`}}{b{d{Gd{Gb}}}}}h}{{{b{Fj}}{b{c}}{b{{Gd{Gb}}}}}{{Ab{G`Bh}}}{BjGf}}{cc{}}0{{{b{dc}}j}Gh{}}{{{b{dc}}{b{Gh}}{b{Gh}}}Gh{}}{{{b{dc}}j}Gj{}}{{{b{dc}}{b{Gj}}}Gj{}}{{{b{dc}}{b{Gj}}{b{Gj}}}Gj{}}2{{}j}0{ce{}{}}0{{}Fj}{GlFj}{{{b{dG`}}}E`}{{{b{dG`}}}Ad}{{{b{dG`}}{b{d{Gd{Gb}}}}}{{Ab{hGn}}}}{c{{Ab{e}}}{}{}}000{{{b{c}}}An{}}077```````````````````````````````{{{b{En}}}{{b{{Gd{Gb}}}}}}{{{b{H`}}}Gb}1{{{b{Fb}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}0000{{{b{dc}}}{{b{de}}}{}{}}0000{{{b{H`}}}H`}{{{b{En}}}En}{{{b{Fb}}}Fb}{{{b{c}}{b{de}}}h{}{}}00{{{b{c}}}h{}}000{{{b{H`}}{b{H`}}}Hb}{{{b{En}}{b{En}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}0`{{}Fb}{j{{b{c}}}{}}0000{j{{b{dc}}}{}}0000{jh}0000`{{{b{c}}}e{}{{Hf{Hd}}}}000{{{b{H`}}{b{H`}}}l}{{{b{En}}{b{En}}}l}{{{b{En}}{b{Hh}}}l}{{{b{Fb}}{b{Fb}}}l}{{{b{c}}{b{e}}}l{}{}}00{{{b{H`}}{b{dn}}}Cd}{{{b{En}}{b{dn}}}Cd}{{{b{Hj}}{b{dn}}}Cd}0{{{b{Fb}}{b{dn}}}Cd}{cc{}}00{HhEn}1{{{F`{Gb}}}Fb}2{{{b{{Gd{Gb}}}}}{{Ab{HlHj}}}}{{H`{b{{Gd{Gb}}}}}{{Ab{HnHj}}}}{{H`{b{{Gd{Gb}}}}}{{Ab{EnHj}}}}{{{b{H`}}{b{dc}}}hAf}{{{b{En}}{b{dc}}}hAf}{{}j}0000{ce{}{}}0000{H`Ah}{EnAh}{FbAh}{{{b{H`}}}l}0000{{{b{En}}}{{b{Dd}}}};:{{H`{b{Dd}}}Hn}{{{b{H`}}{b{H`}}}{{Bf{Hb}}}}{{{b{En}}{b{En}}}{{Bf{Hb}}}}{{{b{Hl}}}En}{{{b{Hn}}}En}{{{b{dc}}}{{Ab{HlHj}}}Fn}```{{{b{Hl}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Hn}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Hn}}H`{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Hl}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Hn}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}`{{{b{Hl}}}{{F`{Gb}}}}{{{b{Hn}}}{{F`{Gb}}}}{{{b{c}}}e{}{}}00{{{b{c}}}Fh{}}{{}{{Ab{FbAl}}}}{c{{Ab{e}}}{}{}}{Gb{{Ab{H`c}}}{}}1111{Ah{{Ab{H`Al}}}}{Ah{{Ab{EnAl}}}}{Ah{{Ab{FbAl}}}}44444{{{b{c}}}An{}}0000{{{b{En}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}{{{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}{b{{Gd{En}}}}{b{{Gd{Fb}}}}}{{Ab{hHj}}}}{{{b{En}}H`{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}{{{b{En}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}{ce{}{}}0000{{{b{{Gd{Gb}}}}}{{F`{Gb}}}}{{Eh{b{Dd}}}h}``{{{b{I`}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{I`}}}I`}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{I`}}{b{I`}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{I`}}{b{I`}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{I`}}{b{dn}}}Cd}{cc{}}{{{b{Hh}}}I`}{{{b{Dd}}}I`}2{HhI`}{{{b{{Gd{Gb}}}}}{{Ab{IbHj}}}}{{{b{{Gd{Gb}}}}}{{Ab{I`Hj}}}}{{{b{I`}}{b{dc}}}hAf}{{}j}0{ce{}{}}0{I`Ah}5{{{b{I`}}{b{I`}}}{{Bf{Hb}}}}{{{b{Ib}}}En}{{{b{dc}}}{{Ab{IbHj}}}Fn}{{{b{Ib}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Ib}}c}{{Ab{FbHj}}}{{Ih{}{{Id{If}}}}}}{{{b{Ib}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Ib}}}{{F`{Gb}}}}{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}0{Ah{{Ab{I`Al}}}}11{{{b{c}}}An{}}0{{{b{I`}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}{{{b{I`}}c{b{Fb}}}{{Ab{hHj}}}{{Ih{}{{Id{If}}}}}}{{{b{I`}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}??``{{{b{Ij}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{Ij}}}Ij}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{Ij}}{b{Ij}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{Ij}}{b{Ij}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{Ij}}{b{dn}}}Cd}{cc{}}0{{{b{Dd}}}Ij}{{{b{{Gd{Gb}}}}}{{Ab{IlHj}}}}{{{b{{Gd{Gb}}}}}{{Ab{IjHj}}}}{{{b{Ij}}{b{dc}}}hAf}{{}j}0{ce{}{}}0{IjAh}5{{{b{Ij}}{b{Ij}}}{{Bf{Hb}}}}{{{b{Il}}}En}{{{b{dc}}}{{Ab{IlHj}}}Fn}{{{b{Il}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Il}}c}{{Ab{FbHj}}}{Ih{J`{}{{Id{In}}}}}}{{{b{Il}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Il}}}{{F`{Gb}}}}{{{b{Ij}}}{{F`{Gb}}}}{{{b{c}}}e{}{}}1{c{{Ab{e}}}{}{}}0{Ah{{Ab{IjAl}}}}11{{{b{c}}}An{}}0{{{b{Ij}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}{{{b{Ij}}c{b{Fb}}}{{Ab{hHj}}}{Ih{J`{}{{Id{In}}}}}}{{{b{Ij}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}{ce{}{}}0``{{{b{Jb}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{Jb}}}Jb}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{Jb}}{b{Jb}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{Jb}}{b{Jb}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{Jb}}{b{dn}}}Cd}{cc{}}0{{{b{Dd}}}Jb}{{{b{{Gd{Gb}}}}}{{Ab{JdHj}}}}{{{b{{Gd{Gb}}}}}{{Ab{JbHj}}}}{{{b{Jb}}{b{dc}}}hAf}{{}j}0{ce{}{}}0{JbAh}5{{{b{Jb}}{b{Jb}}}{{Bf{Hb}}}}{{{b{Jd}}}En}{{{b{dc}}}{{Ab{JdHj}}}Fn}{{{b{Jd}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Jd}}c}{{Ab{FbHj}}}{Ih{J`{}{{Id{In}}}}JfJh}}{{{b{Jd}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Jd}}}{{F`{Gb}}}}{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}0{Ah{{Ab{JbAl}}}}11{{{b{c}}}An{}}0{{{b{Jb}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}{{{b{Jb}}c{b{Fb}}}{{Ab{hHj}}}{Ih{J`{}{{Id{In}}}}}}{{{b{Jb}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}??``{{{b{Jj}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{Jj}}}Jj}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{Jj}}{b{Jj}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{Jj}}{b{Jj}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{Jj}}{b{dn}}}Cd}{cc{}}{{{b{Dd}}}Jj}1{{{b{{Gd{Gb}}}}}{{Ab{JlHj}}}}{{{b{{Gd{Gb}}}}}{{Ab{JjHj}}}}{{{b{Jj}}{b{dc}}}hAf}{{}j}0{ce{}{}}0{JjAh}5{{{b{Jj}}{b{Jj}}}{{Bf{Hb}}}}{{{b{Jl}}}En}{{{b{dc}}}{{Ab{JlHj}}}Fn}{{{b{Jl}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Jl}}c}{{Ab{FbHj}}}{Ih{J`{}{{Id{Jn}}}}JfJh}}{{{b{Jl}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}}{{{b{Jl}}}{{F`{Gb}}}}{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}0{Ah{{Ab{JjAl}}}}11{{{b{c}}}An{}}0{{{b{Jj}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}{{{b{Jj}}c{b{Fb}}}{{Ab{hHj}}}{Ih{J`{}{{Id{Jn}}}}}}{{{b{Jj}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}??`{{{b{K`}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{K`}}}K`}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{K`}}{b{K`}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{K`}}{b{K`}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{K`}}{b{dn}}}Cd}{{{b{Dd}}}K`}{cc{}}{{{b{{Gd{Gb}}}}}{{Ab{K`Hj}}}}{{{b{K`}}{b{dc}}}hAf}{{}j}{ce{}{}}{K`Ah}{{{b{K`}}{b{K`}}}{{Bf{Hb}}}}{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}{Ah{{Ab{K`Al}}}}1{{{b{c}}}An{}}{{{b{K`}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}{b{Fb}}}{{Ab{hHj}}}}7`````````{{{b{c}}}{{b{e}}}{}{}}000{{{b{dc}}}{{b{de}}}{}{}}000`{{{b{{Kb{c}}}}Kd{b{Kf}}}{{Ab{{F`{Kh}}Kj}}}{CnKlKn}}{{{b{c}}E`L`}{{Ab{KhLb}}}Bj}{{{b{Lb}}}E`}{{{b{c}}{b{{Gd{Gb}}}}}{{Ab{L`Bh}}}Bj}{{}Ld}{j{{b{c}}}{}}000{j{{b{dc}}}{}}000{{{b{c}}{b{Dd}}{F`{Gb}}}{{Ab{{F`{Gb}}Kj}}}Bj}{{{b{c}}E`L`j}{{Ab{LfLb}}}Bj}{{{b{c}}B`{b{Ld}}}{{Bd{BlBb}}}Bj}{{{b{c}}L`{b{Ld}}}{{Ab{LfLb}}}Bj}{jh}000{{{b{{Kb{c}}}}Kd{b{Kf}}{b{{Gd{Lh}}}}}{{Ab{LjKj}}}{CnKlKn}}{{{b{c}}E`FlL`j}{{Ab{LlLb}}}Bj}{{{b{c}}L`{b{Ld}}}{{Ab{{Bd{BnLn}}Lb}}}Bj}{{{b{Lb}}{b{dn}}}Cd}0{{{b{Lf}}{b{dn}}}Cd}{cc{}}0{M`Lb}1{BlLf}2{{}j}000{ce{}{}}000{Lb{{Ab{LbLb}}}}`{{{b{Lb}}}{{b{Dd}}}}{{{b{d{Md{Mb}}}}L`}{{Ab{hKj}}}}`{{{b{{Kb{c}}}}Kd{b{Dd}}{F`{Gb}}}{{Ab{{F`{Gb}}Kj}}}{CnKlKn}}{{{b{{Kb{c}}}}{b{dMf}}}h{CnKlKnCn}}`{{{b{{Kb{c}}}}Kd{b{dKf}}{b{{Gd{Lh}}}}}{{Ab{LjKj}}}{CnKlKn}}`{{{b{d{Kb{c}}}}{Mj{Mh}}}h{CnKlKn}}`{{{b{Lb}}}{{Bf{{b{Ml}}}}}}`{{{b{c}}}Fh{}}{c{{Ab{e}}}{}{}}0000000```{{{b{c}}}An{}}000;;;;```{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{Mn}}}Mn}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{}Mn}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{Mn}}{b{dn}}}Cd}{cc{}}{{}j}{ce{}{}}{MnAh}``{{{b{c}}}e{}{}}{{}{{Ab{MnAl}}}}{c{{Ab{e}}}{}{}}{Ah{{Ab{MnAl}}}}1{{{b{c}}}An{}}6``{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{Kj}}}Kj}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{N`}}}E`}`{{}Kj}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{Kj}}{b{dn}}}{{Ab{hA`}}}}0{NbKj}{NdKj}{NfKj}{NhKj}{NjKj}{cc{}}{NlKj}{BhKj}{NnKj}{O`Kj}{LbKj}{ObKj}{OdKj}{OfKj}{OhKj}{OjKj}{OlKj}{{}j}{ce{}{}}{N`{{Ab{LbN`}}}}{N`Bl}{KjAh}``{{{b{N`}}}{{b{Dd}}}}{{{b{Dd}}E`{b{Dd}}}Kj}{{{b{c}}}e{}{}}{{{b{c}}}Fh{}}{{}{{Ab{KjAl}}}}{c{{Ab{e}}}{}{}}{Ah{{Ab{KjAl}}}}1{{{b{c}}}An{}};````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{On}}}On}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{A@`}}}E`}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{Dd}}E`Ah}On}{{{b{On}}{b{dn}}}Cd}{cc{}}{{}j}{ce{}{}}{A@`On}{A@bLn}{A@dLn}`{{}{{b{Dd}}}}{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}0{{{b{c}}}An{}}`7````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{Oh}}}E`}{{{b{Dh}}AdA@f}{{Ab{{F`{A@h}}Oh}}}}{{{b{Dh}}Ad}{{Ab{DbOh}}}}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{Oh}}{b{dn}}}Cd}0{cc{}}{{}j}{ce{}{}}{Oh{{Ab{LbOh}}}}{{{b{Oh}}}{{b{Dd}}}}{{{b{c}}}Fh{}}{c{{Ab{e}}}{}{}}0{{{b{c}}}An{}}5``````````````````````````````````````````{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{Dl}}}{{Eb{Dl}}}}{{{b{A@j}}}{{Eb{Dl}}}}``{{{b{Dl}}}h}{{{b{A@j}}}h}{{{b{A@j}}}A@j}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}`{cc{}}{cCh{{A@n{}{{A@l{{b{{Gd{Gb}}}}}}}}}}{{{b{Dl}}ChCf}{{Ab{AA`M`}}}}{{{b{A@j}}ChCf}{{Ab{AA`M`}}}}{{{b{Dl}}Ch}{{Ab{AA`M`}}}}{{{b{A@j}}Ch}{{Ab{AA`M`}}}}{{{b{Dl}}ChCf}{{Ab{AAbM`}}}}{{{b{A@j}}ChCf}{{Ab{AAbM`}}}}{{{b{Dl}}Ch}{{Ab{AAbM`}}}}{{{b{A@j}}Ch}{{Ab{AAbM`}}}}{{}j}`{ce{}{}}`{{{b{Dl}}}{{Bf{Eh}}}}{{{b{A@j}}}{{Bf{Eh}}}}{{{b{Dl}}}{{Bf{Hh}}}}{{{b{A@j}}}{{Bf{Hh}}}}````{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}0{{{b{c}}}An{}}7```````````````````````````{{{b{c}}{b{AAd}}{b{Bl}}}hBj}{{{b{c}}Bl}{{Ab{BlBh}}}Bj}{{{b{c}}{b{{Gd{Gb}}}}}{{Ab{hBh}}}Bj}{{{b{c}}{b{AAf}}}{{Ab{hBh}}}Bj}{{{b{c}}{b{L`}}}{{Ab{AAhBh}}}Bj}{{{b{c}}{b{B`}}}{{Ab{hBh}}}Bj}0{{{b{c}}}hBj}{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{c}}}{{Ab{hBh}}}Bj}{{{b{AAh}}}AAh}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{c}}{b{Dd}}{b{{Gd{Gb}}}}}{{Ab{{Bf{L`}}Bh}}}Bj}{j{{b{c}}}{}}00{j{{b{dc}}}{}}00{{{b{c}}Ahk}{{AAj{AhBl}}}BjDnAAlN`{{AB`{{b{c}}e}{{AAn{{Ab{gi}}}}}}}}{{{b{c}}{b{Dd}}Ah}{{AAj{AhBl}}}Bj}{{{b{c}}{b{Dd}}ABb}{{AAj{ABbh}}}Bj}{{{b{c}}Ahk}{{AAj{Ah{Ab{AhKj}}}}}BjDnAAlN`{{AB`{{b{c}}e}{{AAn{{Ab{gi}}}}}}}}{{{b{c}}{b{Dd}}Ah}{{AAj{Ah{Ab{AhKj}}}}}Bj}{jh}00?{{{b{Bl}}{b{dn}}}Cd}{{{b{AAh}}{b{dn}}}Cd}{cc{}}00{{}j}00{{{b{c}}{b{dABd}}e}lBj{}}{ce{}{}}00{{{b{Dd}}}l}00{{{b{Bl}}}l}{{{b{c}}}{{ABh{FhABf}}}Bj}{{{AAj{ce}}g}{{Ab{eg}}}{}{}{}}{{{AAj{ce}}i}{{Ab{eg}}}{}{}{}{{AB`{}{{AAn{g}}}}}}{{}c{}}{{{b{d{Md{Mb}}}}{b{Dd}}Ah{b{AAd}}}{{AAj{Ah{Ab{hKj}}}}}}{{{b{c}}{b{L`}}}{{Ab{{Bf{ABj}}Bh}}}Bj}{ch{}}{{}{{F`{ABl}}}}{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}00000{{{b{c}}}An{}}00{{{b{{AC`{}{{ABn{c}}}}}}}{{Ab{hc}}}{}}>>>```````````````{{{b{c}}{b{B`}}}{{Ab{hBh}}}Bj}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{Of}}}E`}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{{{b{c}}{b{Dd}}Ah}{{AAj{Ah{Ab{AhKj}}}}}Bj}{jh}0{{{b{Of}}{b{dn}}}Cd}0{cc{}}0{{}j}0{{{b{c}}{b{dABd}}e}lBj{}}{ce{}{}}0{Of{{Ab{LbOf}}}}{{{b{c}}}{{ABh{FhABf}}}Bj}{{{b{Of}}}{{b{Dd}}}}{{{b{c}}}Fh{}}{c{{Ab{e}}}{}{}}000{{{b{c}}}An{}}0`66``````{cACb{{A@n{}{{A@l{ABj}}}}}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{}ACd}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{cc{}}0{{}j}0??5::::99??{eACd{{ACf{Dd}}}{{A@n{}{{A@l{{Bd{cACb}}}}}}}}````````````````````{{{b{c}}{b{AAd}}{b{Bl}}}hBj}{{{b{c}}Bl}{{Ab{BlBh}}}Bj}{{{b{c}}{b{L`}}}{{Ab{AAhBh}}}Bj}`;;;;;;;:::::::{{ABj{b{ACh}}}{{Ab{hNd}}}}0{{ABj{b{ACh}}}{{Ab{hBh}}}}0{{{b{c}}}{{Ab{hBh}}}Bj}{{{b{c}}{b{AAd}}}{{Ab{ABjBh}}}Bj}0{{{b{ACj}}}ACj}{{{b{ACl}}}ACl}{{{b{ACn}}}ACn}{{{b{c}}{b{de}}}h{}{}}00{{{b{c}}}h{}}00{{{b{Nd}}}E`}{{{b{AD`}}}E`}`{{}ACj}{{}ACl}{{}ACn}`{j{{b{c}}}{}}000000{j{{b{dc}}}{}}000000{{{b{c}}{b{Dd}}Ah}{{AAj{AhBl}}}Bj}{{{b{c}}{b{Dd}}Ah}{{AAj{Ah{Ab{AhKj}}}}}Bj}{jh}000000{{{b{c}}}hBj}{{ABj{b{ACh}}}{{Ab{hNd}}}}`{{{b{Nd}}{b{dn}}}Cd}0{{{b{AD`}}{b{dn}}}Cd}{{{b{ACj}}{b{dn}}}Cd}{{{b{ACl}}{b{dn}}}Cd}{{{b{ADb}}{b{dn}}}Cd}0{{{b{ACn}}{b{dn}}}Cd}{cc{}}{BhNd}111111`{ADd{{Ab{{F`{ABj}}Nd}}}}0{{ABjADd}{{Ab{ADfNd}}}}0{ABj{{Ab{ADhNd}}}}0{{{b{ADd}}}{{Ab{ADjNd}}}}0{ABj{{Ab{AdNd}}}}0{{}{{Ab{{ABh{ADdADf}}Nd}}}}0{ABjh}0{ACnh}{{}j}000000{{{b{c}}{b{dABd}}e}lBj{}}{ce{}{}}000000{Nd{{Ab{LbNd}}}}{AD`Ah}{ACjAh}{AClAh}{ACnAh}{{{b{Dd}}}l}{{ABj{b{ACh}}}{{Ab{hNd}}}}0{{{b{c}}}{{ABh{FhABf}}}Bj}{{{b{Nd}}}{{b{Dd}}}}{{}{{b{Dd}}}}`{{{b{d{Md{Mb}}}}{b{Dd}}Ah{b{AAd}}}{{AAj{Ah{Ab{hKj}}}}}}{{ABj{b{ACh}}}h}0{{ABjAd}h}0{lh}0{{{b{ACh}}}h}0{{{b{Nd}}}{{Bf{{b{Ml}}}}}}`{{}{{F`{ABl}}}}{{}l}0{{{b{c}}}e{}{}}00{{{b{c}}}Fh{}}0`{{ABjABj{b{ACh}}}{{Ab{hNd}}}}000`{{}{{Ab{ACjAl}}}}{{}{{Ab{AClAl}}}}{{}{{Ab{ACnAl}}}}{c{{Ab{e}}}{}{}}000000{Ah{{Ab{ACjAl}}}}{Ah{{Ab{AClAl}}}}{Ah{{Ab{ACnAl}}}}3333333`{{{b{c}}}An{}}000000`{{{b{c}}{b{AAd}}}{{Ab{hBh}}}Bj}0{{{b{ACl}}}{{Ab{hc}}}{}}{ce{}{}}000000``````````{{{b{ADl}}}ADf}{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{ADn}}}ADn}{{{b{ADl}}}ADl}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0{ADn{{ABh{ADdADf}}}}{{{b{dADn}}}AE`}{{}ADn}{{}ADl}{{{b{ADl}}}ADd}{j{{b{c}}}{}}00{j{{b{dc}}}{}}00{jh}00{{{b{ADn}}{b{dn}}}Cd}{{{b{ADl}}{b{dn}}}Cd}{cc{}}00{{}j}00{ce{}{}}00:{{{b{ADl}}}ABj}`{{{b{dADn}}ABj{b{ACh}}}h}{{{b{dADn}}ADf}h}`{{{b{c}}}e{}{}}0{c{{Ab{e}}}{}{}}00000{{{b{ADn}}}{{Bf{{b{ADl}}}}}}{{{b{c}}}An{}}00777```````````````{{{b{c}}}{{b{e}}}{}{}}0000000{{{b{dc}}}{{b{de}}}{}{}}0000000{{{b{AEb}}}AEb}{{{b{AEd}}}AEd}{{{b{AEf}}}AEf}{{{b{AEh}}}AEh}{{{b{AEj}}}AEj}{{{b{ADh}}}ADh}{{{b{AEl}}}AEl}{{{b{ADj}}}ADj}{{{b{c}}{b{de}}}h{}{}}0000000{{{b{c}}}h{}}0000000`{{}AEb}{{}AEd}{{}AEf}{{}AEh}{{}AEj}{{}ADh}{{}AEl}{{}ADj}``{j{{b{c}}}{}}0000000{j{{b{dc}}}{}}0000000{jh}0000000{{{b{AEb}}{b{dn}}}Cd}{{{b{AEd}}{b{dn}}}Cd}{{{b{AEf}}{b{dn}}}Cd}{{{b{AEh}}{b{dn}}}Cd}{{{b{AEj}}{b{dn}}}Cd}{{{b{ADh}}{b{dn}}}Cd}{{{b{AEl}}{b{dn}}}Cd}{{{b{ADj}}{b{dn}}}Cd}{cc{}}0000000{{}j}0000000{ce{}{}}0000000{AEbAh}{AEdAh}{AEfAh}{AEhAh}{AEjAh}{ADhAh}{AElAh}{ADjAh}``{{{b{c}}}e{}{}}0000000{{}{{Ab{AEbAl}}}}{{}{{Ab{AEdAl}}}}{{}{{Ab{AEfAl}}}}{{}{{Ab{AEhAl}}}}{{}{{Ab{AEjAl}}}}{{}{{Ab{ADhAl}}}}{{}{{Ab{AElAl}}}}{{}{{Ab{ADjAl}}}}{c{{Ab{e}}}{}{}}0000000{Ah{{Ab{AEbAl}}}}{Ah{{Ab{AEdAl}}}}{Ah{{Ab{AEfAl}}}}{Ah{{Ab{AEhAl}}}}{Ah{{Ab{AEjAl}}}}{Ah{{Ab{ADhAl}}}}{Ah{{Ab{AElAl}}}}{Ah{{Ab{ADjAl}}}}88888888{{{b{c}}}An{}}0000000{ce{}{}}0000000``````````````````{{{b{c}}ABj}{{Ab{AEnNh}}}Bj}0{{{b{c}}ADf}{{Ab{ADfNh}}}Bj}000{{{b{c}}}{{b{e}}}{}{}}000000{{{b{dc}}}{{b{de}}}{}{}}000000{{{b{AF`}}}AF`}{{{b{AFb}}}AFb}{{{b{AFd}}}AFd}{{{b{c}}{b{de}}}h{}{}}00{{{b{c}}}h{}}00{{{b{AFf}}}E`}{{{b{Nh}}}E`}{{}{{Ab{ADdNh}}}}0``{{}AF`}{{}AFb}{{}AFd}{{{b{c}}ABjABj}{{Ab{AFhNh}}}Bj}0{j{{b{c}}}{}}000000{j{{b{dc}}}{}}000000{{{b{c}}{b{Dd}}Ah}{{AAj{AhBl}}}Bj}{{{b{c}}{b{Dd}}Ah}{{AAj{Ah{Ab{AhKj}}}}}Bj}{jh}000000{{}{{Ab{hNh}}}}0{{{b{AF`}}{b{AF`}}}l}{{{b{AFb}}{b{AFb}}}l}{{{b{c}}{b{e}}}l{}{}}0{{{b{c}}ABj{b{ACh}}AFj}{{Ab{hNh}}}Bj}0{{{b{AF`}}{b{dn}}}Cd}{{{b{AFb}}{b{dn}}}Cd}{{{b{AFl}}{b{dn}}}Cd}0{{{b{AFf}}{b{dn}}}Cd}{{{b{AFd}}{b{dn}}}Cd}{{{b{Nh}}{b{dn}}}Cd}0{cc{}}00000{OhNh}{OjNh}2{BhNh}`{{{b{c}}Cf}{{Ab{AdNh}}}Bj}0{AFdh}{{}j}000000{{{b{c}}{b{dABd}}e}lBj{}}{ce{}{}}000000{Nh{{Ab{LbNh}}}}{AF`Ah}{AFbAh}{AFfAh}{AFdAh}`{{{b{c}}}{{ABh{FhABf}}}Bj}{{}{{b{Dd}}}}{{{b{Nh}}}{{b{Dd}}}}`{{{b{c}}ABjADfAFj}{{Ab{hNh}}}Bj}0`{{{b{c}}EhAd}{{Ab{{Bf{AFn}}Nh}}}Bj}0{{{b{Nh}}}{{Bf{{b{Ml}}}}}}{{}{{F`{ABl}}}}{{{b{c}}}e{}{}}00{{{b{c}}}Fh{}}0{{{b{c}}ABj{b{ACh}}AFj}{{Ab{hNh}}}Bj}0{{}{{Ab{AF`Al}}}}{{}{{Ab{AFbAl}}}}{{}{{Ab{AFdAl}}}}{c{{Ab{e}}}{}{}}000000{Ah{{Ab{AF`Al}}}}{Ah{{Ab{AFbAl}}}}{Ah{{Ab{AFdAl}}}}3333333{{{b{c}}}An{}}000000`{{{b{AFb}}}{{Ab{hc}}}{}}{ce{}{}}000000::````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{AG`}}}AG`}{{{b{AGb}}}AGb}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{AG`}}{b{dn}}}Cd}{{{b{AGb}}{b{dn}}}Cd}{cc{}}0{{}j}0=={AG`Ah}{AGbAh}```{{{b{c}}}e{}{}}0{c{{Ab{e}}}{}{}}0{Ah{{Ab{AG`Al}}}}{Ah{{Ab{AGbAl}}}}22{{{b{c}}}An{}}0{ce{}{}}0````````````````````{{{b{c}}}{{b{e}}}{}{}}00000{{{b{dc}}}{{b{de}}}{}{}}00000{{{b{c}}}{{Ab{hBh}}}Bj}{{{b{AGd}}}AGd}{{{b{AGf}}}AGf}{{{b{AGh}}}AGh}{{{b{c}}{b{de}}}h{}{}}00{{{b{c}}}h{}}00{{{b{Nf}}}E`}{{{b{AGj}}}E`}{{}AGd}{{}AGf}{{}AGh}{{{b{c}}ABjAdABjAChl}{{Ab{hNf}}}Bj}0{{{b{c}}ABjAdABjACh}{{Ab{hNf}}}Bj}0{j{{b{c}}}{}}00000{j{{b{dc}}}{}}00000````{{{b{c}}{b{Dd}}Ah}{{AAj{AhBl}}}Bj}{{{b{c}}{b{Dd}}ABb}{{AAj{ABbh}}}Bj}{{{b{c}}{b{Dd}}Ah}{{AAj{Ah{Ab{AhKj}}}}}Bj}{jh}00000{{{b{c}}}hBj}{{{b{Nf}}{b{dn}}}Cd}0{{{b{AGd}}{b{dn}}}Cd}{{{b{AGf}}{b{dn}}}Cd}{{{b{AGj}}{b{dn}}}Cd}{{{b{AGh}}{b{dn}}}Cd}{cc{}}{BhNf}{NhNf}22222`{AGhh}{{}j}00000{{{b{c}}{b{dABd}}e}lBj{}}{ce{}{}}00000{Nf{{Ab{LbNf}}}}{AGdAh}{AGfAh}{AGjAh}{AGhAh}{{{b{c}}}{{ABh{FhABf}}}Bj}{{{b{Nf}}}{{b{Dd}}}}{{}{{b{Dd}}}}`{{{b{d{Md{Mb}}}}{b{Dd}}Ah{b{AAd}}}{{AAj{Ah{Ab{hKj}}}}}}{{{b{Nf}}}{{Bf{{b{Ml}}}}}}``{{}{{F`{ABl}}}}`{{{b{c}}}e{}{}}00{{{b{c}}}Fh{}}{{}{{Ab{AGdAl}}}}{{}{{Ab{AGfAl}}}}{{}{{Ab{AGhAl}}}}{c{{Ab{e}}}{}{}}00000{Ah{{Ab{AGdAl}}}}{Ah{{Ab{AGfAl}}}}{Ah{{Ab{AGhAl}}}}333333````{{{b{c}}}An{}}00000`{{{b{c}}ABjAdABjADfl}{{Ab{hNf}}}Bj}0{ce{}{}}00000{{{b{c}}ABjAdABjACh}{{Ab{hNf}}}Bj}0``````````````````````````````{{ABjABjADf}{{Ab{hNf}}}}{{ABjABjCfADfAd}{{Ab{AdNf}}}}{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}`{cc{}}`{{ABjABj}{{Ab{AGlNf}}}}{ABj{{Ab{{F`{AGn}}Nf}}}}{{}{{Ab{{ABh{ABjADf}}Nf}}}}{Cf{{Ab{{F`{AH`}}Nf}}}}{ABj{{Ab{{F`{AHb}}Nf}}}}{{}j}?{{ABjAHdAdAHf}h}>{{ABjAHdAd}{{Bf{AHf}}}}{{{b{AH`}}}{{Ab{AGlNf}}}}`{{{b{{Gd{Gb}}}}}{{Ab{AH`c}}}{}}{c{{Ab{e}}}{}{}}0{{{b{c}}}An{}}{ce{}{}}`````````````````````````````````````{{{b{c}}}{{b{e}}}{}{}}00000000000000000000{{{b{dc}}}{{b{de}}}{}{}}00000000000000000000{{{b{AHh}}}AHh}{{{b{AHj}}}AHj}{{{b{AHl}}}AHl}{{{b{AHn}}}AHn}{{{b{AHd}}}AHd}{{{b{AI`}}}AI`}{{{b{AHf}}}AHf}{{{b{AIb}}}AIb}{{{b{AId}}}AId}{{{b{AIf}}}AIf}{{{b{AIh}}}AIh}{{{b{AIj}}}AIj}{{{b{AIl}}}AIl}{{{b{AGl}}}AGl}{{{b{AGn}}}AGn}{{{b{AHb}}}AHb}{{{b{AIn}}}AIn}{{{b{AJ`}}}AJ`}{{{b{AJb}}}AJb}{{{b{AJd}}}AJd}{{{b{AJf}}}AJf}{{{b{c}}{b{de}}}h{}{}}00000000000000000000{{{b{c}}}h{}}00000000000000000000`{{}AHh}{{}AHj}{{}AHl}{{}AHn}{{}AHd}{{}AI`}{{}AHf}{{}AIb}{{}AId}{{}AIf}{{}AIh}{{}AIj}{{}AIl}{{}AGl}{{}AGn}{{}AHb}{{}AIn}{{}AJ`}{{}AJb}{{}AJd}{{}AJf}{j{{b{c}}}{}}00000000000000000000{j{{b{dc}}}{}}00000000000000000000{jh}00000000000000000000``{{{b{AJf}}{b{AJf}}}l}{{{b{c}}{b{e}}}l{}{}}`{{{b{AHh}}{b{dn}}}Cd}{{{b{AHj}}{b{dn}}}Cd}{{{b{AHl}}{b{dn}}}Cd}{{{b{AHn}}{b{dn}}}Cd}{{{b{AHd}}{b{dn}}}Cd}{{{b{AI`}}{b{dn}}}Cd}{{{b{AHf}}{b{dn}}}Cd}{{{b{AIb}}{b{dn}}}Cd}{{{b{AId}}{b{dn}}}Cd}{{{b{AIf}}{b{dn}}}Cd}{{{b{AIh}}{b{dn}}}Cd}{{{b{AIj}}{b{dn}}}Cd}{{{b{AIl}}{b{dn}}}Cd}{{{b{AGl}}{b{dn}}}Cd}{{{b{AGn}}{b{dn}}}Cd}{{{b{AHb}}{b{dn}}}Cd}{{{b{AIn}}{b{dn}}}Cd}{{{b{AJ`}}{b{dn}}}Cd}{{{b{AJb}}{b{dn}}}Cd}{{{b{AJd}}{b{dn}}}Cd}{{{b{AJf}}{b{dn}}}Cd}{cc{}}00000000000000000000{AJhAJf}````````{{}j}00000000000000000000{ce{}{}}00000000000000000000{AHhAh}{AHjAh}{AHlAh}{AHnAh}{AHdAh}{AI`Ah}{AHfAh}{AIbAh}{AIdAh}{AIfAh}{AIhAh}{AIjAh}{AIlAh}{AGlAh}{AGnAh}{AHbAh}{AInAh}{AJ`Ah}{AJbAh}{AJdAh}{AJfAh}{{{b{AHd}}}l}```````````````````````````{{{b{c}}}e{}{}}00000000000000000000{{}{{Ab{AHhAl}}}}{{}{{Ab{AHjAl}}}}{{}{{Ab{AHlAl}}}}{{}{{Ab{AHnAl}}}}{{}{{Ab{AI`Al}}}}{{}{{Ab{AHfAl}}}}{{}{{Ab{AIbAl}}}}{{}{{Ab{AIdAl}}}}{{}{{Ab{AIfAl}}}}{{}{{Ab{AIhAl}}}}{{}{{Ab{AIjAl}}}}{{}{{Ab{AIlAl}}}}{{}{{Ab{AGlAl}}}}{{}{{Ab{AGnAl}}}}{{}{{Ab{AHbAl}}}}{{}{{Ab{AInAl}}}}{{}{{Ab{AJ`Al}}}}{{}{{Ab{AJbAl}}}}{{}{{Ab{AJdAl}}}}{{}{{Ab{AJfAl}}}}{c{{Ab{e}}}{}{}}00000000000000000000{Ah{{Ab{AHhAl}}}}{Ah{{Ab{AHjAl}}}}{Ah{{Ab{AHlAl}}}}{Ah{{Ab{AHnAl}}}}{Ah{{Ab{AHdAl}}}}{Ah{{Ab{AI`Al}}}}{Ah{{Ab{AHfAl}}}}{Ah{{Ab{AIbAl}}}}{Ah{{Ab{AIdAl}}}}{Ah{{Ab{AIfAl}}}}{Ah{{Ab{AIhAl}}}}{Ah{{Ab{AIjAl}}}}{Ah{{Ab{AIlAl}}}}{Ah{{Ab{AGlAl}}}}{Ah{{Ab{AGnAl}}}}{Ah{{Ab{AHbAl}}}}{Ah{{Ab{AInAl}}}}{Ah{{Ab{AJ`Al}}}}{Ah{{Ab{AJbAl}}}}{Ah{{Ab{AJdAl}}}}{Ah{{Ab{AJfAl}}}}{c{{Ab{e}}}{}{}}00000000000000000000{{{b{c}}}An{}}00000000000000000000{ce{}{}}00000000000000000000```````````````````````````````````````````````````{{{b{c}}Bl}{{Ab{BlBh}}}Bj}{{{b{c}}{b{{Gd{Gb}}}}}{{Ab{hBh}}}Bj}{{{b{c}}{b{AAf}}}{{Ab{hBh}}}Bj}``{{{b{c}}{b{L`}}}{{Ab{AAhBh}}}Bj}{{{b{c}}{b{B`}}}{{Ab{hBh}}}Bj}{{{b{c}}}hBj}{{{b{c}}}{{b{e}}}{}{}}000000000{{{b{dc}}}{{b{de}}}{}{}}000000000`{{{b{AJj}}}AJj}{{{b{AJl}}}AJl}{{{b{AJn}}}AJn}{{{b{AK`}}}AK`}{{{b{AKb}}}AKb}{{{b{c}}{b{de}}}h{}{}}0000{{{b{c}}}h{}}0000{{{b{Bh}}}E`}{{{b{AKd}}}E`}{{{b{AKf}}}E`}{{}AJj}{{}AJl}{{}AJn}{{}AK`}{{}AKb}{j{{b{c}}}{}}000000000{j{{b{dc}}}{}}000000000{{{b{c}}{b{Dd}}Ah}{{AAj{AhBl}}}Bj}{{{b{c}}{b{Dd}}Ah}{{AAj{Ah{Ab{AhKj}}}}}Bj}{jh}000000000``{{{b{c}}}hBj}{{{b{AKf}}{b{AKf}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{c}}}AdBj}0`{{{b{Bh}}{b{dn}}}Cd}0{{{b{AKd}}{b{dn}}}Cd}0{{{b{AKf}}{b{dn}}}Cd}{{{b{AJj}}{b{dn}}}Cd}{{{b{AJl}}{b{dn}}}Cd}{{{b{AKh}}{b{dn}}}Cd}0{{{b{AJn}}{b{dn}}}Cd}{{{b{AK`}}{b{dn}}}Cd}{{{b{AKb}}{b{dn}}}Cd}{cc{}}{AKjBh}{AKdBh}222222222`{{}l}0{{}j}{AK`h}111111111{{{b{c}}{b{dABd}}e}lBj{}}{ce{}{}}000000000{Bh{{Ab{LbBh}}}}{AKfAh}{AJjAh}{AJlAh}{AJnAh}{AK`Ah}{AKbAh}{{{b{Dd}}}l}{{{b{AKd}}}l}1{{}Ad}0`````{{{b{ADd}}}{{Bf{ADf}}}}0```{{{b{c}}}{{ABh{FhABf}}}Bj}{{{b{Bh}}}{{b{Dd}}}}{{{b{AKd}}}{{b{Dd}}}}{{}{{b{Dd}}}}{{AdAd}Bh}`{{{b{c}}AKl}{{Ab{AdBh}}}Bj}7777{Adh}0{AKnh}0{{{b{Bh}}}{{Bf{{b{Ml}}}}}}``{{}{{F`{ABl}}}};;{{}AKn}0`{{{b{c}}}e{}{}}0000{{{b{c}}}Fh{}}00{{}{{Ab{AJjAl}}}}{{}{{Ab{AJlAl}}}}{{}{{Ab{AJnAl}}}}{{}{{Ab{AK`Al}}}}{{}{{Ab{AKbAl}}}}{c{{Ab{e}}}{}{}}00{Bl{{Ab{AKdc}}}{}}1111111{Ah{{Ab{AJjAl}}}}{Ah{{Ab{AJlAl}}}}{Ah{{Ab{AJnAl}}}}{Ah{{Ab{AK`Al}}}}{Ah{{Ab{AKbAl}}}}6666666666`{{{b{c}}}An{}}000000000`{Ad{{Ab{hBh}}}}000{{}Ad}000{{{b{AJn}}}{{Ab{hc}}}{}}{ce{}{}}000000000``````````````````{{{b{c}}}{{b{e}}}{}{}}00000000{{{b{dc}}}{{b{de}}}{}{}}00000000`{{{b{ABd}}}ABd}{{{b{AKl}}}AKl}{{{b{AL`}}}AL`}{{{b{ALb}}}ALb}{{{b{ABl}}}ABl}{{{b{ABf}}}ABf}{{{b{ALd}}}ALd}{{{b{ALf}}}ALf}{{{b{ALh}}}ALh}{{{b{c}}{b{de}}}h{}{}}00000000{{{b{c}}}h{}}000000000{{}ABd}{{}AL`}{{}ALf}{{}ALh}{j{{b{c}}}{}}00000000{j{{b{dc}}}{}}00000000{jh}00000000`{{{b{ABd}}{b{dn}}}Cd}{{{b{AKl}}{b{dn}}}Cd}{{{b{AL`}}{b{dn}}}Cd}{{{b{ALb}}{b{dn}}}Cd}{{{b{ABl}}{b{dn}}}Cd}{{{b{ABf}}{b{dn}}}Cd}{{{b{ALd}}{b{dn}}}Cd}{{{b{ALf}}{b{dn}}}Cd}{{{b{ALh}}{b{dn}}}Cd}{cc{}}00000000{{}j}00000000{ce{}{}}00000000{ABdAh}{AKlAh}{AL`Ah}{ALbAh}{ABlAh}{ABfAh}{ALdAh}{ALfAh}{ALhAh}``````````{{{b{c}}}e{}{}}00000000{{}{{Ab{ABdAl}}}}{{}{{Ab{AL`Al}}}}{{}{{Ab{ALfAl}}}}{{}{{Ab{ALhAl}}}}{c{{Ab{e}}}{}{}}00000000{Ah{{Ab{ABdAl}}}}{Ah{{Ab{AKlAl}}}}{Ah{{Ab{AL`Al}}}}{Ah{{Ab{ALbAl}}}}{Ah{{Ab{ABlAl}}}}{Ah{{Ab{ABfAl}}}}{Ah{{Ab{ALdAl}}}}{Ah{{Ab{ALfAl}}}}{Ah{{Ab{ALhAl}}}}999999999``{{{b{c}}}An{}}00000000``{ce{}{}}00000000`````````{{{b{c}}}{{b{e}}}{}{}}0000{{{b{dc}}}{{b{de}}}{}{}}0000{{{b{ALj}}}ALj}{{{b{ALl}}}ALl}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0{{{b{Ol}}}E`}{{}ALj}{{}ALl}{j{{b{c}}}{}}0000{j{{b{dc}}}{}}0000{{{b{c}}{b{Dd}}Ah}{{AAj{Ah{Ab{AhKj}}}}}Bj}{jh}0000{{{b{c}}}hBj}{{{b{Ol}}{b{dn}}}Cd}0{{{b{ALj}}{b{dn}}}Cd}{{{b{ALn}}{b{dn}}}Cd}0{{{b{ALl}}{b{dn}}}Cd}{cc{}}000{AM`ALn}1{{}j}0000{{{b{c}}{b{dABd}}e}lBj{}}{ce{}{}}0000{Ol{{Ab{LbOl}}}}{ALjAh}{ALlAh}{{{b{c}}}{{ABh{FhABf}}}Bj}{{{b{Ol}}}{{b{Dd}}}}````{{{b{ALn}}}{{Bf{{b{Ml}}}}}}`{{{b{c}}}e{}{}}0{{{b{c}}}Fh{}}0{{}{{Ab{ALjAl}}}}{{}{{Ab{ALlAl}}}}{c{{Ab{e}}}{}{}}0000{Ah{{Ab{ALjAl}}}}{Ah{{Ab{ALlAl}}}}22222{{{b{c}}}An{}}0000`{{{b{ALj}}}{{Ab{hc}}}{}}?????``````````{{{b{c}}}{{b{e}}}{}{}}0000{{{b{dc}}}{{b{de}}}{}{}}0000{{{b{AMb}}}AMb}{{{b{AMd}}}AMd}{{{b{AMf}}}AMf}{{{b{AMh}}}AMh}{{{b{c}}{b{de}}}h{}{}}000{{{b{c}}}h{}}000{{}AMb}{{}AMd}{{}AMf}{{}AMh}{j{{b{c}}}{}}0000{j{{b{dc}}}{}}0000{jh}0000{{{b{AMf}}{b{AMf}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{AMb}}{b{dn}}}Cd}{{{b{AMd}}{b{dn}}}Cd}{{{b{AM`}}{b{dn}}}Cd}0{{{b{AMf}}{b{dn}}}Cd}{{{b{AMh}}{b{dn}}}Cd}{{{b{AMh}}AdAd}{{`{{AMj{}{{A@l{ABj}}}}}}}}{{{b{AMd}}Cf}ACh}{{{b{dAMf}}}h}{cc{}}00001{{}j}0000{ce{}{}}0000{AMbAh}{AMdAh}{AMfAh}{AMhAh}``{{{b{c}}}e{}{}}000{{{b{c}}}Fh{}}{{}{{Ab{AMbAl}}}}{{}{{Ab{AMdAl}}}}{{}{{Ab{AMfAl}}}}{{}{{Ab{AMhAl}}}}{c{{Ab{e}}}{}{}}0000{Ah{{Ab{AMbAl}}}}{Ah{{Ab{AMdAl}}}}{Ah{{Ab{AMfAl}}}}{Ah{{Ab{AMhAl}}}}44444{{{b{c}}}An{}}0000`{{{b{AMd}}}{{Ab{hAM`}}}}{{{b{AMf}}}Ad}{ce{}{}}0000```````````````````````````````````````````````{{{b{c}}}{{b{e}}}{}{}}00000{{{b{dc}}}{{b{de}}}{}{}}00000{{{b{AMl}}}AMl}{{{b{AMn}}}AMn}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0{{{b{Nn}}}E`}{{{b{AN`}}}E`}{{}AMl}{{}AMn}{j{{b{c}}}{}}00000{j{{b{dc}}}{}}00000{{{b{c}}{b{Dd}}Ah}{{AAj{AhBl}}}Bj}{{{b{c}}{b{Dd}}Ah}{{AAj{Ah{Ab{AhKj}}}}}Bj}{jh}00000{{{b{c}}}hBj}{{{b{Nn}}{b{dn}}}Cd}0{{{b{AN`}}{b{dn}}}Cd}{{{b{AMl}}{b{dn}}}Cd}{{{b{ANb}}{b{dn}}}Cd}0{{{b{AMn}}{b{dn}}}Cd}{cc{}}0{BhNn}{NdNn}2222{ANd{{Ab{ANfNn}}}}0{ANd{{Ab{{F`{ANh}}Nn}}}}0{{}{{Bf{En}}}}0{ANd{{Bf{ANh}}}}0{{ANdEn}{{Ab{ANhNn}}}}0{{}j}00000{{{b{c}}{b{dABd}}e}lBj{}}{ce{}{}}00000{Nn{{Ab{LbNn}}}}{AN`Ah}{AMlAh}{AMnAh}{ANdl}0{{{b{Dd}}}l}{{{b{c}}}{{ABh{FhABf}}}Bj}{{{b{Nn}}}{{b{Dd}}}}{{}{{b{Dd}}}}``{{{b{c}}{b{L`}}}{{Ab{{Bf{ABj}}Bh}}}Bj}{{{b{Nn}}}{{Bf{{b{Ml}}}}}}`{{}{{F`{ABl}}}}{{{b{c}}}e{}{}}0{{{b{c}}}Fh{}}0{{}{{Ab{AMlAl}}}}{{}{{Ab{AMnAl}}}}{c{{Ab{e}}}{}{}}00000{Ah{{Ab{AMlAl}}}}{Ah{{Ab{AMnAl}}}}222222{{{b{c}}}An{}}00000`{{{b{AMl}}}{{Ab{hc}}}{}}{ce{}{}}00000````````{{{b{{ANj{c}}}}AdABj}{{ANl{Ad}}}ANn}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{{AO`{c}}}}}{{b{{ANj{c}}}}}ANn}{{{b{{ANj{c}}}}}{{ANj{c}}}ANn}{{{b{{AO`{c}}}}}{{AO`{c}}}ANn}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0{{}{{Bf{AOb}}}}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{{ANj{c}}}}AKl}{{ANl{Ad}}}ANn}{cc{}}0{{{b{{ANj{c}}}}Ad{b{ADd}}}{{ANl{ADf}}}ANn}{{}ANd}{{}j}0{ce{}{}}0{{{b{{ANj{c}}}}}{{ANl{Ad}}}ANn}{{{b{{ANj{c}}}}{b{{Gd{{Mj{Hl}}}}}}L`}{{ANl{Bn}}}ANn}`{{{b{ANn}}{b{Dd}}c}L`AAl}{{{Mj{ANn}}{AO`{ANn}}Ad}{{AOf{{Eb{AOd}}}}}}`{{{b{{ANj{c}}}}Ad{b{Dd}}e}{{ANl{g}}}ANnAAl{DnKl}}{{{Mj{ANn}}{AO`{ANn}}}{{AOf{{Eb{AOd}}}}}}{{{b{{ANj{c}}}}{Mj{Hl}}L`}{{ANl{Bn}}}ANn}{{{b{{AO`{c}}}}}{{Mj{Hl}}}ANn}{ANnh}{{{b{{ANj{c}}}}Ad}{{ANl{AOh}}}ANn}{{{b{c}}}e{}{}}0{c{{Ab{e}}}{}{}}000{{{b{c}}}An{}}0=={{{b{{ANj{c}}}}Adg}{{ANl{e}}}ANnKl{{AB`{}{{AAn{{ANl{e}}}}}}Kl}}`````````{{{b{{Mj{ce}}}}}{{b{e}}}{}AOj}{{{b{dAOl}}}{{Ab{{Mj{c}}AOn}}}B@`}{{{b{dAOl}}}{{Ab{{Mj{Dd}}AOn}}}}{{{b{dAOl}}}{{Ab{{Mj{{Gd{c}}}}AOn}}}B@`}{AOl{{Ab{{Mj{{Gd{c}}}}AOn}}}B@`}{{{b{{Mj{c}}}}}B@b{B@dGf}}{{{b{{Mj{c}}}}}{}{}}{{{b{{Mj{ce}}}}}{}GfAOj}{{{b{{Mj{c}}}}}B@fB@h}{{{b{{Mj{ce}}}}}{{b{c}}}GfAOj}{{{Mj{{B@j{c}}e}}}{{Mj{ce}}}{}AOj}{{{Mj{{Gd{{B@j{c}}}}e}}}{{Mj{{Gd{c}}e}}}{}AOj}`{{{b{c}}}{{b{e}}}{}{}}30{{{b{dc}}}{{b{de}}}{}{}}0{{{b{{Mj{c}}}}}{{Bf{{b{Ml}}}}}{MlGf}}`{{{b{{Mj{c}}}}Kd{b{Kf}}}{{Ab{{F`{Kh}}Kj}}}{B@lGf}}{{{b{{Mj{c}}}}GbAdHh{F`{Hh}}}{{AOf{{Eb{AOd}}}}}{B@nGf}}00{{{b{{Mj{c}}}}GbCh}{{AOf{{Eb{AOd}}}}}{B@nGf}}{{{b{{Mj{c}}}}GbAd{F`{Hh}}}{{AOf{{Eb{AOd}}}}}{B@nGf}}{{{b{{Mj{c}}}}}h{B@nGf}}{{{b{{Mj{ce}}}}}{{Mj{ce}}}Gf{AOjBA`}}{{{b{AOb}}}AOb}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0{{{b{{Mj{ce}}}}{b{{Mj{ce}}}}}Hb{BAbGf}AOj}{{{b{c}}{b{e}}}Hb{}{}}{{{b{c}}AdA@f}{{Ab{{F`{A@h}}Oh}}}{}}{{{b{c}}Ad}{{Ab{DbOh}}}{}}{{}h}{chAOj}{{}{{Mj{BAd}}}}{{}{{Mj{{Gd{c}}}}}{}}{{}{{Mj{Dd}}}}{{}{{Mj{c}}}BAf}{{}AOb}{j{{b{c}}}{}}{{{b{{Mj{ce}}}}}{{b{c}}}GfAOj}1{j{{b{dc}}}{}}0{{{b{{Mj{c}}}}}{{b{Dd}}}{MlGf}}{{{Mj{BAhc}}}{{Ab{{Mj{ec}}{Mj{BAhc}}}}}AOj{BAhKlKn}}{{{Mj{BAhc}}}{{Mj{ec}}}AOj{BAhKlKn}}{{{b{{Mj{ce}}}}}{{BAj{ce}}}Gf{BA`AOj}}{{{b{d{Mj{ce}}}}}hGfAOj}{jh}0{{{b{{Mj{c}}}}{b{BAl}}}l{BAnGf}}{{{b{c}}}e{}{{Hf{Hd}}}}0{{{b{{Mj{ce}}}}{b{{Mj{ce}}}}}l{BB`Gf}AOj}{{{b{AOb}}{b{AOb}}}l}{{{b{c}}{b{e}}}l{}{}}0{{{b{{Mj{c}}}}AdA@f}{{AOf{{Eb{AOd}}}}}{BBbGf}}{{{b{{Mj{c}}}}Kd{b{Kf}}{b{{Gd{Lh}}}}}{{Ab{LjKj}}}{B@lGf}}{{{b{{Mj{c}}}}Fl}h{B@lGf}}{{{b{d{Mj{BBd}}}}}{{Ab{hBBf}}}}{{{b{{Mj{c}}}}}h{BAnGf}}{{{b{{Mj{ce}}}}{b{dn}}}{{Ab{hA`}}}{BBhGf}AOj}{{{b{{Mj{ce}}}}{b{dn}}}{{Ab{hA`}}}{BBjGf}AOj}{{{b{{Mj{ce}}}}{b{dn}}}{{Ab{hA`}}}GfAOj}{{{b{AOb}}{b{dn}}}{{Ab{hA`}}}}{{{b{BAd}}}{{Mj{BAd}}}}{{{BBl{c}}}{{Mj{{Gd{c}}}}}{}}{c{{Mj{c}}}{}}{cc{}}{BBn{{Mj{BC`}}}}{{{BCb{c}}}{{Mj{c}}}{BCdGf}}{{{Mj{Dd}}}{{Mj{{Gd{Gb}}}}}}{BCfc{}}{{{F`{ce}}}{{Mj{{Gd{c}}e}}}{}{AOjBA`}}{BCh{{Mj{BCj}}}}{{{b{BC`}}}{{Mj{BC`}}}}{BCl{{Mj{BAd}}}}{Fh{{Mj{Dd}}}}{{{Eb{ce}}}{{Mj{ce}}}GfAOj}{{{b{BCj}}}{{Mj{BCj}}}}{{{b{{Gd{c}}}}}{{Mj{{Gd{c}}}}}BA`}{{{b{Dd}}}{{Mj{Dd}}}}={{{b{{Gd{Gb}}}}}{{Ab{{Mj{c}}Hj}}}{HlGf}}{e{{Mj{{Gd{c}}}}}{}{{A@n{}{{A@l{c}}}}}}{{}{{Mj{c}}}{}}{{}{{Mj{c}}}Gf}{c{{Mj{ec}}}AOjGf}{{{b{{Mj{ce}}}}{b{{Mj{ce}}}}}l{BCnGf}AOj}{{{b{{Mj{c}}}}{F`{Gb}}}{{Ab{{F`{Gb}}Kj}}}{BD`Gf}}{{{b{d{Mj{ce}}}}}{{Bf{{b{dc}}}}}GfAOj}{{{b{d{Mj{ce}}}}}{{b{dc}}}GfAOj}{{{b{{Mj{c}}}}ChAd}{{AOf{{Eb{AOd}}}}}{B@nGf}}0004{{{b{{Mj{ce}}}}{b{dg}}}h{BDbGf}AOjAf}``{{}h}{ch{BA`AOj}}{{}j}0{{{b{{Mj{c}}}}{F`{Gb}}{F`{Gb}}}{{Ab{hKj}}}{BD`Gf}}{ce{}{}}0{AObAh}{{{Mj{ce}}}{{Bf{c}}}{}AOj}{{{Mj{c}}}{}{}}{{{Mj{ce}}}{}GfAOj}{{{Mj{ce}}}{{Bd{e}}}GfAOj}{{{b{{Mj{c}}}}BDd}l{BDfGf}}{{{b{{Mj{BBd}}}}}l}0{{{b{{Mj{c}}}}}{{AOf{{Eb{AOd}}}}}{BBbGf}}0{{{b{{Mj{ce}}}}{b{{Mj{ce}}}}}l{BCnGf}AOj}{{{b{c}}}{{BDh{e}}}{}{}}{{{b{c}}}{}{}}{{{b{{Mj{c}}}}{b{BDj}}{b{BDl}}}Ab{BDfGf}}{{{b{{Mj{c}}}}{b{BDn}}}h{BAnGf}}4`{{{b{d{Mj{ce}}}}}{{b{dc}}}{BE`Gf}{AOjBA`}}`{{{b{{Mj{ce}}}}{b{{Mj{ce}}}}}l{BB`Gf}AOj}{c{{Mj{c}}}{}}{e{{Mj{c}}}{}{{AB`{{b{{BAj{c}}}}}{{AAn{c}}}}}}{{{b{{Gd{Gb}}}}}{{Ab{{Mj{c}}Hj}}}{HlGf}}{{ce}{{Mj{ce}}}{}AOj}{{}{{Mj{{B@j{c}}}}}{}}{c{{Mj{{B@j{e}}c}}}AOj{}}{j{{Mj{{Gd{{B@j{c}}}}}}}{}}{{jc}{{Mj{{Gd{{B@j{e}}}}c}}}AOj{}}3210{{{b{{Mj{ce}}}}{b{{Mj{ce}}}}}{{Bf{Hb}}}{BCnGf}AOj}`{c{{AOf{{Mj{c}}}}}{}}{{ce}{{AOf{{Mj{ce}}}}}{}AOj}{{{b{{Mj{c}}}}{b{dBEb}}}h{MlGf}}{{{b{{Mj{ce}}}}{b{{Mj{ce}}}}}lGfAOj}{{{b{{Mj{c}}}}}En{HlGf}}{{{b{{Mj{c}}}}Kd{b{Dd}}{F`{Gb}}}{{Ab{{F`{Gb}}Kj}}}{B@lGf}}{{{b{dc}}}{{Ab{{Mj{e}}Hj}}}Fn{HlGf}}{{{b{d{Mj{BBd}}}}{b{d{Gd{Gb}}}}}{{Ab{jBBf}}}}{{{b{d{Mj{BBd}}}}BEd}{{Ab{hBBf}}}}{{{b{d{Mj{BBd}}}}{b{d{F`{Gb}}}}}{{Ab{jBBf}}}}{{{b{d{Mj{BBd}}}}{b{dFh}}}{{Ab{jBBf}}}}{{{b{d{Mj{BBd}}}}{b{d{Gd{BEf}}}}}{{Ab{jBBf}}}}{{{b{{Mj{c}}}}Ad{F`{Hh}}}{{AOf{{Eb{AOd}}}}}{B@nGf}}0{{{b{{Mj{c}}}}}{{Bf{Eh}}}{B@nGf}}`{{{b{{Mj{c}}}}}{{Bf{Hh}}}{B@nGf}}{{{b{{Mj{c}}}}Kd{b{dKf}}{b{{Gd{Lh}}}}}{{Ab{LjKj}}}{B@lGf}}`{{{b{d{Mj{BBd}}}}BEh}{{Ab{AdBBf}}}}{{{b{{Mj{c}}}}{b{BDj}}{b{Dd}}{b{dBEj}}}{{Ab{hBEl}}}{BEnGf}}{{{b{{Mj{c}}}}{b{BDj}}{b{dBEj}}}{{Ab{hBEl}}}{BF`Gf}}{{{b{d{Mj{c}}}}{Mj{Mh}}}h{B@lGf}}{{{b{{Mj{c}}}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}{HlGf}}{{{b{{Mj{c}}}}{b{{Gd{Gb}}}}}{{Ab{FbHj}}}{HlGf}}{j{{Bd{j{Bf{j}}}}}}00{{{b{{Mj{c}}}}}{{Bf{{b{Ml}}}}}{MlGf}}{{{b{{Mj{c}}}}{BFb{h}}}{{Ab{hBFd}}}{BFfGf}}{{{b{{Mj{c}}}}{BFh{h}}}{{Ab{hBFd}}}{BFjGf}}{{{b{{Mj{c}}}}Ad}{{AOf{{Eb{AOd}}}}}{BBbGf}}{{{b{{Mj{c}}}}}{{Ab{hBFd}}}{BFjGf}}{{{b{{Mj{c}}}}}{{Ab{hBFd}}}{BFfGf}}{{{b{{Mj{ce}}}}}jGfAOj}3{{{b{{Mj{c}}}}}{{F`{Gb}}}{HlGf}}{{{b{c}}}e{}{}}0{{{b{c}}}Fh{}}{{}{{Ab{AObAl}}}}{c{{Ab{e}}}{}{}}{{{Mj{{Gd{c}}e}}}{{Ab{{Mj{{BBl{c}}e}}}}}{}AOj}1{Ah{{Ab{AObAl}}}}22{c{{Ab{{Mj{c}}BFl}}}{}}{{ce}{{Ab{{Mj{ce}}BFl}}}{}AOj}{{}{{Ab{{Mj{{B@j{c}}}}BFl}}}{}}{c{{Ab{{Mj{{B@j{e}}c}}BFl}}}AOj{}}10{c{{Ab{{AOf{{Mj{c}}}}BFl}}}{}}{{ce}{{Ab{{AOf{{Mj{ce}}}}BFl}}}{}AOj}{{{Mj{ce}}}{{Ab{c{Mj{ce}}}}}{}AOj}{{{b{c}}}An{}}0{{{b{{Mj{c}}}}BFn}{{AOf{{Eb{AOd}}}}}{BBbGf}}{{{Mj{ce}}}cBA`AOj}{{{b{{Mj{c}}}}BFnEdAd}{{AOf{{Eb{AOd}}}}}{BBbGf}}0{ce{}{}}0{{{b{{Mj{ce}}}}}jGfAOj}{{{b{dc}}{b{{Gd{Gb}}}}}{{Ab{hBG`}}}{}}{{{b{d{Mj{BBd}}}}{b{{Gd{Gb}}}}}{{Ab{jBBf}}}}{{{b{d{Mj{BBd}}}}{b{{Gd{BGb}}}}}{{Ab{jBBf}}}}`````{{{b{ANd}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{ANd}}}ANd}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}0{{{b{ANd}}{b{ANd}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}{{}ANd}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{c}}}e{}{{Hf{Hd}}}}0{{{b{ANd}}{b{ANd}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{BGd}}{b{dn}}}Cd}0{{{b{ANd}}{b{dn}}}Cd}00{cc{}}0{{{b{Dd}}}ANd}{{{b{Dd}}}{{Ab{ANdBGd}}}}{{{b{{Gd{Gb}}}}}{{Ab{ANdBGd}}}}{{ABjAd}ANd}{{ABjAdE`}ANd}4{{{b{ANd}}{b{dc}}}hAf}{{}j}0{ce{}{}}0{ANd{{BBl{Gb}}}}{ANdAh}{{{b{ANd}}{b{ANd}}}{{Bf{Hb}}}}{{{b{ANd}}{b{BDj}}BGf{b{dBEj}}}BGh}{ANdFh}{{{b{c}}}e{}{}}{{{b{c}}}Fh{}}0{{}{{Ab{ANdAl}}}}{c{{Ab{e}}}{}{}}0{{{b{{Gd{Gb}}}}}{{Ab{ANdc}}}{}}{Ah{{Ab{ANdAl}}}}22{{{b{c}}}An{}}0<<``````````{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{BGj}}}BGj}{{{b{BGl}}}BGl}{{{b{BGn}}}BGn}{{{b{c}}{b{de}}}h{}{}}00{{{b{c}}}h{}}00{{}BGj}{{}BGn}{j{{b{c}}}{}}00{j{{b{dc}}}{}}00{jh}00``{{{b{BGj}}{b{BGj}}}l}{{{b{BGl}}{b{BGl}}}l}{{{b{BGn}}{b{BGn}}}l}{{{b{c}}{b{e}}}l{}{}}00`{{{b{BGj}}{b{dn}}}Cd}{{{b{BGl}}{b{dn}}}Cd}{{{b{BGn}}{b{dn}}}Cd}{cc{}}00{{}j}00{ce{}{}}00{BGjAh}{BGlAh}{BGnAh}``{{{b{c}}}e{}{}}00{{}{{Ab{BGjAl}}}}{c{{Ab{e}}}{}{}}00{Ah{{Ab{BGjAl}}}}{Ah{{Ab{BGlAl}}}}{Ah{{Ab{BGnAl}}}}333{{{b{c}}}An{}}00:::`{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{BH`}}}BH`}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{}BH`}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{BH`}}{b{BH`}}}l}{{{b{c}}{b{e}}}l{}{}}{{Cfj}h}{{{b{BH`}}{b{dn}}}Cd}{{HhHh}BH`}{HhBH`}{cc{}}{ANd{{Bf{ANf}}}}{{{b{En}}}{{Bf{BH`}}}}{{ANd{b{Hh}}}{{Bf{ANh}}}}{ANd{{F`{ANh}}}}{{}j}{ce{}{}}{BH`Ah}``{ANdh}{{ANd{b{Hh}}}h}{ANfh}{{{b{c}}}e{}{}}{{}{{Ab{BH`Al}}}}{c{{Ab{e}}}{}{}}{Ah{{Ab{BH`Al}}}}1{{{b{c}}}An{}}{ANh{{Ab{hNn}}}}:``````````````````{{{b{c}}}{{b{e}}}{}{}}000000000{{{b{dc}}}{{b{de}}}{}{}}000000000{{{b{BHb}}}BHb}{{{b{BHd}}}BHd}{{{b{BHf}}}BHf}{{{b{BHh}}}BHh}{{{b{ANf}}}ANf}{{{b{BHj}}}BHj}{{{b{ANh}}}ANh}{{{b{BHl}}}BHl}{{{b{BHn}}}BHn}{{{b{BI`}}}BI`}{{{b{c}}{b{de}}}h{}{}}000000000{{{b{c}}}h{}}0000000000{{}BHb}{{}BHd}{{}BHf}{{}BHh}{{}ANf}{{}BHj}{{}ANh}{{}BHl}{{}BI`}{j{{b{c}}}{}}000000000{j{{b{dc}}}{}}000000000{jh}000000000``{{{b{ANh}}{b{ANh}}}l}{{{b{c}}{b{e}}}l{}{}}````{{{b{BHb}}{b{dn}}}Cd}{{{b{BHd}}{b{dn}}}Cd}{{{b{BHf}}{b{dn}}}Cd}{{{b{BHh}}{b{dn}}}Cd}{{{b{ANf}}{b{dn}}}Cd}{{{b{BHj}}{b{dn}}}Cd}{{{b{ANh}}{b{dn}}}Cd}{{{b{BHl}}{b{dn}}}Cd}{{{b{BHn}}{b{dn}}}Cd}{{{b{BI`}}{b{dn}}}Cd}{cc{}}000000000````{{}j}000000000{ce{}{}}000000000{BHbAh}{BHdAh}{BHfAh}{BHhAh}{ANfAh}{BHjAh}{ANhAh}{BHlAh}{BHnAh}{BI`Ah}`````````{{{b{c}}}e{}{}}000000000{{}{{Ab{BHbAl}}}}{{}{{Ab{BHfAl}}}}{{}{{Ab{BHhAl}}}}{{}{{Ab{ANfAl}}}}{{}{{Ab{BHjAl}}}}{{}{{Ab{ANhAl}}}}{{}{{Ab{BHlAl}}}}{{}{{Ab{BI`Al}}}}{c{{Ab{e}}}{}{}}000000000{Ah{{Ab{BHbAl}}}}{Ah{{Ab{BHdAl}}}}{Ah{{Ab{BHfAl}}}}{Ah{{Ab{BHhAl}}}}{Ah{{Ab{ANfAl}}}}{Ah{{Ab{BHjAl}}}}{Ah{{Ab{ANhAl}}}}{Ah{{Ab{BHlAl}}}}{Ah{{Ab{BHnAl}}}}{Ah{{Ab{BI`Al}}}}::::::::::{{{b{c}}}An{}}000000000{ce{}{}}000000000`````````{{}{{Bf{AOb}}}}{{}}{{{b{Dd}}}l}00{{{b{c}}}hBj}0{{}h}{{}{{Bf{BIb}}}}```{{{b{c}}}{{b{e}}}{}{}}{{{b{dc}}}{{b{de}}}{}{}}{{{b{Nb}}}E`}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{BId}}{Bf{Fl}}E`}{{Ab{{Bf{Kf}}Nb}}}}{{{b{Nb}}{b{dn}}}Cd}0{cc{}}{{}j}{ce{}{}}{Nb{{Ab{LbNb}}}}{{{b{Nb}}}{{b{Dd}}}}{{{b{c}}}Fh{}}{c{{Ab{e}}}{}{}}0{{{b{c}}}An{}}5``?>{{{b{AKn}}}AKn}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{}AKn}{j{{b{c}}}{}}{j{{b{dc}}}{}}{jh}{{{b{AKn}}{b{AKn}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{AKn}}{b{dn}}}Cd}{cc{}}{{{b{AKn}}}{{F`{Gb}}}}{{}j}{ce{}{}}`{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}0`{{{b{c}}}An{}}3``````````````{{{b{dBIf}}{b{Dd}}}{{BIh{c}}}BAh}{{{b{c}}}{{b{e}}}{}{}}0000000{{{b{dc}}}{{b{de}}}{}{}}0000000{{{b{Gl}}}Gl}{{{b{BIj}}}BIj}{{{b{BIl}}}BIl}{{{b{BIn}}}BIn}{{{b{c}}{b{de}}}h{}{}}000{{{b{c}}}h{}}0000{{{b{dBIf}}}h}{{}h}`{{}Gl}{{}BIj}{{}BIn}{j{{b{c}}}{}}0000000{j{{b{dc}}}{}}0000000{jh}0000000{{{b{dBIf}}c}hA@`}{{{b{dBIf}}On}h}{{{b{dBIf}}{b{c}}BJ`AFj}{{Ab{hBh}}}Bj}2{{{b{BIf}}}j}0{{{b{BIf}}{b{c}}}E`Bj}{{cg}eBJb{}{{AB`{}{{AAn{e}}}}}}{{BIncg}eBJb{}{{AB`{}{{AAn{e}}}}}}{{{b{BIf}}}{{b{BIj}}}}0{{{b{Gl}}{b{Gl}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{Gl}}{b{dn}}}Cd}0{{{b{BIj}}{b{dn}}}Cd}{{{b{BIl}}{b{dn}}}Cd}{{{b{BIn}}{b{dn}}}Cd}{cc{}}{h{{BJd{h}}}}{{{Ab{ce}}}{{BJd{{Ab{ce}}}}}{}{}}2222222{{{BIh{c}}}{{Bf{{b{c}}}}}BAh}{{{b{d{BIh{c}}}}}{{Bf{{b{dc}}}}}BAh}{{{b{BIf}}}l}`{{{b{dBIf}}}h}`{{}j}0000000{L`BIl}`{ce{}{}}0000000{{{b{BIj}}}l}000000{{{b{BIf}}}j}{{{b{dBIf}}{b{Dd}}}{{BIh{c}}}BAh}{{{b{BIj}}}Gl}`{{}BIn}8{{{BIh{c}}}{{b{dc}}}{BAhBAf}}4{{{b{dBIf}}}{{b{dFj}}}}`:{{}h}{{{BIh{c}}c}{{b{dc}}}BAh}`1{{{b{dBIf}}}{{b{dBJb}}}}{{{BIh{c}}}{{Bf{c}}}BAh}{{{b{dBIf}}}A@d}0{{{b{dBIf}}}{{F`{{Bd{BJ`AFj}}}}}}1{{{b{c}}}e{}{}}000{{{b{c}}}Fh{}}{c{{Ab{e}}}{}{}}000000000000000`{{{b{BIj}}}{{b{AAd}}}}{{{b{BIj}}}BJf}{{{b{BIj}}}ABj}{{{b{BIj}}}{{Bf{En}}}}{{{b{BIj}}}j}{{{b{BIj}}}E`}{{{b{c}}}An{}}0000000{ce{}{}}0000000{ec{}{{AB`{{b{dBIf}}}{{AAn{c}}}}}}{ec{}{{AB`{{b{BIj}}}{{AAn{c}}}}}}0{{BInl}BIn}{{BInGl}BIn}{BInBIn}{ec{}{{AB`{{b{dBJb}}}{{AAn{c}}}}}}{gc{}{{BJh{{BJd{c}}}}}{{AB`{}{{AAn{e}}}}}}{{BIng}c{}{{BJh{{BJd{c}}}}}{{AB`{}{{AAn{e}}}}}}{{BInBIl}BIn}````````````{{{b{Mb}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}000000{{{b{dc}}}{{b{de}}}{}{}}000000{{{b{Mb}}}Mb}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{{{b{Mb}}{b{Mb}}}Hb}{{{BJl{}{{BJj{c}}}}}c{}}{{{BJn{c}}}eBK`{}}{{{BKb{c}}}eBJb{}}{{{b{c}}{b{e}}}Hb{}{}}`{{}Mb}{j{{b{c}}}{}}000000{{{b{Mb}}}b}{j{{b{dc}}}{}}000000{{{b{dMb}}}{{b{d}}}}{jh}000000{{{b{c}}}e{}{{Hf{Hd}}}}0{{{b{Mb}}{b{Mb}}}l}{{{b{c}}{b{e}}}l{}{}}{{{b{Mb}}{b{dn}}}{{Ab{hA`}}}}{cc{}}00000{{{F`{Gb}}}Mb}1{{{b{BJb}}{b{{Gd{Gb}}}}}{{Bf{{F`{Gb}}}}}}{{{b{{BKd{ce}}}}{b{{Gd{Gb}}}}}{{Bf{{F`{Gb}}}}}BJbIh}{{{b{AOh}}{b{{Gd{Gb}}}}}{{Bf{{F`{Gb}}}}}}{{{b{{BJn{c}}}}{b{{Gd{Gb}}}}}{{Bf{{F`{Gb}}}}}BK`}{{{b{{BKb{c}}}}{b{{Gd{Gb}}}}}{{Bf{{F`{Gb}}}}}BJb}{{{b{{BKf{ce}}}}{b{{Gd{Gb}}}}}{{Bf{{F`{Gb}}}}}BJb{{ACf{{Gd{Gb}}}}}}{{{b{{BKh{c}}}}e}{{Bf{g}}}BJb{{ACf{{Gd{Gb}}}}}Dn}{{{b{{BJl{}{{BJj{c}}}}}}}l{}}{{{b{{BJn{c}}}}}lBK`}{{{b{{BKb{c}}}}}lBJb}{{}j}000000{{{b{dBJb}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}h}{{{b{d{BKd{ce}}}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}hBJbIh}{{{b{dAOh}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}h}{{{b{d{BJn{c}}}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}hBK`}{{{b{d{BKb{c}}}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}hBJb}{{{b{d{BKf{ce}}}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}hBJb{{ACf{{Gd{Gb}}}}}}{{{b{d{BKh{c}}}}eg}hBJb{{ACf{{Gd{Gb}}}}}AAl}{ce{}{}}000000{MbAh}{{{b{BJb}}}{{Eb{BKj}}}}{{{b{{BKd{ce}}}}}{{Eb{BKj}}}BJbIh}{{{b{AOh}}}{{Eb{BKj}}}}{{{b{{BJn{c}}}}}{{Eb{BKj}}}BK`}{{{b{{BKb{c}}}}}{{Eb{BKj}}}BJb}{{{b{{BKf{ce}}}}}{{Eb{BKj}}}BJb{{ACf{{Gd{Gb}}}}}}{{{b{{BKh{c}}}}}{{`{eg}}}BJb{{BKl{{b{{Gd{Gb}}}}}}}{DnBAf}}{c{{BKd{ce}}}BJbIh}{{{Mj{BKn}}BL`}AOh}{c{{BJn{c}}}BK`}{c{{BKb{c}}}BJb}{{ce}{{BKf{ce}}}BJb{{ACf{{Gd{Gb}}}}}}{c{{BKh{c}}}BJb}{{{Mj{BKn}}{b{{Mj{BBb}}}}EhAd}{{ANl{AOh}}}}{{{b{Mb}}{b{Mb}}}{{Bf{Hb}}}}{{{b{{BJl{}{{BJj{c}}}}}}}j{}}{{{b{{BJn{c}}}}}jBK`}{{{b{{BKb{c}}}}}jBJb}{{{b{dBJb}}{F`{Mb}}Aj}h}{{{b{d{BKd{ce}}}}{F`{Mb}}Aj}hBJbIh}{{{b{dAOh}}{F`{Mb}}Aj}h}{{{b{d{BJn{c}}}}{F`{Mb}}Aj}hBK`}{{{b{d{BKb{c}}}}{F`{Mb}}Aj}hBJb}{{{b{d{BKf{ce}}}}{F`{Mb}}Aj}hBJb{{ACf{{Gd{Gb}}}}}}{{{b{dBJb}}{b{{Gd{Gb}}}}}h}{{{b{d{BKd{ce}}}}{b{{Gd{Gb}}}}}hBJbIh}{{{b{dAOh}}{b{{Gd{Gb}}}}}h}{{{b{d{BJn{c}}}}{b{{Gd{Gb}}}}}hBK`}{{{b{d{BKb{c}}}}{b{{Gd{Gb}}}}}hBJb}{{{b{d{BKf{ce}}}}{b{{Gd{Gb}}}}}hBJb{{ACf{{Gd{Gb}}}}}}{{{b{d{BKh{c}}}}e}hBJb{{ACf{{Gd{Gb}}}}}}{{{BJl{}{{BJj{c}}}}}c{}}{{{BJn{c}}}eBK`{}}{{{BKb{c}}}eBJb{}}{{{b{c}}}e{}{}}{{}{{Ab{MbAl}}}}{c{{Ab{e}}}{}{}}000000{Ah{{Ab{MbAl}}}}1111111{{{b{c}}}An{}}000000{ce{}{}}000000``````{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0{{{b{BLb}}{b{dn}}}Cd}0{cc{}}0{{{b{{BLd{c}}}}{b{{Gd{Gb}}}}}{{Bf{{F`{Gb}}}}}BJb}{{}j}0{{{b{d{BLd{c}}}}{b{{Gd{Gb}}}}{b{{Gd{Gb}}}}}hBJb}::{{{b{{BLd{c}}}}}{{Eb{BKj}}}BJb}{{c{BBl{Gb}}{b{{Gd{{b{{Gd{Gb}}}}}}}}}{{BLd{c}}}BJb}{{{b{d{BLd{c}}}}{F`{Mb}}Aj}hBJb}{{{b{d{BLd{c}}}}{b{{Gd{Gb}}}}}hBJb}{{{b{c}}}Fh{}}{c{{Ab{e}}}{}{}}000{{{b{c}}}An{}}0{ce{}{}}0{{{b{d{BLd{c}}}}}hBJb}`````{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{c}}BLfe}{{Ab{BLhBh}}}BjBLj}``{{{b{BLf}}}BLf}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}{j{{b{c}}}{}}00{j{{b{dc}}}{}}00{jh}00{{{b{BLf}}{b{dn}}}Cd}{{{b{BLh}}{b{dn}}}Cd}{cc{}}00`{{{b{c}}}AjBj}{{}j}00???```{{{b{c}}}e{}{}}{c{{Ab{e}}}{}{}}00000{{{b{c}}}An{}}00{{{b{BLj}}{b{BLf}}}{{Ab{hBh}}}}{{{b{BLl}}{b{BLf}}}{{Ab{hBh}}}}{ce{}{}}00```````````````````````````````````````````{{{b{Ch}}}{{b{{Gd{Gb}}}}}}{{{b{BLn}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}000000{{{b{dc}}}{{b{de}}}{}{}}000000{{{b{BM`}}}{{Eb{Dl}}}}``{{{b{BM`}}}h}{{{b{Ch}}}Ch}{{{b{BLn}}}BLn}{{{b{AA`}}}AA`}{{{b{AAb}}}AAb}{{{b{BIb}}}BIb}{{{b{BM`}}}BM`}{{{b{c}}{b{de}}}h{}{}}00000{{{b{c}}}h{}}000000{{{b{Ch}}{b{Ch}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}{{}Ch}{{}BLn}{{}AA`}{{}AAb}{{}BIb}{{}BM`}{j{{b{c}}}{}}000000{j{{b{dc}}}{}}000000{jh}00{{{b{dBLn}}}h}1111{{{b{c}}}e{}{{Hf{Hd}}}}000{{{b{Ch}}{b{Ch}}}l}{{{b{AAb}}{b{AAb}}}l}{{{b{c}}{b{e}}}l{}{}}0`{{{b{M`}}{b{dn}}}{{Ab{hA`}}}}0{{{b{Ch}}{b{dn}}}{{Ab{hA`}}}}00{{{b{AAb}}{b{dn}}}{{Ab{hA`}}}}{{{b{BIb}}{b{dn}}}{{Ab{hA`}}}}{NlM`}{cc{}}{OjM`}{NjM`}{{{F`{Gb}}}Ch}{{{b{{Gd{Gb}}}}}Ch}4{{{b{Dd}}}Ch}55555{{C`{F`{Gb}}}AA`}{{{b{Dd}}}{{Ab{ChBMb}}}}{{}AA`}{{{b{BM`}}ChCf}{{Ab{AA`M`}}}}{{{b{BM`}}Ch}{{Ab{AA`M`}}}}{{{b{BM`}}ChCf}{{Ab{AAbM`}}}}{{{b{BM`}}Ch}{{Ab{AAbM`}}}}{{{b{Ch}}{b{dc}}}hAf}{{}j}000000`{ce{}{}}000000{ChAh}{BLnAh}{AA`Ah}{AAbAh}{BIbAh}`6{{C`CbBLn{F`{Gb}}}AA`}{{C`{F`{Gb}}EhCh{Bf{Ad}}{b{{Mj{BMd}}}}}{{Ab{AAbNj}}}}{{}BM`}{{{b{Ch}}{b{Ch}}}{{Bf{Hb}}}}{{{b{BM`}}}{{Bf{Eh}}}}{{{b{BM`}}}{{Bf{Hh}}}}``{{{b{M`}}}{{Bf{{b{Ml}}}}}}``{{{b{c}}}e{}{}}00000{{{b{c}}}Fh{}}0{{}{{Ab{ChAl}}}}{{}{{Ab{BLnAl}}}}{{}{{Ab{AA`Al}}}}{{}{{Ab{AAbAl}}}}{{}{{Ab{BIbAl}}}}{c{{Ab{e}}}{}{}}000000{Ah{{Ab{ChAl}}}}{Ah{{Ab{BLnAl}}}}{Ah{{Ab{AA`Al}}}}{Ah{{Ab{AAbAl}}}}{Ah{{Ab{BIbAl}}}}5555555{{{b{c}}}An{}}000000{{{b{AAb}}EhCh{Bf{Ad}}{Bf{Ad}}{b{Hh}}}{{Ab{hNj}}}}{{{b{BIb}}{b{e}}}{{Ab{{b{c}}Nj}}}{}{{BMf{c}}}}{ce{}{}}000000{{{b{dCh}}}h}{{{b{dBLn}}}h}```````{{}ABj}{{}En}{{}I`}{{}BMh}3210321032{{}Ij}1430143{{}K`}25402`````{{{b{c}}}{{b{e}}}{}{}}0000{{{b{dc}}}{{b{de}}}{}{}}0000{{{b{dBMj}}{b{c}}{b{Dd}}e}LfBjAAl}{{{b{dBMj}}{b{c}}{b{Dd}}eBMl}LfBjAAl}{{{b{BMl}}}BMl}{{{b{c}}{b{de}}}h{}{}}{{{b{c}}}h{}}`{{{b{dBMn}}}{{D`{BN`}}}}{{{b{dBMn}}l}{{D`{c}}}Cn}{{}BMn}{{}BMl}{j{{b{c}}}{}}0000{j{{b{dc}}}{}}0000{jh}0000{{}{{BJn{{BNd{BNb}}}}}}```{{{b{BMl}}{b{dn}}}Cd}{cc{}}0000{{}}``{{}j}0000{ce{}{}}0000`{{AdBMh}BMj}{{{b{BMj}}{b{c}}{b{Dd}}e}{{Ab{gKj}}}BjAAlDn}``{{{b{BMj}}}{{b{BMh}}}}{{{b{c}}}e{}{}}{{}L`}{c{{Ab{e}}}{}{}}000000000{{{b{c}}}An{}}000077777{{{ABh{FhAh}}}BMn}``````````````````````{{{b{ABj}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{BMh}}}BMh}{{{b{ABj}}}ABj}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}00{{{b{ABj}}{b{ABj}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}{{}ABj}{j{{b{c}}}{}}00{j{{b{dc}}}{}}00{jh}00{{{b{c}}}e{}{{Hf{Hd}}}}0{{{b{BMh}}{b{BMh}}}l}{{{b{ABj}}{b{ABj}}}l}{{{b{c}}{b{e}}}l{}{}}0{{{b{BMh}}{b{dn}}}Cd}{{{b{BNf}}{b{dn}}}Cd}0{{{b{ABj}}{b{dn}}}Cd}00{cc{}}0{{{b{Dd}}}ABj}1{{{b{Dd}}}{{Ab{ABjBNf}}}}{{{b{{Gd{Gb}}}}}{{Ab{ABjBNf}}}}{{{b{Hh}}}ABj}{{{b{{Gd{Gb}}}}}ABj}{{{b{Dd}}{b{Dd}}}ABj}{{{b{Dd}}{b{{Gd{Gb}}}}}ABj}{EjABj}{{{b{Eh}}}ABj}{{{b{BMh}}}ABj}{{{b{ABj}}{b{dc}}}hAf}{{}j}00{ce{}{}}00{ABj{{BBl{Gb}}}}{BMhAh}{ABjAh}{{{b{{Gd{Gb}}}}Gb{b{{Gd{Gb}}}}}ABj}{{{b{ABj}}{b{ABj}}}{{Bf{Hb}}}}{{{b{BMh}}}En}{{{b{ABj}}{b{BDj}}BGf{b{dBEj}}}BGh}{ABjFh}{{{b{c}}}e{}{}}0{{{b{c}}}Fh{}}0{{}{{Ab{ABjAl}}}}{c{{Ab{e}}}{}{}}0{{{b{{Gd{Gb}}}}}{{Ab{ABjc}}}{}}1{Ah{{Ab{BMhAl}}}}{Ah{{Ab{ABjAl}}}}{{{b{En}}}{{Bf{BMh}}}}444{{{b{c}}}An{}}00{ce{}{}}00```{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{BNh}}}BNh}{{{b{BNj}}}BNj}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0``{{}BNh}{{}BNj}{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0`{{{b{BNh}}{b{dn}}}Cd}{{{b{BNj}}{b{dn}}}Cd}{cc{}}0{{}j}0??{BNhAh}{BNjAh}```{{{b{c}}}e{}{}}0{{}{{Ab{BNhAl}}}}{{}{{Ab{BNjAl}}}}{c{{Ab{e}}}{}{}}0{Ah{{Ab{BNhAl}}}}{Ah{{Ab{BNjAl}}}}22{{{b{c}}}An{}}0{ce{}{}}0```{{{b{c}}}{{b{e}}}{}{}}0{{{b{dc}}}{{b{de}}}{}{}}0{{{b{AFj}}}AFj}{{{b{ABb}}}ABb}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0``{j{{b{c}}}{}}0{j{{b{dc}}}{}}0{jh}0`{{{b{AFj}}{b{dn}}}Cd}{{{b{ABb}}{b{dn}}}Cd}{cc{}}0``{{}j}0=={AFjAh}`{{Fhc}AFjAAl}``{{{b{c}}}e{}{}}0{c{{Ab{e}}}{}{}}0{Ah{{Ab{AFjAl}}}}11{{{b{c}}}An{}}0{ce{}{}}0``````{{{b{ACh}}}ADf}{{{b{ADd}}}{{b{{Gd{Gb}}}}}}{{{b{c}}}{{b{e}}}{}{}}00{{{b{dc}}}{{b{de}}}{}{}}00{{{b{ADd}}}ADd}{{{b{ACh}}}ACh}{{{b{c}}{b{de}}}h{}{}}0{{{b{c}}}h{}}0{{{b{ADd}}{b{ADd}}}Hb}{{{b{ACh}}{b{ACh}}}Hb}{{{b{c}}{b{e}}}Hb{}{}}0{{}ADd}{{}ACh}{{{b{ACh}}}{{b{ADd}}}}{j{{b{c}}}{}}00{j{{b{dc}}}{}}00{jh}00{{{b{c}}}e{}{{Hf{Hd}}}}0{{{b{ADd}}{b{ADd}}}l}{{{b{ACh}}{b{ACh}}}l}{{{b{c}}{b{e}}}l{}{}}0{{{b{ADd}}{b{dn}}}Cd}0{{{b{BNl}}{b{dn}}}Cd}0{{{b{ACh}}{b{dn}}}Cd}0{cc{}}00{{{b{Dd}}}{{Ab{ADdc}}}{}}{{{b{ADd}}{b{dc}}}hAf}{{}j}00{ce{}{}}00{ADdAh}{AChAh}{ADd{{F`{Gb}}}}{{{b{ADd}}}l}{{ADfADd}ACh}{{{b{ADd}}{b{ADd}}}{{Bf{Hb}}}}{{{b{ACh}}{b{ACh}}}{{Bf{Hb}}}}{{{b{c}}}e{}{}}0{{{b{c}}}Fh{}}00{{}{{Ab{ADdAl}}}}{{}{{Ab{AChAl}}}}{{{b{{Gd{Gb}}}}}{{Ab{ADdc}}}{}}{c{{Ab{e}}}{}{}}00{Ah{{Ab{ADdAl}}}}{Ah{{Ab{AChAl}}}}222{{{b{c}}}An{}}00{ce{}{}}00```````````````````````````````````{{{b{BNn}}}ABj}{{{b{BO`}}}ABj}``{{{b{dL`}}EjAd}h}{{{b{dL`}}BMhAd}h}{{{b{dBOb}}{b{c}}}{{Ab{hAKj}}}{HlGf}}{{{b{dL`}}BO`Ad}h}`{{{b{BO`}}{b{BOd}}}{{Ab{{Bd{{F`{En}}{F`{Fb}}}}AKj}}}}`{{{b{c}}}{{b{e}}}{}{}}0000000000000{{{b{dc}}}{{b{de}}}{}{}}0000000000000`{{{b{BO`}}}BNn}{{{b{BOd}}}BOd}{{{b{AAf}}}AAf}{{{b{L`}}}L`}{{{b{BJf}}}BJf}{{{b{B`}}}B`}{{{b{AAd}}}AAd}{{{b{BOf}}}BOf}{{{b{BOh}}}BOh}{{{b{BNn}}}BNn}{{{b{BO`}}}BO`}{{{b{BOj}}}BOj}{{{b{Bn}}}Bn}{{{b{c}}{b{de}}}h{}{}}00000000000{{{b{c}}}h{}}000000000000`{{}BOd}{{}BJf}{{}B`}{{}AAd}{{}BOf}{{}BOh}{{}Bn}{j{{b{c}}}{}}0000000000000{j{{b{dc}}}{}}0000000000000{jh}0000000000000{{{b{BJf}}{b{BJf}}}l}{{{b{c}}{b{e}}}l{}{}}`{{{b{L`}}}{{b{ACh}}}}{{{b{L`}}}Ad}{BObAAf}{{{b{AKj}}{b{dn}}}Cd}0{{{b{BOd}}{b{dn}}}Cd}{{{b{AAf}}{b{dn}}}Cd}{{{b{L`}}{b{dn}}}Cd}{{{b{BJf}}{b{dn}}}Cd}{{{b{B`}}{b{dn}}}Cd}{{{b{AAd}}{b{dn}}}Cd}{{{b{BOf}}{b{dn}}}Cd}{{{b{BOh}}{b{dn}}}Cd}{{{b{BNn}}{b{dn}}}Cd}{{{b{BO`}}{b{dn}}}Cd}{{{b{BOj}}{b{dn}}}Cd}{{{b{Bn}}{b{dn}}}Cd}`{cc{}}0{HjAKj}111111111111{BlBn}`{{{b{BOf}}}ADf}`{{}j}0000000000000{ce{}{}}0000000000000{BOdAh}{AAfAh}{L`Ah}{BJfAh}{B`Ah}{AAdAh}{BOfAh}{BOhAh}{BNnAh}{BO`Ah}{BOjAh}{BnAh}{{{b{Bn}}}l}``{L`BOb}{{{b{Dd}}c}L`AAl}{{EjAd}BOj}{{BMhAd}BOj}```{Bn{{ANl{Ah}}}}4`{{{b{BO`}}}{{Bf{En}}}}`{{{b{dL`}}ACh}h}{{{b{dL`}}Ad}h}{{{b{dL`}}{b{Dd}}{b{{Gd{Gb}}}}}h}`{{{b{AKj}}}{{Bf{{b{Ml}}}}}}{{{b{c}}}e{}{}}00000000000{{{b{c}}}Fh{}}{{}{{Ab{BJfAl}}}}{{}{{Ab{B`Al}}}}{{}{{Ab{AAdAl}}}}{{}{{Ab{BOfAl}}}}{{}{{Ab{BOhAl}}}}{c{{Ab{e}}}{}{}}0000000000000{Ah{{Ab{BOdAl}}}}{Ah{{Ab{AAfAl}}}}{Ah{{Ab{L`Al}}}}{Ah{{Ab{BJfAl}}}}{Ah{{Ab{B`Al}}}}{Ah{{Ab{AAdAl}}}}{Ah{{Ab{BOfAl}}}}{Ah{{Ab{BOhAl}}}}{Ah{{Ab{BNnAl}}}}{Ah{{Ab{BO`Al}}}}{Ah{{Ab{BOjAl}}}}{Ah{{Ab{BnAl}}}}<<<<<<<<<<<<<<{{{b{c}}}An{}}0000000000000{{{b{L`}}}{{Ab{hAKj}}}}{AAf{{Ab{L`AKj}}}}`{ce{}{}}0000000000000{{{b{BNn}}}BNn}```","D":"KLn","p":[[1,"reference"],[0,"mut"],[5,"Version",0,5809],[1,"unit"],[1,"usize"],[1,"bool"],[5,"Formatter",5810],[5,"Error",5810],[6,"Result",5811],[1,"u64"],[10,"Hasher",5812],[6,"Value",5813],[1,"u16"],[6,"DecodeError",5814],[5,"TypeId",5815],[5,"Call",5454],[6,"Metadata",64],[1,"tuple"],[6,"Option",5816],[6,"Error",2616],[10,"Context",107],[6,"CallResult",992],[6,"CallResult",5454],[5,"PublicKey",5817],[5,"PrivateKey",5817],[8,"Result",5810],[8,"EpochTime",5818],[5,"KeyPairId",4801,5819],[5,"ScheduleControl",89],[17,"Runtime"],[10,"Runtime",4258],[5,"RuntimeBatchContext",107],[5,"ConsensusState",5820],[1,"str"],[5,"Logger",5821],[10,"HistoryHost",884],[5,"HostInfo",5822],[10,"KeyManager",908],[10,"Decode",5823],[1,"u32"],[5,"Box",5824],[5,"Header",5825],[5,"RoundResults",5826],[5,"Namespace",5827],[5,"Config",151],[8,"SignatureSet",151],[6,"PublicKey",263],[5,"Vec",5828],[5,"Signature",263],[6,"Error",151],[5,"Signer",151],[5,"String",5829],[5,"RootRng",220],[5,"Hash",5830],[10,"RngCore",5831],[5,"LeafRng",220],[1,"u8"],[1,"slice"],[10,"Sized",5832],[5,"BigInt",5833],[5,"BigUint",5834],[6,"Mode",4323],[5,"Error",5835],[6,"SignatureType",263],[6,"Ordering",5836],[1,"char"],[10,"FromIterator",5837],[5,"PublicKey",5838],[6,"Error",263],[10,"Signer",263],[6,"MemorySigner",263],[5,"PublicKey",441],[5,"MemorySigner",441],[17,"OutputSize"],[8,"U64",5839],[10,"Digest",5840],[5,"PublicKey",496],[5,"MemorySigner",496],[8,"U32",5839],[10,"FixedOutput",5841],[5,"PublicKey",551],[5,"MemorySigner",551],[10,"BlockSizeUser",5842],[10,"FixedOutputReset",5841],[5,"PublicKey",604],[5,"MemorySigner",604],[8,"U48",5839],[5,"PublicKey",657],[5,"Dispatcher",687],[5,"Context",5843],[5,"TxnBatch",5844],[5,"CheckTxResult",5845],[5,"RuntimeError",806],[10,"Send",5832],[10,"Sync",5832],[5,"Transaction",5454],[6,"Error",687],[5,"DispatchOptions",687],[5,"DispatchResult",687],[5,"IncomingMessage",5846],[5,"ExecuteBatchResult",5847],[5,"ExecuteTxResult",5847],[8,"Tags",5848],[6,"KeyManagerError",4801,5849],[5,"Prefix",4531,5850],[5,"BTreeSet",5851],[5,"Dispatcher",5852],[5,"AtomicBool",5853],[5,"Arc",3604,5854],[10,"Error",5855],[5,"QueryRequest",780],[10,"Error",806],[6,"Error",4276],[6,"Error",1175],[6,"Error",1875],[6,"Error",1642],[5,"Error",5856],[6,"Error",5857],[6,"Error",3367,5858],[6,"ProtocolError",5822],[5,"JoinError",5859],[6,"Error",5860],[6,"Error",1101],[6,"Error",884],[6,"StateError",5820],[6,"Error",3138],[5,"EventTag",855],[10,"Event",855],[10,"IntoTags",855],[8,"EventTags",855],[6,"EventKind",5845],[6,"Event",5861],[5,"KeyManagerClientWithContext",908],[17,"Item"],[10,"IntoIterator",5837],[5,"KeyPair",4801,5819],[5,"SignedPublicKey",4801,5819],[5,"AuthInfo",5454],[5,"UnverifiedTransaction",5454],[6,"AuthDecision",992],[6,"DispatchResult",992],[10,"Encode",5862],[17,"Output"],[10,"FnOnce",5863],[5,"MessageResult",5317],[5,"Metadata",2929],[5,"ModuleInfo",2929],[5,"BTreeMap",5864],[5,"Address",5162],[5,"MethodHandlerInfo",2929],[17,"Error"],[10,"Parameters",992],[6,"MethodAuthorization",1141],[6,"Authorization",1141],[10,"AsRef",5865],[5,"BaseUnits",5365],[5,"GasCosts",1175],[5,"Parameters",1175],[5,"Genesis",1175],[6,"Event",1175],[6,"ParameterValidationError",1175],[5,"Denomination",5365],[1,"u128"],[5,"AccountBalances",1457],[5,"DenominationInfo",1457],[5,"TransactionFee",1392],[5,"FeeManager",1392],[5,"FeeUpdates",1392],[5,"Transfer",1457],[5,"Account",1457],[5,"NonceQuery",1457],[5,"AddressesQuery",1457],[5,"BalancesQuery",1457],[5,"DenominationInfoQuery",1457],[5,"Account",5866],[5,"GasCosts",1642],[5,"Parameters",1642],[5,"Genesis",1642],[6,"Event",1642],[5,"Delegation",5866],[5,"MessageEventHookInvocation",5317],[6,"ParameterValidationError",1642],[5,"RoundRoots",5826],[6,"RootKind",1830],[5,"RoundRootBody",1830],[5,"GasCosts",1875],[5,"Parameters",1875],[5,"Genesis",1875],[6,"Event",1875],[5,"DelegationInfo",2096],[5,"ExtendedDelegationInfo",2096],[5,"Undelegation",2064],[5,"UndelegationInfo",2096],[6,"ReceiptKind",2096],[5,"Receipt",2096],[5,"Deposit",2096],[5,"Withdraw",2096],[5,"Delegate",2096],[5,"Undelegate",2096],[5,"TakeReceipt",2096],[5,"BalanceQuery",2096],[5,"ConsensusAccountQuery",2096],[5,"DelegationQuery",2096],[5,"DelegationsQuery",2096],[5,"UndelegationsQuery",2096],[5,"AccountBalance",2096],[5,"ConsensusTransferContext",2096],[5,"ConsensusWithdrawContext",2096],[5,"ConsensusDelegateContext",2096],[5,"ConsensusUndelegateContext",2096],[5,"ConsensusError",2096],[8,"MessageEvent",5317],[5,"GasCosts",2616],[5,"DynamicMinGasPrice",2616],[5,"Parameters",2616],[5,"Genesis",2616],[5,"LocalConfig",2616],[5,"TxSimulationFailure",2616],[6,"Event",2616],[6,"ParameterValidationError",2616],[6,"Error",5454],[5,"EstimateGasQuery",2929],[5,"SenderMeta",4298],[5,"CallDataPublicKeyQueryResponse",2929],[6,"MethodHandlerKind",2929],[5,"RuntimeInfoResponse",2929],[5,"ExecuteReadOnlyTxQuery",2929],[5,"ExecuteReadOnlyTxResponse",2929],[5,"Parameters",3138],[5,"Genesis",3138],[6,"ParameterValidationError",3138],[6,"RewardScheduleError",3248],[5,"RewardStep",3248],[5,"RewardSchedule",3248],[6,"RewardAction",3248],[5,"EpochRewards",3248],[10,"Iterator",5867],[5,"Parameters",3367],[5,"Genesis",3367],[6,"Event",3367,5868],[6,"ParameterValidationError",3367],[5,"AppId",3829],[5,"AppConfig",4011],[5,"Registration",4011],[5,"Client",3548,5869],[8,"Result",3604,5856],[10,"App",3548],[5,"Environment",3548,5870],[5,"TrustRoot",3604,5857],[10,"Future",5871],[5,"Pin",5872],[5,"HostStore",4531,5873],[10,"Allocator",5874],[5,"Unstructured",5875],[6,"Error",5876],[10,"Arbitrary",5877],[5,"BorrowedFd",5878],[10,"AsFd",5878],[1,"i32"],[10,"AsRawFd",5879],[20,"MaybeUninit",5880],[10,"Dispatcher",5847],[10,"KeyManagerClient",5881],[10,"Clone",5882],[10,"Ord",5836],[5,"CStr",5883],[10,"Default",5884],[10,"Any",5815],[5,"Weak",5854],[5,"Metadata",5885],[10,"Log",5885],[10,"PartialEq",5836],[10,"Verifier",5857],[5,"File",5886],[5,"Error",5887],[10,"Debug",5810],[10,"Display",5810],[1,"array"],[5,"OsString",5888],[5,"OsStr",5888],[6,"Cow",5889],[10,"ToOwned",5889],[1,"never"],[5,"PathBuf",5890],[5,"Path",5890],[5,"CString",5891],[10,"PartialOrd",5836],[10,"KeyValue",5892],[10,"Hash",5812],[6,"Level",5821],[10,"Drain",5821],[5,"DynGuard",5893],[5,"Record",5821],[5,"OwnedKVList",5821],[5,"Record",5885],[10,"CloneToUninit",5882],[5,"Request",5855],[5,"BorrowedCursor",5894],[5,"IoSliceMut",5895],[6,"SeekFrom",5895],[10,"Serializer",5821],[6,"Error",5821],[10,"Value",5821],[10,"KV",5821],[5,"LocalFutureObj",5896],[5,"SpawnError",5897],[10,"LocalSpawn",5897],[5,"FutureObj",5896],[10,"Spawn",5897],[5,"AllocError",5874],[5,"LightBlock",5861],[5,"Error",5898],[5,"IoSlice",5895],[6,"Error",3829],[8,"Key",5899],[8,"Result",5821],[5,"AppAuthPolicy",3893],[6,"AllowedEndorsement",3893],[6,"FeePolicy",3893],[5,"KeyEndorsementInfo",3974],[5,"Create",4011],[6,"IdentifierScheme",4011],[5,"Update",4011],[5,"Remove",4011],[5,"Register",4011],[5,"AppQuery",4011],[5,"AppInstanceQuery",4011],[5,"StakeThresholds",4011],[5,"TrustedSigners",4801,5900],[10,"ScheduleControlHost",4276],[5,"State",4323],[5,"StateValue",4323],[5,"Environment",4323],[5,"TransactionWithMeta",4323],[5,"Options",4323],[6,"Message",5846],[10,"Store",4531],[6,"TransactionResult",4323],[6,"CallFormat",5454],[10,"Into",5865],[17,"Inner"],[10,"NestedStore",4531],[5,"MKVSStore",4531,5901],[10,"MKVS",5850],[5,"OverlayStore",4531,5902],[5,"HashedStore",4531,5903],[5,"PrefixStore",4531,5904],[5,"TypedStore",4531,5905],[10,"Iterator",5850],[10,"TryFrom",5865],[5,"Protocol",5822],[5,"Root",5906],[6,"Error",4701],[5,"ConfidentialStore",4701],[5,"SubcallInfo",4741],[5,"SubcallResult",4741],[10,"Validator",4741],[5,"AllowAllValidator",4741],[5,"StateKey",4801,5819],[5,"MockKeyManagerClient",4801],[6,"FromHexError",5907],[10,"Signer",5838],[10,"SignedData",5900],[6,"SignatureAddressSpec",5162],[5,"Signer",5065],[5,"CallOptions",5065],[5,"Mock",5065],[5,"EmptyRuntime",5065],[5,"Tree",5908],[5,"OverlayTree",5909],[6,"Error",5162],[5,"CallEnvelopeX25519DeoxysII",5266],[5,"ResultEnvelopeX25519DeoxysII",5266],[6,"Error",5365],[6,"CallerAddress",5454],[6,"AddressSpec",5454],[5,"TransactionSigner",5454],[6,"AuthProof",5454],[5,"Fee",5454],[5,"FeeProxy",5454],[5,"SignerInfo",5454],[15,"EncryptedX25519DeoxysII",86],[10,"Module",992],[10,"MigrationHandler",992],[10,"TransactionHandler",992],[10,"BlockHandler",992],[10,"InvariantHandler",992],[10,"MethodHandler",992],[10,"ModuleInfoHandler",992],[10,"FeeProxyHandler",992],[15,"Failed",1091],[10,"Config",1101],[5,"Module",1101],[5,"Module",1175],[10,"API",1175],[15,"Transfer",1385],[15,"Burn",1385],[15,"Mint",1385],[10,"API",1642],[5,"Module",1642],[5,"Module",1875],[10,"API",1875],[15,"Deposit",2039],[15,"Withdraw",2039],[15,"Delegate",2039],[15,"UndelegateDone",2039],[15,"UndelegateStart",2039],[10,"Config",2616],[10,"API",2616],[5,"Module",2616],[15,"GasUsed",2924],[5,"Module",3138],[10,"Config",3367],[5,"Module",3367],[10,"API",3367],[15,"AppCreated",3545],[15,"AppUpdated",3545],[15,"AppRemoved",3545],[5,"CurrentState",4323],[5,"Config",5065],[15,"NameTooLong",5453],[15,"Failed",5806]],"r":[[0,107],[1,4323],[2,5910],[3,5910],[4,992],[5,4258],[6,5809],[32,5910],[41,5910],[49,5910],[62,5910],[924,5849],[925,5819],[926,5819],[942,5819],[945,5819],[948,5900],[3374,5911],[3376,5858],[3377,5868],[3549,3829],[3550,5869],[3551,5870],[3604,3548],[3605,3829],[3606,5854],[3607,5870],[3610,5856],[3611,5857],[3612,5809],[3625,5912],[4531,4701],[4533,5903],[4534,5873],[4536,5901],[4538,5902],[4539,5850],[4540,5904],[4542,5905],[4706,5913],[4814,5849],[4815,5819],[4816,5819],[4833,5819],[4836,5819],[4839,5900]],"b":[[182,"impl-Display-for-Error"],[183,"impl-Debug-for-Error"],[345,"impl-PartialEq-for-PublicKey"],[346,"impl-PartialEq%3CPublicKey%3E-for-PublicKey"],[353,"impl-Display-for-Error"],[354,"impl-Debug-for-Error"],[463,"impl-From%3C%26PublicKey%3E-for-PublicKey"],[464,"impl-From%3C%26str%3E-for-PublicKey"],[466,"impl-From%3CPublicKey%3E-for-PublicKey"],[729,"impl-Debug-for-Error"],[730,"impl-Display-for-Error"],[819,"impl-Display-for-Error"],[820,"impl-Debug-for-Error"],[821,"impl-From%3CError%3E-for-Error"],[822,"impl-From%3CError%3E-for-Error"],[823,"impl-From%3CError%3E-for-Error"],[824,"impl-From%3CError%3E-for-Error"],[825,"impl-From%3CError%3E-for-Error"],[827,"impl-From%3CError%3E-for-Error"],[828,"impl-From%3CError%3E-for-Error"],[829,"impl-From%3CError%3E-for-Error"],[830,"impl-From%3CProtocolError%3E-for-Error"],[831,"impl-From%3CError%3E-for-Error"],[832,"impl-From%3CJoinError%3E-for-Error"],[833,"impl-From%3CError%3E-for-Error"],[834,"impl-From%3CError%3E-for-Error"],[835,"impl-From%3CError%3E-for-Error"],[836,"impl-From%3CStateError%3E-for-Error"],[837,"impl-From%3CError%3E-for-Error"],[896,"impl-Debug-for-Error"],[897,"impl-Display-for-Error"],[1119,"impl-Display-for-Error"],[1120,"impl-Debug-for-Error"],[1262,"impl-Display-for-Error"],[1263,"impl-Debug-for-Error"],[1267,"impl-Display-for-ParameterValidationError"],[1268,"impl-Debug-for-ParameterValidationError"],[1733,"impl-Debug-for-ParameterValidationError"],[1734,"impl-Display-for-ParameterValidationError"],[1737,"impl-Debug-for-Error"],[1738,"impl-Display-for-Error"],[1745,"impl-From%3CError%3E-for-Error"],[1746,"impl-From%3CStateError%3E-for-Error"],[1748,"impl-From%3CError%3E-for-Error"],[1952,"impl-Display-for-Error"],[1953,"impl-Debug-for-Error"],[1959,"impl-From%3CError%3E-for-Error"],[1960,"impl-From%3CError%3E-for-Error"],[2759,"impl-Debug-for-Error"],[2760,"impl-Display-for-Error"],[2761,"impl-Display-for-TxSimulationFailure"],[2762,"impl-Debug-for-TxSimulationFailure"],[2766,"impl-Debug-for-ParameterValidationError"],[2767,"impl-Display-for-ParameterValidationError"],[2772,"impl-From%3CError%3E-for-Error"],[2773,"impl-From%3CTxSimulationFailure%3E-for-Error"],[3183,"impl-Display-for-Error"],[3184,"impl-Debug-for-Error"],[3186,"impl-Debug-for-ParameterValidationError"],[3187,"impl-Display-for-ParameterValidationError"],[3302,"impl-Display-for-RewardScheduleError"],[3303,"impl-Debug-for-RewardScheduleError"],[3457,"impl-Display-for-Error"],[3458,"impl-Debug-for-Error"],[3461,"impl-Display-for-ParameterValidationError"],[3462,"impl-Debug-for-ParameterValidationError"],[3466,"impl-From%3CError%3E-for-Error"],[3467,"impl-From%3CError%3E-for-Error"],[3614,"impl-Arbitrary%3C\'a%3E-for-Arc%3CA%3E"],[3615,"impl-Arbitrary%3C\'a%3E-for-Arc%3Cstr%3E"],[3616,"impl-Arbitrary%3C\'a%3E-for-Arc%3C%5BA%5D%3E"],[3619,"impl-RefCnt-for-Arc%3CT%3E"],[3620,"impl-Arc%3CT,+A%3E"],[3623,"impl-Arc%3CMaybeUninit%3CT%3E,+A%3E"],[3624,"impl-Arc%3C%5BMaybeUninit%3CT%3E%5D,+A%3E"],[3652,"impl-Default-for-Arc%3CCStr%3E"],[3653,"impl-Default-for-Arc%3C%5BT%5D%3E"],[3654,"impl-Default-for-Arc%3Cstr%3E"],[3655,"impl-Default-for-Arc%3CT%3E"],[3679,"impl-Write-for-Arc%3CFile%3E"],[3680,"impl-Log-for-Arc%3CT%3E"],[3681,"impl-Debug-for-Arc%3CT,+A%3E"],[3682,"impl-Display-for-Arc%3CT,+A%3E"],[3683,"impl-Pointer-for-Arc%3CT,+A%3E"],[3685,"impl-From%3C%26CStr%3E-for-Arc%3CCStr%3E"],[3686,"impl-From%3C%5BT;+N%5D%3E-for-Arc%3C%5BT%5D%3E"],[3687,"impl-From%3CT%3E-for-Arc%3CT%3E"],[3689,"impl-From%3COsString%3E-for-Arc%3COsStr%3E"],[3690,"impl-From%3CCow%3C\'a,+B%3E%3E-for-Arc%3CB%3E"],[3691,"impl-From%3CArc%3Cstr%3E%3E-for-Arc%3C%5Bu8%5D%3E"],[3693,"impl-From%3CVec%3CT,+A%3E%3E-for-Arc%3C%5BT%5D,+A%3E"],[3694,"impl-From%3CPathBuf%3E-for-Arc%3CPath%3E"],[3695,"impl-From%3C%26OsStr%3E-for-Arc%3COsStr%3E"],[3696,"impl-From%3CCString%3E-for-Arc%3CCStr%3E"],[3697,"impl-From%3CString%3E-for-Arc%3Cstr%3E"],[3698,"impl-From%3CBox%3CT,+A%3E%3E-for-Arc%3CT,+A%3E"],[3699,"impl-From%3C%26Path%3E-for-Arc%3CPath%3E"],[3700,"impl-From%3C%26%5BT%5D%3E-for-Arc%3C%5BT%5D%3E"],[3701,"impl-From%3C%26str%3E-for-Arc%3Cstr%3E"],[3740,"impl-Drain-for-Arc%3CD%3E"],[3741,"impl-Log-for-Arc%3CT%3E"],[3781,"impl-Value-for-Arc%3CT%3E"],[3782,"impl-KV-for-Arc%3CT%3E"],[3786,"impl-Arbitrary%3C\'a%3E-for-Arc%3CA%3E"],[3787,"impl-Arbitrary%3C\'a%3E-for-Arc%3Cstr%3E"],[3788,"impl-Arbitrary%3C\'a%3E-for-Arc%3C%5BA%5D%3E"],[3856,"impl-Debug-for-Error"],[3857,"impl-Display-for-Error"],[3858,"impl-Debug-for-AppId"],[3859,"impl-LowerHex-for-AppId"],[3860,"impl-Display-for-AppId"],[4286,"impl-Debug-for-Error"],[4287,"impl-Display-for-Error"],[4410,"impl-Display-for-Mode"],[4411,"impl-Debug-for-Mode"],[4416,"impl-From%3C()%3E-for-TransactionResult%3C()%3E"],[4417,"impl-From%3CResult%3CR,+E%3E%3E-for-TransactionResult%3CResult%3CR,+E%3E%3E"],[4717,"impl-Display-for-Error"],[4718,"impl-Debug-for-Error"],[4919,"impl-Display-for-KeyManagerError"],[4920,"impl-Debug-for-KeyManagerError"],[4921,"impl-Display-for-KeyPairId"],[4922,"impl-LowerHex-for-KeyPairId"],[4923,"impl-Debug-for-KeyPairId"],[4926,"impl-From%3CError%3E-for-KeyManagerError"],[4928,"impl-From%3CStateError%3E-for-KeyManagerError"],[4929,"impl-From%3CError%3E-for-KeyManagerError"],[4930,"impl-From%3CVec%3Cu8%3E%3E-for-KeyPairId"],[4931,"impl-From%3C%26%5Bu8%5D%3E-for-KeyPairId"],[4933,"impl-From%3C%26str%3E-for-KeyPairId"],[5212,"impl-Debug-for-Error"],[5213,"impl-Display-for-Error"],[5214,"impl-Debug-for-Address"],[5215,"impl-Display-for-Address"],[5216,"impl-LowerHex-for-Address"],[5407,"impl-Display-for-Denomination"],[5408,"impl-Debug-for-Denomination"],[5409,"impl-Display-for-Error"],[5410,"impl-Debug-for-Error"],[5411,"impl-Display-for-BaseUnits"],[5412,"impl-Debug-for-BaseUnits"],[5622,"impl-Display-for-Error"],[5623,"impl-Debug-for-Error"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAMoQ9wEBAAEABQABAAgAAQALAAQAEgAAABQAAgAYAAAAGgABAB4AAAAgAAAAIgAAACQAAAAmAAAAKQAAACsAAAAvAAAANAAAADgABQBAAAIARAABAEgAAgBOAAAAUQAAAFMAAwBcAAEAXwACAGMAAABoAAMAbwABAHIAAAB0AAMAeQAAAHwAAAB+AAAAgAABAIYAAACJAAAAjAAAAI8AAACRAAQAmgACAKEAGQC+AAIAxAABAMkADgDZAAIA4gALAPEABwD9AA8ADgEEABUBCgAjAQMAKAEaAEQBDwBVAQ8AaAEAAGoBAABvAQYAewEHAIcBAQCXARcAswEEAL0BEQDQAQEA0wEBANYBAgDbARAA7wEBAPQBEQAIAgEACwICABACCAAaAgAAHAIGACYCAQArAhEAPwIBAEICAgBHAhAAWwIBAGACEQBzAgAAdQIAAHcCAgB8AhAAkAIBAJQCDQCkAgEApwIGAK8CAgC2AgoAwgIAAMQCAADGAggA0wIEANoCAgDfAgAA4QIAAOMCAwDrAgAA7QIAAPACAADzAgAA9QIAAPcCAAD5AggABQMHAA8DCgAbAwAAHQMJACkDBAAvAwsAPAMLAEsDAgBQAwcAXAMEAGIDAgBmAwAAaAMAAGsDAgBvAwUAdgMBAHkDAgB+AwQAhAMAAIYDEwCgAw4AsAMBALMDAQC2AwQAvgMGAMkDAADLAwAAzQMAAM8DAQDVAwAA1wMAANwDBADoAwAA7QMAAPoDAAAEBAUACwQCAA8EBQAaBAIAHgQBACMEAgA2BAkAQQQFAFIEDwBkBAIAaQQJAHQEAQB9BAoAigQBAI8EBwCbBAIAoAQAAKMEBACqBBMAvwQAAMEEAADEBCgA7wQHAPgEAAD/BAAAAQUAAAMFAAAFBQAABwUAAAkFAAALBQAADQUJAB4FBQAlBQUALAUAAC4FAAAwBQAAMgUBADUFAAA3BQYAPwUAAEEFHQBhBQ8AdQULAIMFAQCGBQoAlAUCAKAFBwCpBQUAugUrAOcFKQAZBgcAKQZBAGwGAwBzBgQAegYCAH4GAACABgAAggYZAJ0GBQCkBhcAvQYEAMMGCADSBgEA1QYBANgGCQDpBgQA7wYDAPQGAAD3BgcAAAckACYHAQAqBxIAPwcBAEMHEABXBwQAXQcAAGAHAwBlBw4AdQcNAIQHAACGBwwAlwcPAKgHAQCvBwgAvgcKAMsHAADNBx8A7wcGAPcHGQAYCAUAHwgAACUIAAArCAYAOggAAEAIAABFCAEASggGAFIIwQAWCQEAGQkUAEMJAwBICRgAdgkUAIwJBwCWCQIAnQkFAKQJlAA7CgEARgoDAE0KAgBRCggAXQoIAGgKAgBsClQAwgoCAMYKAADICgsA1QoBAOAKAADiCgwA+QoHAAILAAAECwEABwsCAAsLAQAPCwMAFAsAABcLAAAZCwAAGwsAAB0LAQAgCwEAIwsAACULAAAnCzIAWwsAAF0LAABfCwAAYQsMAHILAAB3CwAAeQsBAHwLAAB/CxEAkgs6AM4LCADgCwgA8gsNAAIMKgAuDAoAOgwIAEYMAgBMDCkAegwAAHwMBQCHDAkAkgwWAKoMBQCyDAEAuAwyAPQMBAD+DCIAIw0EACoNBAAwDQAAMw0BAEYNBABNDQAAUA0DAFcNMQCLDQEAkg0AAJQNAACWDQAAmA0AAJoNBwCoDQMArQ0vAN4NAADjDQMA6A0FAO8NBQD6DQEACg4JABUOAQAYDgAAHw4FACYOAQAqDgYAMg4GADoOBABADgIASQ4GAFQOBABaDgsAbQ4AAHgOAAB6DgAAfg4AAIEOAwCGDgAAiw4CAJAOAACSDgAAlQ4EAJsOAwCgDgAAog4AAKYOAACxDgAAtA4AALYOCgDCDhEA1Q4LAOoOAgDuDgMA8w4CAPkOAAD7DhoAGA8AAB4PAgAkDwIAKA8NAEAPGQBcDwUAYw8CAGkPAgBvDwIAdA8SAIgPCgCUDwAAnA8AAJ4PAACkDwUAqw8AALAPAQC+D1kAGhABACAQCQA4EAkATBAJAF8QQwC2EAAAuBAFAL8QAQDCEAAAxBAGAM0QCwDbEAAA3hACAOIQAQDlEAAA7BAAAPMQHAATERoAOREGAEERAQBQEQcAWREAAGwRAAByEQAAfhEVAJoRDwC0EQEAwBESANQRIAD7EQAA/hEEAAUSCAAPEgQAHBIAAB4SBQAmEgAAKxIAAC0SAQAwEgQANhIEAD0SIABfEgIAZBILAHISAwB4EgAAehILAIsSBQCUEg0ApxICALASCQC7EgMAwhIMANISDwDjEgEA5hIBAOkSEQD9EjkAOBMHAEETAwBGEwAATRMAAE8TCwBjEwQAbBMDAHITAAB1EyYAnhMIAMsTAADPEwkA2xMDAOETEAD0EwAA9hMAAPwTBwAJFAAADBQBAA8UAAARFBMAKBQAADcUAAA8FCUAZBQAAG8UAwB3FAEAehQAAHwUAAB+FAoAihQIAJYUCQCiFAcAqxQBAK8UAQCzFAEAuBQNAMkUFADgFAMA5hQBAOkUDAD4FAAA+xQAAP0UEgARFRQAKRUEADEVAQA2FRkAWRUCAGEVAABlFQAAaxUAAG4VAQBzFQAAeRUAAHwVHACaFSQAwBUyAPcVDQAIFgAAFRYAABkWDQA1FgsASBYAAFQWSACfFg4ArxYCAA=="}],\ +["oasis_runtime_sdk_contracts",{"t":"PPPPPPPPPPPPKPPPPPPPPGGPPFFPPPFFPPFPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOONNNONNNONNNNNCNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNONONONONOONNNNNNNCNNNNNNNOOOOOOOOOOOOOOOOOOOOSSSSSSGPFFFFFFFFPFFFPFFFFFFFFFPPGPGFFGPFFFOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNN","n":["Abort","CodeAlreadyUpgraded","CodeDeclaresMultipleSubVersions","CodeDeclaresReservedExport","CodeDeclaresStartFunction","CodeDeclaresTooManyFunctions","CodeDeclaresTooManyLocals","CodeDeclaresTooManyMemories","CodeMalformed","CodeMissingRequiredExport","CodeNotFound","CodeTooLarge","Config","Contract","Core","CryptoKeyDerivationFunctionFailure","CryptoMalformedKey","CryptoMalformedNonce","CryptoMalformedPrivateKey","CryptoMalformedPublicKey","CryptoMsgTooLarge","Error","Event","ExecutionFailed","Forbidden","GasCosts","Genesis","InstanceNotFound","InsufficientCallerBalance","InvalidArgument","LocalConfig","Module","ModuleLoadingFailed","ModuleUsesFloatingPoint","Parameters","ResultTooLarge","StorageKeyTooLarge","StorageValueTooLarge","TooManySubcalls","Unsupported","UnsupportedABI","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","code","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","dispatch_call","dispatch_query","drop","drop","drop","drop","drop","drop","drop","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","gas_costs","init","init","init","init","init","init","init","init_or_migrate","into","into","into","into","into","into","into","into_abort","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","is_allowed_interactive_call","is_expensive_query","load_code","max_code_size","max_crypto_signature_verify_message_size_bytes","max_instance_raw_storage_query_items","max_memory_pages","max_query_size_bytes","max_result_size_bytes","max_stack_size","max_storage_key_size_bytes","max_storage_value_size_bytes","max_subcall_count","max_subcall_depth","max_wasm_functions","max_wasm_locals","module_info","module_name","module_name","parameters","query_code","query_code_storage","query_custom","query_custom_max_gas","query_instance","query_instance_raw_storage","query_instance_storage","query_public_key","source","state","store_code","subcall_dispatch","supported_methods","to_owned","to_owned","to_owned","to_owned","to_string","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","tx_call","tx_call","tx_change_upgrade_policy","tx_change_upgrade_policy","tx_instantiate","tx_instantiate","tx_upgrade","tx_upgrade","tx_upload","tx_upload","tx_upload_per_byte","type_id","type_id","type_id","type_id","type_id","type_id","type_id","types","vzip","vzip","vzip","vzip","vzip","vzip","vzip","wasm_confidential_storage_get_base","wasm_confidential_storage_insert_base","wasm_confidential_storage_key_byte","wasm_confidential_storage_remove_base","wasm_confidential_storage_value_byte","wasm_crypto_deoxysii_base","wasm_crypto_deoxysii_byte","wasm_crypto_ecdsa_recover","wasm_crypto_random_bytes_base","wasm_crypto_random_bytes_byte","wasm_crypto_signature_verify_ed25519","wasm_crypto_signature_verify_secp256k1","wasm_crypto_signature_verify_sr25519","wasm_crypto_x25519_derive_symmetric","wasm_env_query_base","wasm_public_storage_get_base","wasm_public_storage_insert_base","wasm_public_storage_key_byte","wasm_public_storage_remove_base","wasm_public_storage_value_byte","CODE","CODE_INFO","INSTANCE_INFO","INSTANCE_STATE","NEXT_CODE_IDENTIFIER","NEXT_INSTANCE_IDENTIFIER","ABI","Address","Call","CallResult","ChangeUpgradePolicy","Code","CodeId","CodeQuery","CodeStorageQuery","CodeStorageQueryResult","Confidential","ContractEvent","CustomQuery","CustomQueryResult","Everyone","Instance","InstanceId","InstanceQuery","InstanceRawStorageQuery","InstanceRawStorageQueryResult","InstanceStorageQuery","InstanceStorageQueryResult","Instantiate","InstantiateResult","Nobody","OasisV1","Policy","Public","PublicKeyKind","PublicKeyQuery","PublicKeyQueryResult","StoreKind","Transaction","Upgrade","Upload","UploadResult","abi","abi","abi_sv","address","address_for","as_u64","as_u64","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","checksum","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","code","code","code_id","code_id","code_id","creator","data","data","data","data","data","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","enforce","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","hash","hash","id","id","id","id","id","id","id","id","id","id","id","id","id","id","id","increment","increment","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","instantiate_policy","instantiate_policy","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","into_cbor_value","items","key","key","kind","limit","offset","signature","store_kind","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_storage_key","to_storage_key","tokens","tokens","tokens","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_default","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_from_cbor_value","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","upgrades_policy","upgrades_policy","upgrades_policy","uploader","value","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip"],"q":[[0,"oasis_runtime_sdk_contracts"],[240,"oasis_runtime_sdk_contracts::state"],[246,"oasis_runtime_sdk_contracts::types"],[940,"oasis_cbor_value::values"],[941,"oasis_runtime_sdk::module"],[942,"oasis_runtime_sdk::context"],[943,"oasis_core_runtime::types"],[944,"core::result"],[945,"core::fmt"],[946,"oasis_runtime_sdk::modules::core"],[947,"oasis_runtime_sdk::dispatcher"],[948,"oasis_runtime_sdk::modules::core::types"],[949,"alloc::vec"],[950,"alloc::string"],[951,"alloc::collections::btree::map"],[952,"core::error"],[953,"core::option"],[954,"oasis_cbor"],[955,"core::any"],[956,"oasis_runtime_sdk::types::address"],[957,"oasis_contract_sdk_types"],[958,"core::hash"]],"i":[8,8,8,8,8,8,8,8,8,8,8,8,0,8,8,8,8,8,8,8,8,0,0,8,8,0,0,8,8,8,0,0,8,8,0,8,8,8,8,8,8,70,8,10,3,4,5,6,70,8,10,3,4,5,6,3,4,5,6,3,4,5,6,3,4,5,6,8,10,3,4,5,6,70,8,10,3,4,5,6,70,8,10,3,4,5,6,70,70,70,8,10,3,4,5,6,8,8,10,3,4,5,6,70,8,8,8,10,3,4,5,6,4,70,8,10,3,4,5,6,70,70,8,10,3,4,5,6,8,10,3,4,5,6,70,70,70,4,4,6,4,4,4,4,4,4,4,4,4,4,70,8,10,5,70,70,70,6,70,70,70,70,8,0,70,3,70,3,4,5,6,8,3,4,5,6,70,8,10,3,4,5,6,3,4,5,6,70,8,10,3,4,5,6,70,3,70,3,70,3,70,3,70,3,3,70,8,10,3,4,5,6,0,70,8,10,3,4,5,6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,62,0,0,0,0,0,0,0,0,64,0,0,0,62,0,0,0,0,0,0,0,0,0,62,63,0,64,0,0,0,0,65,0,0,0,25,55,25,37,37,60,59,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,43,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,60,59,59,62,62,63,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,55,33,37,52,54,37,52,49,54,34,66,60,59,56,53,50,32,33,36,40,41,39,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,62,60,59,63,60,60,60,59,59,59,63,63,63,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,60,59,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,63,25,25,37,56,53,49,54,51,31,32,36,40,38,42,34,66,60,59,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,25,55,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,39,40,43,42,38,38,43,38,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,52,49,54,60,59,56,53,50,32,33,36,40,41,39,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66,37,52,51,25,41,60,59,62,63,25,37,55,56,52,53,49,50,54,51,31,32,33,36,40,41,64,38,39,65,42,43,34,35,66],"f":"`````````````````````````````````````````{{{b{c}}}{{b{e}}}{}{}}000000{{{b{dc}}}{{b{de}}}{}{}}000000{{{b{f}}}f}{{{b{h}}}h}{{{b{j}}}j}{{{b{l}}}l}{{{b{c}}{b{de}}}n{}{}}000{{{b{c}}}n{}}000{{{b{A`}}}Ab}{{{b{Ad}}}Ab}{{}f}{{}h}{{}j}{{}l}{Af{{b{c}}}{}}000000{Af{{b{dc}}}{}}000000{{{b{c}}{b{Ah}}Aj}{{An{AjAl}}}B`}{{{b{c}}{b{Ah}}Aj}{{An{Aj{Bd{AjBb}}}}}B`}{Afn}000000{{{b{A`}}{b{dBf}}}Bh}0{{{b{Ad}}{b{dBf}}}Bh}{{{b{f}}{b{dBf}}}Bh}{{{b{h}}{b{dBf}}}Bh}{{{b{j}}{b{dBf}}}Bh}{{{b{l}}{b{dBf}}}Bh}{cc{}}{BjA`}1{BlA`}22222`{{}Af}000000{{{b{c}}{b{dBn}}e}C`B`{}}{ce{}{}}000000{A`{{Bd{BlA`}}}}{AdAj}{fAj}{hAj}{jAj}{lAj}{{{b{Ah}}}C`}0{{{b{Cb}}}{{Bd{{Cf{Cd}}A`}}}}`````````````{{{b{c}}}{{Cl{ChCj}}}B`}{{{b{A`}}}{{b{Ah}}}}{{}{{b{Ah}}}}`{{{b{c}}Cn}{{Bd{CbA`}}}B`}{{{b{c}}D`}{{Bd{DbA`}}}B`}{{{b{c}}Dd}{{Bd{DfA`}}}B`}`{{{b{c}}Dh}{{Bd{DjA`}}}B`}{{{b{c}}Dl}{{Bd{DnA`}}}B`}{{{b{c}}E`}{{Bd{EbA`}}}B`}{{{b{c}}Ed}{{Bd{EfA`}}}B`}{{{b{A`}}}{{Ej{{b{Eh}}}}}}`{{{b{Cb}}{b{{El{Cd}}}}}{{Bd{nA`}}}}`{{}{{Cf{En}}}}{{{b{c}}}e{}{}}000{{{b{c}}}Ch{}}{{}{{Bd{fF`}}}}{{}{{Bd{hF`}}}}{{}{{Bd{jF`}}}}{{}{{Bd{lF`}}}}{c{{Bd{e}}}{}{}}000000{Aj{{Bd{fF`}}}}{Aj{{Bd{hF`}}}}{Aj{{Bd{jF`}}}}{Aj{{Bd{lF`}}}}4444444{{{b{c}}Fb}{{Bd{FdA`}}}B`}`{{{b{c}}Ff}{{Bd{nA`}}}B`}`{{{b{c}}Fh}{{Bd{FjA`}}}B`}`{{{b{c}}Fl}{{Bd{nA`}}}B`}`{{{b{c}}Fn}{{Bd{G`A`}}}B`}``{{{b{c}}}Gb{}}000000`{ce{}{}}000000`````````````````````````````````````````````````````````````````{{{b{Dj}}}Gd}{GfGd}{{{b{Gh}}}Gj}{{{b{Gf}}}Gj}{{{b{c}}}{{b{e}}}{}{}}0000000000000000000000000000{{{b{dc}}}{{b{de}}}{}{}}0000000000000000000000000000`{{{b{Gh}}}Gh}{{{b{Gf}}}Gf}{{{b{Gl}}}Gl}{{{b{Gn}}}Gn}{{{b{Cb}}}Cb}{{{b{Dj}}}Dj}{{{b{Fn}}}Fn}{{{b{G`}}}G`}{{{b{Fh}}}Fh}{{{b{Fj}}}Fj}{{{b{Fb}}}Fb}{{{b{Fd}}}Fd}{{{b{Fl}}}Fl}{{{b{Ff}}}Ff}{{{b{Cn}}}Cn}{{{b{D`}}}D`}{{{b{Db}}}Db}{{{b{Dh}}}Dh}{{{b{E`}}}E`}{{{b{Eb}}}Eb}{{{b{H`}}}H`}{{{b{Dl}}}Dl}{{{b{Dn}}}Dn}{{{b{Hb}}}Hb}{{{b{Ed}}}Ed}{{{b{Ef}}}Ef}{{{b{Dd}}}Dd}{{{b{Df}}}Df}{{{b{Hd}}}Hd}{{{b{c}}{b{de}}}n{}{}}0000000000000000000000000000{{{b{c}}}n{}}00000000000000000000000000000000```````````{{}Gh}{{}Gf}{{}G`}{{}Fj}{{}Fd}{{}D`}{{}Db}{{}Dh}{{}E`}{{}Eb}{{}Dn}{{}Ef}{{}Dd}{{}Df}{{}Hd}{Af{{b{c}}}{}}0000000000000000000000000000{Af{{b{dc}}}{}}0000000000000000000000000000{Afn}0000000000000000000000000000{{{b{Gl}}{b{Gd}}}{{Bd{nA`}}}}{{{b{Gh}}{b{Gh}}}C`}{{{b{Gf}}{b{Gf}}}C`}{{{b{Gn}}{b{Gn}}}C`}{{{b{c}}{b{e}}}C`{}{}}00000000{{{b{Gh}}{b{dBf}}}{{Bd{nHf}}}}{{{b{Gf}}{b{dBf}}}{{Bd{nHf}}}}{{{b{Gl}}{b{dBf}}}Bh}{{{b{Gn}}{b{dBf}}}Bh}{{{b{Cb}}{b{dBf}}}Bh}{{{b{Dj}}{b{dBf}}}Bh}{{{b{Fn}}{b{dBf}}}Bh}{{{b{G`}}{b{dBf}}}Bh}{{{b{Fh}}{b{dBf}}}Bh}{{{b{Fj}}{b{dBf}}}Bh}{{{b{Fb}}{b{dBf}}}Bh}{{{b{Fd}}{b{dBf}}}Bh}{{{b{Fl}}{b{dBf}}}Bh}{{{b{Ff}}{b{dBf}}}Bh}{{{b{Cn}}{b{dBf}}}Bh}{{{b{D`}}{b{dBf}}}Bh}{{{b{Db}}{b{dBf}}}Bh}{{{b{Dh}}{b{dBf}}}Bh}{{{b{E`}}{b{dBf}}}Bh}{{{b{Eb}}{b{dBf}}}Bh}{{{b{H`}}{b{dBf}}}Bh}{{{b{Dl}}{b{dBf}}}Bh}{{{b{Dn}}{b{dBf}}}Bh}{{{b{Hb}}{b{dBf}}}Bh}{{{b{Ed}}{b{dBf}}}Bh}{{{b{Ef}}{b{dBf}}}Bh}{{{b{Dd}}{b{dBf}}}Bh}{{{b{Df}}{b{dBf}}}Bh}{{{b{Hd}}{b{dBf}}}Bh}{GjGh}{cc{}}0{GjGf}111111111111111111111111111{{{b{Gn}}{b{dc}}}nHh}````````````````{{{b{Gh}}}Gh}{{{b{Gf}}}Gf}{{}Af}0000000000000000000000000000``{ce{}{}}0000000000000000000000000000{GhAj}{GfAj}{GlAj}{GnAj}{CbAj}{DjAj}{FnAj}{G`Aj}{FhAj}{FjAj}{FbAj}{FdAj}{FlAj}{FfAj}{CnAj}{D`Aj}{DbAj}{DhAj}{E`Aj}{EbAj}{H`Aj}{DlAj}{DnAj}{HbAj}{EdAj}{EfAj}{DdAj}{DfAj}{HdAj}````````{{{b{c}}}e{}{}}0000000000000000000000000000{Gh{{Hj{Cd}}}}{Gf{{Hj{Cd}}}}```{{}{{Bd{GhF`}}}}{{}{{Bd{GfF`}}}}{{}{{Bd{G`F`}}}}{{}{{Bd{FjF`}}}}{{}{{Bd{FdF`}}}}{{}{{Bd{D`F`}}}}{{}{{Bd{DbF`}}}}{{}{{Bd{DhF`}}}}{{}{{Bd{E`F`}}}}{{}{{Bd{EbF`}}}}{{}{{Bd{DnF`}}}}{{}{{Bd{EfF`}}}}{{}{{Bd{DdF`}}}}{{}{{Bd{DfF`}}}}{{}{{Bd{HdF`}}}}{c{{Bd{e}}}{}{}}0000000000000000000000000000{Aj{{Bd{GhF`}}}}{Aj{{Bd{GfF`}}}}{Aj{{Bd{GlF`}}}}{Aj{{Bd{GnF`}}}}{Aj{{Bd{CbF`}}}}{Aj{{Bd{DjF`}}}}{Aj{{Bd{FnF`}}}}{Aj{{Bd{G`F`}}}}{Aj{{Bd{FhF`}}}}{Aj{{Bd{FjF`}}}}{Aj{{Bd{FbF`}}}}{Aj{{Bd{FdF`}}}}{Aj{{Bd{FlF`}}}}{Aj{{Bd{FfF`}}}}{Aj{{Bd{CnF`}}}}{Aj{{Bd{D`F`}}}}{Aj{{Bd{DbF`}}}}{Aj{{Bd{DhF`}}}}{Aj{{Bd{E`F`}}}}{Aj{{Bd{EbF`}}}}{Aj{{Bd{H`F`}}}}{Aj{{Bd{DlF`}}}}{Aj{{Bd{DnF`}}}}{Aj{{Bd{HbF`}}}}{Aj{{Bd{EdF`}}}}{Aj{{Bd{EfF`}}}}{Aj{{Bd{DdF`}}}}{Aj{{Bd{DfF`}}}}{Aj{{Bd{HdF`}}}}{c{{Bd{e}}}{}{}}0000000000000000000000000000{{{b{c}}}Gb{}}0000000000000000000000000000`````{ce{}{}}0000000000000000000000000000","D":"AFf","p":[[1,"reference"],[0,"mut"],[5,"GasCosts",0],[5,"Parameters",0],[5,"Genesis",0],[5,"LocalConfig",0],[1,"unit"],[6,"Error",0],[1,"u32"],[6,"Event",0],[1,"usize"],[1,"str"],[6,"Value",940],[6,"CallResult",941],[6,"DispatchResult",941],[10,"Context",942],[5,"Error",943],[6,"Result",944],[5,"Formatter",945],[8,"Result",945],[6,"Error",946],[6,"Error",947],[5,"Metadata",948],[1,"bool"],[5,"Code",246],[1,"u8"],[5,"Vec",949],[5,"String",950],[5,"ModuleInfo",948],[5,"BTreeMap",951],[5,"CodeQuery",246],[5,"CodeStorageQuery",246],[5,"CodeStorageQueryResult",246],[5,"CustomQuery",246],[5,"CustomQueryResult",246],[5,"InstanceQuery",246],[5,"Instance",246],[5,"InstanceRawStorageQuery",246],[5,"InstanceRawStorageQueryResult",246],[5,"InstanceStorageQuery",246],[5,"InstanceStorageQueryResult",246],[5,"PublicKeyQuery",246],[5,"PublicKeyQueryResult",246],[10,"Error",952],[6,"Option",953],[1,"slice"],[5,"MethodHandlerInfo",948],[6,"DecodeError",954],[5,"Call",246],[5,"CallResult",246],[5,"ChangeUpgradePolicy",246],[5,"Instantiate",246],[5,"InstantiateResult",246],[5,"Upgrade",246],[5,"Upload",246],[5,"UploadResult",246],[5,"TypeId",955],[5,"Address",956],[5,"InstanceId",246,957],[5,"CodeId",246,957],[1,"u64"],[6,"Policy",246],[6,"ABI",246],[6,"StoreKind",246],[6,"PublicKeyKind",246],[5,"ContractEvent",246],[5,"Error",945],[10,"Hasher",958],[1,"array"],[5,"Module",0]],"r":[[252,957],[262,957]],"b":[[96,"impl-Display-for-Error"],[97,"impl-Debug-for-Error"],[104,"impl-From%3CError%3E-for-Error"],[106,"impl-From%3CError%3E-for-Error"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAPkCIQABAAsADgAHABgAAQAcAAIAIAACACQAQwBpAAAAawAAAHEACACBAAcAigABAI0AEACfAAQApgAuANYAGgD4AAAAAQEAAAUBAAAMAQAADwEAABIBAAAXAQAAIgE5AF0BWgDDAWUAKgIpAFYCAAByAgAAhQIcAMECHADmAhwACAOCAJADHAA="}],\ +["oasis_runtime_sdk_macros",{"t":"YYXXXQ","n":["Error","Event","handler","migration","sdk_derive","version_from_cargo"],"q":[[0,"oasis_runtime_sdk_macros"]],"i":[0,0,0,0,0,0],"f":"``````","D":"l","p":[],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAEAAAAAAAAAEAAAAAAA"}],\ +["rofl_utils",{"t":"CHH","n":["https","agent","agent_with_config"],"q":[[0,"rofl_utils"],[1,"rofl_utils::https"],[3,"ureq::agent"],[4,"ureq::config"]],"i":[0,0,0],"f":"`{{}b}{db}","D":"h","p":[[5,"Agent",3],[5,"AgentConfig",4]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAAAAAA="}]\ +]')); +if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; +else if (window.initSearch) window.initSearch(searchIndex); diff --git a/rust/search.desc/fuzz_mkvs_node/fuzz_mkvs_node-desc-0-.js b/rust/search.desc/fuzz_mkvs_node/fuzz_mkvs_node-desc-0-.js new file mode 100644 index 0000000000..3a7894a345 --- /dev/null +++ b/rust/search.desc/fuzz_mkvs_node/fuzz_mkvs_node-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("fuzz_mkvs_node", 0, "") \ No newline at end of file diff --git a/rust/search.desc/fuzz_mkvs_proof/fuzz_mkvs_proof-desc-0-.js b/rust/search.desc/fuzz_mkvs_proof/fuzz_mkvs_proof-desc-0-.js new file mode 100644 index 0000000000..88105e4e5e --- /dev/null +++ b/rust/search.desc/fuzz_mkvs_proof/fuzz_mkvs_proof-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("fuzz_mkvs_proof", 0, "") \ No newline at end of file diff --git a/rust/search.desc/fuzz_sgx_pcs_quote/fuzz_sgx_pcs_quote-desc-0-.js b/rust/search.desc/fuzz_sgx_pcs_quote/fuzz_sgx_pcs_quote-desc-0-.js new file mode 100644 index 0000000000..d8ac5caf1d --- /dev/null +++ b/rust/search.desc/fuzz_sgx_pcs_quote/fuzz_sgx_pcs_quote-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("fuzz_sgx_pcs_quote", 0, "") \ No newline at end of file diff --git a/rust/search.desc/oasis_contract_sdk/oasis_contract_sdk-desc-0-.js b/rust/search.desc/oasis_contract_sdk/oasis_contract_sdk-desc-0-.js new file mode 100644 index 0000000000..371a7e7fa8 --- /dev/null +++ b/rust/search.desc/oasis_contract_sdk/oasis_contract_sdk-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("oasis_contract_sdk", 0, "Oasis Contract SDK.\nDerives the Error trait on an enum.\nDerives the Event trait on an enum.\nContract execution context.\nThe contract trait.\nSmart contract environment query interface.\nContract error trait.\nContract event trait.\nMemory management.\nSmart contract storage interface.\nUtilities for testing smart contracts.\nThe confidential store.\nExecution context.\nThe environment.\nThe public store.\nCall format.\nCaller address.\nConfidential contract store.\nTokens deposited by the caller.\nEmits an event.\nEmits a message.\nEnvironment.\nContract instance address.\nContract instance identifier.\nWhether the call is read-only and must not make any …\nPublic contract store.\nTrait that needs to be implemented by contract …\nType of all errors.\nType of all requests.\nType of all responses.\nCall the contract.\nHandle replies from sent messages.\nInstantiate the contract.\nPerform any post-upgrade tasks. This method is called on …\nPerform any pre-upgrade tasks. This method is called on …\nQuery the contract.\nCrypto helpers trait.\nErrors that can be returned from crypto functions.\nEnvironment query trait.\nReturns an address for the contract instance id.\nPrints a message to the console. Useful when debugging.\nDecrypt and authenticate a message and authenticate …\nEncrypt and authenticate a message and authenticate …\nECDSA public key recovery function.\nReturns the argument unchanged.\nCalls U::from(self).\nPerform an environment query.\nFills dst with cryptographically secure random bytes. …\nVerify an ed25519 message signature.\nVerify a secp256k1 message signature.\nVerify an sr25519 message signature.\nDerive a symmetric key from a public/private key pair.\nA contract error that gets propagated to the caller.\nError code uniquely identifying the error.\nName of the module that emitted the error.\nConverts the error into an execution result.\nAn event emitted by the contract.\nCode uniquely identifying the event.\nConverts an event into the raw event type that can be …\nName of the module that emitted the event.\nA region of memory managed on behalf of the host.\nReference to a host region.\nAllocate memory on host’s behalf.\nDeallocate memory on host’s behalf.\nReturns a new region by dereferencing a pointer to the …\nReturns the argument unchanged.\nReturns the argument unchanged.\nCreates a new host region from arguments.\nCreates a new host region from arguments.\nCreates a new host region from the given byte slice.\nTransfers ownership of memory to the host by constructing …\nCalls U::from(self).\nCalls U::from(self).\nTransfers ownership of memory from the host and returns …\nMarker trait for stores backed by confidential storage.\nMarker trait for stores backed by public storage.\nKey/value store trait.\nFetch a given key from contract storage.\nInsert a given key/value pair into contract storage.\nRemove a given key from contract storage.\nA mock contract context suitable for testing.\nMock environment.\nMock store.\n“Confidential” store.\nExecution context.\nEnvironment.\nEmitted events.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nEmitted messages.\nCreate a new empty mock store.\nCreate a new mock environment.\nPublic store.") \ No newline at end of file diff --git a/rust/search.desc/oasis_contract_sdk_storage/oasis_contract_sdk_storage-desc-0-.js b/rust/search.desc/oasis_contract_sdk_storage/oasis_contract_sdk_storage-desc-0-.js new file mode 100644 index 0000000000..9eed8e0383 --- /dev/null +++ b/rust/search.desc/oasis_contract_sdk_storage/oasis_contract_sdk_storage-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("oasis_contract_sdk_storage", 0, "High-level storage helpers for the Oasis Contract SDK.\nLow-level storage primitive that holds one value.\nA map backed by contract storage.\nA storage cell identifies a storage key of a specific type.\nA storage cell identifies a storage key of a specific type.\nClear the value in the storage cell.\nClear the value in the storage cell.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturn the current value of the storage cell.\nReturn the current value of the storage cell.\nCalls U::from(self).\nCalls U::from(self).\nCreate a new storage cell with the specified key and type.\nCreate a new storage cell with the specified key and type.\nSet the value of the storage cell.\nSet the value of the storage cell.\nA map backed by contract storage.\nType of the encoded representation.\nAn integer in big-endian representation.\nA trait representing an integer that can be encoded into …\nA trait for types which can be used as map keys.\nA map backed by contract storage.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nLookup a given key.\nLookup a given key.\nInsert a given key/value pair.\nInsert a given key/value pair.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturn the composite key.\nCreate a new integer in big-endian representation.\nCreate a new map instance.\nCreate a new map instance.\nRemove a given key.\nRemove a given key.\nReturn the memory representation of this integer as a byte …") \ No newline at end of file diff --git a/rust/search.desc/oasis_contract_sdk_types/oasis_contract_sdk_types-desc-0-.js b/rust/search.desc/oasis_contract_sdk_types/oasis_contract_sdk_types-desc-0-.js new file mode 100644 index 0000000000..9efbfbf37f --- /dev/null +++ b/rust/search.desc/oasis_contract_sdk_types/oasis_contract_sdk_types-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("oasis_contract_sdk_types", 0, "A collection of common types used by the Oasis Contract …\nFormat used for encoding the call (and output) information.\nUnique stored code identifier.\nEncrypted call data using X25519 for key exchange and …\nExecution context.\nResult of a successful contract execution.\nContract execution result.\nUnique deployed code instance identifier.\nPlain text call data.\nA minimal representation of an Oasis Runtime SDK address.\nConvert identifier to u64.\nConvert identifier to u64.\nTransaction’s call format.\nCaller address.\nCryptography-related types.\nRaw data returned from the contract.\nTokens deposited by the caller.\nEnvironment query-related types.\nEvents.\nEvents emitted from the contract.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturn the next identifier in sequence.\nReturn the next identifier in sequence.\nContract instance address.\nContract instance identifier.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nMessages that can be emitted by contracts.\nMessages emitted from the contract.\nA collection of types for easier calling into existing SDK …\nRead-only flag.\nStorage-related types.\nTesting helpers.\nConvert identifier to storage key representation.\nConvert identifier to storage key representation.\nToken types.\nAn account address.\nError.\nSize of an address in bytes.\nReturns the argument unchanged.\nReturns the argument unchanged.\nTries to create a new address from Bech32-encoded string.\nTries to create a new address from raw bytes.\nCalls U::from(self).\nCalls U::from(self).\nConverts an address to Bech32 representation.\nSignature kind.\nReturns the argument unchanged.\nCalls U::from(self).\nAccounts queries.\nAccounts queries.\nAccounts API queries.\nAccounts API responses.\nQuery an account’s balance.\nAn account’s balance of the given denomination.\nInformation about the current runtime block.\nInformation about the current runtime block.\nIndication of a failing request.\nA query request.\nA query response.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nAn event emitted from the contract.\nUnique code representing the event for the given module.\nArbitrary data associated with the event.\nReturns the argument unchanged.\nCalls U::from(self).\nOptional module name.\nCalls an arbitrary runtime method handler in a child …\nReply from a call message.\nCall result.\nMessages can be emitted by contracts and are processed …\nSpecifies when the caller (smart contract) wants to be …\nReplies to delivered messages.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCheck whether the call result indicates a successful …\nInstantiate call result.\nReturns the argument unchanged.\nAssigned instance identifier.\nCalls U::from(self).\nKind of the store to use.\nReturns the argument unchanged.\nCalls U::from(self).\nPrefix that should be used for the underlying store.\nToken amount of given denomination in base units.\nName/type of the token.\nMaximum length of a denomination.\nDenomination in native token.\nToken amount in base units.\nDenomination of the token amount.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nRaw representation of a denomination.\nWhether the denomination represents the native token.\nCreates a new token amount of the given denomination.") \ No newline at end of file diff --git a/rust/search.desc/oasis_core_runtime/oasis_core_runtime-desc-0-.js b/rust/search.desc/oasis_core_runtime/oasis_core_runtime-desc-0-.js new file mode 100644 index 0000000000..a0043f50e5 --- /dev/null +++ b/rust/search.desc/oasis_core_runtime/oasis_core_runtime-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("oasis_core_runtime", 0, "Oasis Core runtime SDK.\nRuntime build information.\nTEE type this build is for.\nRuntime apps.\nIn-memory cache of trees.\nCommon types.\nRuntime configuration.\nConsensus service interfaces.\nRuntime call dispatcher.\nSecure inter-enclave RPC.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nHelper functions to use with the asynchronous Tokio …\nHost interface.\nRuntime attestation key handling.\nDefine a byte array-like type.\nRuntime initialization.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nTrue iff the build can provide integrity and …\nDefine a KeyFormat from KeyFormatAtom and a prefix.\nConsensus SGX and quote policy handling.\nRuntime side of the worker-host protocol.\nSupported runtime protocol version.\nRuntime storage interfaces and implementations.\nTEE type this build is for.\nRuntime transaction processing.\nTypes used by the worker-host protocol.\nAn Oasis runtime app.\nAn application which doesn’t do anything.\nReturns the argument unchanged.\nCalls U::from(self).\nWhether this is a ROFL app.\nCreate a new runtime initializer for an application.\nCalled on application initialization.\nCalled on new runtime block being received.\nCalled on new runtime event being detected.\nCalled for runtime queries.\nQuote policy to use for verifying our own enclave identity.\nCached storage tree with an associated root.\nA set of storage tree caches, one for each storage …\nCache used for checking transactions.\nCommits a specific version and root as being stored by the …\nCache used for executing transactions.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCreate a new empty cache set.\nCache used for queries.\nReference to the cached tree.\nMutable reference to the cached tree.\nByte array type helpers.\nCryptographic primitives.\nLogging subsystem for runtimes.\nChain namespace.\nPanic-related functions.\nProcess-related helpers.\nAn arbitrary precision unsigned integer.\nSGX-specific functionality.\nRuntime time source.\nProtocol and runtime versioning.\nHash type.\nMRAE primitives.\nSignature types.\nCBOR serializable X25519 types.\nA 32-byte SHA-512/256 hash.\nCompute a digest of the passed slice of bytes.\nCompute a digest of the passed slices of bytes.\nHash of an empty string.\nReturns the argument unchanged.\nCalls U::from(self).\nReturns true if the hash is of an empty string.\nSize of this object in bytes.\nHash truncated to the given number of bytes.\nDeoxys-II-256-128 MRAE primitives implementation.\nNonce utility used to ensure nonces are safely incremented.\nDeoxys-II-256-128 state.\nSize of the Deoxys-II-256-128 key in bytes.\nSize of the nonce in bytes.\nAn abstract Deoxys-II-256-128 box opener.\nSize of the authentication tag in bytes.\nUnboxes (“opens”) the provided additional data and …\nUnboxes (“opens”) the provided additional data and …\nBoxes (“seals”) the provided additional data and …\nReturns the argument unchanged.\nGenerates a public/private key pair suitable for use with …\nCalls U::from(self).\nCreates a new instance using the provided key.\nDecrypts and authenticates ciphertext, authenticates the …\nLike DeoxysII::open but writes the plaintext into plaintext…\nEncrypts and authenticates plaintext, authenticates the …\nLike DeoxysII::seal but seals into ciphertext_with_tag, …\nSize of the nonce in bytes. Size of the nonce in bytes.\n120 bit nonce with a 88 bit tag and 32 bit counter. If the …\nSize of tag portion of the nonce in bytes. These bytes …\nReturns the argument unchanged.\nGenerate a random nonce.\nAdds one to the nonce, affecting only the last 32 counting …\nCalls U::from(self).\nCreate a new nonce.\nBlob signed by multiple public keys.\nAn Ed25519 private key.\nAn Ed25519 public key.\nAn Ed25519 signature.\nA signature bundled with a public key.\nBlob signed with one public key.\nA abstract signer.\nSigned blob.\nSigned blob.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a private key from bytes returned by to_bytes.\nGenerate a new private key from a test key seed.\nGenerates a new private key pair.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nSize of this object in bytes.\nSize of this object in bytes.\nReturns the public key corresponding to the signer.\nReturns the public key.\nPublic key that produced the signature.\nGenerates a signature over the context and message.\nSignature over the blob.\nActual signature.\nExtends signature context with additional domain …\nExtends signature context with additional domain …\nSignatures over the blob.\nConvert this private key into bytes.\nVerify signature.\nReturns true iff the signature is valid.\nVerify returns true iff the signature is valid over the …\nVerify signature without applying domain separation.\nThe length of an X25519 private key, in bytes.\nThe length of an X25519 public key, in bytes.\nA CBOR serializable Diffie-Hellman X25519 private key.\nA CBOR serializable Diffie-Hellman X25519 public key.\nLoad private key from a byte array.\nReturns the argument unchanged.\nGiven an X25519 private key, compute its corresponding …\nLoad public key from a byte array.\nReturns the argument unchanged.\nGenerate a new private key from a test key seed.\nGenerate a new private key.\nCalls U::from(self).\nCalls U::from(self).\nCompute corresponding public key.\nA key formatting helper trait to be used together with …\nPart of the KeyFormat to be used with key-value backends …\nDecode the given key format from data.\nDecode the given key format from data (without prefix).\nEncode the given key format.\nEncode the given key format into a set of atoms.\nEncode the first few atoms in the key format.\nThe prefix that identifies the key format.\nThe minimum size of the encoded key.\nGet the logger.\nInitialize the global slog_stdlog adapter to allow logging …\nSize of the namespace in bytes.\nChain namespace.\nReturns the argument unchanged.\nCalls U::from(self).\nSize of this object in bytes.\nA guard that will abort the process if dropped while …\nReturns the argument unchanged.\nCalls U::from(self).\nAborts the process via std::process::abort, but also …\nAn arbitrary precision unsigned integer.\nDivides two numbers, checking for underflow, overflow and …\nSubtracts two numbers, checking for underflow. If …\nReturns the argument unchanged.\nCalls U::from(self).\nEnclave identity.\nMaximum age of a quote from the viewpoint of the enclave.\nEnclave hash (MRENCLAVE).\nEnclave signer hash (MRSIGNER).\nAn unverified SGX remote attestation quote, depending on …\nQuote validity policy.\nA remote attestation quote that has undergone verification.\nEnclave identity for the current enclave (when available).\nSGX per-CPU package sealing key accessor.\nEnclave identity using a test MRSIGNER from Fortanix with …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIntel Attestation Service (IAS) attestation verification …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the quote should be considered fresh.\nSize of this object in bytes.\nSize of this object in bytes.\nIntel Provisioning Certification Services (PCS) quote …\nGenerate a report for the given target enclave.\nWrappers for sealing secrets to the enclave in cold …\nVerify the remote attestation quote.\negetkey returns a 256 bit key suitable for sealing secrets …\nAttestation verification report.\nThe purpose of QuoteContext is to prevent quotes from …\nQuote validity policy.\nAllowed quote statuses.\nWhether IAS quotes are disabled and will always be …\nReturns the argument unchanged.\nReturns the argument unchanged.\nList of blocked platform EPID group IDs.\nCalls U::from(self).\nCalls U::from(self).\nThe minimum TCB evaluation data number that should be …\nVerify attestation report.\nTUD.DEBUG (TD runs in debug mode).\nPossible errors returned by this module.\nSEC.KL (TD is allowed to use Key Locker).\nOTHER.PERFMON (TD is allowed to use Perfmon and …\nSEC.PKS (TD is allowed to use Supervisor Protection Keys).\nAn enclave quote.\nAn attestation quote together with the TCB bundle required …\nQuote validity policy.\nSEC.SEPT_VE_DISABLE (Disable EPT violation conversion to …\nThe TCB bundle contains all the required components to …\nTDX TD attributes.\nTDX TD report.\nTDX module policy.\nTDX-specific quote policy.\nGet a flags value with all known bits set.\nAllowed TDX modules. Empty to allow ANY Intel-signed …\nConverts this report into an enclave identity.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nGet the underlying bits value.\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise negation (!) of the bits in a flags value, …\nWhether all set bits in a source flags value are also set …\nThe intersection of a source flags value with the …\nWhether PCS quotes are disabled and will always be …\nGet a flags value with all bits unset.\nThe bitwise or (|) of the bits in each flags value.\nA list of hexadecimal encoded FMSPCs specifying which …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConvert from a bits value.\nConvert from a bits value exactly.\nConvert from a bits value, unsetting any unknown bits.\nThe bitwise or (|) of the bits in each flags value.\nGet a flags value with the bits of a flag with the given …\nQuote header.\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nWhether any set bits in a source flags value are also set …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether all known bits in this flags value are set.\nWhether all bits in this flags value are unset.\nWhether the quote with timestamp ts is expired.\nYield a set of contained flags values.\nYield a set of contained named flags values.\nReturns true iff the TDX module in the given report …\nMinimum TCB evaluation data number that is considered to …\nSoftware-defined ID for non-owner-defined configuration of …\nSoftware-defined ID for the TD’s owner.\nSoftware-defined ID for owner-defined configuration of the …\nOptional allowed measurement of the TDX Module. In case it …\nMeasurement of the TDX Module.\nAllowed signer of the TDX Module (zero for Intel).\nSigner of the TDX Module (zero for Intel).\nMeasurement of the initial contents of the TD.\nThe bitwise negation (!) of the bits in a flags value, …\nParse a TDX report.\nParse raw TDX attributes.\nThe intersection of a source flags value with the …\nReport body.\nCustom report data.\nRuntime extendable measurement register 0.\nRuntime extendable measurement register 1.\nRuntime extendable measurement register 2.\nRuntime extendable measurement register 3.\nTDX Module attributes (must be zero for TDX 1.0).\nCall insert when value is true or remove when value is …\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nThe bitwise exclusive-or (^) of the bits in two flags …\nValidity (in days) of the TCB collateral.\nTD attributes.\nCompute enclave identity from the given measurements.\nOptional TDX-specific policy. In case this is None, TDX …\nDescribes the TCB of TDX.\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise or (|) of the bits in two flags values.\nVerify whether the TDX policy is satisfied for the given …\nVerify the quote bundle.\nVerify quote.\nXFAM (eXtended Features Available Mask).\nCreates a new Deoxys-II instance initialized with an SGX …\nSeal a secret to the enclave.\nUnseal a previously sealed secret to the enclave.\nReturns the number of seconds since the UNIX epoch. The …\nProtocol versions.\nA protocol or runtime version.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nChecks if two versions are compatible.\nCreates a new version with given major, minor, and patch …\nVersion key used in serialized form.\nA generic versioned serializable data structure.\nReturns the argument unchanged.\nCalls U::from(self).\nCreate a new versioned structure.\nGlobal runtime configuration.\nStorage-related configuration.\nThe maximum number of tree nodes held by the cache before …\nThe total size, in bytes, of values held by the cache …\nAdvertised runtime features.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nWhether storage state should be persisted between …\nStorage configuration.\nOptional trust root for consensus layer integrity …\nSemantic runtime version.\nBlockMetadata contains additional metadata related to the …\nAn event emitted by the consensus layer.\nThe height that represents the most recent block height.\nLight consensus block.\nA unique module name for the consensus module.\nConsensus account address structures.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGovernance structures.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nRegistry structures.\nConsensus roothash structures.\nScheduler structures.\nConsensus staking structures.\nConsensus state wrappers.\nState root after executing all logic in the block.\nTendermint consensus layer backend.\nTrait for consensus layer verification.\nA staking account address.\nCommon pool reserved address.\nPer-block fee accumulator reserved address.\nGovernance deposits reserved address.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nTries to create a new address from Bech32-encoded string.\nCreates a new address from a public key.\nCreates a new runtime address.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCreates a new address from a context, version and data.\nConverts an address to Bech32 representation.\nAn invalid epoch time.\nThe number of intervals (epochs) since a fixed instant in …\nThe epoch state.\nReturns the argument unchanged.\nCalls U::from(self).\nAbstained.\nCancel proposal content.\nChange parameters proposal content.\nInvalid vote that should never be explicitly set.\nNo vote.\nConsensus layer governance proposal content.\nVote for a proposal.\nUpgrade proposal content.\nA governance vote.\nYes Vote.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nUnique identifier of a proposal.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nProposal vote.\nPer enclave key manager access control policy.\nEncrypted ephemeral secret.\nEncrypted master secret.\nA secret encrypted with Deoxys-II MRAE algorithm.\nErrors emitted by the key manager module.\nKey manager access control policy.\nSigned encrypted ephemeral secret (RAK).\nSigned encrypted master secret (RAK).\nSigned key manager access control policy.\nChecksum for validating decrypted secret.\nKey manager state in the consensus layer.\nA map of REK encrypted secrets.\nEpoch time in which the secret was created.\nEpoch time to which the ephemeral secret belongs.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGeneration of the secret.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nA map of runtime IDs to the vector of enclave IDs that may …\nA vector of enclave IDs that may retrieve the master …\nPublic key to derive the symmetric key for decryption.\nRuntime ID of the key manager.\nRuntime ID of the key manager.\nEncrypted secret.\nEncrypted secret.\nEncrypted master secret.\nEncrypted ephemeral secret.\nSignature of the encrypted master secret.\nSignature of the encrypted ephemeral secret.\nVerify the signatures.\nApplication represents a node’s application to form a …\nErrors emitted by the CHURP module.\nThe NIST P-384 elliptic curve group with the SHA3-384 hash …\nKey manager access control policy.\nSigned key manager access control policy.\nStatus represents the current state of a CHURP instance.\nCipher suite identifier.\nA map of nodes that wish to form the new committee.\nThe hash of the verification matrix from the last …\nThe hash of the random verification matrix.\nA vector of nodes holding a share of the secret in the …\nThe minimum number of shares that can be lost to render …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nThe epoch of the last successfully completed handoff.\nThe time interval in epochs between handoffs.\nA unique identifier within the key manager runtime.\nA unique identifier within the key manager runtime.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nA vector of enclave identities that may form the new …\nA map of runtime identities to the vector of enclave …\nA vector of enclave identities from which a share can be …\nThe hash of the verification matrix from the current …\nThe epoch in which the next handoff will occur.\nA signed SGX access control policy.\nAn SGX access control policy.\nReconstructed is true if and only if the node verified all …\nThe identifier of the key manager runtime.\nThe identifier of the key manager runtime.\nA monotonically increasing policy serial number.\nA vector of signatures.\nThe identifier of a cipher suite used for verifiable …\nThe degree of the secret-sharing polynomial.\nVerify the signatures.\nAttestation signature context.\nAdmission policy that allows any node to register.\nRepresents a node’s capabilities.\nRepresents the node’s TEE capability.\nRepresents a consensus address that includes an ID and a …\nNode’s consensus member information.\nTEE capability endorsement signature context.\nAn endorsed CapabilityTEE structure.\nEntity whitelist configuration.\nA per-role entity whitelist policy.\nA per-entity whitelist configuration for a given role.\nPolicy that allows only whitelisted entities’ nodes to …\nParameters for the executor committee.\nConsensus governance model.\nEntity governance model.\nInvalid model that should never be explicitly set.\nRuntime governance model.\nGeneric compute runtime.\nInvalid runtime that should never be explicitly set.\nKey manager runtime.\nThe latest entity descriptor version that should be used …\nThe method name for freshness proofs.\nA unique module name for the registry module.\nA constraint which specifies that only the given number of …\nA constraint which specifies the minimum required …\nNode registry descriptor.\nRepresents the runtimes supported by a given Oasis node.\nNode’s P2P information.\nA per-role admission policy.\nCompute worker role.\nEmpty roles mask.\nKey manager role.\nObserver role.\nPublic consensus RPC services worker role.\nPublic storage RPC services worker role.\nValidator role.\nOasis node roles bitmask.\nRuntime.\nSpecification of which nodes are allowed to register for a …\nRuntime genesis information that is used to initialize …\nRuntime governance model.\nRuntime kind.\nStake-related parameters for a runtime.\nIntel SGX remote attestation.\nIntel SGX TEE constraints.\nThe node scheduling constraints.\nStorage parameters.\nRepresents the address of a TCP endpoint.\nTEE hardware implementation.\nIntel SGX TEE implementation.\nNon-TEE implementation.\nRepresents an Oasis committee address that includes a TLS …\nNode’s TLS information.\nParameters for the runtime transaction scheduler.\nOld V0 format that only supported IAS policies.\nOld V0 format that only supported IAS quotes.\nNew V1 format that supports both IAS and PCS policies.\nNew V1 format that supports both IAS and PCS policies.\nContains information for this node’s participation in …\nA constraint which specifies that the entity must have a …\nVerified remote attestation.\nA verified endorsed CapabilityTEE structure.\nPer-runtime version information.\nThe currently active deployment for the specified epoch if …\nAddress at which the node can be reached.\nAddress at which the node can be reached.\nList of addresses at which the node can be reached.\nList of addresses at which the node can be reached.\nWhich nodes are allowed to register for this runtime.\nNumber of allowed stragglers.\nAllow any node to register.\nAttestation.\nHow long to wait for a scheduled batch in nanoseconds …\nThe SHA256 hash of the runtime bundle (optional).\nNode’s capabilities for a given runtime.\nTEE capability structure to be endorsed.\nChunk size parameter for checkpoint creation.\nExpected runtime state checkpoint interval (in rounds).\nExpected minimum number of checkpoints to keep.\nInformation for connecting to this node as a consensus …\nNode scheduling constraints.\nWhether the roles mask contains any of the specified roles.\nChecks whether the given enclave identity is whitelisted.\nDeployment corresponding to the specified version if it …\nRuntime deployment information.\nIdentities of allowed enclaves.\nEntity whitelist configuration for each whitelisted entity.\nPublic key identifying the Entity controlling the node.\nPublic key identifying the Entity controlling the runtime.\nAllow only the whitelisted entities’ nodes to register.\nParameters of the executor committee.\nEpoch in which the node’s commitment expires.\nExtra per node + per runtime opaque data associated with …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nRuntime genesis information.\nSearches for an existing supported runtime descriptor in …\nRuntime governance model.\nSize of the discrepancy resolution group.\nSize of the committee.\nHardware type.\nChecks whether the node has any of the specified roles.\nChecks whether the node has the provided TEE identity …\nHashes the required data that needs to be signed by RAK …\nEnclave’s view of the consensus layer height at the time …\nUnique identifier of the node on the P2P transport.\nPublic key identifying the node.\nUnique identifier of the node as a consensus member.\nUnique identifier of the node used to generate VRF proofs.\nPublic key identifying the runtime.\nPublic key identifying the node.\nGlobally unique long term identifier of the runtime.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the roles mask encodes a single valid role.\nKey manager runtime ID for this runtime.\nType of runtime.\nChecks whether the TEE capability matches the given TEE …\nMaximum size of a scheduled batch.\nMaximum size of a scheduled batch in bytes.\nMaximum size of the incoming message queue.\nMaximum number of liveness failures that are tolerated …\nMaximum number of messages that can be emitted by the …\nMaximum percentage of proposed rounds in an epoch that can …\nMaximum number of nodes that an entity can register under …\nSpecifies the minimum fee that the incoming message must …\nMinimum number of live rounds in an epoch for the liveness …\nMinimum percentage of rounds in an epoch that a node must …\nNode endorsement signature.\nOptional identifier of the node that endorsed the TEE …\nInformation for connecting to this node via P2P.\nA per-role admission policy that must be satisfied in …\nSGX quote policy.\nHow long to wait before accepting proposal from the next …\nPublic key used for establishing TLS connections.\nPublic key used for establishing TLS connections.\nSGX attestation quote.\nVerified enclave quote.\nRuntime attestation key.\nRuntime encryption key.\nThe percentage of the reward obtained when slashing for …\nThe percentage of the reward obtained when slashing for …\nBitmask representing the node roles.\nRuntime round in the genesis.\nRound timeout in consensus blocks.\nNode’s runtimes.\nPer-runtime misbehavior slashing parameters.\nNode’s oasis-node software version.\nRuntime’s staking-related parameters.\nState root that should be used at genesis time. If the …\nParameters of the storage committee.\nIs the capability of a node executing batches in a TEE.\nEnclave version information, in an enclave provided …\nRuntime’s TEE hardware requirements.\nMinimum stake thresholds for a runtime. These per-runtime …\nInformation for connecting to this node via TLS.\nTries to decode the TEE-specific attestation.\nTries to decode the TEE-specific version information.\nTransaction scheduling parameters of the executor …\nStructure version.\nStructure version.\nThe epoch at which this version is valid.\nVerified TEE remote attestation.\nVerifies the TEE capability.\nVerify endorsed TEE capability is valid.\nVerifies the SGX attestation.\nVerify the endorsement signature is valid.\nVersion of the runtime.\nVersion of the runtime.\nInformation for this node’s participation in VRF based …\nThe runtime’s view of the consensus layer height at the …\nAn Intel SGX quote.\nThe signature of the attestation by the enclave (RAK).\nA set of allowed quote statuses.\nThe allowed MRENCLAVE/MRSIGNER pairs.\nThe allowed MRENCLAVE/MRSIGNER pairs.\nThe maximum attestation age (in blocks).\nThe quote policy.\nRuntime block annotated with consensus information.\nRuntime block.\nThe signature context used to sign compute results headers …\nThe header of a computed batch output by a runtime. This …\nThe signature context used to sign executor worker …\nErrors emitted by the roothash module.\nA commitment to results of processing a proposed runtime …\nThe executor commitment failure reason.\nThe header of an executor commitment.\nIndicates that no failure has occurred.\nIndicates that batch processing failed due to the state …\nIndicates a generic failure.\nBlock header.\nHeader type.\nAn incoming message emitted by the consensus layer to be …\nA message that can be emitted by the runtime to be …\nResult of a message being processed by the consensus layer.\nA trait that validates messages for validity. It can be …\nA trait for looking up registry node descriptors.\nVerified roothash commitment.\nA pool of commitments that can be used to perform …\nInformation about how a particular round was executed by …\nPer-round state and I/O roots that are stored in consensus …\nVerifies and adds a new executor commitment to the pool.\nPublic keys of compute nodes’ controlling entities that …\nRuntime block.\nAddress of the caller authenticated by the consensus layer.\nConsensus height at which this runtime block was produced.\nArbitrary runtime-dependent data.\nReturns a hash of an encoded header.\nReturns a hash of an encoded header.\nThe executor commitment failure reason.\nFee sent into the runtime as part of the message being …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nPublic keys of compute nodes’ controlling entities that …\nHeader.\nThe compute results header.\nHeader type.\nUnique identifier of the message.\nReturns a hash of provided incoming runtime messages.\nReturns a hash of provided runtime messages.\nThe number of processed incoming messages.\nHash of processed incoming messages.\nThe hash of processed incoming messages.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nI/O merkle root.\nThe I/O merkle root.\nReturns true if this commitment indicates a failure.\nReturns true iff the header is the parent of a child …\nReturns true if the event indicates that the message was …\nResults of executing emitted runtime messages.\nReturns a hash of provided runtime messages.\nMessages hash.\nHash of messages sent from this batch.\nReturns true if the commitment is mostly equal to another …\nChain namespace.\nCreates a new pool.\nCreates a new empty block with a specific type.\nCreates a new empty genesis block given a runtime id and …\nPrevious block hash.\nHash of the previous block header this batch was computed …\nPerforms a single round of commitment checks. If there are …\nRound number.\nRound number.\nSigns the executor commitment header.\nSigns the executor commitment header and sets the …\nState merkle root.\nThe root hash of the state after computing this batch.\nAn optional tag provided by the caller which is ignored …\nTimestamp (POSIX time).\nReturns a commitment-specific result after discrepancy …\nReturns a hash that represents a vote for this commitment …\nTokens sent into the runtime as part of the message being …\nPerforms basic validation of the runtime message.\nPerforms basic validation of the staking message.\nPerforms basic validation of the registry message.\nPerforms basic validation of the governance message.\nVerifies that the header signature is valid.\nVerifies the RAK signature.\nProtocol version number.\nIndicates the node is a backup worker.\nA per-runtime (instance) committee.\nThe functionality a committee exists to provide.\nA node participating in a committee.\nA compute executor committee.\nAn invalid role (should never appear on the wire).\nAn invalid committee (should never appear on the wire).\nThe role a given node plays in a committee.\nIndicates the node is a worker.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nThe functionality a committee exists to provide.\nThe committee members.\nThe node’s public key.\nThe node’s role in a committee.\nThe runtime ID that this committee is for.\nReturns the transaction scheduler of the provided …\nThe epoch for which the committee is valid.\nReturns committee nodes with Worker role.\nEntry in the staking ledger.\nEvent emitted when stake is transferred into an escrow …\nAdd escrow result.\nEvent emitted when allowance is changed for a beneficiary.\nEvent emitted when stake is destroyed via a call to Burn.\nCommission rate bound and its starting time.\nCommission rate and its starting time.\nDefines a list of commission rates and commission rate …\nDebonding delegation descriptor.\nEvent emitted when the debonding process has started and …\nDelegation descriptor.\nA stake escrow.\nEscrow account.\nEscrow-related events.\nA staking-related event.\nGeneral purpose account.\nEntity staking threshold.\nCompute node staking threshold.\nKeymanager node staking threshold.\nValidator node staking threshold.\nCompute runtime staking threshold.\nKeymanager runtime staking threshold.\nEvent emitted when stake is reclaimed from an escrow …\nA reclaim escrow.\nReclaim escrow result.\nSlashing due to signing two different executor commits or …\nSlashing due to submission of incorrect results in runtime …\nSlashing due to not doing the required work.\nCombined balance of serval entries, the relative sizes of …\nPer-reason slashing configuration.\nReason for slashing an entity.\nPer escrow account stake accumulator.\nUnique stake claim identifier.\nStake threshold used in the stake accumulator.\nEvent emitted when stake is taken from an escrow account …\nKind of staking threshold.\nA stake transfer.\nEvent emitted when stake is transferred, either by a call …\nTransfer result.\nA withdrawal from an account.\nWithdraw result.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nProvides consensus state tree from the host.\nBeacon state in the consensus layer.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCreates consensus state using host protocol.\nConsensus layer height that this data is for.\nCalls U::from(self).\nCalls U::from(self).\nKey manager state in the consensus layer.\nCreates a consensus state wrapping the provided tree.\nRegistry state in the consensus layer.\nRoothash state in the consensus layer.\nStaking state in the consensus layer.\nConsensus beacon state wrapper.\nMutable consensus beacon state wrapper.\nReturns the current epoch number.\nReturns the current epoch state.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the future epoch number.\nReturns the future epoch state.\nCalls U::from(self).\nCalls U::from(self).\nConstructs a new ImmutableMKVS.\nSet current epoch state.\nSet future epoch state.\nConsensus key manager state wrapper.\nCurrent key manager status.\nKey manager master secret verification checksum.\nKey manager state in the consensus layer.\nLooks up a specific key manager ephemeral secret by its …\nReturns the argument unchanged.\nReturns the argument unchanged.\nGeneration of the latest master secret.\nRuntime ID of the key manager.\nCalls U::from(self).\nCalls U::from(self).\nTrue iff the key manager is done initializing.\nTrue iff the key manager is secure.\nLooks up a specific key manager master secret by its …\nConstructs a new ImmutableMKVS.\nList of currently active key manager node IDs.\nKey manager policy.\nEpoch of the last master secret rotation.\nRuntime signing key of the key manager.\nLooks up a specific key manager status by its namespace …\nReturns the list of all key manager statuses.\nConsensus CHURP state wrapper.\nReturns the argument unchanged.\nCalls U::from(self).\nConstructs a new ImmutableMKVS.\nLooks up a specific key manager status by its namespace …\nConsensus registry state wrapper.\nReturns the argument unchanged.\nCalls U::from(self).\nConstructs a new ImmutableMKVS.\nLooks up a specific node by its identifier.\nReturns the list of all registered nodes.\nLooks up a specific runtime by its identifier.\nConsensus roothash state wrapper.\nReturns the argument unchanged.\nCalls U::from(self).\nReturns the last round results for a specific runtime.\nConstructs a new ImmutableMKVS.\nReturns the state root for a specific runtime.\nConsensus staking state wrapper.\nReturns the staking account for the given account address.\nReturns the non-empty addresses from the staking ledger.\nReturns the balance of the global common pool.\nReturns the debonding delegation.\nReturns all debonding delegations.\nReturns the delegation.\nReturns all active delegations.\nReturns the argument unchanged.\nReturns the governance deposits balance.\nCalls U::from(self).\nReturns the last block fees balance.\nConstructs a new ImmutableMKVS.\nReturns the total supply.\nTendermint consensus backend name. Keep synced with …\nTendermint light consensus block metadata.\nThe domain separation context used by Oasis Core for …\nConvert an Oasis Core chain context into a Tendermint …\nDecode the light block metadata as a Tendermint light …\nEncode the light block metadata to a Tendermint light …\nReturns the argument unchanged.\nState root specified by this light block.\nCalls U::from(self).\nMerkle proofs used in Tendermint networks\nExtract state root from the given signed block header.\nTendermint consensus layer verification logic.\nMaximum number of aunts that can be included in a Proof. …\nProof represents a Merkle proof.\nCompute the root hash given a leaf hash. Does not verify …\nReturns the argument unchanged.\nCalls U::from(self).\nVerify that the Proof proves the root hash. Check …\nA verifier which performs no verification.\nTendermint consensus layer verifier.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturn a handle to interact with the verifier.\nCalls U::from(self).\nCalls U::from(self).\nCreate a new non-verifying verifier.\nCreate a new Tendermint consensus layer verifier.\nStart the non-verifying verifier.\nStart the verifier in a separate thread.\nConsensus transaction fee the sender wishes to pay for …\nConsensus gas representation.\nMethod name.\nProof of transaction inclusion in a block.\nSigned consensus transaction.\nSigned consensus transaction with a proof of its inclusion …\nUnsigned consensus transaction.\nFee amount to be paid.\nSigned blob.\nMethod call body.\nOptional fee that the sender commits to pay to execute …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nMaximum gas that a transaction can use.\nBlock height at which the transaction was published.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nMethod that should be called.\nNonce to prevent replay.\nProof of transaction inclusion in a block.\nActual raw proof.\nSignature over the blob.\nSigned transaction.\nReturns true iff the signature is valid.\nConsensus layer trust root.\nVerifier is the consensus layer state verifier trait.\nKnown consensus chain context.\nReturn the consensus layer events at the given height.\nReturns the argument unchanged.\nReturns the argument unchanged.\nKnown hex-encoded trusted consensus layer header hash.\nKnown trusted height.\nCalls U::from(self).\nCalls U::from(self).\nReturn the latest known consensus layer height.\nReturn the latest verified consensus layer state.\nKnown runtime identifier.\nReturn the verified consensus layer state for a given …\nSynchronize the verifier state up to including the passed …\nReturn the consensus layer state accessor for the given …\nVerify that the given runtime header is valid at the given …\nVerify that the given runtime header is valid at the given …\nVerify consensus layer state freshness based on our …\nRuntime call dispatcher.\nInterface for dispatcher initializers.\nState returned by the initializer.\nState available before initialization.\nOptional ROFL application.\nConsensus verifier instance.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nRuntime Attestation Key instance.\nInitializes the dispatcher(s).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCreate a new runtime call dispatcher.\nProtocol instance.\nQueue a new request to be dispatched.\nRPC demultiplexer instance.\nRPC dispatcher instance.\nStart the dispatcher.\nOptional transaction dispatcher that should be used.\nEnclave RPC client.\nRPC call context.\nSession demultiplexer.\nRPC dispatcher.\nSecure channel session.\nSession demultiplexer.\nRPC protocol types.\nAn EnclaveRPC response that can be used to provide peer …\nRPC client.\nRPC client error.\nReport bad peer as peer feedback.\nReport failure as peer feedback.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCall a remote method over an insecure channel where …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nConsume the response instance returning the inner result.\nReport success if result was Ok(_) and failure if result …\nConstruct an unconnected RPC client with runtime-internal …\nReference to inner result.\nCall a remote method using an encrypted and authenticated …\nReport success as peer feedback.\nUpdate allowed remote enclave identities.\nUpdate remote end’s quote policy.\nUpdate remote runtime id.\nRPC call context.\nReturns the argument unchanged.\nCalls U::from(self).\nConstruct new transaction context.\nInformation about the session the RPC call was delivered …\nSession demultiplexer.\nDemultiplexer error.\nCloses the given session.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCreate new session demultiplexer.\nProcess a frame, returning the locked session guard and …\nResets all open sessions.\nSet the session builder to use.\nRPC call dispatcher.\nRPC handler.\nKey manager quote policy update handler callback.\nKey manager status update handler callback.\nRPC method dispatcher implementation.\nDescriptor of a RPC API method.\nHandler for a RPC method.\nDispatcher for a RPC method.\nRegister a new method in the dispatcher.\nRegister new methods in the dispatcher.\nDispatch request.\nDispatch request.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet method descriptor.\nInvoke the method implementation and return a response.\nHandle key manager quote policy update.\nHandle key manager status update.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nSpecifies which kind of RPC is allowed to call the method.\nReturns the list of RPC methods supported by this handler.\nMethod name.\nCreate a new enclave method descriptor.\nUpdate key manager quote policy update handler.\nUpdate key manager status update handler.\nSession builder.\nBinding of the session’s static public key to a remote …\nAn encrypted and authenticated RPC session.\nInformation about a session.\nOld V0 format that only supported IAS quotes.\nNew V1 format that supports both IAS and PCS quotes.\nV2 format which supports endorsed CapabilityTEE structures.\nBuild initiator session.\nBuild responder session.\nMark the session as closed.\nEnable remote node identity verification.\nIdentifier of the node that endorsed the TEE.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturn the local identity if configured in the builder.\nReturn quote policy if configured in the builder.\nReturn remote enclave identities if configured in the …\nReturn remote node identifier.\nReturn remote runtime ID if configured in the builder.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the session is in closed state.\nWhether the session handshake has completed and the session\nWhether the session is connected to one of the given nodes.\nWhether the session is in unauthenticated transport state. …\nEnable RAK binding.\nProcess incoming data.\nConfigure quote policy used for remote quote verification.\nRAK binding.\nPublic part of the RAK.\nEnable remote enclave identity verification.\nSet remote runtime ID for node identity verification.\nSession information.\nSet the remote node identifier.\nUse endorsement from host node when establishing sessions.\nVerified TEE remote attestation.\nVerify the RAK binding.\nWrite message to session.\nSessions error.\nA multiplexed session.\nKey for use in the by-idle-time index.\nStructure used for session accounting.\nSession indices and management operations.\nShared pointer to a multiplexed session.\nAdd a session if there is an available spot.\nMark the session as closed.\nCreate a new multiplexed initiator session.\nCreate a new multiplexed responder session.\nRemoves and returns all sessions.\nFetch an existing session from one of the given peers. If …\nFetch an existing session from any peer.\nFetch an existing session from one of the given peers.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nFetch an existing session given its identifier.\nReturn the session’s peer ID.\nReturn remote node identifier.\nReturn the session ID.\nSession information.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the session is in closed state.\nWhether the session handshake has completed and the session\nWhether the session is in unauthenticated transport state. …\nCreate a new session management instance.\nProcess incoming session data.\nRemove a session that must be currently owned by the …\nRemove one session to free up a slot for the given peer.\nRemove one existing session from the given peer if the …\nRemove one stale session if the total number of sessions …\nSet the session builder to use.\nSet the session’s peer ID.\nSet the remote node identifier.\nUpdate remote enclave identity verification in the session …\nUpdate quote policy used for remote quote verification in …\nUpdate remote runtime ID for node identity verification in …\nWrite message to session and generate a response.\nFrame.\nAn insecure RPC call where messages are sent in plain text.\nRPC call kind.\nA local RPC call.\nProtocol message.\nA secure RPC call using an encrypted and authenticated …\nFeedback on the peer that handled the last EnclaveRPC call.\nSession identifier for multiplexing multiple sessions over …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nSize of this object in bytes.\nGenerate a random session identifier.\nRuns a future to completion on the current Tokio handle’…\nCreate a new asynchronous Tokio runtime.\nErrors.\nInterface to the (untrusted) host node.\nNotification registration options.\nTransaction submission options.\nTransaction submission result.\nOrder of the transaction in the execution batch.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the identity of the host node.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nTransaction output.\nOptional inclusion proof.\nWhether the response should include a proof of transaction …\nRegister for receiving notifications.\nRound in which the transaction was executed.\nSubscribe to runtime block notifications.\nSubscribe to runtime event notifications.\nTarget runtime identifier. If not specified, own runtime …\nSubmit a transaction.\nWhether the call should wait until the transaction is …\nRuntime identity.\nEndorsed TEE capability.\nReturns the argument unchanged.\nCalls U::from(self).\nCreate an uninitialized runtime identity.\nHost node identity public key.\nPublic part of RAK.\nPublic part of REK.\nQuote for RAK.\nRuntime quote policy.\nChecks whether the RAK matches another specified (RAK_pub, …\nVerify a provided RAK binding.\nStarts the runtime.\nConsensus policy verifier.\nPolicy verifier error.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nFetch runtime’s key manager.\nFetch key manager’s policy from the latest verified …\nFetch key manager’s status from the latest verified …\nCreate a new consensus policy verifier.\nFetch runtime’s quote policy from the latest verified …\nVerify that key manager’s policy has been published in …\nVerify that key manager’s status has been published in …\nVerify that runtime’s quote policy has been published in …\nInformation about the host environment.\nRuntime part of the runtime host protocol.\nUntrusted key/value store which stores arbitrary binary …\nStream used to communicate with the host.\nMake a new request to the runtime host and wait for the …\nMake a new request to the runtime host and wait for the …\nName of the consensus backend that is in use for the …\nConsensus layer chain domain separation context.\nConsensus protocol version that is in use for the …\nEnsure that the runtime is ready to process requests and …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nThe supplied runtime configuration.\nThe host environment information for this instance.\nThe runtime identity.\nThe runtime identifier for this instance.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nNode-local runtime configuration.\nAssigned runtime identifier of the loaded runtime.\nSend an async response to a previous request back to the …\nTrivial key/value storage.\nUntrusted key/value storage which stores arbitrary binary …\nReturns the argument unchanged.\nFetch the value for a specific key.\nStore a specific key/value into storage.\nCalls U::from(self).\nMerklized key-value store.\nMerklized key-value store where methods return errors …\nStorage root for transaction IO.\nImmutable merkalized key value store.\nInvalid or uninitialized storage root type.\nAn MKVS iterator.\nAn entry in the write log, describing a single update.\nThe type of entry in the log.\nMerklized key-value store.\nA box type that can contain either internal or leaf nodes.\nA pointer to a node in the tree.\nA reference-counted pointer to a pointer.\nA key-value tree overlay that holds all updates in memory …\nA key prefix.\nStorage root.\nStorage root type.\nStorage root for runtime state.\nA patricia tree-based MKVS implementation.\nThe write log.\nReturn an builder struct to chain configuration calls on.\nCheck if the local MKVS cache contains the given key.\nCheck if the local MKVS cache contains the given key.\nCheck if the key exists in the local cache.\nCommit all database changes to the underlying store.\nCommit all database changes to the underlying store.\nCommit any modifications to the underlying tree.\nCommit tree updates to the underlying database and return …\nCommit any modifications to the underlying tree and then …\nReturn the error that occurred during iteration if any.\nReturn a copy of this pointer containing only hash …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a node pointer from a full node.\nFetch entry with given key.\nFetch entry with given key.\nFetch entry with given key.\nGet an existing key.\nGet an existing key.\nThe key under the iterator.\nGet a reference to the node the pointer is pointing to.\nFetch proof for entry with given key.\nFetch proof for entry with given key.\nFetch proof for entry with given key.\nThe value under the iterator.\nCheck if the pointer has a resolved reference to a …\nMerkle root hash.\nConstruct a hash-only pointer.\nUpdate entry with given key.\nUpdate entry with given key.\nInsert a key/value pair into the tree.\nInsert a key/value pair into the tree.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCheck if the pointer is a null pointer.\nReturn whether the iterator is valid.\nReturns an iterator over the tree.\nReturns an iterator over the tree.\nReturns an iterator over the tree.\nReturn an iterator over the tree.\nReturn an iterator over the tree.\nThe key that was inserted or deleted.\nNamespace under which the root is stored.\nCreate a new overlay tree.\nConstruct a new tree instance using the given read syncer …\nAdvance the iterator to the next key.\nConstruct a null pointer.\nPopulate the in-memory tree with nodes for keys starting …\nPopulate the in-memory tree with nodes for keys starting …\nPopulate the in-memory tree with nodes for keys starting …\nPopulate the in-memory tree with nodes for keys starting …\nRemove entry with given key, returning the value at the …\nRemove entry with given key, returning the value at the …\nRemove entry with given key, returning the value at the …\nRemove entry with given key, returning the value at the …\nMoves the iterator to the first key in the tree.\nThe storage type that this root has data for.\nMoves the iterator either at the given key or at the next …\nSets the number of next elements to prefetch.\nThe read-only tree sync interface.\nThe inserted value (empty if the key was deleted).\nMonotonically increasing version number in which the root …\nThe Marshal trait is used for marshaling and unmarshaling …\nMarshal the object into a binary form and return it as a …\nUnmarshal from the given byte slice reference and modify …\nRequest for the SyncGetPrefixes operation.\nRequest for the SyncGet operation.\nA proxy read syncer which forwards calls to the runtime …\nRequest for the SyncIterate operation.\nA no-op read syncer which doesn’t support any of the …\nA Merkle proof for a subtree.\nA Merkle proof builder.\nResponse for requests that produce proofs.\nA proof verifier enables verifying proofs returned by the …\nA raw proof entry.\nReadSync is the interface for synchronizing the in-memory …\nA proxy read syncer which keeps track of call statistics.\nIdentifies a specific tree and a position within that tree.\nReturn self as an Any object, useful for downcasting.\nBuild the (unverified) proof.\nProof entries in pre-order traversal.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nAdd a node to the set of included nodes.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nMerges a previously verified subtree with an existing tree.\nConstruct a new host proxy instance.\nCreate a new proof builder for the given root hash.\nConstruct a new instance, proxying to the given backing …\nCreate a new proof builder for the given root hash and …\nThe caller’s position in the tree structure to allow …\nThe Merkle tree root.\nFetch a single key and returns the corresponding proof.\nCount of sync_get calls made to the underlying read syncer.\nFetch all keys under the given prefixes and returns the …\nCount of sync_get_prefixes calls made to the underlying …\nSeek to a given key and then fetch the specified number of …\nCount of sync_iterate calls made to the underlying read …\nThe root hash this proof is for. This should only be used …\nVerify a proof and generate an in-memory subtree …\nRuntime call context.\nRuntime transaction batch dispatcher.\nRead/write set.\nTransaction tags.\nTransaction I/O tree.\nTransaction protocol types.\nTransaction context.\nFlag indicating whether to only perform transaction check …\nConsensus light block.\nConsensus state tree.\nEpoch corresponding to the currently processed block.\nReturns the argument unchanged.\nThe block header accompanying this transaction.\nCalls U::from(self).\nThe maximum number of messages that can be emitted in this …\nConstruct new transaction context.\nLow-level access to the underlying Runtime Host Protocol.\nResults of processing the previous successful round.\nRuntime state.\nRuntime transaction dispatcher trait.\nResult of processing a batch of ExecuteTx.\nResult of processing an ExecuteTx.\nNo-op dispatcher.\nBlock emitted tags (not emitted by a specific transaction).\nCheck the transactions in the given batch for validity.\nExecute the transactions in the given batch.\nInvoke the finalizer (if any).\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nNumber of processed incoming messages.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether dispatch is supported by this dispatcher.\nEmitted runtime messages.\nTransaction output.\nProcess a query.\nPer-transaction execution results.\nSchedule and execute transactions in the given batch.\nConfigure abort batch flag.\nEmitted tags.\nHashes of transactions to reject.\nA coarsened key prefix that represents any key that starts …\nA set of coarsened keys.\nA read/write set.\nReturns the argument unchanged.\nReturns the argument unchanged.\nSize of the key prefixes (in bytes) used for coarsening …\nCalls U::from(self).\nCalls U::from(self).\nThe read set.\nThe write set.\nTag is a key/value pair of arbitrary byte blobs with …\nA set of tags.\nReturns the argument unchanged.\nCalls U::from(self).\nThe tag key.\nCreate a new tag.\nThe hash of the transaction that emitted the tag.\nThe tag value.\nHash used for block emitted tags not tied to a specific …\nA Merkle tree containing transaction artifacts.\nAdd block tags.\nAdd an input transaction artifact.\nAdd an output transaction artifact.\nCommit updates to the underlying Merkle tree and return …\nReturns the argument unchanged.\nCalls U::from(self).\nCreate a new transaction artifacts tree.\nBatch of transaction inputs/outputs.\nReturns the argument unchanged.\nCalls U::from(self).\nRuntime host protocol message body.\nCheckTx transaction metadata.\nResult of a CheckTx operation.\nComputed batch.\nA serializable error.\nConsensus event kind.\nExecution mode where the batch of transactions is executed …\nBatch execution mode.\nA feature specifying that the runtime supports controlling …\nSet of supported runtime features.\nRequest to host to fetch the consensus events for the …\nResponse from host fetching the consensus events for the …\nHost storage endpoint.\nInvalid message (should never be seen on the wire).\nRuntime protocol message.\nRegistration for runtime event notifications.\nRequest.\nResponse.\nRuntime information request.\nRuntime information response.\nAn event notification.\nExecution mode where the runtime is in control of …\nStorage sync request.\nStorage sync response.\nHeader of the block that emitted the event.\nMessage body.\nA feature specifying that the runtime supports endorsed …\nDescribes the features supported by the runtime.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCompute results header.\nUnique request identifier.\nSize of the initial batch of transactions.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nLog that generates the I/O tree.\nA feature specifying that the runtime supports updating …\nA feature specifying that the runtime supports updating …\nMessage type.\nMessages emitted by the runtime.\nCreate a new error.\nThe runtime protocol version supported by the runtime.\nIf this runtime uses a TEE, then this is the signature of …\nThe version of the runtime.\nSchedule control feature.\nLog of changes to the state tree.\nEvent tags to subscribe to.\nMatching tags.") \ No newline at end of file diff --git a/rust/search.desc/oasis_runtime_sdk/oasis_runtime_sdk-desc-0-.js b/rust/search.desc/oasis_runtime_sdk/oasis_runtime_sdk-desc-0-.js new file mode 100644 index 0000000000..c26c4e0eca --- /dev/null +++ b/rust/search.desc/oasis_runtime_sdk/oasis_runtime_sdk-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("oasis_runtime_sdk", 0, "Oasis runtime SDK.\nDerives the Error trait on an enum.\nDerives the Event trait on an enum.\nA protocol or runtime version.\nHandling of different call formats.\nConfiguration types.\nExecution context.\nCryptography.\nTransaction dispatcher.\nExposed EnclaveRPC methods.\nError types for runtimes.\nEvent types for runtimes.\nReturns the argument unchanged.\nA helper attribute for #[sdk_derive(...)]. It doesn’t do …\nHistoric state access.\nCalls U::from(self).\nChecks if two versions are compatible.\nKeymanager interface.\nA helper attribute for #[sdk_derive(...)]. It doesn’t do …\nRuntime modules.\nRuntime modules included with the SDK.\nCreates a new version with given major, minor, and patch …\nRuntime.\nTypes related to schedule control.\nDerives traits from a non-trait impl block (rather than …\nTransaction sender metadata.\nStorage.\nSubcall dispatch.\nModule which contains utilities useful for testing and …\nTypes defined by the SDK.\nConstructs an oasis_sdk::core::common::version::Version …\nAdditional metadata required by the result encoding …\nDecode call arguments.\nDecode call arguments.\nEncode call results.\nEncode call results.\nEncrypt a call result using the X25519-Deoxys-II …\nReturns the argument unchanged.\nDerive the key pair ID for the call data encryption key …\nCalls U::from(self).\nTransaction index within the batch.\nCaller’s ephemeral public key used for X25519.\nSecret key.\nRuntime schedule control configuration.\nSize of each extra batch that the runtime should fetch.\nConstruct a default schedule control configuration.\nReturns the argument unchanged.\nSize of the initial batch that the node should provide to …\nCalls U::from(self).\nMaximum number of transactions that can go in a batch.\nMinimum amount of gas that needs to be remaining in a …\nRuntime SDK context.\nRuntime that the context is being invoked in.\nDispatch context for the whole batch.\nClone this context.\nConsensus state.\nCurrent epoch.\nReturns the argument unchanged.\nReturns a logger.\nHistorical state.\nInformation about the host environment.\nCalls U::from(self).\nWhether method is an allowed query per policy in the local …\nWhether the context has a key manager available (e.g. the …\nThe key manager, if the runtime is confidential.\nReturns node operator-provided local configuration.\nMaximum number of consensus messages that the runtime can …\nCreate a new dispatch context.\nLast runtime block header.\nRuntime ID.\nResults of executing the last successful runtime round.\nWhether smart contracts should be executed in this context.\nRandom number generator based on root VRF key and Merlin …\nCryptographic signatures.\nA multisig configuration. A set of signers with total “…\nError.\nA set of signatures corresponding to a multisig …\nA SignatureSet owned in a Vec.\nOne of the signers in a multisig configuration.\nChecks that the configuration and signature set are …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nThe public key of the signer.\nThe signers.\nThe threshold.\nPerforms some sanity checks. This looks at the …\nThe weight of the signer.\nA leaf RNG.\nA root RNG that can be used to derive domain-separated …\nAppend local entropy to the root RNG.\nAppend an observed subcontext to RNG transcript.\nAppend an observed transaction hash to RNG transcript.\nCreate an independent leaf RNG using this RNG as its …\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCreate an invalid root RNG which will fail when any leaf …\nCreate a new root RNG.\nError.\nA memory-backed signer.\nA public key used for signing.\nVariable-length opaque signature.\nA specific combination of signature and hash.\nCommon trait for memory signers.\nReturn a byte representation of this public key.\nDomain separation context helpers.\nEd25519 signatures.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nRecreate signer from a byte serialization.\nReconstruct the signer from its byte representation.\nConstruct a public key from a slice of bytes.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturn the key type as string.\nCreate a new signer from the given seed.\nCreate a new memory signer from a seed.\nCreate a new signer for testing purposes.\nReturn the public key counterpart to the signer’s secret …\nPublic key corresponding to the signer.\nCreate a new random signer.\nSecp256k1 signatures.\nSecp256r1 signatures.\nSecp384r1 signatures.\nGenerate a signature over the context and message.\nGenerate a signature with the private key over the context …\nGenerate a signature for the specified message and …\nGenerate a signature over the message.\nGenerate a signature with the private key over the message.\nSr25519 signatures.\nSerialize the signer into bytes.\nReturn a byte representation of the signer.\nVerify a signature.\nVerify a batch of signatures of the same message.\nVerify the signature of a message.\nVerify signature raw using the underlying method, without …\nReturn the globally configured chain domain separation …\nConfigure the global chain domain separation context.\nA memory-backed signer for Ed25519.\nAn Ed25519 public key.\nReturn a byte representation of this public key.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a public key from a slice of bytes.\nCalls U::from(self).\nCalls U::from(self).\nVerify a signature.\nVerify signature of a pre-hashed message.\nVerify signature without applying domain separation.\nA memory-backed signer for Secp256k1.\nA Secp256k1 public key (in compressed form).\nReturn a byte representation of this public key.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a public key from a slice of bytes.\nCalls U::from(self).\nCalls U::from(self).\nDerive an Ethereum-compatible address.\nReturn an alternative byte representation used in deriving …\nVerify a signature.\nVerify signature of a pre-hashed message.\nVerify signature without using any domain separation …\nA memory-backed signer for Secp256r1.\nA Secp256r1 public key (in compressed form).\nReturn a byte representation of this public key.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a public key from a slice of bytes.\nCalls U::from(self).\nCalls U::from(self).\nVerify a signature.\nVerify signature of a pre-hashed message.\nVerify signature without using any domain separation …\nA memory-backed signer for Secp384r1.\nA Secp384r1 public key (in compressed form).\nReturn a byte representation of this public key.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConstruct a public key from a slice of bytes.\nCalls U::from(self).\nCalls U::from(self).\nVerify a signature.\nVerify signature of a pre-hashed message.\nVerify signature without using any domain separation …\nA Sr25519 public key.\nReturn a byte representation of this public key.\nReturns the argument unchanged.\nConstruct a public key from a slice of bytes.\nCalls U::from(self).\nVerify a signature.\nAdditional options for dispatch operations.\nResult of dispatching a transaction.\nThe runtime dispatcher.\nError emitted by the dispatch process. Note that this …\nCall format metadata.\nCheck whether the given transaction is valid.\nDecode a runtime transaction.\nProcess the given runtime query.\nDispatch a runtime transaction in the given context.\nRun the dispatch steps inside a transaction context. This …\nDispatch a runtime transaction in the given context with …\nExecute the given transaction.\nExecute the given transaction, returning unserialized …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nOptionally only allow methods for which the provided …\nPrefetch prefixes for the given transaction.\nTransaction priority.\nRegister EnclaveRPC methods.\nTransaction call result.\nTransaction sender metadata.\nOptionally skip authentication.\nTransaction tags.\nTransaction hash.\nTransaction index within the batch.\nTransaction size.\nName of the query method.\nArguments for the query method.\nReturns the argument unchanged.\nCalls U::from(self).\nA runtime error that gets propagated to the caller.\nA serializable error.\nError code uniquely identifying the error.\nReturns the argument unchanged.\nCalls U::from(self).\nConsumes self and returns either Ok(err) (where err is a …\nConverts the error into a call result.\nName of the module that emitted the error.\nCreate a new error.\nAn event emitted by the runtime.\nA key-value pair representing an emitted event that will …\nEvent tags with values accumulated by key.\nProvides method for converting event tags into events.\nCode uniquely identifying the event.\nGenerate an EventTag corresponding to the passed event …\nReturns the argument unchanged.\nCalls U::from(self).\nConverts an event into an event tag.\nName of the module that emitted the event.\nHistory host errors.\nInterface to the runtime host to fetch historic …\nFetch events emitted during execution of the block at …\nFetch historic consensus state after executing the block …\nReturns the argument unchanged.\nCalls U::from(self).\nKey pair ID domain separation context.\nKey manager interface.\nConvenience wrapper around an existing KeyManagerClient …\nKey manager error.\nA key pair managed by the key manager.\nA 256-bit key pair identifier.\nSigned public key.\nA state encryption key.\nSet of trusted key manager signing keys.\nChecksum of the key manager state.\nChecksum of the key manager state.\nClear local key cache.\nExpiration epoch.\nReturns the argument unchanged.\nDerive a KeyPairId for use with the key manager functions.\nGet or create named ephemeral key pair for given epoch.\nGet or create named key pair.\nGet ephemeral public key for an epoch and a key pair id.\nGet public key for a key pair id.\nInput key pair (pk, sk)\nCalls U::from(self).\nPublic key.\nKey manager runtime identifier this client is connected …\nKey manager runtime signing key used to sign messages from …\nSign(sk, (key || checksum || runtime id || key pair id || …\nSet of trusted signers.\nState encryption key\nThreshold for determining if enough valid signatures are …\nA fatal error has occurred and the batch must be aborted.\nAn authentication decision for cases where multiple …\nBlock handler.\nA variant of types::transaction::CallResult but used for …\nAuthentication passed, continue with the next …\nResult of invoking the method handler.\nModule error type.\nModule event type.\nCall has completed with failure.\nFee proxy handler.\nGenesis state type.\nInvariant handler.\nMethod handler.\nMigration handler.\nA runtime module.\nInfo handler.\nModule name.\nCall has completed successfully.\nParameters for a runtime module.\nModule parameters.\nStore key used for storing parameters.\nAuthentication passed, no further authentication handlers …\nTransaction handler.\nModule version.\nPerform any action after dispatching the transaction, in …\nPerform any action after call, within the transaction …\nJudge if a raw transaction is good enough to undergo …\nJudge if an unverified transaction is good enough to …\nAuthenticate a transaction.\nPerform any action after authentication and decoding, …\nPerform any action after authentication, within the …\nPerform any common actions at the start of the block …\nCheck invariants.\nDecode a transaction that was sent with module-controlled …\nA convenience function for dispatching method calls.\nDispatch a call.\nDispatch a message result.\nA convenience function for dispatching queries.\nDispatch a query.\nPerform any common actions at the end of the block (after …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nInitialize state from genesis or perform a migration.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nChecks whether the given call is allowed to be called …\nChecks whether the given query is allowed to access …\nChecks whether the given query method is tagged as …\nCheck whether the call result indicates a successful …\nReports info about the module (or modules, if Self is a …\nTransforms DispatchResult<B, R> into Result<R, E>, mapping …\nTransforms DispatchResult<B, R> into Result<R, E>, mapping …\nReturn the module’s parameters.\nAdd storage prefixes to prefetch.\nResolve the proxy payer for the given transaction. If no …\nSet the module’s parameters.\nLists the names of all RPC methods exposed by this module. …\nPerform basic parameter validation.\nMethod access control module.\nAccounts module.\nConsensus module.\nConsensus accounts module.\nCore definitions module.\nRewards module.\nOn-chain coordination for ROFL components.\nModule configuration.\nErrors emitted by the access module.\nTo filter methods by caller address, add them to this …\nThe method access control module.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nMethod access control module types.\nA set of addresses that can be used to define access …\nOnly allow method calls from these addresses; for other …\nA specific kind of access control.\nControl a statically configured set of methods, each with a\nA specific kind of method authorization.\nA set of methods that are subject to access control.\nHelper for creating a method authorization type that only …\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nReturn a new access control configuration.\nHelper for creating a static access control configuration.\nModule’s address that has the common pool.\nModule’s address that has the fee accumulator.\nInterface that can be called from other modules.\nErrors emitted by the accounts module.\nEvents emitted by the accounts module.\nGas costs.\nGenesis state for the accounts module.\nErrors emitted during rewards parameter validation.\nParameters for the accounts module.\nBurn existing tokens, decreasing the total supply.\nMoves the amount into the per-transaction fee accumulator.\nCheck invariants.\nCheck transaction signer account nonces. Return payer …\nEnsures that the given account has at least the specified …\nFee manager.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nFetch addresses.\nFetch an account’s balance of the given denomination.\nFetch an account’s current balances.\nFetch information about a denomination.\nFetch an account’s current nonce.\nFetch total supplies.\nIncrements an account’s nonce.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nMint new tokens, increasing the total supply.\nSets an account’s balance of the given denomination.\nSets an account’s nonce.\nIndicates that the unused portion of the transaction fee …\nSets the total supply for the given denomination.\nState schema constants.\nTake the flag indicating that the unused portion of the …\nTransfer an amount from one account to the other.\nTransfer an amount from one account to the other without …\nAccount module types.\nUpdate transaction signer account nonces.\nThe per-block fee manager that records what fees have been …\nFee updates to apply to state after commit_tx.\nInformation about fees charged for the current transaction.\nTransaction fee amount.\nCommit the fees accumulated for the current block, …\nCommit the currently open transaction fee by moving the …\nDenomination of the transaction fee.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCreate a new per-block fee manager.\nTransaction fee payer address.\nFee payer.\nRecord that a transaction fee has been charged.\nRecord that a portion of the previously charged …\nAmount that should be refunded to fee payer.\nFees charged for the current transaction.\nMap of account addresses to account metadata.\nMap of account addresses to map of denominations to …\nMap of total supplies (per denomination).\nAccount metadata.\nBalances in an account.\nArguments for the Addresses query.\nArguments for the Balances query.\nInformation about a denomination.\nArguments for the DenominationInfo query.\nArguments for the Nonce query.\nTransfer call.\nNumber of decimals that the denomination is using.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nInterface that can be called from other modules.\nEvents emitted by the consensus module (none so far).\nGas costs.\nGenesis state for the consensus module.\nErrors emitted during rewards parameter validation.\nParameters for the consensus module.\nQuery consensus account info.\nConvert runtime amount to consensus amount, scaling as …\nConvert consensus amount to runtime amount, scaling as …\nReturns consensus token denomination.\nQuery consensus delegation info.\nEnsures transaction signer is consensus compatible.\nEscrow an amount of the runtime account funds.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nDetermine consensus height corresponding to the given …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nMinimum amount that is allowed to be delegated. This …\nReclaim an amount of runtime staked shares.\nCost of the internal round_root call.\nRound roots return the round roots for the given runtime …\nTransfer an amount from the runtime account.\nWithdraw an amount into the runtime account.\nKind of root.\nInternal round root call body.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nModule’s address that has the tokens pending delegation.\nModule’s address that has the tokens pending withdrawal.\nInterface that can be called from other modules.\nEvents emitted by the consensus accounts module.\nGas costs.\nGenesis state for the consensus module.\nParameters for the consensus module.\nCheck invariants.\nDelegate from runtime account to consensus staking account.\nTransfer from consensus staking account to runtime account.\nWhether delegate functionality should be disabled.\nWhether deposit functionality should be disabled.\nWhether undelegate functionality should be disabled.\nWhether withdraw functionality should be disabled.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nState schema.\nCost of storing a delegation/undelegation receipt.\nCost of taking a delegation/undelegation receipt.\nConsensus module types.\nStart the undelegation process of the given number of …\nTransfer from runtime account to consensus staking account.\nMap of active delegations.\nReceipts.\nMap of undelegations.\nAn undelegation queue.\nUndelegation metadata.\nAdd delegation for a given (from, to) pair.\nRecord new undelegation and add to undelegation queue.\nReturns the argument unchanged.\nRetrieve delegation metadata for a given (from, to) pair.\nRetrieve all delegation metadata originating from a given …\nReturn the number of delegated shares for each destination …\nRetrieve all queued undelegations for epochs earlier than …\nRetrieve all undelegation metadata to a given address.\nCalls U::from(self).\nStore the given receipt.\nSubtract delegation from a given (from, to) pair.\nRemove the given receipt from storage if it exists and …\nRemove an existing undelegation and return it.\nBalance query.\nConsensus account query.\nContext for consensus delegate message handler.\nError details from the consensus layer.\nContext for consensus transfer message handler.\nContext for consensus undelegate message handler.\nContext for consensus withdraw message handler.\nDelegate from runtime call.\nInformation about a delegation.\nDelegation query.\nDelegations query.\nDeposit into runtime call. Transfer from consensus staking …\nExtended information about a delegation.\nA receipt.\nKind of receipt.\nTake receipt internal runtime call.\nUndelegate into runtime call.\nInformation about an undelegation.\nUndelegations query.\nWithdraw from runtime call. Transfer from an account in …\nAmount of tokens received.\nUndelegate end epoch.\nEpoch when the undelegation will be complete.\nConsensus layer error.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nAddress being undelegated from.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the receipt kind is valid.\nUndelegate end receipt.\nReceipt identifier for this undelegation.\nShares received (for delegations).\nThe amount of owned shares.\nThe amount of owned shares.\nThe amount of undelegated shares.\nAddress delegated to.\nWhether to allow submission of read-only transactions in …\nInterface that can be called from other modules.\nModule configuration.\nModule configuration.\nDefault local estimate gas max search iterations …\nDefault local minimum gas price configuration that is used …\nDynamic min gas price parameters.\nWhether gas used events should be emitted for every …\nEstimated gas amount to be added to failed transaction …\nErrors emitted by the core module.\nEvents emitted by the core module.\nThe gas cost of the internal call to retrieve the current …\nThe gas cost of the internal call to retrieve the current …\nGas costs.\nGenesis state for the accounts module.\nLocal configuration that can be provided by the node …\nMethods which are exempt from minimum gas price …\nUnique module name.\nErrors emitted during core parameter validation.\nParameters for the core module.\nSimulation failure error.\nEnables the dynamic min gas price feature which …\nReturns the configured max iterations in the binary search …\nThe maximum number of iterations of the binary search to …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCheck whether the epoch has changed since last processed …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns true if the failure is “core::Error::OutOfGas”.\nConfigured maximum amount of gas that can be used in a …\nWhen estimating gas in core.EstimateGas, simulate the tx …\nConfigured minimum gas price.\nMinimum gas price to accept.\nRepresents a constant value used to limit the rate at …\nGenerate a proper OutOfGas error, depending on whether the …\nRun a transaction in simulation and return how much gas it …\nReturns the remaining batch-wide gas.\nReturn the remaining tx-wide gas.\nSets the transaction priority to the provided amount.\nSet transaction sender metadata.\nState schema constants.\nTakes and returns the stored transaction priority.\nTakes and returns the stored transaction sender metadata.\nTarget block gas usage indicates the desired block gas …\nAttempt to use gas. If the gas specified would cause …\nAttempt to use gas. If the gas specified would cause …\nReturns the total batch-wide gas used.\nReturn the used tx-wide gas.\nDynamic min gas price.\nLast processed epoch for detecting epoch changes.\nMap of message idx to message handlers for messages …\nRuntime metadata.\nResponse to the call data public key query.\nArguments for the EstimateGas query.\nArguments for the ExecuteReadOnlyTx query.\nResponse to the ExecuteReadOnlyTx query.\nBasic per-module metadata; tracked in core module’s …\nMetadata for an individual module.\nResponse to the RuntimeInfo query.\nKey in the versions map used for the global state version.\nThe address of the caller for which to do estimation. If …\nEpoch of the ephemeral runtime key.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nIf the estimate gas query should fail in case of …\nPublic key used for deriving the shared secret for …\nThe unsigned transaction to estimate.\nA set of state versions for all supported modules.\nModule’s address that has the reward pool.\nErrors emitted by the rewards module.\nGenesis state for the rewards module.\nRewards module.\nErrors emitted during rewards parameter validation.\nParameters for the rewards module.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nState schema constants.\nRewards module types.\nMap of epochs to rewards pending distribution.\nRewards for the epoch.\nAction that should be taken for a given address when …\nA reward schedule.\nErrors emitted during reward schedule validation.\nOne of the time periods in the reward schedule.\nReturns an iterator over addresses that should be rewarded.\nCompute the per-entity reward amount for the given epoch …\nForbids any rewards from accumulating.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIncrement the reward counter associated with the reward.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nPerform basic reward schedule validation.\nValue of the reward counter.\nModule’s address that has the application stake pool.\nInterface that can be called from other modules.\nModule configuration.\nErrors emitted by the module.\nEvents emitted by the ROFL module.\nGas cost of rofl.AuthorizedOriginEntity call.\nGas cost of rofl.AuthorizedOriginEntity call.\nGas cost of rofl.AuthorizedOriginNode call.\nGas cost of rofl.AuthorizedOriginNode call.\nGas cost of rofl.Create call.\nGas cost of rofl.Create call.\nGas cost of rofl.IsAuthorizedOrigin call.\nGas cost of rofl.IsAuthorizedOrigin call.\nGas cost of rofl.Register call.\nGas cost of rofl.Register call.\nGas cost of rofl.Remove call.\nGas cost of rofl.Remove call.\nGas cost of rofl.StakeThresholds call.\nGas cost of rofl.StakeThresholds call.\nGas cost of rofl.Update call.\nGas cost of rofl.Update call.\nGenesis state for the module.\nErrors emitted during parameter validation.\nParameters for the module.\nAmount of stake required for maintaining an application.\nAmount of stake required for maintaining an application.\nWrapper to make development of ROFL components easier.\nROFL application identifier.\nApplication configurations.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet an application’s configuration.\nGet all registered instances for an application.\nGet the Runtime Attestation Key of the ROFL app instance …\nGet the registration descriptor of the ROFL app instance …\nGet a specific registered instance for an application.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nVerify whether the origin transaction is signed by an …\nROFL component application.\nA runtime client meant for use within runtimes.\nApplication environment.\nROFL application version.\nRetrieve the nonce for the given account.\nRuntime client.\nReturn the consensus layer trust root for this runtime; if …\nSecurely perform gas estimation.\nReturns the argument unchanged.\nReturns the argument unchanged.\nRetrieve the gas price in the given denomination.\nIdentifier of the application (used for registrations).\nCalls U::from(self).\nCalls U::from(self).\nRetrieve the latest known runtime round.\nSign a given transaction, submit it and wait for block …\nSign a given transaction, submit it and wait for block …\nCreate a new unsigned transaction.\nLogic that runs on each runtime block. Only one of these …\nPrelude for ROFL applications.\nSecurely query the on-chain runtime component.\nMain application processing loop.\nSign a given transaction, submit it and wait for block …\nTransaction signer.\nStart the application.\nReturn a store corresponding to the given round.\nRun a closure inside a CurrentState context with store for …\nA thread-safe reference-counting pointer. ‘Arc’ stands …\nContains the error value\nContains the success value\nResult<T, Error>\nConsensus layer trust root.\nA protocol or runtime version.\nReturns a reference to the underlying allocator.\nProvides a raw pointer to the data.\nConverts to Arc<T>.\nConverts to Arc<[T]>.\nKnown consensus chain context.\nMakes a clone of the Arc pointer.\nComparison for two Arcs.\nDecrements the strong reference count on the Arc<T> …\nDecrements the strong reference count on the Arc<T> …\nCreates an empty CStr inside an Arc\nCreates an empty [T] inside an Arc\nCreates an empty str inside an Arc\nCreates a new Arc<T>, with the Default value for T.\nAttempt to downcast the Arc<dyn Any + Send + Sync> to a …\nDowncasts the Arc<dyn Any + Send + Sync> to a concrete …\nCreates a new Weak pointer to this allocation.\nDrops the Arc.\nEquality for two Arcs.\nConverts a &CStr into a Arc<CStr>, by copying the contents …\nConverts a [T; N] into an Arc<[T]>.\nConverts a T into an Arc<T>\nReturns the argument unchanged.\nConverts an OsString into an Arc<OsStr> by moving the …\nCreate an atomically reference-counted pointer from a …\nConverts an atomically reference-counted string slice into …\nAllocate a reference-counted slice and move v’s items …\nConverts a PathBuf into an Arc<Path> by moving the PathBuf …\nCopies the string into a newly allocated Arc<OsStr>.\nConverts a CString into an Arc<CStr> by moving the CString …\nAllocate a reference-counted str and copy v into it.\nMove a boxed object to a new, reference-counted allocation.\nConverts a Path into an Arc by copying the Path data into …\nAllocate a reference-counted slice and fill it by cloning v…\nAllocate a reference-counted str and copy v into it.\nReturns the argument unchanged.\nTakes each element in the Iterator and collects it into an …\nConstructs an Arc<T> from a raw pointer.\nConstructs an Arc<T, A> from a raw pointer.\n‘Greater than or equal to’ comparison for two Arcs.\nReturns a mutable reference into the given Arc, if there …\nReturns a mutable reference into the given Arc, without …\nGreater-than comparison for two Arcs.\nKnown hex-encoded trusted consensus layer header hash.\nKnown trusted height.\nIncrements the strong reference count on the Arc<T> …\nIncrements the strong reference count on the Arc<T> …\nCalls U::from(self).\nCalls U::from(self).\nReturns the inner value, if the Arc has exactly one strong …\nConsumes the Arc, returning the wrapped pointer.\nConsumes the Arc, returning the wrapped pointer and …\n‘Less than or equal to’ comparison for two Arcs.\nLess-than comparison for two Arcs.\nMakes a mutable reference into the given Arc.\nInequality for two Arcs.\nConstructs a new Arc<T>.\nConstructs a new Arc<T> while giving you a Weak<T> to the …\nConstructs a new Arc<T> in the provided allocator.\nConstructs a new Arc with uninitialized contents.\nConstructs a new Arc with uninitialized contents in the …\nConstructs a new atomically reference-counted slice with …\nConstructs a new atomically reference-counted slice with …\nConstructs a new Arc with uninitialized contents, with the …\nConstructs a new Arc with uninitialized contents, with the …\nConstructs a new atomically reference-counted slice with …\nConstructs a new atomically reference-counted slice with …\nPartial comparison for two Arcs.\nConstructs a new Pin<Arc<T>>. If T does not implement Unpin…\nConstructs a new Pin<Arc<T, A>> in the provided allocator. …\nReturns true if the two Arcs point to the same allocation …\nKnown runtime identifier.\nGets the number of strong (Arc) pointers to this …\nConstructs a new Arc<T>, returning an error if allocation …\nConstructs a new Arc<T, A> in the provided allocator, …\nConstructs a new Arc with uninitialized contents, …\nConstructs a new Arc with uninitialized contents, in the …\nConstructs a new Arc with uninitialized contents, with the …\nConstructs a new Arc with uninitialized contents, with the …\nConstructs a new Pin<Arc<T>>, return an error if …\nConstructs a new Pin<Arc<T, A>> in the provided allocator, …\nReturns the inner value, if the Arc has exactly one strong …\nIf we have the only reference to T then unwrap it. …\nGets the number of Weak pointers to this allocation.\nHuman readable part for Bech32-encoded application …\nROFL application identifier.\nError.\nSize of an application identifier in bytes.\nReturns the argument unchanged.\nReturns the argument unchanged.\nTries to create a new identifier from Bech32-encoded …\nTries to create a new identifier from raw bytes.\nCreates a new v0 application identifier from creator/nonce …\nCreates a new v0 application identifier from …\nCreates a new v0 application identifier from a global name.\nCalls U::from(self).\nCalls U::from(self).\nConvert the identifier into raw bytes.\nConverts an identifier to Bech32 representation.\nAn allowed endorsement policy.\nAny node can endorse the enclave.\nPer-application ROFL policy.\nCompute node for the current runtime can endorse the …\nEndorsing node pays the gas fees.\nRegistered node from a specific entity can endorse the …\nGas fee payment policy.\nApplication enclave pays the gas fees.\nSpecific node can endorse the enclave.\nObserver node for the current runtime can endorse the …\nThe set of allowed enclave identities.\nThe set of allowed endorsements.\nGas fee payment policy.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nMaximum number of future epochs for which one can register.\nQuote policy.\nInformation about an endorsed key.\nRemoves all expired registrations, e.g. those that expire …\nCreate a new key endorsement information for extra key …\nCreate a new key endorsement information for RAK endorsed …\nReturns the argument unchanged.\nRetrieves an application configuration.\nRetrieves endorser of the given ROFL enclave. In case …\nRetrieves registration of the given ROFL enclave. In case …\nRetrieves all registrations for the given ROFL application.\nCalls U::from(self).\nIdentifier of node that endorsed the enclave.\nRAK of the enclave that endorsed the key. This is only set …\nRemoves an application configuration.\nRemoves an existing registration of the given ROFL enclave.\nUpdates an application configuration.\nUpdates registration of the given ROFL enclave.\nROFL application configuration.\nApplication instance query.\nApplication-related query.\nCreate new ROFL application call.\nROFL application identifier generation scheme.\nRegister ROFL call.\nROFL registration descriptor.\nRemove an existing ROFL application call.\nStake thresholds for managing ROFL.\nUpdate an existing ROFL application call.\nApplication administrator address.\nApplication administrator address.\nROFL application identifier.\nApplication this enclave is registered for.\nROFL application identifier.\nRequired stake for creating new ROFL application.\nEndorsed TEE capability.\nOptional identifier of the endorsing entity.\nEpoch when the ROFL registration expires if not renewed.\nEpoch when the ROFL registration expires if not renewed.\nExtra public keys to endorse (e.g. secp256k1 keys).\nExtra public keys to endorse (e.g. secp256k1 keys).\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nROFL application identifier.\nROFL application identifier.\nROFL application identifier.\nROFL application identifier.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nIdentifier of the endorsing node.\nApplication authentication policy.\nAuthentication policy.\nAuthentication policy.\nRuntime Attestation Key.\nRuntime Attestation Key.\nRuntime Encryption Key.\nIdentifier generation scheme.\nStaked amount.\nModule that provides the accounts API.\nModule that provides the core API.\nHandler for proxy fee payments.\nSupported modules.\nPrefetch limit. To enable prefetch set it to a non-zero …\nA runtime.\nRuntime schedule control configuration.\nState version.\nRuntime version.\nReturn the consensus layer trust root for this runtime; if …\nGenesis state for the runtime.\nWhether a given call is allowed to be invoked …\nWhether a given query method is allowed to access private …\nWhether a given query method is allowed to be invoked.\nPerform state migrations if required.\nPerform runtime-specific state migration. This method is …\nStart the runtime.\nReturn the trusted signers for this runtime; if None, a …\nSchedule control errors.\nInterface to the runtime host that supports schedule …\nFetch the specified set of transactions from the host’s …\nReturns the argument unchanged.\nCalls U::from(self).\nTransaction sender metadata.\nSender address.\nReturns the argument unchanged.\nUnique identifier of the sender, currently derived from …\nCalls U::from(self).\nSender nonce contained in runtime state.\nSender nonce contained in the transaction.\nCheck that transactions are valid for local acceptance …\nState attached to the current thread.\nInformation about the execution environment.\nActually execute transactions during block production.\nExecution mode.\nEnvironment modification options.\nCheck that transactions are still valid before scheduling.\nSimulate transaction outcomes (e.g. for gas estimation).\nMutable block state of a runtime.\nA per-state arbitrary value.\nResult of a transaction helper closure.\nDecoded transaction with additional metadata.\nFetches a block state value entry.\nCommit the current state and return to its parent state.\nCommit a previously started transaction.\nDecoded transaction.\nEmit an event.\nEmit a raw event.\nQueue a message to be emitted by the runtime for consensus …\nEmit an unconditional event.\nEmitted messages count returns the number of messages …\nEmitted messages count returns the number of messages …\nMaximum number of messages that can be emitted.\nAttach a new state to the current thread and enter the …\nAttach a new state to the current thread and enter the …\nEnvironment information.\nOrigin environment information.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGets a reference to the specified per-state value.\nGets a mutable reference to the specified per-state value.\nWhether the store associated with the state has any …\nTransaction hash.\nHides block values from the current state which will have …\nTransaction index within the batch.\nCreate transaction with metadata for an internally …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether the execution mode is such that only checks should …\nWhether the execution mode is Mode::Execute.\nWhether the current execution environment is part of an …\nWhether the execution mode is Mode::PreSchedule.\nAn active transaction’s read only flag.\nWhether the execution mode is Mode::Simulate.\nWhether there is an active transaction in the current …\nReturns the nesting level of the current state.\nFetches a local state value entry.\nExecution mode.\nCreate options with default values.\nOpen a child state after which self will point to the …\nRetrieves the existing value or inserts and returns the …\nSize (in bytes) of any pending updates in the associated …\nRandom number generator.\nRollback the current state and return to its parent state.\nRollback a previously started transaction.\nSets the context value, returning a mutable reference to …\nTransaction size.\nStart a new transaction by opening a new child state.\nStore associated with the state.\nTakes the context value, if it exists.\nTake all events accumulated in the current state and …\nTake all regular events accumulated in the current state.\nTake all messages accumulated in the current state.\nTake all unconditional events accumulated in the current …\nAn active transaction’s authentication information.\nAn active transaction’s call format.\nAuthenticated address of the caller.\nAuthenticated caller public key if available.\nAn active transaction’s index (order) within the block.\nAn active transaction’s size in bytes.\nRun a closure with the currently active state.\nRun a closure with the environment of the currently active …\nRun a closure with the origin environment of the currently …\nChange the internal flag of the environment.\nChange the execution mode of the environment.\nRequest for local entropy to be mixed into the current RNG.\nRun a closure with the store of the currently active state.\nRun a closure within a state transaction.\nRun a closure within a state transaction, allowing the …\nChange the active transaction of the environment.\nA key-value store that hashes all keys and stores them as …\nA store for a specific state root that talks to the …\nType of the inner store.\nA key-value store backed by MKVS.\nA key-value store that supports the commit operation.\nAn overlay store which keeps values locally until …\nA key prefix.\nA key-value store that prefixes all keys with the given …\nA key-value store.\nA key-value store that transparently handles …\nCommit any changes to the underlying store.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nFetch entry with given key.\nFetch entry with given key.\nWhether there are any store updates pending to be …\nUpdate entry with given key to the given value.\nUpdate entry with given key to the given value.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns an iterator over the tree.\nCreate a new hashed store.\nCreate a new host store for the given host and root.\nCreate a new overlay store.\nCreate a new prefix store with the given prefix.\nCreate a new typed store.\nCreate a new host store for the given host and root at the …\nSize (in bytes) of any pending updates.\nPopulate the in-memory tree with nodes for keys starting …\nRemove entry with given key.\nRemove entry with given key.\nRollback any changes.\nA key-value store that encrypts all content with DeoxysII.\nErrors emitted by the confidential store.\nSize of the Deoxys-II-256-128 key in bytes.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCreate a new confidential store with the given keypair.\nA validator which allows everything.\nInformation about a subcall to be dispatched.\nResult of dispatching a subcall.\nSubcall validator.\nSubcall body.\nPerform a subcall.\nResult of the subcall.\nAddress of the caller.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGas used by the subcall.\nThe current subcall depth.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nMaximum subcall depth.\nMaximum gas amount that can be consumed.\nMethod to call.\nValidate a subcall before it is performed.\nMock key manager implementation.\nModule that contains known test keys.\nMock dispatch context for use in tests.\nKey manager error.\nA key pair managed by the key manager.\nA 256-bit key pair identifier.\nSigned public key.\nA state encryption key.\nSet of trusted key manager signing keys.\nChecksum of the key manager state.\nChecksum of the key manager state.\nExpiration epoch.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCreate a KeyPair with only the public key.\nGenerate a new random key (for testing).\nInput key pair (pk, sk)\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nPublic key.\nSize of this object in bytes.\nCreate a KeyPair.\nCreate a new signed public key.\nSign(sk, (key || checksum || runtime id || key pair id || …\nSet of trusted signers.\nState encryption key\nThreshold for determining if enough valid signatures are …\nVerify the signature.\nVerifies that signed data has valid signatures and that …\nTest key A .\nTest key B .\nTest key C .\nTest key D .\nTest key E .\nTest key F .\nTest key G .\nTest address A .\nTest public key A .\nTest Ed25519 public key A .\nTest address derivation information A .\nTest address B .\nTest public key B .\nTest Ed25519 public key B .\nTest address derivation information B .\nTest address C .\nTest public key C .\nTest Ed25519 public key C .\nTest address derivation information C .\nTest address D .\nTest public key D .\nTest Secp256k1 public key D .\nTest address derivation information D .\nTest address E .\nTest public key E .\nTest Secp256k1 public key E .\nTest address derivation information E .\nTest address F .\nTest public key F .\nTest Sr25519 public key F .\nTest address derivation information F .\nTest address G .\nTest public key G .\nTest Sr25519 public key G .\nTest address derivation information G .\nOptions that can be used during mock signer calls.\nA mock runtime that only has the core module.\nMock dispatch context factory.\nA mock signer for use during tests.\nDispatch a call to the given method.\nDispatch a call to the given method with the given options.\nCreate a new mock dispatch context.\nCreate a new mock dispatch context.\nCreate an empty MKVS store.\nShould the call be encrypted.\nTransaction fee.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCreate a new mock signer using the given nonce and …\nDispatch a query to the given method.\nAddress specification for this signer.\nCreate a new mock transaction.\nCreate an instance with the given local configuration.\nAccount address type.\nTypes related to call formats.\nToken types.\nTransaction types.\nHuman readable part for Bech32-encoded addresses.\nV0 runtime address context.\nV0 runtime address version.\nV0 Ed25519 addres context (shared with consensus layer).\nV0 module address context.\nV0 multisig address context.\nV0 Secp256k1 address context.\nV0 Sr25519 address context.\nV0 address version.\nAn account address.\nEd25519 address derivation compatible with the consensus …\nError.\nSize of an address in bytes.\nEthereum-compatible address derivation from Secp256k1 …\nInformation for signature-based authentication and public …\nSr25519 address derivation.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nTries to create a new address from Bech32-encoded string.\nTries to create a new address from raw bytes.\nCreates a new address from a consensus-layer Ed25519 …\nCreates a new address from an Ethereum-compatible address.\nCreates a new address for a specific module and kind.\nCreates a new address for a specific module and raw kind.\nCreates a new address from a multisig configuration.\nCreates a new runtime address.\nCreates a new address from a public key.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nConvert the address into raw bytes.\nCreates a new address from a context, version and data.\nPublic key of the authentication/address derivation …\nConverts an address to Bech32 representation.\nTry to construct an authentication/address derivation …\nCall data key pair ID domain separation context base.\nA call envelope when using the EncryptedX25519DeoxysII …\nA result envelope when using the EncryptedX25519DeoxysII …\nEncrypted call data.\nEncrypted call data.\nEpoch of the ephemeral runtime key.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nNonce.\nNonce.\nCaller’s ephemeral public key used for X25519.\nResult of a message being processed by the consensus layer.\nHandler name and context to be called after message is …\nResult of a message being processed by the consensus layer …\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nConstructs a new message hook invocation.\nToken amount of given denomination in base units.\nName/type of the token.\nMaximum length of a denomination.\nDenomination in native token.\nToken amount in base units.\nDenomination of the token amount.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nRaw representation of a denomination.\nWhether the denomination represents the native token.\nCreates a new token amount of the given denomination.\nCommon information that specifies an address as well as …\nTransaction authentication information.\nA container for data that authenticates a transaction.\nMethod call.\nFormat used for encoding the call (and output) information.\nCall result.\nA caller address.\nEncrypted call data using X25519 for key exchange and …\nError.\nTransaction fee.\nInformation about a fee proxy.\nFor internal child calls (cannot be …\nA non-serializable placeholder value.\nThe latest transaction format version.\nA flag to use module-controlled decoding. The string is an …\nFor multisig authentication.\nFor multisig authentication.\nPlain text call data.\nTransaction signature domain separation context base.\nFor signature authentication.\nFor signature authentication.\nTransaction signer information.\nTransaction.\nTransaction signer.\nAn unverified signed transaction.\nDerives the address.\nDerives the address.\nAmount of base units paid as fee for transaction …\nAppend a new transaction signer information with a …\nAppend a new transaction signer information with a …\nSign the transaction and append the signature.\nAppend a new transaction signer information to the …\nChecks that the address specification and the …\nMethod body.\nDerives the caller address.\nMaximum amount of emitted consensus messages paid for. …\nFee payment information.\nAmount of fee to pay for transaction execution.\nMaximum amount of gas that the transaction can use.\nFinalize the signing process and return the (signed) …\nCall format.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nMaximum amount of gas paid for.\nCalculates gas price from fee amount and gas.\nModule-specific identifier that will handle fee payments …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCheck whether the call result indicates a successful …\nMethod name.\nModule that will handle the proxy payment.\nConstruct a new transaction signer for the given …\nCreate a new (unsigned) transaction.\nCreate a new signer info from a multisig configuration and …\nCreate a new signer info from a signature address …\nLatest round when the transaction is valid.\nEarliest round when the transaction is valid.\nTransforms CallResult into anyhow::Result<cbor::Value>, …\nPrepare this transaction for signing.\nProxy which has authorized the fees to be paid.\nReturns the public key when the address spec represents a …\nRead-only flag.\nSet amount of fee to pay for transaction execution.\nSet maximum amount of gas that the transaction can use.\nSet a proxy for paying the transaction fee.\nTransaction signer information.\nPerform basic validation on the transaction.\nVerify and deserialize the unverified transaction.\nMaps the caller address to one of the same type but with …") \ No newline at end of file diff --git a/rust/search.desc/oasis_runtime_sdk_contracts/oasis_runtime_sdk_contracts-desc-0-.js b/rust/search.desc/oasis_runtime_sdk_contracts/oasis_runtime_sdk_contracts-desc-0-.js new file mode 100644 index 0000000000..7e32b28290 --- /dev/null +++ b/rust/search.desc/oasis_runtime_sdk_contracts/oasis_runtime_sdk_contracts-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("oasis_runtime_sdk_contracts", 0, "Smart contracts module.\nModule configuration.\nErrors emitted by the contracts module.\nEvents emitted by the contracts module.\nGas costs.\nGenesis state for the contracts module.\nLocal configuration that can be provided by the node …\nParameters for the contracts module.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nLoads code with the specified code identifier.\nMaximum number of items per page in InstanceRawStorage …\nGas limit for custom queries that invoke smart contracts.\nState schema constants.\nStores code with the specified code identifier.\nContracts module types.\nUploaded code.\nInformation about uploaded code.\nInformation about the deployed contract instance.\nPer-instance key/value store.\nNext code identifier (u64).\nNext instance identifier (u64).\nABI that the given contract should conform to.\nContract call.\nContract call result.\nChange upgrade policy call.\nStored code information.\nUnique stored code identifier.\nCode information query.\nCode storage information query.\nCode storage query result.\nAn event emitted from a contract, wrapped to include …\nCustom contract query.\nCustom query result.\nDeployed code instance information.\nUnique deployed code instance identifier.\nInstance information query.\nInstance raw storage query.\nInstance raw storage query result.\nInstance storage query.\nInstantiate call.\nInstantiate call result.\nCustom Oasis SDK-specific ABI (v1).\nA generic policy that specifies who is allowed to perform …\nPublic key kind.\nPublic key query.\nPublic key query result.\nExposed wrapper for oasis-contract-sdk-types::StoreKind.\nUpgrade call.\nUpload call.\nUpload call result.\nABI.\nABI.\nABI sub-version.\nAddress associated with the contract.\nAddress associated with a specific contract instance.\nConvert identifier to u64.\nConvert identifier to u64.\nChecksum of the key manager state.\nCompiled contract code.\nStored contract code.\nIdentifier of code used by the instance.\nIdentifier of code used by the instance.\nUpdated code identifier.\nInstance creator address.\nArguments to contract’s instantiation function.\nCall arguments.\nArguments to contract’s upgrade function.\nQuery arguments.\nRaw event data emitted by the instance.\nEnforce the given policy by returning an error if the …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCode hash.\nUnique code identifier.\nUnique instance identifier.\nAssigned code identifier.\nAssigned instance identifier.\nInstance identifier.\nInstance identifier.\nInstance identifier.\nCode identifier.\nCode identifier.\nInstance identifier.\nInstance identifier.\nInstance identifier.\nInstance identifier.\nInstance identifier.\nIdentifier of the instance that emitted the event.\nReturn the next identifier in sequence.\nReturn the next identifier in sequence.\nWho is allowed to instantiate this code.\nWho is allowed to instantiate this code.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nList of key-value pairs in contract’s public store.\nStorage key.\nPublic key.\nKind of public key.\nMaximum number of items per page.\nNumber of skipped items.\nSign(sk, (key || checksum)) from the key manager.\nKind of the store to query.\nConvert identifier to storage key representation.\nConvert identifier to storage key representation.\nTokens that should be sent to the contract as part of the …\nTokens that should be sent to the contract as part of the …\nTokens that should be sent to the contract as part of the …\nWho is allowed to upgrade this instance.\nWho is allowed to upgrade this instance.\nUpdated upgrade policy.\nCode uploader address.\nStorage value or None if key doesn’t exist.") \ No newline at end of file diff --git a/rust/search.desc/oasis_runtime_sdk_macros/oasis_runtime_sdk_macros-desc-0-.js b/rust/search.desc/oasis_runtime_sdk_macros/oasis_runtime_sdk_macros-desc-0-.js new file mode 100644 index 0000000000..aea0d77555 --- /dev/null +++ b/rust/search.desc/oasis_runtime_sdk_macros/oasis_runtime_sdk_macros-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("oasis_runtime_sdk_macros", 0, "Derives the Error trait on an enum.\nDerives the Event trait on an enum.\nA helper attribute for #[sdk_derive(...)]. It doesn’t do …\nA helper attribute for #[sdk_derive(...)]. It doesn’t do …\nDerives traits from a non-trait impl block (rather than …\nConstructs an oasis_sdk::core::common::version::Version …") \ No newline at end of file diff --git a/rust/search.desc/rofl_utils/rofl_utils-desc-0-.js b/rust/search.desc/rofl_utils/rofl_utils-desc-0-.js new file mode 100644 index 0000000000..196fa1a463 --- /dev/null +++ b/rust/search.desc/rofl_utils/rofl_utils-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("rofl_utils", 0, "ROFL utilities.\nA very simple HTTPS client that can be used inside ROFL …\nAn ureq::Agent that can be used to perform blocking HTTPS …\nAn ureq::Agent with given configuration that can be used …") \ No newline at end of file diff --git a/rust/settings.html b/rust/settings.html new file mode 100644 index 0000000000..f6344a59a1 --- /dev/null +++ b/rust/settings.html @@ -0,0 +1 @@ +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/rust/src-files.js b/rust/src-files.js new file mode 100644 index 0000000000..cf1cae5573 --- /dev/null +++ b/rust/src-files.js @@ -0,0 +1,14 @@ +var srcIndex = new Map(JSON.parse('[\ +["fuzz_mkvs_node",["",[],["mkvs_node.rs"]]],\ +["fuzz_mkvs_proof",["",[],["mkvs_proof.rs"]]],\ +["fuzz_sgx_pcs_quote",["",[],["sgx_pcs_quote.rs"]]],\ +["oasis_contract_sdk",["",[],["context.rs","contract.rs","env.rs","error.rs","event.rs","lib.rs","memory.rs","storage.rs","testing.rs"]]],\ +["oasis_contract_sdk_storage",["",[],["cell.rs","lib.rs","map.rs"]]],\ +["oasis_contract_sdk_types",["",[["modules",[],["contracts.rs","mod.rs"]]],["address.rs","crypto.rs","env.rs","event.rs","lib.rs","message.rs","storage.rs","testing.rs","token.rs"]]],\ +["oasis_core_runtime",["",[["common",[["crypto",[["mrae",[],["deoxysii.rs","mod.rs","nonce.rs"]]],["hash.rs","mod.rs","signature.rs","x25519.rs"]],["sgx",[["pcs",[],["certificates.rs","constants.rs","mod.rs","policy.rs","quote.rs","report.rs","tcb.rs","utils.rs"]]],["egetkey.rs","ias.rs","mod.rs","seal.rs"]]],["bytes.rs","key_format.rs","logger.rs","mod.rs","namespace.rs","panic.rs","process.rs","quantity.rs","time.rs","version.rs","versioned.rs"]],["consensus",[["keymanager",[],["churp.rs"]],["roothash",[["commitment",[],["executor.rs","mod.rs","pool.rs"]]],["block.rs","message.rs","mod.rs"]],["state",[["keymanager",[],["churp.rs"]]],["beacon.rs","keymanager.rs","mod.rs","registry.rs","roothash.rs","staking.rs"]],["tendermint",[["verifier",[["store",[],["lru.rs","mod.rs","state.rs"]]],["cache.rs","clock.rs","handle.rs","io.rs","mod.rs","noop.rs","predicates.rs","signature.rs","types.rs"]]],["merkle.rs","mod.rs"]]],["address.rs","beacon.rs","governance.rs","keymanager.rs","mod.rs","registry.rs","scheduler.rs","staking.rs","transaction.rs","verifier.rs"]],["enclave_rpc",[],["client.rs","context.rs","demux.rs","dispatcher.rs","mod.rs","session.rs","sessions.rs","transport.rs","types.rs"]],["storage",[["mkvs",[["cache",[],["lru_cache.rs","mod.rs"]],["sync",[],["errors.rs","host.rs","merge.rs","mod.rs","noop.rs","proof.rs","stats.rs"]],["tree",[],["commit.rs","errors.rs","insert.rs","iterator.rs","lookup.rs","macros.rs","marshal.rs","mod.rs","node.rs","overlay.rs","prefetch.rs","remove.rs"]]],["marshal.rs","mod.rs"]]],["mod.rs"]],["transaction",[],["context.rs","dispatcher.rs","mod.rs","rwset.rs","tags.rs","tree.rs","types.rs"]]],["app.rs","attestation.rs","cache.rs","config.rs","dispatcher.rs","future.rs","host.rs","identity.rs","init.rs","lib.rs","policy.rs","protocol.rs","types.rs"]]],\ +["oasis_runtime_sdk",["",[["crypto",[["multisig",[],["mod.rs"]],["signature",[],["context.rs","digests.rs","ed25519.rs","mod.rs","secp256k1.rs","secp256r1.rs","secp384r1.rs","sr25519.rs"]]],["mod.rs","random.rs"]],["modules",[["access",[],["mod.rs","types.rs"]],["accounts",[],["fee.rs","mod.rs","types.rs"]],["consensus",[],["mod.rs","types.rs"]],["consensus_accounts",[],["mod.rs","state.rs","types.rs"]],["core",[],["mod.rs","types.rs"]],["rewards",[],["mod.rs","types.rs"]],["rofl",[["app",[],["client.rs","env.rs","mod.rs","notifier.rs","prelude.rs","processor.rs","registration.rs"]]],["app_id.rs","config.rs","error.rs","event.rs","mod.rs","policy.rs","state.rs","types.rs"]]],["mod.rs"]],["storage",[],["confidential.rs","hashed.rs","host.rs","mkvs.rs","mod.rs","overlay.rs","prefix.rs","typed.rs"]],["testing",[],["keymanager.rs","keys.rs","mock.rs","mod.rs"]],["types",[],["address.rs","callformat.rs","message.rs","mod.rs","token.rs","transaction.rs"]]],["callformat.rs","config.rs","context.rs","dispatcher.rs","enclave_rpc.rs","error.rs","event.rs","history.rs","keymanager.rs","lib.rs","module.rs","runtime.rs","schedule_control.rs","sender.rs","state.rs","subcall.rs"]]],\ +["oasis_runtime_sdk_contracts",["",[["abi",[["oasis",[],["crypto.rs","env.rs","memory.rs","mod.rs","storage.rs","validation.rs"]]],["gas.rs","mod.rs"]]],["code.rs","lib.rs","results.rs","store.rs","types.rs","wasm.rs"]]],\ +["oasis_runtime_sdk_macros",["",[["module_derive",[],["method_handler.rs","migration_handler.rs","mod.rs","module.rs"]]],["error_derive.rs","event_derive.rs","generators.rs","lib.rs","version_from_cargo.rs"]]],\ +["rofl_utils",["",[],["https.rs","lib.rs"]]]\ +]')); +createSrcSidebar(); diff --git a/rust/src/fuzz_mkvs_node/mkvs_node.rs.html b/rust/src/fuzz_mkvs_node/mkvs_node.rs.html new file mode 100644 index 0000000000..bb819f2004 --- /dev/null +++ b/rust/src/fuzz_mkvs_node/mkvs_node.rs.html @@ -0,0 +1,33 @@ +mkvs_node.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
use honggfuzz::fuzz;
+
+use oasis_core_runtime::storage::mkvs::{marshal::Marshal, NodeBox};
+
+fn main() {
+    loop {
+        fuzz!(|data: &[u8]| {
+            let mut node = NodeBox::default();
+            if node.unmarshal_binary(data).is_err() {
+                return;
+            }
+
+            let _ = node.marshal_binary().unwrap();
+        });
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/fuzz_mkvs_proof/mkvs_proof.rs.html b/rust/src/fuzz_mkvs_proof/mkvs_proof.rs.html new file mode 100644 index 0000000000..3469870250 --- /dev/null +++ b/rust/src/fuzz_mkvs_proof/mkvs_proof.rs.html @@ -0,0 +1,35 @@ +mkvs_proof.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
use honggfuzz::fuzz;
+
+use oasis_core_runtime::storage::mkvs::sync::{Proof, ProofVerifier, RawProofEntry};
+
+fn main() {
+    loop {
+        fuzz!(|entries: Vec<Option<RawProofEntry>>| {
+            let proof = Proof {
+                entries,
+                ..Default::default()
+            };
+
+            let pv = ProofVerifier;
+            let _ = pv.verify_proof(proof.untrusted_root, &proof);
+        });
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/fuzz_sgx_pcs_quote/sgx_pcs_quote.rs.html b/rust/src/fuzz_sgx_pcs_quote/sgx_pcs_quote.rs.html new file mode 100644 index 0000000000..df69c4d475 --- /dev/null +++ b/rust/src/fuzz_sgx_pcs_quote/sgx_pcs_quote.rs.html @@ -0,0 +1,23 @@ +sgx_pcs_quote.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
use honggfuzz::fuzz;
+
+use oasis_core_runtime::common::sgx::pcs::Quote;
+
+fn main() {
+    loop {
+        fuzz!(|quote: Vec<u8>| {
+            let _ = Quote::parse(&quote);
+        });
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/context.rs.html b/rust/src/oasis_contract_sdk/context.rs.html new file mode 100644 index 0000000000..86bcf147f2 --- /dev/null +++ b/rust/src/oasis_contract_sdk/context.rs.html @@ -0,0 +1,101 @@ +context.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
//! Contract execution context.
+use crate::{
+    env::{Crypto, Env},
+    event::Event,
+    storage::{ConfidentialStore, PublicStore},
+    types::{address::Address, message::Message, token, CallFormat, InstanceId},
+};
+
+/// Execution context.
+pub trait Context {
+    /// The public store.
+    type PublicStore: PublicStore;
+    /// The confidential store.
+    type ConfidentialStore: ConfidentialStore;
+    /// The environment.
+    type Env: Env + Crypto;
+
+    /// Contract instance identifier.
+    fn instance_id(&self) -> InstanceId;
+
+    /// Contract instance address.
+    fn instance_address(&self) -> &Address;
+
+    /// Caller address.
+    fn caller_address(&self) -> &Address;
+
+    /// Tokens deposited by the caller.
+    fn deposited_tokens(&self) -> &[token::BaseUnits];
+
+    /// Whether the call is read-only and must not make any storage modifications.
+    fn is_read_only(&self) -> bool;
+
+    /// Call format.
+    fn call_format(&self) -> CallFormat;
+
+    /// Emits a message.
+    fn emit_message(&mut self, msg: Message);
+
+    /// Emits an event.
+    fn emit_event<E: Event>(&mut self, event: E);
+
+    /// Public contract store.
+    fn public_store(&mut self) -> &mut Self::PublicStore;
+
+    /// Confidential contract store.
+    fn confidential_store(&mut self) -> &mut Self::ConfidentialStore;
+
+    /// Environment.
+    fn env(&self) -> &Self::Env;
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/contract.rs.html b/rust/src/oasis_contract_sdk/contract.rs.html new file mode 100644 index 0000000000..e883c461aa --- /dev/null +++ b/rust/src/oasis_contract_sdk/contract.rs.html @@ -0,0 +1,107 @@ +contract.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
//! The contract trait.
+use crate::{context::Context, error, types};
+
+/// Trait that needs to be implemented by contract implementations.
+pub trait Contract {
+    /// Type of all requests.
+    type Request: cbor::Decode;
+    /// Type of all responses.
+    type Response: cbor::Encode;
+    /// Type of all errors.
+    type Error: error::Error;
+
+    /// Instantiate the contract.
+    fn instantiate<C: Context>(_ctx: &mut C, _request: Self::Request) -> Result<(), Self::Error> {
+        // Default implementation doesn't do anything.
+        Ok(())
+    }
+
+    /// Call the contract.
+    fn call<C: Context>(ctx: &mut C, request: Self::Request)
+        -> Result<Self::Response, Self::Error>;
+
+    /// Query the contract.
+    fn query<C: Context>(
+        _ctx: &mut C,
+        _request: Self::Request,
+    ) -> Result<Self::Response, Self::Error>;
+
+    /// Handle replies from sent messages.
+    fn handle_reply<C: Context>(
+        _ctx: &mut C,
+        _reply: types::message::Reply,
+    ) -> Result<Option<Self::Response>, Self::Error> {
+        // Default implementation does not perform any processing.
+        Ok(None)
+    }
+
+    /// Perform any pre-upgrade tasks. This method is called on the old contract code.
+    ///
+    /// If this method reports an error the upgrade will be aborted.
+    fn pre_upgrade<C: Context>(_ctx: &mut C, _request: Self::Request) -> Result<(), Self::Error> {
+        // Default implementation accepts all upgrades.
+        Ok(())
+    }
+
+    /// Perform any post-upgrade tasks. This method is called on the new contract code.
+    ///
+    /// If this method reports an error the upgrade will be aborted.
+    fn post_upgrade<C: Context>(_ctx: &mut C, _request: Self::Request) -> Result<(), Self::Error> {
+        // Default implementation accepts all upgrades.
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/env.rs.html b/rust/src/oasis_contract_sdk/env.rs.html new file mode 100644 index 0000000000..49f0c72f71 --- /dev/null +++ b/rust/src/oasis_contract_sdk/env.rs.html @@ -0,0 +1,149 @@ +env.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+
//! Smart contract environment query interface.
+use oasis_contract_sdk_types::address::Address;
+
+use crate::types::{
+    env::{QueryRequest, QueryResponse},
+    InstanceId,
+};
+
+/// Environment query trait.
+pub trait Env {
+    /// Perform an environment query.
+    fn query<Q: Into<QueryRequest>>(&self, query: Q) -> QueryResponse;
+
+    /// Returns an address for the contract instance id.
+    fn address_for_instance(&self, instance_id: InstanceId) -> Address;
+
+    /// Prints a message to the console. Useful when debugging.
+    #[cfg(feature = "debug-utils")]
+    fn debug_print(&self, msg: &str);
+}
+
+/// Errors that can be returned from crypto functions.
+#[derive(Debug, thiserror::Error)]
+pub enum CryptoError {
+    #[error("decryption or additional data authentication failed")]
+    DecryptionFailed,
+}
+
+/// Crypto helpers trait.
+pub trait Crypto {
+    /// ECDSA public key recovery function.
+    fn ecdsa_recover(&self, input: &[u8]) -> [u8; 65];
+
+    /// Verify an ed25519 message signature.
+    fn signature_verify_ed25519(&self, key: &[u8], message: &[u8], signature: &[u8]) -> bool;
+
+    /// Verify a secp256k1 message signature.
+    fn signature_verify_secp256k1(&self, key: &[u8], message: &[u8], signature: &[u8]) -> bool;
+
+    /// Verify an sr25519 message signature.
+    fn signature_verify_sr25519(
+        &self,
+        key: &[u8],
+        context: &[u8],
+        message: &[u8],
+        signature: &[u8],
+    ) -> bool;
+
+    /// Derive a symmetric key from a public/private key pair.
+    fn x25519_derive_symmetric(&self, public_key: &[u8], private_key: &[u8]) -> [u8; 32];
+
+    /// Encrypt and authenticate a message and authenticate additional data using DeoxysII.
+    fn deoxysii_seal(
+        &self,
+        key: &[u8],
+        nonce: &[u8],
+        message: &[u8],
+        additional_data: &[u8],
+    ) -> Result<Vec<u8>, CryptoError>;
+
+    /// Decrypt and authenticate a message and authenticate additional data using DeoxysII.
+    fn deoxysii_open(
+        &self,
+        key: &[u8],
+        nonce: &[u8],
+        message: &[u8],
+        additional_data: &[u8],
+    ) -> Result<Vec<u8>, CryptoError>;
+
+    /// Fills `dst` with cryptographically secure random bytes.
+    /// Returns the number of bytes written.
+    /// If the optional personalization string (`pers`) is provided, it will be mixed into the RNG to provide additional domain separation.
+    fn random_bytes(&self, pers: &[u8], dst: &mut [u8]) -> usize;
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/error.rs.html b/rust/src/oasis_contract_sdk/error.rs.html new file mode 100644 index 0000000000..fee23b8c17 --- /dev/null +++ b/rust/src/oasis_contract_sdk/error.rs.html @@ -0,0 +1,103 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+
//! Contract error trait.
+use crate::types::ExecutionResult;
+
+/// A contract error that gets propagated to the caller.
+///
+/// It extends `std::error::Error` with module name and error code so that errors can be easily
+/// serialized and transferred between different processes.
+///
+/// This trait can be derived:
+/// ```
+/// # #[cfg(feature = "oasis-contract-sdk-macros")]
+/// # mod example {
+/// # use oasis_contract_sdk_macros::Error;
+/// #[derive(Clone, Debug, Error, thiserror::Error)]
+/// #[sdk_error(autonumber)]
+/// enum Error {
+///    #[error("invalid argument")]
+///    InvalidArgument,          // autonumbered to 0
+///
+///    #[error("forbidden")]
+///    #[sdk_error(code = 401)]  // manually numbered to 403 (`code` or autonumbering is required)
+///    Forbidden,
+/// }
+/// # }
+/// ```
+pub trait Error: std::error::Error {
+    /// Name of the module that emitted the error.
+    fn module_name(&self) -> &str;
+
+    /// Error code uniquely identifying the error.
+    fn code(&self) -> u32;
+
+    /// Converts the error into an execution result.
+    fn to_execution_result(&self) -> ExecutionResult {
+        ExecutionResult::Failed {
+            module: self.module_name().to_owned(),
+            code: self.code(),
+            message: self.to_string(),
+        }
+    }
+}
+
+impl Error for std::convert::Infallible {
+    fn module_name(&self) -> &str {
+        "(none)"
+    }
+
+    fn code(&self) -> u32 {
+        Default::default()
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/event.rs.html b/rust/src/oasis_contract_sdk/event.rs.html new file mode 100644 index 0000000000..3a66561f57 --- /dev/null +++ b/rust/src/oasis_contract_sdk/event.rs.html @@ -0,0 +1,107 @@ +event.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+
//! Contract event trait.
+use crate::types;
+
+/// An event emitted by the contract.
+///
+/// This trait can be derived:
+/// ```
+/// # #[cfg(feature = "oasis-contract-sdk-macros")]
+/// # mod example {
+/// # use oasis_contract_sdk_macros::Event;
+/// #[derive(Clone, Debug, cbor::Encode, Event)]
+/// #[cbor(untagged)]
+/// #[sdk_event(autonumber)]
+/// enum MyEvent {
+///    Greeting(String),      // autonumbered to 0
+///    #[sdk_event(code = 2)] // manually numbered to 2 (`code` is required if not autonumbering)
+///    DontPanic,
+///    Salutation {           // autonumbered to 1
+///        plural: bool,
+///    }
+/// }
+/// # }
+/// ```
+pub trait Event: Sized + cbor::Encode {
+    /// Name of the module that emitted the event.
+    fn module_name(&self) -> &str;
+
+    /// Code uniquely identifying the event.
+    fn code(&self) -> u32;
+
+    /// Converts an event into the raw event type that can be emitted from the contract.
+    fn into_raw(self) -> types::event::Event {
+        types::event::Event {
+            module: self.module_name().to_string(),
+            code: self.code(),
+            data: cbor::to_vec(self),
+        }
+    }
+}
+
+impl Event for types::event::Event {
+    fn module_name(&self) -> &str {
+        &self.module
+    }
+
+    fn code(&self) -> u32 {
+        self.code
+    }
+
+    fn into_raw(self) -> types::event::Event {
+        self
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/lib.rs.html b/rust/src/oasis_contract_sdk/lib.rs.html new file mode 100644 index 0000000000..dbf2bb88d9 --- /dev/null +++ b/rust/src/oasis_contract_sdk/lib.rs.html @@ -0,0 +1,65 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
//! Oasis Contract SDK.
+#![cfg_attr(target_arch = "wasm32", feature(wasm_abi))]
+
+#[cfg(target_arch = "wasm32")]
+pub mod abi;
+pub mod context;
+pub mod contract;
+pub mod env;
+pub mod error;
+pub mod event;
+pub mod memory;
+pub mod storage;
+#[cfg(not(target_arch = "wasm32"))]
+pub mod testing;
+
+// Re-export types.
+pub use oasis_contract_sdk_types as types;
+
+// Re-export the CBOR crate for use in macros.
+pub use cbor;
+
+// Re-exports.
+pub use self::{context::Context, contract::Contract, error::Error, event::Event};
+
+// Re-export the SDK support proc-macros.
+#[cfg(feature = "oasis-contract-sdk-macros")]
+pub use oasis_contract_sdk_macros::*;
+
+// Use `wee_alloc` as the global allocator.
+#[cfg(target_arch = "wasm32")]
+#[global_allocator]
+static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/memory.rs.html b/rust/src/oasis_contract_sdk/memory.rs.html new file mode 100644 index 0000000000..6011d41e8d --- /dev/null +++ b/rust/src/oasis_contract_sdk/memory.rs.html @@ -0,0 +1,197 @@ +memory.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+
//! Memory management.
+use std::marker::PhantomData;
+
+/// A region of memory managed on behalf of the host.
+///
+/// The host is responsible for deallocating the region by calling `deallocate`.
+#[repr(C)]
+pub struct HostRegion {
+    pub offset: u32,
+    pub length: u32,
+}
+
+impl HostRegion {
+    /// Creates a new host region from arguments.
+    ///
+    /// This does not yet transfer memory ownership from the host.
+    pub fn from_arg((offset, length): (u32, u32)) -> Self {
+        Self::from_args(offset, length)
+    }
+
+    /// Creates a new host region from arguments.
+    ///
+    /// This does not yet transfer memory ownership from the host.
+    pub fn from_args(offset: u32, length: u32) -> Self {
+        Self { offset, length }
+    }
+
+    /// Transfers ownership of memory to the host by constructing a host region.
+    pub fn from_vec(data: Vec<u8>) -> Self {
+        let data_ptr = data.as_ptr() as usize;
+        let data_len = data.len();
+        std::mem::forget(data);
+
+        HostRegion {
+            offset: data_ptr as u32,
+            length: data_len as u32,
+        }
+    }
+
+    /// Transfers ownership of memory from the host and returns the vector.
+    ///
+    /// # Safety
+    ///
+    /// This is safe as long as the region was constructed from valid arguments.
+    pub fn into_vec(self) -> Vec<u8> {
+        let ptr = self.offset as *mut u8;
+        assert!(!ptr.is_null());
+
+        unsafe { Vec::from_raw_parts(ptr, self.length as usize, self.length as usize) }
+    }
+
+    /// Returns a new region by dereferencing a pointer to the region.
+    ///
+    /// This does not yet transfer memory ownership from the host.
+    ///
+    /// # Safety
+    ///
+    /// This is safe as long as the pointer is a valid pointer to the region struct.
+    pub unsafe fn deref(arg: *const HostRegion) -> Self {
+        let hr = &*arg;
+        HostRegion {
+            offset: hr.offset,
+            length: hr.length,
+        }
+    }
+}
+
+/// Reference to a host region.
+pub struct HostRegionRef<'a> {
+    pub offset: u32,
+    pub length: u32,
+
+    _lifetime: PhantomData<&'a [u8]>,
+}
+
+impl<'a> HostRegionRef<'a> {
+    /// Creates a new host region from the given byte slice.
+    pub fn from_slice(data: &'a [u8]) -> Self {
+        Self {
+            offset: data.as_ptr() as u32,
+            length: data.len() as u32,
+            _lifetime: PhantomData,
+        }
+    }
+}
+
+/// Allocate memory on host's behalf.
+pub fn allocate_host(length: u32) -> u32 {
+    let data: Vec<u8> = Vec::with_capacity(length as usize);
+    let data_ptr = data.as_ptr() as usize;
+    std::mem::forget(data);
+    data_ptr as u32
+}
+
+/// Deallocate memory on host's behalf.
+pub fn deallocate_host(offset: u32, length: u32) {
+    HostRegion::from_args(offset, length).into_vec();
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/storage.rs.html b/rust/src/oasis_contract_sdk/storage.rs.html new file mode 100644 index 0000000000..8766f68b7d --- /dev/null +++ b/rust/src/oasis_contract_sdk/storage.rs.html @@ -0,0 +1,39 @@ +storage.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
//! Smart contract storage interface.
+
+/// Key/value store trait.
+pub trait Store {
+    /// Fetch a given key from contract storage.
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;
+
+    /// Insert a given key/value pair into contract storage.
+    fn insert(&mut self, key: &[u8], value: &[u8]);
+
+    /// Remove a given key from contract storage.
+    fn remove(&mut self, key: &[u8]);
+}
+
+/// Marker trait for stores backed by public storage.
+pub trait PublicStore: Store {}
+
+/// Marker trait for stores backed by confidential storage.
+pub trait ConfidentialStore: Store {}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk/testing.rs.html b/rust/src/oasis_contract_sdk/testing.rs.html new file mode 100644 index 0000000000..60b82f059c --- /dev/null +++ b/rust/src/oasis_contract_sdk/testing.rs.html @@ -0,0 +1,535 @@ +testing.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+
//! Utilities for testing smart contracts.
+use std::{
+    collections::BTreeMap,
+    sync::{Arc, Mutex},
+};
+
+use rand_core::{RngCore as _, SeedableRng as _};
+use rand_xorshift::XorShiftRng;
+
+use oasis_contract_sdk_crypto as crypto;
+use oasis_runtime_sdk::crypto::signature;
+
+use crate::{
+    context::Context,
+    env::{Crypto, CryptoError, Env},
+    event::Event,
+    storage::{ConfidentialStore, PublicStore, Store},
+    types::{
+        address::Address,
+        env::{QueryRequest, QueryResponse},
+        event::Event as RawEvent,
+        message::Message,
+        token, CallFormat, ExecutionContext, InstanceId,
+    },
+};
+
+/// Mock store.
+#[derive(Clone, Default)]
+pub struct MockStore {
+    inner: BTreeMap<Vec<u8>, Vec<u8>>,
+}
+
+impl MockStore {
+    /// Create a new empty mock store.
+    pub fn new() -> Self {
+        Self {
+            inner: BTreeMap::new(),
+        }
+    }
+}
+
+impl Store for MockStore {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        self.inner.get(key).cloned()
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        self.inner.insert(key.to_owned(), value.to_owned());
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        self.inner.remove(key);
+    }
+}
+
+impl PublicStore for MockStore {}
+impl ConfidentialStore for MockStore {}
+
+/// Mock environment.
+#[derive(Clone)]
+pub struct MockEnv {
+    rng: Arc<Mutex<XorShiftRng>>,
+}
+
+impl MockEnv {
+    /// Create a new mock environment.
+    pub fn new() -> Self {
+        Default::default()
+    }
+}
+
+impl Default for MockEnv {
+    fn default() -> Self {
+        Self {
+            rng: Arc::new(Mutex::new(XorShiftRng::seed_from_u64(0))),
+        }
+    }
+}
+
+impl Env for MockEnv {
+    fn query<Q: Into<QueryRequest>>(&self, query: Q) -> QueryResponse {
+        match query.into() {
+            QueryRequest::BlockInfo => QueryResponse::BlockInfo {
+                round: 42,
+                epoch: 2,
+                timestamp: 100_000,
+            },
+            _ => unimplemented!(),
+        }
+    }
+
+    fn address_for_instance(&self, instance_id: InstanceId) -> Address {
+        let b = [
+            "test_12345678".as_bytes(),
+            &instance_id.as_u64().to_be_bytes(),
+        ]
+        .concat();
+        Address::from_bytes(&b).unwrap()
+    }
+
+    #[cfg(feature = "debug-utils")]
+    fn debug_print(&self, msg: &str) {
+        eprintln!("{msg}");
+    }
+}
+
+impl Crypto for MockEnv {
+    fn ecdsa_recover(&self, input: &[u8]) -> [u8; 65] {
+        crypto::ecdsa::recover(input).unwrap()
+    }
+
+    fn signature_verify_ed25519(&self, key: &[u8], message: &[u8], signature: &[u8]) -> bool {
+        let key = if let Ok(key) = signature::ed25519::PublicKey::from_bytes(key) {
+            key
+        } else {
+            return false;
+        };
+        let sig: signature::Signature = signature.to_vec().into();
+        key.verify_raw(message, &sig).is_ok()
+    }
+
+    fn signature_verify_secp256k1(&self, key: &[u8], message: &[u8], signature: &[u8]) -> bool {
+        let key = if let Ok(key) = signature::secp256k1::PublicKey::from_bytes(key) {
+            key
+        } else {
+            return false;
+        };
+        let sig: signature::Signature = signature.to_vec().into();
+        key.verify_raw(message, &sig).is_ok()
+    }
+
+    fn signature_verify_sr25519(
+        &self,
+        key: &[u8],
+        context: &[u8],
+        message: &[u8],
+        signature: &[u8],
+    ) -> bool {
+        let key = if let Ok(key) = signature::sr25519::PublicKey::from_bytes(key) {
+            key
+        } else {
+            return false;
+        };
+        let sig: signature::Signature = signature.to_vec().into();
+        key.verify(context, message, &sig).is_ok()
+    }
+
+    fn x25519_derive_symmetric(&self, public_key: &[u8], private_key: &[u8]) -> [u8; 32] {
+        crypto::x25519::derive_symmetric(public_key, private_key).unwrap()
+    }
+
+    fn deoxysii_seal(
+        &self,
+        key: &[u8],
+        nonce: &[u8],
+        message: &[u8],
+        additional_data: &[u8],
+    ) -> Result<Vec<u8>, CryptoError> {
+        Ok(crypto::deoxysii::seal(key, nonce, message, additional_data).unwrap())
+    }
+
+    fn deoxysii_open(
+        &self,
+        key: &[u8],
+        nonce: &[u8],
+        message: &[u8],
+        additional_data: &[u8],
+    ) -> Result<Vec<u8>, CryptoError> {
+        crypto::deoxysii::open(key, nonce, message, additional_data).map_err(|e| match e {
+            crypto::deoxysii::Error::DecryptionFailed => CryptoError::DecryptionFailed,
+            _ => panic!("unexpected crypto error"),
+        })
+    }
+
+    fn random_bytes(&self, _pers: &[u8], dst: &mut [u8]) -> usize {
+        self.rng.lock().unwrap().fill_bytes(dst);
+        dst.len()
+    }
+}
+
+/// A mock contract context suitable for testing.
+pub struct MockContext {
+    /// Execution context.
+    pub ec: ExecutionContext,
+
+    /// Public store.
+    pub public_store: MockStore,
+    /// "Confidential" store.
+    pub confidential_store: MockStore,
+    /// Environment.
+    pub env: MockEnv,
+
+    /// Emitted messages.
+    pub messages: Vec<Message>,
+    /// Emitted events.
+    pub events: Vec<RawEvent>,
+}
+
+impl From<ExecutionContext> for MockContext {
+    fn from(ec: ExecutionContext) -> Self {
+        Self {
+            ec,
+            public_store: MockStore::new(),
+            confidential_store: MockStore::new(),
+            env: MockEnv::new(),
+            messages: Vec::new(),
+            events: Vec::new(),
+        }
+    }
+}
+
+impl Context for MockContext {
+    type PublicStore = MockStore;
+    type ConfidentialStore = MockStore;
+    type Env = MockEnv;
+
+    fn instance_id(&self) -> InstanceId {
+        self.ec.instance_id
+    }
+
+    fn instance_address(&self) -> &Address {
+        &self.ec.instance_address
+    }
+
+    fn caller_address(&self) -> &Address {
+        &self.ec.caller_address
+    }
+
+    fn deposited_tokens(&self) -> &[token::BaseUnits] {
+        &self.ec.deposited_tokens
+    }
+
+    fn is_read_only(&self) -> bool {
+        self.ec.read_only
+    }
+
+    fn call_format(&self) -> CallFormat {
+        self.ec.call_format
+    }
+
+    fn emit_message(&mut self, msg: Message) {
+        self.messages.push(msg);
+    }
+
+    fn emit_event<E: Event>(&mut self, event: E) {
+        self.events.push(event.into_raw());
+    }
+
+    fn public_store(&mut self) -> &mut Self::PublicStore {
+        &mut self.public_store
+    }
+
+    fn confidential_store(&mut self) -> &mut Self::ConfidentialStore {
+        &mut self.confidential_store
+    }
+
+    fn env(&self) -> &Self::Env {
+        &self.env
+    }
+}
+
+/// A macro that creates Oasis ABI entry points.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! __create_contract {
+    ($name:ty) => {};
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_storage/cell.rs.html b/rust/src/oasis_contract_sdk_storage/cell.rs.html new file mode 100644 index 0000000000..4798763859 --- /dev/null +++ b/rust/src/oasis_contract_sdk_storage/cell.rs.html @@ -0,0 +1,119 @@ +cell.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
//! Low-level storage primitive that holds one value.
+use std::marker::PhantomData;
+
+use oasis_contract_sdk::storage::{ConfidentialStore, PublicStore};
+
+macro_rules! declare_cell {
+    ($name:ident, $store:ident) => {
+        /// A storage cell identifies a storage key of a specific type.
+        pub struct $name<'key, T> {
+            key: &'key [u8],
+            _type: PhantomData<T>,
+        }
+
+        impl<'key, T> $name<'key, T> {
+            /// Create a new storage cell with the specified key and type.
+            pub const fn new(key: &'key [u8]) -> Self {
+                Self {
+                    key,
+                    _type: PhantomData,
+                }
+            }
+
+            /// Clear the value in the storage cell.
+            pub fn clear(&self, store: &mut dyn $store) {
+                store.remove(self.key);
+            }
+        }
+
+        impl<'key, T> $name<'key, T>
+        where
+            T: cbor::Decode,
+        {
+            /// Return the current value of the storage cell.
+            ///
+            /// # Panics
+            ///
+            /// The method will panic in case the raw cell value cannot be deserialized.
+            ///
+            pub fn get(&self, store: &dyn $store) -> Option<T> {
+                store
+                    .get(self.key)
+                    .map(|raw| cbor::from_slice(&raw).unwrap())
+            }
+        }
+
+        impl<'key, T> $name<'key, T>
+        where
+            T: cbor::Encode,
+        {
+            /// Set the value of the storage cell.
+            pub fn set(&self, store: &mut dyn $store, value: T) {
+                store.insert(self.key, &cbor::to_vec(value));
+            }
+        }
+    };
+}
+
+declare_cell!(PublicCell, PublicStore);
+declare_cell!(ConfidentialCell, ConfidentialStore);
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_storage/lib.rs.html b/rust/src/oasis_contract_sdk_storage/lib.rs.html new file mode 100644 index 0000000000..cd66fd4f57 --- /dev/null +++ b/rust/src/oasis_contract_sdk_storage/lib.rs.html @@ -0,0 +1,9 @@ +lib.rs - source
1
+2
+3
+4
+
//! High-level storage helpers for the Oasis Contract SDK.
+
+pub mod cell;
+pub mod map;
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_storage/map.rs.html b/rust/src/oasis_contract_sdk_storage/map.rs.html new file mode 100644 index 0000000000..60fa40bc2a --- /dev/null +++ b/rust/src/oasis_contract_sdk_storage/map.rs.html @@ -0,0 +1,609 @@ +map.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+
//! A map backed by contract storage.
+use std::{convert::TryInto, marker::PhantomData};
+
+use oasis_contract_sdk::{
+    storage::{ConfidentialStore, PublicStore},
+    types::address::Address,
+};
+
+use crate::cell::{ConfidentialCell, PublicCell};
+
+macro_rules! declare_map {
+    ($name:ident, $cell:ident, $store:ident) => {
+        /// A map backed by contract storage.
+        pub struct $name<'key, K, V> {
+            /// Unique map identifier.
+            key: &'key [u8],
+
+            _key: PhantomData<K>,
+            _value: PhantomData<V>,
+        }
+
+        impl<'key, K, V> $name<'key, K, V> {
+            /// Create a new map instance.
+            pub const fn new(key: &'key [u8]) -> Self {
+                Self {
+                    key,
+                    _key: PhantomData,
+                    _value: PhantomData,
+                }
+            }
+        }
+
+        impl<'key, K, V> $name<'key, K, V>
+        where
+            K: MapKey,
+            V: cbor::Encode + cbor::Decode,
+        {
+            fn key(&self, key: K) -> Vec<u8> {
+                let raw_key = key.key();
+                encode_length_prefixed_path(
+                    self.key,
+                    &raw_key[..raw_key.len() - 1],
+                    raw_key[raw_key.len() - 1],
+                )
+            }
+
+            /// Lookup a given key.
+            pub fn get(&self, store: &dyn $store, key: K) -> Option<V> {
+                $cell::new(&self.key(key)).get(store)
+            }
+
+            /// Insert a given key/value pair.
+            pub fn insert(&self, store: &mut dyn $store, key: K, value: V) {
+                $cell::new(&self.key(key)).set(store, value);
+            }
+
+            /// Remove a given key.
+            pub fn remove(&self, store: &mut dyn $store, key: K) {
+                $cell::<V>::new(&self.key(key)).clear(store);
+            }
+        }
+    };
+}
+
+declare_map!(PublicMap, PublicCell, PublicStore);
+declare_map!(ConfidentialMap, ConfidentialCell, ConfidentialStore);
+
+/// A trait for types which can be used as map keys.
+pub trait MapKey {
+    /// Return the composite key.
+    fn key(&self) -> Vec<&[u8]>;
+}
+
+impl<const N: usize> MapKey for [u8; N] {
+    fn key(&self) -> Vec<&[u8]> {
+        vec![self]
+    }
+}
+
+impl MapKey for &[u8] {
+    fn key(&self) -> Vec<&[u8]> {
+        vec![self]
+    }
+}
+
+impl MapKey for &str {
+    fn key(&self) -> Vec<&[u8]> {
+        vec![self.as_bytes()]
+    }
+}
+
+impl MapKey for Vec<u8> {
+    fn key(&self) -> Vec<&[u8]> {
+        vec![self]
+    }
+}
+
+impl MapKey for String {
+    fn key(&self) -> Vec<&[u8]> {
+        vec![self.as_bytes()]
+    }
+}
+
+impl<T, U> MapKey for (T, U)
+where
+    T: MapKey,
+    U: MapKey,
+{
+    fn key(&self) -> Vec<&[u8]> {
+        let mut key = self.0.key();
+        key.extend(self.1.key());
+        key
+    }
+}
+
+impl<T, U, V> MapKey for (T, U, V)
+where
+    T: MapKey,
+    U: MapKey,
+    V: MapKey,
+{
+    fn key(&self) -> Vec<&[u8]> {
+        let mut key = self.0.key();
+        key.extend(self.1.key());
+        key.extend(self.2.key());
+        key
+    }
+}
+
+impl MapKey for Address {
+    fn key(&self) -> Vec<&[u8]> {
+        vec![self.as_ref()]
+    }
+}
+
+/// A trait representing an integer that can be encoded into big-endian bytes.
+pub trait Integer {
+    /// Type of the encoded representation.
+    type Encoded: AsRef<[u8]>;
+
+    /// Return the memory representation of this integer as a byte array in big-endian byte order.
+    fn to_be_bytes(self) -> Self::Encoded;
+}
+
+macro_rules! impl_integer_for_primitive {
+    ($ty:ty) => {
+        impl Integer for $ty {
+            type Encoded = [u8; std::mem::size_of::<$ty>()];
+
+            fn to_be_bytes(self) -> Self::Encoded {
+                <$ty>::to_be_bytes(self)
+            }
+        }
+    };
+}
+
+impl_integer_for_primitive!(u8);
+impl_integer_for_primitive!(u16);
+impl_integer_for_primitive!(u32);
+impl_integer_for_primitive!(u64);
+impl_integer_for_primitive!(u128);
+
+impl_integer_for_primitive!(i8);
+impl_integer_for_primitive!(i16);
+impl_integer_for_primitive!(i32);
+impl_integer_for_primitive!(i64);
+impl_integer_for_primitive!(i128);
+
+/// An integer in big-endian representation.
+pub struct Int<I: Integer> {
+    encoded: I::Encoded,
+    _type: PhantomData<I>,
+}
+
+impl<I: Integer> Int<I> {
+    /// Create a new integer in big-endian representation.
+    pub fn new(v: I) -> Self {
+        Self {
+            encoded: v.to_be_bytes(),
+            _type: PhantomData,
+        }
+    }
+}
+
+impl<I: Integer> From<I> for Int<I> {
+    fn from(v: I) -> Self {
+        Self::new(v)
+    }
+}
+
+impl<I: Integer> MapKey for Int<I> {
+    fn key(&self) -> Vec<&[u8]> {
+        vec![self.encoded.as_ref()]
+    }
+}
+
+/// Encodes the given components as a length-prefixed path.
+fn encode_length_prefixed_path(front: &[u8], middle: &[&[u8]], back: &[u8]) -> Vec<u8> {
+    let size = middle.iter().fold(0, |acc, k| acc + k.len() + 1);
+    let mut output = Vec::with_capacity(front.len() + size + back.len());
+
+    // Front is not length-prefixed.
+    output.extend_from_slice(front);
+    // Middle keys are length-prefixed.
+    for key in middle {
+        output.extend_from_slice(&encode_length(key));
+        output.extend_from_slice(key);
+    }
+    // Back is not length-prefixed.
+    output.extend_from_slice(back);
+
+    output
+}
+
+/// Encode the length of a storage key.
+///
+/// # Panics
+///
+/// This function will panic if the key length is greater than 255 bytes.
+fn encode_length(key: &[u8]) -> [u8; 1] {
+    [key.len().try_into().expect("key length greater than 255")]
+}
+
+#[cfg(test)]
+mod test {
+    use oasis_contract_sdk::testing::MockStore;
+
+    use super::*;
+
+    #[test]
+    fn test_map_basic() {
+        let mut store = MockStore::new();
+        let map: PublicMap<&str, u64> = PublicMap::new(b"test");
+
+        assert_eq!(map.get(&store, "foo"), None);
+        map.insert(&mut store, "foo", 42);
+        assert_eq!(map.get(&store, "foo"), Some(42));
+
+        let map: PublicMap<Int<u64>, String> = PublicMap::new(b"test2");
+
+        assert_eq!(map.get(&store, 42.into()), None);
+        map.insert(&mut store, 42.into(), "hello".to_string());
+        assert_eq!(map.get(&store, 42.into()), Some("hello".to_string()));
+
+        map.remove(&mut store, 42.into());
+        assert_eq!(map.get(&store, 42.into()), None);
+    }
+
+    #[test]
+    fn test_map_composite() {
+        let mut store = MockStore::new();
+        let map: PublicMap<(&str, &str), u64> = PublicMap::new(b"test");
+
+        assert_eq!(map.get(&store, ("foo", "bar")), None);
+        map.insert(&mut store, ("foo", "bar"), 42);
+        assert_eq!(map.get(&store, ("foo", "bar")), Some(42));
+        // Make sure we have proper key separation due to length-prefixing.
+        assert_eq!(map.get(&store, ("foob", "ar")), None);
+
+        map.remove(&mut store, ("foo", "bar"));
+        assert_eq!(map.get(&store, ("foo", "bar")), None);
+    }
+
+    #[test]
+    fn test_encode_length() {
+        assert_eq!(encode_length(b"foo"), [0x03]);
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_encode_length_too_long() {
+        let v = vec![0x00; 260];
+        encode_length(&v);
+    }
+
+    #[test]
+    fn test_encode_length_prefixed_path() {
+        let four_five_six = vec![4, 5, 6];
+        let tcs = vec![
+            (vec![], vec![], vec![], vec![]),
+            (vec![1, 2, 3], vec![], vec![], vec![1, 2, 3]),
+            (vec![1, 2, 3], vec![], vec![4, 5, 6], vec![1, 2, 3, 4, 5, 6]),
+            (
+                vec![1, 2, 3],
+                vec![&four_five_six[..]],
+                vec![7, 8, 9],
+                vec![1, 2, 3, 3, 4, 5, 6, 7, 8, 9],
+            ),
+            (
+                vec![1, 2, 3],
+                vec![&four_five_six[..], &four_five_six[..]],
+                vec![7, 8, 9],
+                vec![1, 2, 3, 3, 4, 5, 6, 3, 4, 5, 6, 7, 8, 9],
+            ),
+        ];
+
+        for (front, middle, back, expected) in tcs {
+            assert_eq!(
+                encode_length_prefixed_path(&front, &middle, &back),
+                expected
+            );
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/address.rs.html b/rust/src/oasis_contract_sdk_types/address.rs.html new file mode 100644 index 0000000000..d8792a0391 --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/address.rs.html @@ -0,0 +1,259 @@ +address.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+
//! A minimal representation of an Oasis Runtime SDK address.
+use std::convert::TryFrom;
+
+use bech32::{Bech32, Hrp};
+use thiserror::Error;
+
+const ADDRESS_VERSION_SIZE: usize = 1;
+const ADDRESS_DATA_SIZE: usize = 20;
+const ADDRESS_SIZE: usize = ADDRESS_VERSION_SIZE + ADDRESS_DATA_SIZE;
+
+const ADDRESS_BECH32_HRP: Hrp = Hrp::parse_unchecked("oasis");
+
+/// Error.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("malformed address")]
+    MalformedAddress,
+}
+
+/// An account address.
+#[derive(
+    Copy, Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, cbor::Encode, cbor::Decode,
+)]
+#[cbor(transparent)]
+pub struct Address([u8; ADDRESS_SIZE]);
+
+impl Address {
+    /// Size of an address in bytes.
+    pub const SIZE: usize = ADDRESS_SIZE;
+
+    /// Tries to create a new address from raw bytes.
+    pub fn from_bytes(data: &[u8]) -> Result<Self, Error> {
+        if data.len() != ADDRESS_SIZE {
+            return Err(Error::MalformedAddress);
+        }
+
+        let mut a = [0; ADDRESS_SIZE];
+        a.copy_from_slice(data);
+
+        Ok(Self(a))
+    }
+
+    /// Tries to create a new address from Bech32-encoded string.
+    pub fn from_bech32(data: &str) -> Result<Self, Error> {
+        let (hrp, data) = bech32::decode(data).map_err(|_| Error::MalformedAddress)?;
+        if hrp != ADDRESS_BECH32_HRP {
+            return Err(Error::MalformedAddress);
+        }
+
+        Address::from_bytes(&data)
+    }
+
+    /// Converts an address to Bech32 representation.
+    pub fn to_bech32(self) -> String {
+        bech32::encode::<Bech32>(ADDRESS_BECH32_HRP, &self.0).unwrap()
+    }
+}
+
+impl AsRef<[u8]> for Address {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl TryFrom<&[u8]> for Address {
+    type Error = Error;
+
+    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> {
+        Self::from_bytes(bytes)
+    }
+}
+
+#[cfg(feature = "oasis-runtime-sdk")]
+impl From<oasis_runtime_sdk::types::address::Address> for Address {
+    fn from(a: oasis_runtime_sdk::types::address::Address) -> Self {
+        Self(a.into_bytes())
+    }
+}
+
+#[cfg(feature = "oasis-runtime-sdk")]
+impl From<Address> for oasis_runtime_sdk::types::address::Address {
+    fn from(a: Address) -> Self {
+        oasis_runtime_sdk::types::address::Address::from_bytes(&a.0).unwrap()
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use bech32::Bech32m;
+
+    use super::*;
+
+    #[test]
+    fn test_address_try_from_bytes() {
+        let bytes_fixture = vec![42u8; ADDRESS_SIZE + 1];
+        assert_eq!(
+            Address::try_from(&bytes_fixture[0..ADDRESS_SIZE]).unwrap(),
+            Address::from_bytes(&bytes_fixture[0..ADDRESS_SIZE]).unwrap()
+        );
+        assert!(matches!(
+            Address::try_from(bytes_fixture.as_slice()).unwrap_err(),
+            Error::MalformedAddress
+        ));
+    }
+
+    #[test]
+    fn test_address_from_bech32_invalid_hrp() {
+        assert!(matches!(
+            Address::from_bech32("sisoa1qpcprk8jxpsjxw9fadxvzrv9ln7td69yus8rmtux").unwrap_err(),
+            Error::MalformedAddress,
+        ));
+    }
+
+    #[test]
+    fn test_address_from_bech32_invalid_variant() {
+        let b = vec![42u8; ADDRESS_SIZE];
+        let bech32_addr = bech32::encode::<Bech32>(ADDRESS_BECH32_HRP, &b).unwrap();
+        let bech32m_addr = bech32::encode::<Bech32m>(ADDRESS_BECH32_HRP, &b).unwrap();
+
+        assert!(
+            Address::from_bech32(&bech32_addr).is_ok(),
+            "bech32 address should be ok"
+        );
+        assert!(
+            Address::from_bech32(&bech32m_addr).is_ok(),
+            "bech32m address should be ok",
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/crypto.rs.html b/rust/src/oasis_contract_sdk_types/crypto.rs.html new file mode 100644 index 0000000000..bf980ae81d --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/crypto.rs.html @@ -0,0 +1,49 @@ +crypto.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+
//! Cryptography-related types.
+use std::convert::TryFrom;
+
+/// Signature kind.
+#[derive(Clone, Copy)]
+#[repr(u32)]
+pub enum SignatureKind {
+    Ed25519 = 0,
+    Secp256k1 = 1,
+    Sr25519 = 2,
+}
+
+impl TryFrom<u32> for SignatureKind {
+    type Error = u32;
+
+    fn try_from(value: u32) -> Result<Self, Self::Error> {
+        match value {
+            0 => Ok(Self::Ed25519),
+            1 => Ok(Self::Secp256k1),
+            2 => Ok(Self::Sr25519),
+            _ => Err(value),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/env.rs.html b/rust/src/oasis_contract_sdk_types/env.rs.html new file mode 100644 index 0000000000..890cfd2d0c --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/env.rs.html @@ -0,0 +1,145 @@ +env.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
//! Environment query-related types.
+use crate::{address::Address, token::Denomination};
+
+/// A query request.
+#[non_exhaustive]
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum QueryRequest {
+    /// Information about the current runtime block.
+    #[cbor(rename = "block_info")]
+    BlockInfo,
+
+    /// Accounts queries.
+    #[cbor(rename = "accounts")]
+    Accounts(AccountsQuery),
+}
+
+/// A query response.
+#[non_exhaustive]
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum QueryResponse {
+    /// Indication of a failing request.
+    #[cbor(rename = "error")]
+    Error {
+        module: String,
+        code: u32,
+        message: String,
+    },
+
+    /// Information about the current runtime block.
+    #[cbor(rename = "block_info")]
+    BlockInfo {
+        round: u64,
+        epoch: u64,
+        timestamp: u64,
+    },
+
+    /// Accounts queries.
+    #[cbor(rename = "accounts")]
+    Accounts(AccountsResponse),
+}
+
+/// Accounts API queries.
+#[non_exhaustive]
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum AccountsQuery {
+    /// Query an account's balance.
+    #[cbor(rename = "balance")]
+    Balance {
+        address: Address,
+        denomination: Denomination,
+    },
+}
+
+impl From<AccountsQuery> for QueryRequest {
+    fn from(q: AccountsQuery) -> Self {
+        Self::Accounts(q)
+    }
+}
+
+/// Accounts API responses.
+#[non_exhaustive]
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum AccountsResponse {
+    /// An account's balance of the given denomination.
+    Balance { balance: u128 },
+}
+
+impl From<AccountsResponse> for QueryResponse {
+    fn from(q: AccountsResponse) -> Self {
+        Self::Accounts(q)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/event.rs.html b/rust/src/oasis_contract_sdk_types/event.rs.html new file mode 100644 index 0000000000..55a35ea7ac --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/event.rs.html @@ -0,0 +1,35 @@ +event.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
//! Events.
+
+/// An event emitted from the contract.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Event {
+    /// Optional module name.
+    #[cbor(optional)]
+    pub module: String,
+
+    /// Unique code representing the event for the given module.
+    pub code: u32,
+
+    /// Arbitrary data associated with the event.
+    #[cbor(optional)]
+    pub data: Vec<u8>,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/lib.rs.html b/rust/src/oasis_contract_sdk_types/lib.rs.html new file mode 100644 index 0000000000..fd7015df15 --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/lib.rs.html @@ -0,0 +1,321 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+
//! A collection of common types used by the Oasis Contract SDK.
+
+pub mod address;
+pub mod crypto;
+pub mod env;
+pub mod event;
+pub mod message;
+pub mod modules;
+pub mod storage;
+pub mod token;
+
+pub mod testing;
+
+/// Unique stored code identifier.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, cbor::Decode, cbor::Encode)]
+#[cbor(transparent)]
+pub struct CodeId(u64);
+
+impl CodeId {
+    /// Convert identifier to u64.
+    pub fn as_u64(&self) -> u64 {
+        self.0
+    }
+
+    /// Return the next identifier in sequence.
+    pub fn increment(&self) -> Self {
+        CodeId(self.0 + 1)
+    }
+
+    /// Convert identifier to storage key representation.
+    pub fn to_storage_key(self) -> [u8; 8] {
+        self.0.to_be_bytes()
+    }
+}
+
+impl From<u64> for CodeId {
+    fn from(v: u64) -> Self {
+        CodeId(v)
+    }
+}
+
+/// Unique deployed code instance identifier.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, cbor::Decode, cbor::Encode)]
+#[cbor(transparent)]
+pub struct InstanceId(u64);
+
+impl InstanceId {
+    /// Convert identifier to u64.
+    pub fn as_u64(&self) -> u64 {
+        self.0
+    }
+
+    /// Return the next identifier in sequence.
+    pub fn increment(&self) -> Self {
+        InstanceId(self.0 + 1)
+    }
+
+    /// Convert identifier to storage key representation.
+    pub fn to_storage_key(self) -> [u8; 8] {
+        self.0.to_be_bytes()
+    }
+}
+
+impl From<u64> for InstanceId {
+    fn from(v: u64) -> Self {
+        InstanceId(v)
+    }
+}
+
+/// Format used for encoding the call (and output) information.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+#[cbor(with_default)]
+pub enum CallFormat {
+    /// Plain text call data.
+    Plain = 0,
+    /// Encrypted call data using X25519 for key exchange and Deoxys-II for symmetric encryption.
+    EncryptedX25519DeoxysII = 1,
+}
+
+impl CallFormat {
+    fn is_plain(&self) -> bool {
+        matches!(self, CallFormat::Plain)
+    }
+}
+
+impl Default for CallFormat {
+    fn default() -> Self {
+        Self::Plain
+    }
+}
+
+#[cfg(feature = "oasis-runtime-sdk")]
+impl From<oasis_runtime_sdk::types::transaction::CallFormat> for CallFormat {
+    fn from(a: oasis_runtime_sdk::types::transaction::CallFormat) -> Self {
+        use oasis_runtime_sdk::types::transaction::CallFormat as RuntimeCallFormat;
+
+        match a {
+            RuntimeCallFormat::Plain => Self::Plain,
+            RuntimeCallFormat::EncryptedX25519DeoxysII => Self::EncryptedX25519DeoxysII,
+        }
+    }
+}
+
+/// Execution context.
+///
+/// Contains information that is useful on most invocations as it is always
+/// included without requiring any explicit queries.
+#[derive(Debug, Default, cbor::Decode, cbor::Encode)]
+pub struct ExecutionContext {
+    /// Contract instance identifier.
+    pub instance_id: InstanceId,
+    /// Contract instance address.
+    pub instance_address: address::Address,
+    /// Caller address.
+    pub caller_address: address::Address,
+    /// Tokens deposited by the caller.
+    #[cbor(optional)]
+    pub deposited_tokens: Vec<token::BaseUnits>,
+    /// Read-only flag.
+    ///
+    /// A read-only call cannot make any changes to runtime state. Any attempt at modifying state
+    /// will result in the call failing.
+    #[cbor(optional)]
+    pub read_only: bool,
+    /// Transaction's call format.
+    #[cbor(optional, skip_serializing_if = "CallFormat::is_plain")]
+    pub call_format: CallFormat,
+}
+
+/// Contract execution result.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum ExecutionResult {
+    #[cbor(rename = "ok")]
+    Ok(ExecutionOk),
+
+    #[cbor(rename = "fail")]
+    Failed {
+        #[cbor(optional)]
+        module: String,
+
+        code: u32,
+
+        #[cbor(optional)]
+        message: String,
+    },
+}
+
+/// Result of a successful contract execution.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ExecutionOk {
+    /// Raw data returned from the contract.
+    pub data: Vec<u8>,
+    /// Messages emitted from the contract.
+    #[cbor(optional)]
+    pub messages: Vec<message::Message>,
+    /// Events emitted from the contract.
+    #[cbor(optional)]
+    pub events: Vec<event::Event>,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/message.rs.html b/rust/src/oasis_contract_sdk_types/message.rs.html new file mode 100644 index 0000000000..a9a849a4d3 --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/message.rs.html @@ -0,0 +1,181 @@ +message.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
//! Messages that can be emitted by contracts.
+
+/// Messages can be emitted by contracts and are processed after the contract execution completes.
+#[non_exhaustive]
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum Message {
+    /// Calls an arbitrary runtime method handler in a child context with an optional gas limit.
+    ///
+    /// The call is executed in the context of the smart contract as the caller within the same
+    /// transaction.
+    ///
+    /// This can be used to call other smart contracts.
+    #[cbor(rename = "call")]
+    Call {
+        #[cbor(optional)]
+        id: u64,
+        reply: NotifyReply,
+        method: String,
+        body: cbor::Value,
+        #[cbor(optional)]
+        max_gas: Option<u64>,
+        #[cbor(optional)]
+        data: Option<cbor::Value>,
+    },
+}
+
+/// Specifies when the caller (smart contract) wants to be notified of a reply.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum NotifyReply {
+    Never = 0,
+    OnError = 1,
+    OnSuccess = 2,
+    Always = 3,
+}
+
+/// Replies to delivered messages.
+#[non_exhaustive]
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum Reply {
+    /// Reply from a call message.
+    #[cbor(rename = "call")]
+    Call {
+        #[cbor(optional)]
+        id: u64,
+        result: CallResult,
+        #[cbor(optional)]
+        data: Option<cbor::Value>,
+    },
+}
+
+/// Call result.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum CallResult {
+    #[cbor(rename = "ok")]
+    Ok(cbor::Value),
+
+    #[cbor(rename = "fail")]
+    Failed { module: String, code: u32 },
+}
+
+impl CallResult {
+    /// Check whether the call result indicates a successful operation or not.
+    pub fn is_success(&self) -> bool {
+        match self {
+            CallResult::Ok(_) => true,
+            CallResult::Failed { .. } => false,
+        }
+    }
+}
+
+#[cfg(feature = "oasis-runtime-sdk")]
+impl From<oasis_runtime_sdk::module::CallResult> for CallResult {
+    fn from(r: oasis_runtime_sdk::module::CallResult) -> Self {
+        match r {
+            oasis_runtime_sdk::module::CallResult::Ok(value) => Self::Ok(value),
+            oasis_runtime_sdk::module::CallResult::Failed { module, code, .. } => {
+                Self::Failed { module, code }
+            }
+            oasis_runtime_sdk::module::CallResult::Aborted(err) => {
+                use oasis_runtime_sdk::error::Error;
+
+                Self::Failed {
+                    module: err.module_name().to_string(),
+                    code: err.code(),
+                }
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/modules/contracts.rs.html b/rust/src/oasis_contract_sdk_types/modules/contracts.rs.html new file mode 100644 index 0000000000..253934638b --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/modules/contracts.rs.html @@ -0,0 +1,17 @@ +contracts.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+
use crate::InstanceId;
+
+/// Instantiate call result.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct InstantiateResult {
+    /// Assigned instance identifier.
+    pub id: InstanceId,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/modules/mod.rs.html b/rust/src/oasis_contract_sdk_types/modules/mod.rs.html new file mode 100644 index 0000000000..830cabab09 --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/modules/mod.rs.html @@ -0,0 +1,7 @@ +mod.rs - source
1
+2
+3
+
//!  A collection of types for easier calling into existing SDK modules.
+
+pub mod contracts;
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/storage.rs.html b/rust/src/oasis_contract_sdk_types/storage.rs.html new file mode 100644 index 0000000000..3319551d46 --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/storage.rs.html @@ -0,0 +1,65 @@ +storage.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
//! Storage-related types.
+use std::convert::TryFrom;
+
+/// Kind of the store to use.
+#[derive(Clone, Copy)]
+#[repr(u32)]
+pub enum StoreKind {
+    Public = 0,
+    Confidential = 1,
+}
+
+impl StoreKind {
+    /// Prefix that should be used for the underlying store.
+    pub fn prefix(&self) -> &'static [u8] {
+        match self {
+            StoreKind::Public => &[0x00],
+            StoreKind::Confidential => &[0x01],
+        }
+    }
+}
+
+impl TryFrom<u32> for StoreKind {
+    type Error = u32;
+
+    fn try_from(value: u32) -> Result<Self, Self::Error> {
+        match value {
+            0 => Ok(StoreKind::Public),
+            1 => Ok(StoreKind::Confidential),
+            _ => Err(value),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/testing.rs.html b/rust/src/oasis_contract_sdk_types/testing.rs.html new file mode 100644 index 0000000000..41275dac6a --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/testing.rs.html @@ -0,0 +1,71 @@ +testing.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+
//! Testing helpers.
+
+pub mod addresses {
+    pub mod alice {
+        use crate::address::Address;
+
+        pub fn address() -> Address {
+            Address::from_bech32("oasis1qrec770vrek0a9a5lcrv0zvt22504k68svq7kzve").unwrap()
+        }
+    }
+
+    pub mod bob {
+        use crate::address::Address;
+
+        pub fn address() -> Address {
+            Address::from_bech32("oasis1qrydpazemvuwtnp3efm7vmfvg3tde044qg6cxwzx").unwrap()
+        }
+    }
+
+    pub mod charlie {
+        use crate::address::Address;
+
+        pub fn address() -> Address {
+            Address::from_bech32("oasis1qr5kfjm8lx6mctjmwcx9225q5k3nxacqwqnjahkw").unwrap()
+        }
+    }
+
+    pub mod dave {
+        use crate::address::Address;
+
+        pub fn address() -> Address {
+            Address::from_bech32("oasis1qpufkctqruam5umugwn5jvxtrvvwl075rqrmxqmm").unwrap()
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_contract_sdk_types/token.rs.html b/rust/src/oasis_contract_sdk_types/token.rs.html new file mode 100644 index 0000000000..97b417540a --- /dev/null +++ b/rust/src/oasis_contract_sdk_types/token.rs.html @@ -0,0 +1,385 @@ +token.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+
//! Token types.
+use std::{convert::TryFrom, fmt};
+
+/// Name/type of the token.
+#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, cbor::Encode)]
+#[cbor(transparent)]
+pub struct Denomination(Vec<u8>);
+
+impl Denomination {
+    /// Maximum length of a denomination.
+    pub const MAX_LENGTH: usize = 32;
+    /// Denomination in native token.
+    pub const NATIVE: Denomination = Denomination(Vec::new());
+
+    /// Whether the denomination represents the native token.
+    pub fn is_native(&self) -> bool {
+        self.0.is_empty()
+    }
+
+    /// Raw representation of a denomination.
+    pub fn into_vec(self) -> Vec<u8> {
+        self.0
+    }
+}
+
+impl AsRef<[u8]> for Denomination {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl fmt::Display for Denomination {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        if self.is_native() {
+            write!(f, "<native>")?;
+        } else {
+            write!(f, "{}", String::from_utf8_lossy(&self.0))?;
+        }
+        Ok(())
+    }
+}
+
+impl std::str::FromStr for Denomination {
+    type Err = Error;
+
+    fn from_str(v: &str) -> Result<Self, Self::Err> {
+        Self::try_from(v.as_bytes())
+    }
+}
+
+impl TryFrom<&[u8]> for Denomination {
+    type Error = Error;
+
+    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> {
+        if bytes.len() > Self::MAX_LENGTH {
+            return Err(Error::NameTooLong {
+                length: bytes.len(),
+            });
+        }
+        Ok(Self(bytes.to_vec()))
+    }
+}
+
+impl cbor::Decode for Denomination {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Default::default())
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => {
+                Self::try_from(data.as_ref()).map_err(|_| cbor::DecodeError::UnexpectedType)
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+#[cfg(feature = "oasis-runtime-sdk")]
+impl From<oasis_runtime_sdk::types::token::Denomination> for Denomination {
+    fn from(d: oasis_runtime_sdk::types::token::Denomination) -> Self {
+        Self(d.into_vec())
+    }
+}
+
+#[cfg(feature = "oasis-runtime-sdk")]
+impl From<Denomination> for oasis_runtime_sdk::types::token::Denomination {
+    fn from(d: Denomination) -> Self {
+        oasis_runtime_sdk::types::token::Denomination::try_from(d.0.as_ref()).unwrap()
+    }
+}
+
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+    #[error(
+        "denomination name too long. received length {length} exceeded maximum of {}",
+        Denomination::MAX_LENGTH
+    )]
+    NameTooLong { length: usize },
+}
+
+/// Token amount of given denomination in base units.
+#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, cbor::Encode, cbor::Decode)]
+pub struct BaseUnits(pub u128, pub Denomination);
+
+impl BaseUnits {
+    /// Creates a new token amount of the given denomination.
+    pub fn new(amount: u128, denomination: Denomination) -> Self {
+        BaseUnits(amount, denomination)
+    }
+
+    /// Token amount in base units.
+    pub fn amount(&self) -> u128 {
+        self.0
+    }
+
+    /// Denomination of the token amount.
+    pub fn denomination(&self) -> &Denomination {
+        &self.1
+    }
+}
+
+impl fmt::Display for BaseUnits {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "{} {}", self.0, self.1)?;
+        Ok(())
+    }
+}
+
+#[cfg(feature = "oasis-runtime-sdk")]
+impl From<oasis_runtime_sdk::types::token::BaseUnits> for BaseUnits {
+    fn from(a: oasis_runtime_sdk::types::token::BaseUnits) -> Self {
+        Self(a.0, a.1.into())
+    }
+}
+
+#[cfg(feature = "oasis-runtime-sdk")]
+impl From<&oasis_runtime_sdk::types::token::BaseUnits> for BaseUnits {
+    fn from(a: &oasis_runtime_sdk::types::token::BaseUnits) -> Self {
+        Self(a.0, a.1.clone().into())
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn test_basic() {
+        let cases = vec![
+            // Native denomination.
+            (0, Denomination::NATIVE, "824040"),
+            (1, Denomination::NATIVE, "82410140"),
+            (1000, Denomination::NATIVE, "824203e840"),
+            // Custom denomination.
+            (0, "test".parse().unwrap(), "82404474657374"),
+            (1, "test".parse().unwrap(), "8241014474657374"),
+            (1000, "test".parse().unwrap(), "824203e84474657374"),
+        ];
+
+        for tc in cases {
+            let token = BaseUnits::new(tc.0, tc.1);
+            let enc = cbor::to_vec(token.clone());
+            assert_eq!(hex::encode(&enc), tc.2, "serialization should match");
+
+            let dec: BaseUnits = cbor::from_slice(&enc).expect("deserialization should succeed");
+            assert_eq!(dec, token, "serialization should round-trip");
+        }
+    }
+
+    #[test]
+    fn test_decoding_denomination() {
+        macro_rules! assert_rountrip_ok {
+            ($bytes:expr) => {
+                let enc = cbor::to_vec($bytes.to_vec());
+                let dec: Denomination = cbor::from_slice(&enc).unwrap();
+                assert_eq!(dec, Denomination::try_from($bytes).unwrap());
+                assert_eq!(dec.0, $bytes);
+            };
+        }
+
+        let bytes_fixture = vec![42u8; Denomination::MAX_LENGTH + 1];
+
+        assert_rountrip_ok!(&bytes_fixture[0..0]);
+        assert_rountrip_ok!(&bytes_fixture[0..1]);
+        assert_rountrip_ok!(&bytes_fixture[0..Denomination::MAX_LENGTH]);
+
+        // Too long denomination:
+        let dec_result: Result<Denomination, _> = cbor::from_slice(&cbor::to_vec(bytes_fixture));
+        assert!(dec_result.is_err());
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/app.rs.html b/rust/src/oasis_core_runtime/app.rs.html new file mode 100644 index 0000000000..0bcf949799 --- /dev/null +++ b/rust/src/oasis_core_runtime/app.rs.html @@ -0,0 +1,177 @@ +app.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
//! Runtime apps.
+use std::sync::Arc;
+
+use anyhow::{bail, Result};
+use async_trait::async_trait;
+
+use crate::{
+    common::sgx,
+    consensus::roothash,
+    dispatcher::{Initializer, PostInitState, PreInitState},
+    host::Host,
+};
+
+/// An Oasis runtime app.
+#[allow(unused_variables)]
+#[async_trait]
+pub trait App: Send + Sync {
+    /// Whether this is a ROFL app.
+    fn is_rofl(&self) -> bool {
+        true
+    }
+
+    /// Called on application initialization.
+    fn on_init(&mut self, host: Arc<dyn Host>) -> Result<()> {
+        // Default implementation does nothing.
+        Ok(())
+    }
+
+    /// Quote policy to use for verifying our own enclave identity.
+    async fn quote_policy(&self) -> Result<sgx::QuotePolicy> {
+        // Default implementation uses a sane policy.
+        Ok(sgx::QuotePolicy {
+            ias: Some(sgx::ias::QuotePolicy {
+                disabled: true, // Disable legacy EPID attestation.
+                ..Default::default()
+            }),
+            pcs: Some(sgx::pcs::QuotePolicy {
+                // Allow TDX since that is not part of the default policy.
+                tdx: Some(sgx::pcs::TdxQuotePolicy {
+                    allowed_tdx_modules: vec![],
+                }),
+                ..Default::default()
+            }),
+        })
+    }
+
+    /// Called on new runtime block being received.
+    async fn on_runtime_block(&self, blk: &roothash::AnnotatedBlock) -> Result<()> {
+        // Default implementation does nothing.
+        Ok(())
+    }
+
+    /// Called on new runtime event being detected.
+    async fn on_runtime_event(
+        &self,
+        blk: &roothash::AnnotatedBlock,
+        tags: &[Vec<u8>],
+    ) -> Result<()> {
+        // Default implementation does nothing.
+        Ok(())
+    }
+
+    /// Called for runtime queries.
+    async fn query(&self, method: &str, args: Vec<u8>) -> Result<Vec<u8>> {
+        // Default implementation rejects all requests.
+        bail!("method not supported");
+    }
+}
+
+/// An application which doesn't do anything.
+pub struct NoopApp;
+
+#[async_trait]
+impl App for NoopApp {
+    fn is_rofl(&self) -> bool {
+        false
+    }
+}
+
+/// Create a new runtime initializer for an application.
+pub fn new(app: Box<dyn App>) -> Box<dyn Initializer> {
+    Box::new(|_state: PreInitState<'_>| -> PostInitState {
+        PostInitState {
+            app: Some(app),
+            ..Default::default()
+        }
+    })
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/attestation.rs.html b/rust/src/oasis_core_runtime/attestation.rs.html new file mode 100644 index 0000000000..e462aa13b3 --- /dev/null +++ b/rust/src/oasis_core_runtime/attestation.rs.html @@ -0,0 +1,323 @@ +attestation.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+
//! Functionality related to the enclave attestation flow.
+use std::sync::Arc;
+
+use anyhow::{bail, Result};
+use slog::{info, Logger};
+
+use crate::{
+    app::App,
+    common::{
+        crypto::signature::Signer, logger::get_logger, namespace::Namespace, panic::AbortOnPanic,
+        sgx::Quote, version::Version,
+    },
+    consensus::{
+        registry::{EndorsedCapabilityTEE, SGXAttestation, ATTESTATION_SIGNATURE_CONTEXT},
+        verifier::Verifier,
+    },
+    host::Host,
+    identity::Identity,
+    policy::PolicyVerifier,
+    types::Body,
+};
+
+/// Attestation flow handler.
+#[derive(Clone)]
+pub struct Handler {
+    identity: Arc<Identity>,
+    host: Arc<dyn Host>,
+    consensus_verifier: Arc<dyn Verifier>,
+    runtime_id: Namespace,
+    version: Version,
+    app: Arc<dyn App>,
+    logger: Logger,
+}
+
+impl Handler {
+    /// Create a new instance of the attestation flow handler.
+    pub fn new(
+        identity: Arc<Identity>,
+        host: Arc<dyn Host>,
+        consensus_verifier: Arc<dyn Verifier>,
+        runtime_id: Namespace,
+        version: Version,
+        app: Arc<dyn App>,
+    ) -> Self {
+        Self {
+            identity,
+            host,
+            consensus_verifier,
+            runtime_id,
+            version,
+            app,
+            logger: get_logger("runtime/attestation"),
+        }
+    }
+}
+
+impl Handler {
+    /// Handle an attestation flow request.
+    pub async fn handle(&self, request: Body) -> Result<Body> {
+        match request {
+            Body::RuntimeCapabilityTEERakInitRequest { target_info } => {
+                self.target_info_init(target_info)
+            }
+            Body::RuntimeCapabilityTEERakReportRequest {} => self.report_init(),
+            Body::RuntimeCapabilityTEERakAvrRequest { avr } => {
+                // TODO: Remove this once we want to break the runtime host protocol.
+                self.set_quote(Quote::Ias(avr)).await
+            }
+            Body::RuntimeCapabilityTEERakQuoteRequest { quote } => self.set_quote(quote).await,
+            Body::RuntimeCapabilityTEEUpdateEndorsementRequest { ect } => {
+                self.update_endorsement(ect).await
+            }
+
+            _ => bail!("unsupported attestation request"),
+        }
+    }
+
+    fn target_info_init(&self, target_info: Vec<u8>) -> Result<Body> {
+        // Make sure to abort the process on panics during attestation process.
+        let _guard = AbortOnPanic;
+
+        info!(self.logger, "Initializing the runtime target info");
+        self.identity.init_target_info(target_info)?;
+        Ok(Body::RuntimeCapabilityTEERakInitResponse {})
+    }
+
+    fn report_init(&self) -> Result<Body> {
+        // Make sure to abort the process on panics during attestation process.
+        let _guard = AbortOnPanic;
+
+        info!(self.logger, "Initializing the runtime key report");
+        let (rak_pub, rek_pub, report, nonce) = self.identity.init_report()?;
+
+        Ok(Body::RuntimeCapabilityTEERakReportResponse {
+            rak_pub,
+            rek_pub,
+            report,
+            nonce,
+        })
+    }
+
+    async fn set_quote_policy(&self) -> Result<()> {
+        info!(self.logger, "Configuring quote policy");
+
+        // Use the correct quote policy for verifying our own identity based on what kind of
+        // application this is. For ROFL, ask the application, for RONL, query consensus.
+        let policy = if self.app.is_rofl() {
+            // ROFL, ask the app for policy.
+            self.app.quote_policy().await?
+        } else {
+            // RONL.
+            // TODO: Make async.
+            let consensus_verifier = self.consensus_verifier.clone();
+            let version = self.version;
+            let runtime_id = self.runtime_id;
+            tokio::task::block_in_place(move || {
+                // Obtain current quote policy from (verified) consensus state.
+                PolicyVerifier::new(consensus_verifier).quote_policy(&runtime_id, Some(version))
+            })?
+        };
+
+        self.identity.set_quote_policy(policy)?;
+
+        Ok(())
+    }
+
+    async fn set_quote(&self, quote: Quote) -> Result<Body> {
+        // Make sure to abort the process on panics during attestation process.
+        let _guard = AbortOnPanic;
+
+        // Ensure a quote policy is configured.
+        self.set_quote_policy().await?;
+
+        info!(
+            self.logger,
+            "Configuring quote for the runtime attestation key binding"
+        );
+
+        // Configure the quote and policy on the identity.
+        let node_id = self.host.identity().await?;
+        let verified_quote = self.identity.set_quote(node_id, quote)?;
+
+        // Sign the report data, latest verified consensus height, REK and host node ID.
+        let consensus_state = self.consensus_verifier.latest_state().await?;
+        let height = consensus_state.height();
+        let rek = self.identity.public_rek();
+        let h = SGXAttestation::hash(&verified_quote.report_data, &node_id, height, &rek);
+        let signature = self.identity.sign(ATTESTATION_SIGNATURE_CONTEXT, &h)?;
+
+        Ok(Body::RuntimeCapabilityTEERakQuoteResponse { height, signature })
+    }
+
+    async fn update_endorsement(&self, ect: EndorsedCapabilityTEE) -> Result<Body> {
+        info!(self.logger, "Updating endorsed TEE capability");
+
+        // Update the endorsed TEE capability. This also performs the necessary verification.
+        self.identity.set_endorsed_capability_tee(ect)?;
+
+        Ok(Body::RuntimeCapabilityTEEUpdateEndorsementResponse {})
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/cache.rs.html b/rust/src/oasis_core_runtime/cache.rs.html new file mode 100644 index 0000000000..afb9a778da --- /dev/null +++ b/rust/src/oasis_core_runtime/cache.rs.html @@ -0,0 +1,251 @@ +cache.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+
//! In-memory cache of trees.
+use std::{
+    cell::RefCell,
+    num::NonZeroUsize,
+    rc::Rc,
+    sync::{Arc, Mutex, MutexGuard},
+};
+
+use crate::{
+    common::crypto::hash::Hash,
+    protocol::Protocol,
+    storage::mkvs::{sync::HostReadSyncer, Root, Tree},
+    types::HostStorageEndpoint,
+};
+
+thread_local! {
+    static QUERY_CACHE: RefCell<lru::LruCache<u64, Rc<RefCell<Cache>>>> = RefCell::new(lru::LruCache::new(NonZeroUsize::new(10).unwrap()));
+}
+
+/// A set of storage tree caches, one for each storage operation:
+///
+/// * **Execution** and **checking** of transactions each have their own cache guarded by a mutex
+///   since the usual use case is that only one execution/check batch is running at any given time.
+///
+/// * **Queries** have a thread-local cache as there can be multiple queries running at any given
+///   time and having a global lock would kill concurrency.
+#[derive(Clone)]
+pub struct CacheSet {
+    protocol: Arc<Protocol>,
+    execute: Arc<Mutex<Cache>>,
+    check: Arc<Mutex<Cache>>,
+}
+
+impl CacheSet {
+    /// Create a new empty cache set.
+    pub fn new(protocol: Arc<Protocol>) -> Self {
+        Self {
+            execute: Arc::new(Mutex::new(Cache::new(&protocol))),
+            check: Arc::new(Mutex::new(Cache::new(&protocol))),
+            protocol,
+        }
+    }
+
+    /// Cache used for executing transactions.
+    pub fn execute(&self, root: Root) -> MutexGuard<'_, Cache> {
+        let mut cache = self.execute.lock().unwrap();
+        cache.maybe_replace(&self.protocol, root);
+        cache
+    }
+
+    /// Cache used for checking transactions.
+    pub fn check(&self, root: Root) -> MutexGuard<'_, Cache> {
+        let mut cache = self.check.lock().unwrap();
+        cache.maybe_replace(&self.protocol, root);
+        cache
+    }
+
+    /// Cache used for queries.
+    pub fn query(&self, root: Root) -> Rc<RefCell<Cache>> {
+        let cache = QUERY_CACHE.with(|caches| {
+            let mut caches = caches.borrow_mut();
+            if let Some(cache) = caches.get(&root.version) {
+                return cache.clone();
+            }
+
+            let cache = Rc::new(RefCell::new(Cache::new(&self.protocol)));
+            caches.put(root.version, cache.clone());
+            cache
+        });
+        cache.borrow_mut().maybe_replace(&self.protocol, root);
+        cache
+    }
+}
+
+/// Cached storage tree with an associated root.
+pub struct Cache {
+    root: Root,
+    tree: Tree,
+}
+
+impl Cache {
+    fn new(protocol: &Arc<Protocol>) -> Self {
+        Self {
+            root: Default::default(),
+            tree: Self::build(protocol, Default::default()),
+        }
+    }
+
+    fn build(protocol: &Arc<Protocol>, root: Root) -> Tree {
+        let config = protocol.get_config();
+        let read_syncer = HostReadSyncer::new(protocol.clone(), HostStorageEndpoint::Runtime);
+        Tree::builder()
+            .with_capacity(
+                config.storage.cache_node_capacity,
+                config.storage.cache_value_capacity,
+            )
+            .with_root(root)
+            .build(Box::new(read_syncer))
+    }
+
+    fn maybe_replace(&mut self, protocol: &Arc<Protocol>, root: Root) {
+        if self.root == root {
+            return;
+        }
+
+        self.tree = Self::build(protocol, root);
+        self.root = root;
+    }
+
+    /// Reference to the cached tree.
+    pub fn tree(&self) -> &Tree {
+        &self.tree
+    }
+
+    /// Mutable reference to the cached tree.
+    pub fn tree_mut(&mut self) -> &mut Tree {
+        &mut self.tree
+    }
+
+    /// Commits a specific version and root as being stored by the tree.
+    pub fn commit(&mut self, version: u64, hash: Hash) {
+        self.root.version = version;
+        self.root.hash = hash;
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/bytes.rs.html b/rust/src/oasis_core_runtime/common/bytes.rs.html new file mode 100644 index 0000000000..9ff8f205aa --- /dev/null +++ b/rust/src/oasis_core_runtime/common/bytes.rs.html @@ -0,0 +1,433 @@ +bytes.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+
//! Byte array type helpers.
+
+/// Define a byte array-like type.
+///
+/// # Examples
+///
+/// ```rust,ignore
+/// impl_bytes!(MyType, 32, "A 32-byte type.");
+/// ```
+#[macro_export]
+macro_rules! impl_bytes {
+    ($name:ident, $size:expr, $doc:expr) => {
+        #[doc=$doc]
+        #[derive(Clone, Copy, zeroize::Zeroize)]
+        pub struct $name(pub [u8; $size]);
+
+        impl $name {
+            /// Size of this object in bytes.
+            pub const fn len() -> usize {
+                $size
+            }
+        }
+
+        impl AsRef<[u8]> for $name {
+            fn as_ref(&self) -> &[u8] {
+                &self.0
+            }
+        }
+
+        impl Eq for $name {}
+
+        impl PartialOrd for $name {
+            fn partial_cmp(&self, other: &Self) -> Option<::core::cmp::Ordering> {
+                Some(self.cmp(other))
+            }
+        }
+
+        impl PartialEq for $name {
+            fn eq(&self, other: &Self) -> bool {
+                &self.0[..] == &other.0[..]
+            }
+        }
+
+        impl Ord for $name {
+            fn cmp(&self, other: &Self) -> ::core::cmp::Ordering {
+                self.0[..].cmp(&other.0[..])
+            }
+        }
+
+        impl ::core::hash::Hash for $name {
+            fn hash<H>(&self, state: &mut H)
+            where
+                H: ::core::hash::Hasher,
+            {
+                state.write(&self.0);
+            }
+        }
+
+        impl Default for $name {
+            fn default() -> Self {
+                $name([0; $size])
+            }
+        }
+
+        impl From<$name> for [u8; $size] {
+            fn from(b: $name) -> Self {
+                b.0
+            }
+        }
+
+        impl From<&[u8]> for $name {
+            fn from(b: &[u8]) -> $name {
+                let mut data = [0; $size];
+                data.copy_from_slice(b);
+                $name(data)
+            }
+        }
+
+        impl From<&'static str> for $name {
+            fn from(s: &'static str) -> $name {
+                let s = s.strip_prefix("0x").unwrap_or(s);
+
+                if s.len() % 2 == 1 {
+                    ("0".to_owned() + s).parse().unwrap()
+                } else {
+                    s.parse().unwrap()
+                }
+            }
+        }
+
+        impl From<Vec<u8>> for $name {
+            fn from(v: Vec<u8>) -> $name {
+                Self::from(&v[..])
+            }
+        }
+
+        impl ::std::str::FromStr for $name {
+            type Err = ::rustc_hex::FromHexError;
+
+            fn from_str(s: &str) -> Result<$name, ::rustc_hex::FromHexError> {
+                use ::rustc_hex::FromHex;
+
+                let a: Vec<u8> = s.from_hex()?;
+                if a.len() != $size {
+                    return Err(::rustc_hex::FromHexError::InvalidHexLength);
+                }
+
+                let mut ret = [0; $size];
+                ret.copy_from_slice(&a);
+                Ok($name(ret))
+            }
+        }
+
+        // Formatting.
+
+        impl ::core::fmt::LowerHex for $name {
+            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
+                for i in &self.0[..] {
+                    write!(f, "{:02x}", i)?;
+                }
+                Ok(())
+            }
+        }
+
+        impl ::core::fmt::Debug for $name {
+            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
+                ::core::fmt::LowerHex::fmt(self, f)
+            }
+        }
+
+        impl ::core::fmt::Display for $name {
+            fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
+                for i in &self.0[0..2] {
+                    write!(f, "{:02x}", i)?;
+                }
+                write!(f, "…")?;
+                for i in &self.0[$size - 2..$size] {
+                    write!(f, "{:02x}", i)?;
+                }
+                Ok(())
+            }
+        }
+
+        // Serialization.
+
+        impl $crate::cbor::Encode for $name {
+            fn into_cbor_value(self) -> $crate::cbor::Value {
+                $crate::cbor::Value::ByteString(self.0.into())
+            }
+        }
+
+        // Deserialization.
+
+        impl $crate::cbor::Decode for $name {
+            fn try_default() -> Result<Self, $crate::cbor::DecodeError> {
+                Ok(Default::default())
+            }
+
+            fn try_from_cbor_value(
+                value: $crate::cbor::Value,
+            ) -> Result<Self, $crate::cbor::DecodeError> {
+                use ::std::convert::TryInto;
+
+                match value {
+                    $crate::cbor::Value::ByteString(data) => Ok(Self(
+                        data.try_into()
+                            .map_err(|_| $crate::cbor::DecodeError::UnexpectedType)?,
+                    )),
+                    _ => Err($crate::cbor::DecodeError::UnexpectedType),
+                }
+            }
+        }
+    };
+}
+
+#[cfg(test)]
+mod tests {
+    // Use hash of an empty string as a test key.
+    const TEST_KEY_BYTES: [u8; 32] = [
+        0xc6, 0x72, 0xb8, 0xd1, 0xef, 0x56, 0xed, 0x28, 0xab, 0x87, 0xc3, 0x62, 0x2c, 0x51, 0x14,
+        0x06, 0x9b, 0xdd, 0x3a, 0xd7, 0xb8, 0xf9, 0x73, 0x74, 0x98, 0xd0, 0xc0, 0x1e, 0xce, 0xf0,
+        0x96, 0x7a,
+    ];
+
+    impl_bytes!(TestKey, 32, "test key");
+
+    #[test]
+    fn test_length() {
+        assert_eq!(TestKey::len(), 32);
+    }
+
+    #[test]
+    fn test_cbor() {
+        // Serialize.
+        let test_key = TestKey(TEST_KEY_BYTES);
+        let test_key_vec = cbor::to_vec(test_key);
+
+        // CBOR prepends "X " to the binary value.
+        let mut expected_test_key_vec = vec![88, 32];
+        expected_test_key_vec.extend_from_slice(&TEST_KEY_BYTES);
+        assert_eq!(test_key_vec, expected_test_key_vec);
+
+        // Deserialize.
+        let new_test_key: TestKey = cbor::from_slice(&test_key_vec).unwrap();
+        assert_eq!(new_test_key, test_key);
+    }
+
+    #[test]
+    fn test_cbor_null() {
+        let test_key: TestKey = cbor::from_slice(&[0xF6]).unwrap();
+        assert_eq!(
+            test_key,
+            "0000000000000000000000000000000000000000000000000000000000000000".into()
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/crypto/hash.rs.html b/rust/src/oasis_core_runtime/common/crypto/hash.rs.html new file mode 100644 index 0000000000..9ca30726eb --- /dev/null +++ b/rust/src/oasis_core_runtime/common/crypto/hash.rs.html @@ -0,0 +1,137 @@ +hash.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+
//! Hash type.
+use std::convert::TryInto;
+
+use sha2::{Digest, Sha512_256};
+
+use crate::common::key_format::KeyFormatAtom;
+
+impl_bytes!(Hash, 32, "A 32-byte SHA-512/256 hash.");
+
+impl Hash {
+    /// Compute a digest of the passed slice of bytes.
+    pub fn digest_bytes(data: &[u8]) -> Hash {
+        let mut result = [0u8; 32];
+        result[..].copy_from_slice(Sha512_256::digest(data).as_ref());
+
+        Hash(result)
+    }
+
+    /// Compute a digest of the passed slices of bytes.
+    pub fn digest_bytes_list(data: &[&[u8]]) -> Hash {
+        let mut ctx = Sha512_256::new();
+        for datum in data {
+            ctx.update(datum);
+        }
+
+        let mut result = [0u8; 32];
+        result[..].copy_from_slice(ctx.finalize().as_ref());
+
+        Hash(result)
+    }
+
+    /// Returns true if the hash is of an empty string.
+    pub fn is_empty(&self) -> bool {
+        self == &Hash::empty_hash()
+    }
+
+    /// Hash of an empty string.
+    pub fn empty_hash() -> Hash {
+        // This is SHA-512/256 of an empty string.
+        Hash([
+            0xc6, 0x72, 0xb8, 0xd1, 0xef, 0x56, 0xed, 0x28, 0xab, 0x87, 0xc3, 0x62, 0x2c, 0x51,
+            0x14, 0x06, 0x9b, 0xdd, 0x3a, 0xd7, 0xb8, 0xf9, 0x73, 0x74, 0x98, 0xd0, 0xc0, 0x1e,
+            0xce, 0xf0, 0x96, 0x7a,
+        ])
+    }
+
+    /// Hash truncated to the given number of bytes.
+    pub fn truncated(&self, n: usize) -> &[u8] {
+        &self.0[..n]
+    }
+}
+
+impl KeyFormatAtom for Hash {
+    fn size() -> usize {
+        Hash::len()
+    }
+
+    fn encode_atom(self) -> Vec<u8> {
+        self.as_ref().to_vec()
+    }
+
+    fn decode_atom(data: &[u8]) -> Self
+    where
+        Self: Sized,
+    {
+        Hash(data.try_into().expect("hash: invalid decode atom data"))
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/crypto/mod.rs.html b/rust/src/oasis_core_runtime/common/crypto/mod.rs.html new file mode 100644 index 0000000000..a7f8efb973 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/crypto/mod.rs.html @@ -0,0 +1,13 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+
//! Cryptographic primitives.
+
+pub mod hash;
+pub mod mrae;
+pub mod signature;
+pub mod x25519;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/crypto/mrae/deoxysii.rs.html b/rust/src/oasis_core_runtime/common/crypto/mrae/deoxysii.rs.html new file mode 100644 index 0000000000..5fdb292855 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/crypto/mrae/deoxysii.rs.html @@ -0,0 +1,367 @@ +deoxysii.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+
//! Deoxys-II-256-128 MRAE primitives implementation.
+use anyhow::Result;
+use hmac::{Hmac, Mac};
+use rand::rngs::OsRng;
+use sha2::Sha512_256;
+use x25519_dalek::{PublicKey, StaticSecret};
+
+pub use deoxysii::{DeoxysII, KEY_SIZE, NONCE_SIZE, TAG_SIZE};
+
+type Kdf = Hmac<Sha512_256>;
+
+/// An abstract Deoxys-II-256-128 box opener.
+pub trait Opener: Send + Sync {
+    /// Unboxes ("opens") the provided additional data and ciphertext.
+    fn box_open(
+        &self,
+        nonce: &[u8; NONCE_SIZE],
+        ciphertext: Vec<u8>,
+        additional_data: Vec<u8>,
+        peers_public_key: &PublicKey,
+    ) -> Result<Vec<u8>>;
+}
+
+/// Derives a MRAE AEAD symmetric key suitable for use with the asymmetric
+/// box primitives from the provided X25519 public and private keys.
+fn derive_symmetric_key(public: &PublicKey, private: &StaticSecret) -> [u8; KEY_SIZE] {
+    let pmk = private.diffie_hellman(public);
+
+    let mut kdf = Kdf::new_from_slice(b"MRAE_Box_Deoxys-II-256-128").expect("Hmac::new_from_slice");
+    kdf.update(pmk.as_bytes());
+    drop(pmk);
+
+    let mut derived_key = [0u8; KEY_SIZE];
+    let digest = kdf.finalize();
+    derived_key.copy_from_slice(&digest.into_bytes()[..KEY_SIZE]);
+
+    derived_key
+}
+
+/// Generates a public/private key pair suitable for use with
+/// `derive_symmetric_key`, `box_seal`, and `box_open`.
+pub fn generate_key_pair() -> (PublicKey, StaticSecret) {
+    let sk = StaticSecret::random_from_rng(OsRng);
+    let pk = PublicKey::from(&sk);
+
+    (pk, sk)
+}
+
+/// Boxes ("seals") the provided additional data and plaintext via
+/// Deoxys-II-256-128 using a symmetric key derived from the provided
+/// X25519 public and private keys.
+/// The nonce should be `NONCE_SIZE` bytes long and unique for all time
+/// for a given public and private key tuple.
+pub fn box_seal(
+    nonce: &[u8; NONCE_SIZE],
+    plaintext: Vec<u8>,
+    additional_data: Vec<u8>,
+    peers_public_key: &PublicKey,
+    private_key: &StaticSecret,
+) -> Result<Vec<u8>> {
+    let key = derive_symmetric_key(peers_public_key, private_key);
+
+    let d2 = DeoxysII::new(&key);
+
+    Ok(d2.seal(nonce, plaintext, additional_data))
+}
+
+/// Unboxes ("opens") the provided additional data and ciphertext via
+/// Deoxys-II-256-128 using a symmetric key derived from the provided
+/// X25519 public and private keys.
+/// The nonce should be `NONCE_SIZE` bytes long and both it and the additional
+/// data must match the value passed to `box_seal`.
+pub fn box_open(
+    nonce: &[u8; NONCE_SIZE],
+    ciphertext: Vec<u8>,
+    additional_data: Vec<u8>,
+    peers_public_key: &PublicKey,
+    private_key: &StaticSecret,
+) -> Result<Vec<u8>> {
+    let key = derive_symmetric_key(peers_public_key, private_key);
+
+    let d2 = DeoxysII::new(&key);
+
+    d2.open(nonce, ciphertext, additional_data)
+        .map_err(|err| err.into())
+}
+
+#[cfg(test)]
+mod tests {
+    extern crate test;
+
+    use self::test::{black_box, Bencher};
+    use super::*;
+    use rand::RngCore;
+
+    #[test]
+    fn test_mrae_asymmetric() {
+        let (a_pub, a_priv) = generate_key_pair(); // Alice
+        let (b_pub, b_priv) = generate_key_pair(); // Bob
+
+        // None of the generated keys should be the same.
+        assert_ne!(a_pub.to_bytes(), b_pub.to_bytes());
+        assert_ne!(a_priv.to_bytes(), b_priv.to_bytes());
+        assert_ne!(a_pub.to_bytes(), a_priv.to_bytes());
+        assert_ne!(b_pub.to_bytes(), b_priv.to_bytes());
+
+        // Should successfully seal the text in a box.
+        let nonce = [1u8; NONCE_SIZE];
+        let text = String::from("This is a test!").as_bytes().to_vec();
+        let aad = vec![42u8; 10];
+
+        let sealed = box_seal(&nonce, text.clone(), aad.clone(), &b_pub, &a_priv);
+        assert!(sealed.is_ok());
+
+        // Should successfully open the sealed box.
+        let opened = box_open(&nonce, sealed.unwrap(), aad, &a_pub, &b_priv);
+        assert!(opened.is_ok());
+
+        // The deciphered text should match the original.
+        let deciphered = opened.unwrap();
+        assert_eq!(deciphered, text);
+    }
+
+    #[bench]
+    fn bench_mrae_box_seal_4096(b: &mut Bencher) {
+        let mut rng = OsRng {};
+
+        // Set up the keys.
+        let (_a_pub, a_priv) = generate_key_pair(); // Alice
+        let (b_pub, _b_priv) = generate_key_pair(); // Bob
+
+        // Set up the payload.
+        let mut nonce = [0u8; NONCE_SIZE];
+        rng.fill_bytes(&mut nonce);
+        let mut text = [0u8; 4096];
+        rng.fill_bytes(&mut text);
+        let mut aad = [0u8; 64];
+        rng.fill_bytes(&mut aad);
+
+        // Benchmark box sealing.
+        b.iter(|| {
+            let _sealed = black_box(box_seal(
+                &nonce,
+                text.to_vec(),
+                aad.to_vec(),
+                &b_pub,
+                &a_priv,
+            ));
+        });
+    }
+
+    #[bench]
+    fn bench_mrae_box_open_4096(b: &mut Bencher) {
+        let mut rng = OsRng {};
+
+        // Set up the keys.
+        let (a_pub, a_priv) = generate_key_pair(); // Alice
+        let (b_pub, b_priv) = generate_key_pair(); // Bob
+
+        // Set up the payload.
+        let mut nonce = [0u8; NONCE_SIZE];
+        rng.fill_bytes(&mut nonce);
+        let mut text = [0u8; 4096];
+        rng.fill_bytes(&mut text);
+        let mut aad = [0u8; 64];
+        rng.fill_bytes(&mut aad);
+
+        // Seal the payload.
+        let sealed = box_seal(&nonce, text.to_vec(), aad.to_vec(), &b_pub, &a_priv);
+        let ciphertext = sealed.unwrap();
+
+        // Benchmark box opening.
+        b.iter(|| {
+            let _opened = black_box(box_open(
+                &nonce,
+                ciphertext.clone(),
+                aad.to_vec(),
+                &a_pub,
+                &b_priv,
+            ));
+        });
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/crypto/mrae/mod.rs.html b/rust/src/oasis_core_runtime/common/crypto/mrae/mod.rs.html new file mode 100644 index 0000000000..a4f66c8080 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/crypto/mrae/mod.rs.html @@ -0,0 +1,7 @@ +mod.rs - source
1
+2
+3
+
//! MRAE primitives.
+pub mod deoxysii;
+pub mod nonce;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/crypto/mrae/nonce.rs.html b/rust/src/oasis_core_runtime/common/crypto/mrae/nonce.rs.html new file mode 100644 index 0000000000..4648766bbc --- /dev/null +++ b/rust/src/oasis_core_runtime/common/crypto/mrae/nonce.rs.html @@ -0,0 +1,335 @@ +nonce.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+
//! Nonce utility used to ensure nonces are safely incremented.
+use std::ops::Deref;
+
+use anyhow::{anyhow, Result};
+use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
+use rand::{rngs::OsRng, Rng};
+
+/// Size of the nonce in bytes.
+pub use super::deoxysii::NONCE_SIZE;
+/// Size of tag portion of the nonce in bytes. These bytes will never update.
+pub const TAG_SIZE: usize = 11;
+
+/// 120 bit nonce with a 88 bit tag and 32 bit counter. If the counter exceeds
+/// 32 bits, then the nonce is no longer valid and must be refreshed with a new
+/// random nonce. It is expected that all 128 bits are given randomly. However,
+/// the last 32 counting bits may wrap around to ensure 2^32 counts may be used
+/// per nonce.
+#[derive(Debug, Clone)]
+pub struct Nonce {
+    /// The current value of the nonce, from which we may increment.
+    current_value: [u8; NONCE_SIZE],
+    /// The initial value of the nonce, used to ensure we never allow the nonce
+    /// to be the same again (after incrementing 2^32 times).
+    start_value: [u8; NONCE_SIZE],
+}
+
+impl Nonce {
+    /// Create a new nonce.
+    pub fn new(start_value: [u8; NONCE_SIZE]) -> Self {
+        Nonce {
+            current_value: start_value,
+            start_value,
+        }
+    }
+
+    /// Generate a random nonce.
+    pub fn generate() -> Self {
+        let mut rng = OsRng {};
+        let mut start_value = [0u8; NONCE_SIZE];
+        rng.fill(&mut start_value);
+
+        Self::new(start_value)
+    }
+
+    /// Adds one to the nonce, affecting only the last 32 counting bits.
+    /// Returns an error iff we've exceeded our nonce's counter capacity, i.e.,
+    /// we've incremented 2^32 times. In this case, the Nonce remains unchanged,
+    /// and all subsequent calls to this method will return an Error.
+    pub fn increment(&mut self) -> Result<()> {
+        // Extract the current counter out of the nonce.
+        let mut counter_array = &self.current_value[TAG_SIZE..];
+        // Increment the count and wrap to 0 if necessary.
+        let new_counter: u32 = {
+            let mut counter = counter_array.read_u32::<BigEndian>().unwrap();
+            // If about to overflow wrap around to 0.
+            #[allow(clippy::nonminimal_bool)]
+            if counter == !0u32 {
+                counter = 0;
+            } else {
+                counter += 1;
+            }
+            counter
+        };
+        // Merge this new counter back into the nonce.
+        let new_value: [u8; NONCE_SIZE] = {
+            let mut new_value_vec = self.current_value[..TAG_SIZE].to_vec();
+            new_value_vec.write_u32::<BigEndian>(new_counter).unwrap();
+
+            assert!(new_value_vec.len() == NONCE_SIZE);
+
+            let mut new_value = [0; NONCE_SIZE];
+            new_value.copy_from_slice(&new_value_vec);
+            new_value
+        };
+        // If we've exhausted all 2^32 counters, then error.
+        if new_value == self.start_value {
+            return Err(anyhow!(
+                "This nonce has been exhausted, and a new one must be created",
+            ));
+        }
+        // Update is valid, so mutate.
+        self.current_value = new_value;
+        // Success.
+        Ok(())
+    }
+}
+
+impl Deref for Nonce {
+    type Target = [u8; NONCE_SIZE];
+
+    fn deref(&self) -> &Self::Target {
+        &self.current_value
+    }
+}
+
+#[cfg(test)]
+mod tests {
+
+    use super::*;
+
+    #[test]
+    fn test_increment_zero() {
+        let inner = [0; 15];
+        let mut nonce = Nonce::new(inner);
+        nonce.increment().unwrap();
+        let mut expected = [0; 15];
+        expected[14] = 1;
+        assert_eq!(nonce.to_vec(), expected.to_vec());
+    }
+
+    #[test]
+    fn test_increment_one() {
+        let mut start_value = [0; 15];
+        start_value[14] = 1;
+        let mut nonce = Nonce::new(start_value);
+        nonce.increment().unwrap();
+        let mut expected = [0; 15];
+        expected[14] = 2;
+
+        assert_eq!(nonce.to_vec(), expected.to_vec());
+    }
+
+    #[test]
+    fn test_increment_carry() {
+        let start_value = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255];
+        let mut nonce = Nonce::new(start_value);
+        nonce.increment().unwrap();
+        let expected = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0];
+        assert_eq!(nonce.to_vec(), expected.to_vec());
+    }
+
+    #[test]
+    fn test_increment_overflow() {
+        let start_value = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255];
+        let mut nonce = Nonce::new(start_value);
+        nonce.increment().unwrap();
+        let expected = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+        assert_eq!(nonce.to_vec(), expected.to_vec());
+    }
+
+    #[test]
+    fn test_increment_exhaustion() {
+        let start_value = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255];
+        let current_value = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 254];
+        let mut nonce = Nonce {
+            start_value,
+            current_value,
+        };
+        assert_eq!(nonce.increment().is_err(), true);
+        // Try again.
+        assert_eq!(nonce.increment().is_err(), true);
+    }
+
+    #[test]
+    fn test_double_increment_exhaustion() {
+        let start_value = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255];
+        let current_value = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 253];
+        let mut nonce = Nonce {
+            start_value,
+            current_value,
+        };
+        let first_expected = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 254];
+        nonce.increment().unwrap();
+        assert_eq!(nonce.to_vec(), first_expected.to_vec());
+        assert_eq!(nonce.increment().is_err(), true);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/crypto/signature.rs.html b/rust/src/oasis_core_runtime/common/crypto/signature.rs.html new file mode 100644 index 0000000000..34cd2f9761 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/crypto/signature.rs.html @@ -0,0 +1,863 @@ +signature.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+
//! Signature types.
+use std::{cmp::Ordering, convert::TryInto, io::Cursor};
+
+use anyhow::Result;
+use byteorder::{LittleEndian, ReadBytesExt};
+use curve25519_dalek::{
+    edwards::{CompressedEdwardsY, EdwardsPoint},
+    scalar::Scalar,
+};
+use ed25519_dalek::{Digest as _, Sha512, Signer as _};
+use rand::rngs::OsRng;
+use thiserror::Error;
+use zeroize::Zeroize;
+
+use crate::common::namespace::Namespace;
+
+use super::hash::Hash;
+
+/// The chain separator used to add additional domain separation based on the chain context.
+const CHAIN_SIGNATURE_CONTEXT_SEPARATOR: &[u8] = b" for chain ";
+/// The runtime separator used to add additional domain separation based on the runtime ID.
+const RUNTIME_SIGNATURE_CONTEXT_SEPARATOR: &[u8] = b" for runtime ";
+
+impl_bytes!(
+    PublicKey,
+    ed25519_dalek::PUBLIC_KEY_LENGTH,
+    "An Ed25519 public key."
+);
+
+/// Signature error.
+#[derive(Error, Debug)]
+enum SignatureError {
+    #[error("point decompression failed")]
+    PointDecompression,
+    #[error("small order A")]
+    SmallOrderA,
+    #[error("small order R")]
+    SmallOrderR,
+    #[error("signature malleability check failed")]
+    Malleability,
+    #[error("invalid signature")]
+    InvalidSignature,
+}
+
+static CURVE_ORDER: &[u64] = &[
+    0x1000000000000000,
+    0,
+    0x14def9dea2f79cd6,
+    0x5812631a5cf5d3ed,
+];
+
+/// An Ed25519 private key.
+pub struct PrivateKey(pub ed25519_dalek::SigningKey);
+
+impl PrivateKey {
+    /// Generates a new private key pair.
+    pub fn generate() -> Self {
+        PrivateKey(ed25519_dalek::SigningKey::generate(&mut OsRng))
+    }
+
+    /// Convert this private key into bytes.
+    pub fn to_bytes(&self) -> Vec<u8> {
+        let mut bytes = self.0.to_bytes();
+        let bvec = bytes.to_vec();
+        bytes.zeroize();
+        bvec
+    }
+
+    /// Construct a private key from bytes returned by `to_bytes`.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic in case the passed bytes do not have the correct length.
+    pub fn from_bytes(bytes: Vec<u8>) -> PrivateKey {
+        let mut sk = bytes.try_into().unwrap();
+        let secret = ed25519_dalek::SigningKey::from_bytes(&sk);
+        sk.zeroize();
+
+        PrivateKey(secret)
+    }
+
+    /// Generate a new private key from a test key seed.
+    pub fn from_test_seed(seed: String) -> Self {
+        let mut seed = Hash::digest_bytes(seed.as_bytes());
+        let sk = Self::from_bytes(seed.as_ref().to_vec());
+        seed.zeroize();
+
+        sk
+    }
+
+    /// Returns the public key.
+    pub fn public_key(&self) -> PublicKey {
+        PublicKey(self.0.verifying_key().to_bytes())
+    }
+}
+
+impl Signer for PrivateKey {
+    fn public(&self) -> PublicKey {
+        self.public_key()
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature> {
+        // TODO/#2103: Replace this with Ed25519ctx.
+        let digest = Hash::digest_bytes_list(&[context, message]);
+
+        Ok(Signature(self.0.sign(digest.as_ref()).to_bytes()))
+    }
+}
+
+impl_bytes!(Signature, 64, "An Ed25519 signature.");
+
+impl Signature {
+    /// Verify signature.
+    pub fn verify(&self, pk: &PublicKey, context: &[u8], message: &[u8]) -> Result<()> {
+        // Apply the Oasis core specific domain separation.
+        //
+        // Note: This should be Ed25519ctx based but "muh Ledger".
+        let digest = Hash::digest_bytes_list(&[context, message]);
+
+        self.verify_raw(pk, digest.as_ref())
+    }
+
+    /// Verify signature without applying domain separation.
+    #[allow(non_snake_case)] // Variable names matching RFC 8032 is more readable.
+    pub fn verify_raw(&self, pk: &PublicKey, msg: &[u8]) -> Result<()> {
+        // We have a very specific idea of what a valid Ed25519 signature
+        // is, that is different from what ed25519-dalek defines, so this
+        // needs to be done by hand.
+
+        // Decompress A (PublicKey)
+        //
+        // TODO/perf:
+        //  * PublicKey could just be an EdwardsPoint.
+        //  * Could cache the results of is_small_order() in PublicKey.
+        let A = CompressedEdwardsY::from_slice(pk.as_ref())
+            .map_err(|_| SignatureError::PointDecompression)?;
+        let A = A.decompress().ok_or(SignatureError::PointDecompression)?;
+        if A.is_small_order() {
+            return Err(SignatureError::SmallOrderA.into());
+        }
+
+        // Decompress R (signature point), S (signature scalar).
+        //
+        // Note:
+        //  * Reject S > L, small order A/R
+        //  * Accept non-canonical A/R
+        let sig_slice = self.as_ref();
+        let R_bits = &sig_slice[..32];
+        let S_bits = &sig_slice[32..];
+
+        let R = CompressedEdwardsY::from_slice(R_bits)
+            .map_err(|_| SignatureError::PointDecompression)?;
+        let R = R.decompress().ok_or(SignatureError::PointDecompression)?;
+        if R.is_small_order() {
+            return Err(SignatureError::SmallOrderR.into());
+        }
+
+        if !sc_minimal(S_bits) {
+            return Err(SignatureError::Malleability.into());
+        }
+        let mut S: [u8; 32] = [0u8; 32];
+        S.copy_from_slice(S_bits);
+        #[allow(deprecated)] // S is only used for vartime_double_scalar_mul_basepoint.
+        let S = Scalar::from_bits(S);
+
+        // k = H(R,A,m)
+        let mut k: Sha512 = Sha512::new();
+        k.update(R_bits);
+        k.update(pk.as_ref());
+        k.update(msg);
+        let k = Scalar::from_hash(k);
+
+        // Check the cofactored group equation ([8][S]B = [8]R + [8][k]A').
+        let neg_A = -A;
+        let should_be_small_order =
+            EdwardsPoint::vartime_double_scalar_mul_basepoint(&k, &neg_A, &S) - R;
+        match should_be_small_order.is_small_order() {
+            true => Ok(()),
+            false => Err(SignatureError::InvalidSignature.into()),
+        }
+    }
+}
+
+/// Blob signed with one public key.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Signed {
+    /// Signed blob.
+    #[cbor(rename = "untrusted_raw_value")]
+    pub blob: Vec<u8>,
+    /// Signature over the blob.
+    pub signature: SignatureBundle,
+}
+
+/// Blob signed by multiple public keys.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct MultiSigned {
+    /// Signed blob.
+    #[cbor(rename = "untrusted_raw_value")]
+    pub blob: Vec<u8>,
+    /// Signatures over the blob.
+    pub signatures: Vec<SignatureBundle>,
+}
+
+/// A signature bundled with a public key.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct SignatureBundle {
+    /// Public key that produced the signature.
+    pub public_key: PublicKey,
+    /// Actual signature.
+    pub signature: Signature,
+}
+
+impl SignatureBundle {
+    /// Verify returns true iff the signature is valid over the given context
+    /// and message.
+    pub fn verify(&self, context: &[u8], message: &[u8]) -> bool {
+        self.signature
+            .verify(&self.public_key, context, message)
+            .is_ok()
+    }
+}
+
+/// A abstract signer.
+pub trait Signer: Send + Sync {
+    /// Returns the public key corresponding to the signer.
+    fn public(&self) -> PublicKey;
+
+    /// Generates a signature over the context and message.
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature>;
+}
+
+// Check if s < L, per RFC 8032, inspired by the Go runtime library's version
+// of this check.
+fn sc_minimal(raw_s: &[u8]) -> bool {
+    let mut rd = Cursor::new(raw_s);
+    let mut s = [0u64; 4];
+
+    // Read the raw scalar into limbs, and reverse it, because the raw
+    // representation is little-endian.
+    rd.read_u64_into::<LittleEndian>(&mut s[..]).unwrap();
+    s.reverse();
+
+    // Compare each limb, from most significant to least.
+    for i in 0..4 {
+        match s[i].cmp(&CURVE_ORDER[i]) {
+            Ordering::Greater => return false,
+            Ordering::Less => return true,
+            Ordering::Equal => {}
+        }
+    }
+
+    // The scalar is equal to the order of the curve.
+    false
+}
+
+/// Extends signature context with additional domain separation based on the runtime ID.
+pub fn signature_context_with_runtime_separation(
+    mut context: Vec<u8>,
+    runtime_id: &Namespace,
+) -> Vec<u8> {
+    context.extend(RUNTIME_SIGNATURE_CONTEXT_SEPARATOR);
+    context.extend(runtime_id.0);
+    context
+}
+
+/// Extends signature context with additional domain separation based on the chain context.
+pub fn signature_context_with_chain_separation(
+    mut context: Vec<u8>,
+    chain_context: &String,
+) -> Vec<u8> {
+    context.extend(CHAIN_SIGNATURE_CONTEXT_SEPARATOR);
+    context.extend(chain_context.as_bytes());
+    context
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use rustc_hex::FromHex;
+
+    #[test]
+    fn test_sc_minimal() {
+        // L - 2^0
+        assert!(sc_minimal(&[
+            0xec, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9,
+            0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x10
+        ]));
+
+        // L - 2^64
+        assert!(sc_minimal(&[
+            0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd5, 0x9c, 0xf7, 0xa2, 0xde, 0xf9,
+            0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x10
+        ]));
+
+        // L - 2^192
+        assert!(sc_minimal(&[
+            0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd5, 0x9c, 0xf7, 0xa2, 0xde, 0xf9,
+            0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+            0xff, 0xff, 0xff, 0x0f,
+        ]));
+
+        // L
+        assert!(!sc_minimal(&[
+            0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9,
+            0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x10
+        ]));
+
+        // L + 2^0
+        assert!(!sc_minimal(&[
+            0xef, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9,
+            0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x10
+        ]));
+
+        // L + 2^64
+        assert!(!sc_minimal(&[
+            0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd7, 0x9c, 0xf7, 0xa2, 0xde, 0xf9,
+            0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x10
+        ]));
+
+        // L + 2^128
+        assert!(!sc_minimal(&[
+            0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9,
+            0xde, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x10
+        ]));
+
+        // L + 2^192
+        assert!(!sc_minimal(&[
+            0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9,
+            0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+            0x00, 0x00, 0x00, 0x10
+        ]));
+
+        // Scalar from the go runtime's test case.
+        assert!(!sc_minimal(&[
+            0x67, 0x65, 0x4b, 0xce, 0x38, 0x32, 0xc2, 0xd7, 0x6f, 0x8f, 0x6f, 0x5d, 0xaf, 0xc0,
+            0x8d, 0x93, 0x39, 0xd4, 0xee, 0xf6, 0x76, 0x57, 0x33, 0x36, 0xa5, 0xc5, 0x1e, 0xb6,
+            0xf9, 0x46, 0xb3, 0x1d,
+        ]))
+    }
+
+    #[test]
+    fn test_private_key_to_bytes() {
+        let secret = PrivateKey::generate();
+        let bytes = secret.to_bytes();
+        let from_bytes = PrivateKey::from_bytes(bytes);
+        assert_eq!(secret.public_key(), from_bytes.public_key());
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_private_key_to_bytes_malformed_a() {
+        PrivateKey::from_bytes(vec![]);
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_private_key_to_bytes_malformed_b() {
+        PrivateKey::from_bytes(vec![1, 2, 3]);
+    }
+
+    #[test]
+    fn verification_small_order_a() {
+        // Case 1 from ed25519-speccheck
+        let pbk = "c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa";
+        let msg = "9bd9f44f4dcc75bd531b56b2cd280b0bb38fc1cd6d1230e14861d861de092e79";
+        let sig = "f7badec5b8abeaf699583992219b7b223f1df3fbbea919844e3f7c554a43dd43a5bb704786be79fc476f91d3f3f89b03984d8068dcf1bb7dfc6637b45450ac04";
+
+        let pbk: Vec<u8> = pbk.from_hex().unwrap();
+        let msg: Vec<u8> = msg.from_hex().unwrap();
+        let sig: Vec<u8> = sig.from_hex().unwrap();
+
+        let pbk = PublicKey::from(pbk);
+        let sig = Signature::from(sig);
+
+        assert!(
+            sig.verify_raw(&pbk, &msg).is_err(),
+            "small order A not rejected"
+        )
+    }
+
+    #[test]
+    fn verification_small_order_r() {
+        // Case 2 from ed25519-speccheck
+        let pbk = "f7badec5b8abeaf699583992219b7b223f1df3fbbea919844e3f7c554a43dd43";
+        let msg = "aebf3f2601a0c8c5d39cc7d8911642f740b78168218da8471772b35f9d35b9ab";
+        let sig = "c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa8c4bd45aecaca5b24fb97bc10ac27ac8751a7dfe1baff8b953ec9f5833ca260e";
+
+        let pbk: Vec<u8> = pbk.from_hex().unwrap();
+        let msg: Vec<u8> = msg.from_hex().unwrap();
+        let sig: Vec<u8> = sig.from_hex().unwrap();
+
+        let pbk = PublicKey::from(pbk);
+        let sig = Signature::from(sig);
+
+        assert!(
+            sig.verify_raw(&pbk, &msg).is_err(),
+            "small order R not rejected"
+        )
+    }
+
+    #[test]
+    fn verification_is_cofactored() {
+        // Case 4 from ed25519-speccheck
+        let pbk = "cdb267ce40c5cd45306fa5d2f29731459387dbf9eb933b7bd5aed9a765b88d4d";
+        let msg = "e47d62c63f830dc7a6851a0b1f33ae4bb2f507fb6cffec4011eaccd55b53f56c";
+        let sig = "160a1cb0dc9c0258cd0a7d23e94d8fa878bcb1925f2c64246b2dee1796bed5125ec6bc982a269b723e0668e540911a9a6a58921d6925e434ab10aa7940551a09";
+
+        let pbk: Vec<u8> = pbk.from_hex().unwrap();
+        let msg: Vec<u8> = msg.from_hex().unwrap();
+        let sig: Vec<u8> = sig.from_hex().unwrap();
+
+        let pbk = PublicKey::from(pbk);
+        let sig = Signature::from(sig);
+
+        assert!(
+            sig.verify_raw(&pbk, &msg).is_ok(),
+            "verification is not cofactored(?)"
+        )
+    }
+
+    // Note: It is hard to test rejects small order A/R combined with
+    // accepts non-canonical A/R as there are no known non-small order
+    // points with a non-canonical encoding, that are not also small
+    // order.
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/crypto/x25519.rs.html b/rust/src/oasis_core_runtime/common/crypto/x25519.rs.html new file mode 100644 index 0000000000..d945c42a6a --- /dev/null +++ b/rust/src/oasis_core_runtime/common/crypto/x25519.rs.html @@ -0,0 +1,383 @@ +x25519.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+
//! CBOR serializable X25519 types.
+use anyhow::Result;
+use rand::rngs::OsRng;
+use zeroize::{Zeroize, ZeroizeOnDrop};
+
+use super::hash::Hash;
+
+/// The length of an X25519 private key, in bytes.
+pub const PRIVATE_KEY_LENGTH: usize = 32;
+
+/// The length of an X25519 public key, in bytes.
+pub const PUBLIC_KEY_LENGTH: usize = 32;
+
+/// A CBOR serializable Diffie-Hellman X25519 private key.
+#[derive(Clone, Zeroize, ZeroizeOnDrop)]
+pub struct PrivateKey(pub x25519_dalek::StaticSecret);
+
+impl PrivateKey {
+    /// Generate a new private key.
+    pub fn generate() -> Self {
+        PrivateKey(x25519_dalek::StaticSecret::random_from_rng(OsRng))
+    }
+
+    /// Compute corresponding public key.
+    pub fn public_key(&self) -> PublicKey {
+        PublicKey(x25519_dalek::PublicKey::from(&self.0))
+    }
+
+    /// Generate a new private key from a test key seed.
+    pub fn from_test_seed(seed: String) -> Self {
+        let seed = Hash::digest_bytes(seed.as_bytes());
+        Self::from(seed.0)
+    }
+}
+
+impl From<[u8; PRIVATE_KEY_LENGTH]> for PrivateKey {
+    /// Load private key from a byte array.
+    fn from(bytes: [u8; PRIVATE_KEY_LENGTH]) -> PrivateKey {
+        PrivateKey(x25519_dalek::StaticSecret::from(bytes))
+    }
+}
+
+impl Default for PrivateKey {
+    fn default() -> Self {
+        Self::from([0; PRIVATE_KEY_LENGTH])
+    }
+}
+
+impl AsRef<[u8]> for PrivateKey {
+    fn as_ref(&self) -> &[u8] {
+        self.0.as_ref()
+    }
+}
+
+impl From<PrivateKey> for x25519_dalek::StaticSecret {
+    fn from(sk: PrivateKey) -> Self {
+        sk.0.clone() // `sk` will be zeroized on drop, so clone is ok.
+    }
+}
+
+impl From<x25519_dalek::StaticSecret> for PrivateKey {
+    fn from(sk: x25519_dalek::StaticSecret) -> Self {
+        Self(sk)
+    }
+}
+
+impl cbor::Encode for PrivateKey {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::to_value(self.0.to_bytes())
+    }
+}
+
+impl cbor::Decode for PrivateKey {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Default::default())
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        let mut bytes: [u8; PRIVATE_KEY_LENGTH] = cbor::Decode::try_from_cbor_value(value)?;
+        let sk = PrivateKey(x25519_dalek::StaticSecret::from(bytes));
+        bytes.zeroize();
+        Ok(sk)
+    }
+}
+
+/// A CBOR serializable Diffie-Hellman X25519 public key.
+#[derive(PartialEq, Eq, Hash, Copy, Clone, Debug)]
+pub struct PublicKey(pub x25519_dalek::PublicKey);
+
+impl From<[u8; PUBLIC_KEY_LENGTH]> for PublicKey {
+    /// Load public key from a byte array.
+    fn from(bytes: [u8; PUBLIC_KEY_LENGTH]) -> PublicKey {
+        PublicKey(x25519_dalek::PublicKey::from(bytes))
+    }
+}
+
+impl From<&PrivateKey> for PublicKey {
+    /// Given an X25519 private key, compute its corresponding public key.
+    fn from(sk: &PrivateKey) -> PublicKey {
+        PublicKey(x25519_dalek::PublicKey::from(&sk.0))
+    }
+}
+
+impl Default for PublicKey {
+    fn default() -> Self {
+        Self::from([0; PUBLIC_KEY_LENGTH])
+    }
+}
+
+impl AsRef<[u8]> for PublicKey {
+    fn as_ref(&self) -> &[u8] {
+        self.0.as_ref()
+    }
+}
+
+impl From<PublicKey> for x25519_dalek::PublicKey {
+    fn from(pk: PublicKey) -> Self {
+        pk.0
+    }
+}
+
+impl From<x25519_dalek::PublicKey> for PublicKey {
+    fn from(pk: x25519_dalek::PublicKey) -> Self {
+        Self(pk)
+    }
+}
+
+impl cbor::Encode for PublicKey {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::to_value(*self.0.as_bytes())
+    }
+}
+
+impl cbor::Decode for PublicKey {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Default::default())
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        let bytes: [u8; PUBLIC_KEY_LENGTH] = cbor::Decode::try_from_cbor_value(value)?;
+        let pk = PublicKey(x25519_dalek::PublicKey::from(bytes));
+        Ok(pk)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use crate::common::crypto::x25519::{PrivateKey, PublicKey, PRIVATE_KEY_LENGTH};
+
+    #[test]
+    fn test_cbor_serialization() {
+        let sk = PrivateKey::from([1; PRIVATE_KEY_LENGTH]);
+        let pk = PublicKey::from(&sk);
+
+        // Encode/decode private key.
+        let enc = cbor::to_vec(sk.clone());
+        let dec: PrivateKey = cbor::from_slice(&enc).expect("deserialization should succeed");
+        assert_eq!(
+            sk.0.to_bytes(),
+            dec.0.to_bytes(),
+            "serialization should round-trip"
+        );
+
+        // Encode/decode public key.
+        let enc = cbor::to_vec(pk.clone());
+        let dec: PublicKey = cbor::from_slice(&enc).expect("deserialization should succeed");
+        assert_eq!(
+            pk.0.to_bytes(),
+            dec.0.to_bytes(),
+            "serialization should round-trip"
+        );
+    }
+
+    #[test]
+    fn test_zeroize_on_drop() {
+        // Prepare private key.
+        let private_key_ptr;
+        {
+            let private_key = PrivateKey([10; 32].into());
+            private_key_ptr = private_key.0.as_bytes().as_ptr();
+        }
+
+        // Access the elements of the private key using pointer
+        // arithmetic and verify that they are all zero.
+        unsafe {
+            for i in 0..32 {
+                assert_eq!(*private_key_ptr.add(i), 0);
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/key_format.rs.html b/rust/src/oasis_core_runtime/common/key_format.rs.html new file mode 100644 index 0000000000..460158be4b --- /dev/null +++ b/rust/src/oasis_core_runtime/common/key_format.rs.html @@ -0,0 +1,593 @@ +key_format.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+
use std::{convert::TryInto, mem::size_of};
+
+use impl_trait_for_tuples::impl_for_tuples;
+
+/// Size of the KeyFormat prefix.
+const KEY_FORMAT_PREFIX_SIZE: usize = size_of::<u8>();
+
+/// A key formatting helper trait to be used together with key-value
+/// backends for constructing keys.
+pub trait KeyFormat {
+    /// The prefix that identifies the key format.
+    fn prefix() -> u8;
+
+    /// The minimum size of the encoded key.
+    fn size() -> usize;
+
+    /// Encode the given key format into a set of atoms.
+    fn encode_atoms(self, atoms: &mut Vec<Vec<u8>>);
+
+    /// Decode the given key format from data (without prefix).
+    ///
+    /// The caller must ensure that the size of the passed data is at
+    /// least the minimum size returned by `size`.
+    fn decode_atoms(data: &[u8]) -> Self
+    where
+        Self: Sized;
+
+    /// Encode the first few atoms in the key format.
+    ///
+    /// This method can be used to construct key prefixes for iteration.
+    /// Specifying a zero count will only generate the prefix.
+    fn encode_partial(self, count: usize) -> Vec<u8>
+    where
+        Self: Sized,
+    {
+        let mut v = Vec::with_capacity(KEY_FORMAT_PREFIX_SIZE + Self::size());
+        v.push(Self::prefix());
+
+        if count == 0 {
+            return v;
+        }
+
+        let mut atoms = Vec::new();
+        self.encode_atoms(&mut atoms);
+        for (included, mut atom) in atoms.into_iter().enumerate() {
+            if included >= count {
+                break;
+            }
+            v.append(&mut atom);
+        }
+
+        v
+    }
+
+    /// Encode the given key format.
+    fn encode(self) -> Vec<u8>
+    where
+        Self: Sized,
+    {
+        self.encode_partial(usize::MAX)
+    }
+
+    /// Decode the given key format from data.
+    ///
+    /// The method may return `None` in case the key is of a different
+    /// type as indicated by the prefix byte.
+    fn decode(data: &[u8]) -> Option<Self>
+    where
+        Self: Sized,
+    {
+        assert!(!data.is_empty(), "key format: malformed input (empty data)");
+        if data[0] != Self::prefix() {
+            return None;
+        }
+        assert!(
+            data.len() >= Self::size() + KEY_FORMAT_PREFIX_SIZE,
+            "key format: malformed input"
+        );
+
+        Some(Self::decode_atoms(&data[1..]))
+    }
+}
+
+/// Part of the KeyFormat to be used with key-value backends for constructing keys.
+pub trait KeyFormatAtom {
+    fn size() -> usize;
+
+    fn encode_atom(self) -> Vec<u8>;
+
+    fn decode_atom(data: &[u8]) -> Self
+    where
+        Self: Sized;
+}
+
+impl KeyFormatAtom for u64 {
+    fn size() -> usize {
+        8
+    }
+
+    fn encode_atom(self) -> Vec<u8> {
+        self.to_be_bytes().to_vec()
+    }
+
+    fn decode_atom(data: &[u8]) -> Self
+    where
+        Self: Sized,
+    {
+        u64::from_be_bytes(data.try_into().expect("key_format: malformed u64 input"))
+    }
+}
+
+impl KeyFormatAtom for u8 {
+    fn size() -> usize {
+        1
+    }
+
+    fn encode_atom(self) -> Vec<u8> {
+        vec![self]
+    }
+
+    fn decode_atom(data: &[u8]) -> Self
+    where
+        Self: Sized,
+    {
+        assert!(!data.is_empty(), "key_format: malformed: u8 input");
+        data[0]
+    }
+}
+
+impl KeyFormatAtom for () {
+    fn size() -> usize {
+        0
+    }
+
+    fn encode_atom(self) -> Vec<u8> {
+        Vec::new()
+    }
+
+    fn decode_atom(_: &[u8]) {}
+}
+
+#[impl_for_tuples(2, 10)]
+impl KeyFormatAtom for Tuple {
+    fn size() -> usize {
+        for_tuples!( #( Tuple::size() )+* );
+    }
+
+    fn encode_atom(self) -> Vec<u8> {
+        let mut atoms: Vec<Vec<u8>> = [for_tuples!( #( self.Tuple.encode_atom() ),* )].to_vec();
+
+        atoms.into_iter().flatten().collect()
+    }
+
+    fn decode_atom(data: &[u8]) -> for_tuples!( ( #( Tuple ),* ) ) {
+        assert!(
+            data.len() >= Self::size(),
+            "key format atom: malformed input"
+        );
+
+        let mut sizes: Vec<usize> = [for_tuples!( #( Tuple::size() ),* )].to_vec();
+        sizes.reverse();
+        let mut data = data.to_vec();
+
+        /*
+            (
+                {
+                    let x = T1::decode_atom(data.drain(0..T1::size()));
+                    x
+                },
+                {
+                    let x = T2::decode_atom(data.drain(0..T2::size()));
+                    x
+                }
+                ...
+            )
+        */
+        for_tuples!(
+            (
+                #(
+                    {
+                        let x = Tuple::decode_atom(data.drain(0..sizes.pop().unwrap()).as_slice());
+                        x
+                    }
+                ),*
+            )
+        )
+    }
+}
+
+/// Define a KeyFormat from KeyFormatAtom and a prefix.
+///
+/// # Examples
+///
+/// ```rust,ignore
+/// key_format!(NewKeyFormatName, 0x01, InnerType);
+/// ```
+#[macro_export]
+macro_rules! key_format {
+    ($name:ident, $prefix:expr, $inner:ty) => {
+        #[derive(Debug, Default, PartialEq, Eq, Clone)]
+        struct $name($inner);
+
+        impl KeyFormat for $name {
+            fn prefix() -> u8 {
+                $prefix
+            }
+
+            fn size() -> usize {
+                <$inner>::size()
+            }
+
+            fn encode_atoms(self, atoms: &mut Vec<Vec<u8>>) {
+                atoms.push(self.0.encode_atom());
+            }
+
+            fn decode_atoms(data: &[u8]) -> Self {
+                Self(<$inner>::decode_atom(data))
+            }
+        }
+    };
+}
+
+#[cfg(test)]
+mod test {
+    use rustc_hex::ToHex;
+
+    use crate::common::crypto::hash::Hash;
+
+    use super::*;
+
+    #[derive(Debug, PartialEq)]
+    struct Test1KeyFormat {
+        h: Hash,
+    }
+
+    impl KeyFormat for Test1KeyFormat {
+        fn prefix() -> u8 {
+            b'T'
+        }
+
+        fn size() -> usize {
+            32
+        }
+
+        fn encode_atoms(self, atoms: &mut Vec<Vec<u8>>) {
+            atoms.push(self.h.as_ref().to_vec());
+        }
+
+        fn decode_atoms(data: &[u8]) -> Self {
+            Self { h: data.into() }
+        }
+    }
+
+    #[test]
+    fn test_key_format() {
+        let mut enc = Test1KeyFormat {
+            h: Hash::empty_hash(),
+        }
+        .encode();
+        assert_eq!(
+            enc.to_hex::<String>(),
+            "54c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a"
+        );
+
+        let dec = Test1KeyFormat::decode(&enc);
+        assert_eq!(
+            dec,
+            Some(Test1KeyFormat {
+                h: Hash::empty_hash()
+            })
+        );
+
+        // Clear type.
+        enc[0] = 0x00;
+        let dec = Test1KeyFormat::decode(&enc);
+        assert_eq!(dec, None);
+
+        // Partial encoding.
+        let enc = Test1KeyFormat {
+            h: Hash::empty_hash(),
+        }
+        .encode_partial(0);
+        assert_eq!(enc.to_hex::<String>(), "54");
+    }
+
+    #[test]
+    fn test_key_format_atom() {
+        key_format!(TestKeyFormat, 0x01, (u8, u64, u8, u64, u64));
+
+        let key = TestKeyFormat((1, 2, 3, 4, 5));
+        let enc = key.clone().encode();
+        let dec = TestKeyFormat::decode(&enc);
+
+        assert_eq!(dec, Some(key),)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/logger.rs.html b/rust/src/oasis_core_runtime/common/logger.rs.html new file mode 100644 index 0000000000..17108a3510 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/logger.rs.html @@ -0,0 +1,73 @@ +logger.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+
//! Logging subsystem for runtimes.
+use std::sync::{Mutex, Once};
+
+use lazy_static::lazy_static;
+use log::Level;
+use slog::{o, Drain};
+
+lazy_static! {
+    static ref LOGGER: slog::Logger = slog::Logger::root(
+        Mutex::new(slog_json::Json::default(std::io::stderr())).map(slog::Fuse),
+        o!()
+    );
+
+    /// Initializes the global logger once.
+    static ref INIT_GLOBAL_LOGGER: Once = Once::new();
+
+    /// Prevents the global logger from being dropped.
+    static ref GLOBAL_LOGGER_SCOPE_GUARD: Mutex<Option<slog_scope::GlobalLoggerGuard>> = Mutex::new(None);
+}
+
+/// Get the logger.
+pub fn get_logger(module: &'static str) -> slog::Logger {
+    LOGGER.new(o!("module" => module))
+}
+
+/// Initialize the global slog_stdlog adapter to allow logging with the log crate (instead of slog).
+pub fn init_logger(level: Level) {
+    INIT_GLOBAL_LOGGER.call_once(|| {
+        let global_logger = LOGGER.new(o!("module" => "global"));
+        GLOBAL_LOGGER_SCOPE_GUARD
+            .lock()
+            .unwrap()
+            .get_or_insert(slog_scope::set_global_logger(global_logger));
+        slog_stdlog::init_with_level(level).unwrap();
+    });
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/mod.rs.html b/rust/src/oasis_core_runtime/common/mod.rs.html new file mode 100644 index 0000000000..a658da30b8 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/mod.rs.html @@ -0,0 +1,35 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
//! Common types.
+
+#[macro_use]
+pub mod bytes;
+pub mod crypto;
+pub mod key_format;
+pub mod logger;
+pub mod namespace;
+pub mod panic;
+pub mod process;
+pub mod quantity;
+pub mod sgx;
+#[cfg(feature = "tdx")]
+pub mod tdx;
+pub mod time;
+pub mod version;
+pub mod versioned;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/namespace.rs.html b/rust/src/oasis_core_runtime/common/namespace.rs.html new file mode 100644 index 0000000000..d97ccf51a9 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/namespace.rs.html @@ -0,0 +1,13 @@ +namespace.rs - source
1
+2
+3
+4
+5
+6
+
//! Chain namespace.
+
+/// Size of the namespace in bytes.
+pub const NAMESPACE_SIZE: usize = 32;
+
+impl_bytes!(Namespace, NAMESPACE_SIZE, "Chain namespace.");
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/panic.rs.html b/rust/src/oasis_core_runtime/common/panic.rs.html new file mode 100644 index 0000000000..1482368f34 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/panic.rs.html @@ -0,0 +1,33 @@ +panic.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
//! Panic-related functions.
+
+/// A guard that will abort the process if dropped while panicking.
+///
+/// This is to ensure that the runtime will terminate in case there is
+/// a panic encountered during dispatch and the runtime is built with
+/// a non-abort panic handler.
+pub struct AbortOnPanic;
+
+impl Drop for AbortOnPanic {
+    fn drop(&mut self) {
+        if std::thread::panicking() {
+            crate::common::process::abort();
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/process.rs.html b/rust/src/oasis_core_runtime/common/process.rs.html new file mode 100644 index 0000000000..31b80c31f2 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/process.rs.html @@ -0,0 +1,25 @@ +process.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
//! Process-related helpers.
+use std::io::Write;
+
+/// Aborts the process via `std::process::abort`, but also making sure that log buffers are flushed.
+pub fn abort() -> ! {
+    // Attempt to flush buffers to ensure any log output makes it.
+    let _ = std::io::stderr().flush();
+    let _ = std::io::stdout().flush();
+
+    // Abort the process.
+    std::process::abort()
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/quantity.rs.html b/rust/src/oasis_core_runtime/common/quantity.rs.html new file mode 100644 index 0000000000..f17d9473ab --- /dev/null +++ b/rust/src/oasis_core_runtime/common/quantity.rs.html @@ -0,0 +1,627 @@ +quantity.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+
//! An arbitrary precision unsigned integer.
+use std::{
+    convert::TryFrom,
+    fmt,
+    num::IntErrorKind,
+    ops::{Add, AddAssign, Mul, MulAssign},
+};
+
+use num_bigint::BigUint;
+use num_traits::{CheckedDiv, CheckedSub, ToPrimitive, Zero};
+
+/// An arbitrary precision unsigned integer.
+#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub struct Quantity(BigUint);
+
+impl Quantity {
+    /// Subtracts two numbers, checking for underflow. If underflow happens, `None` is returned.
+    #[inline]
+    pub fn checked_sub(&self, other: &Quantity) -> Option<Quantity> {
+        // NOTE: This does not implemented the num_traits::CheckedSub trait because this forces
+        //       one to also implement Sub which we explicitly don't want to do.
+        self.0.checked_sub(&other.0).map(Quantity)
+    }
+
+    /// Divides two numbers, checking for underflow, overflow and division by zero. If any of that
+    /// happens, `None` is returned.
+    #[inline]
+    pub fn checked_div(&self, other: &Quantity) -> Option<Quantity> {
+        // NOTE: This does not implemented the num_traits::CheckedDiv trait because this forces
+        //       one to also implement Div which we explicitly don't want to do.
+        self.0.checked_div(&other.0).map(Quantity)
+    }
+}
+
+impl Zero for Quantity {
+    fn zero() -> Self {
+        Quantity(BigUint::zero())
+    }
+
+    fn is_zero(&self) -> bool {
+        self.0.is_zero()
+    }
+}
+
+impl From<u8> for Quantity {
+    fn from(v: u8) -> Quantity {
+        Quantity(BigUint::from(v))
+    }
+}
+
+impl From<u16> for Quantity {
+    fn from(v: u16) -> Quantity {
+        Quantity(BigUint::from(v))
+    }
+}
+
+impl From<u32> for Quantity {
+    fn from(v: u32) -> Quantity {
+        Quantity(BigUint::from(v))
+    }
+}
+
+impl From<u64> for Quantity {
+    fn from(v: u64) -> Quantity {
+        Quantity(BigUint::from(v))
+    }
+}
+
+impl From<u128> for Quantity {
+    fn from(v: u128) -> Quantity {
+        Quantity(BigUint::from(v))
+    }
+}
+
+impl TryFrom<Quantity> for u64 {
+    type Error = IntErrorKind;
+
+    fn try_from(value: Quantity) -> Result<u64, Self::Error> {
+        value.0.to_u64().ok_or(IntErrorKind::PosOverflow)
+    }
+}
+
+impl TryFrom<&Quantity> for u64 {
+    type Error = IntErrorKind;
+
+    fn try_from(value: &Quantity) -> Result<u64, Self::Error> {
+        value.0.to_u64().ok_or(IntErrorKind::PosOverflow)
+    }
+}
+
+impl TryFrom<Quantity> for u128 {
+    type Error = IntErrorKind;
+
+    fn try_from(value: Quantity) -> Result<u128, Self::Error> {
+        value.0.to_u128().ok_or(IntErrorKind::PosOverflow)
+    }
+}
+
+impl TryFrom<&Quantity> for u128 {
+    type Error = IntErrorKind;
+
+    fn try_from(value: &Quantity) -> Result<u128, Self::Error> {
+        value.0.to_u128().ok_or(IntErrorKind::PosOverflow)
+    }
+}
+
+impl Add for Quantity {
+    type Output = Quantity;
+
+    fn add(mut self, other: Quantity) -> Quantity {
+        self += &other;
+        self
+    }
+}
+
+impl<'a> Add<&'a Quantity> for Quantity {
+    type Output = Quantity;
+
+    fn add(mut self, other: &Quantity) -> Quantity {
+        self += other;
+        self
+    }
+}
+
+impl<'a> AddAssign<&'a Quantity> for Quantity {
+    fn add_assign(&mut self, other: &Quantity) {
+        self.0 += &other.0;
+    }
+}
+
+impl AddAssign<Quantity> for Quantity {
+    fn add_assign(&mut self, other: Quantity) {
+        self.0 += other.0;
+    }
+}
+
+impl Add<u64> for Quantity {
+    type Output = Quantity;
+
+    fn add(mut self, other: u64) -> Quantity {
+        self += other;
+        self
+    }
+}
+
+impl AddAssign<u64> for Quantity {
+    fn add_assign(&mut self, other: u64) {
+        self.0 += other;
+    }
+}
+
+impl Mul for Quantity {
+    type Output = Quantity;
+
+    fn mul(mut self, rhs: Quantity) -> Quantity {
+        self *= &rhs;
+        self
+    }
+}
+
+impl<'a> Mul<&'a Quantity> for Quantity {
+    type Output = Quantity;
+
+    fn mul(mut self, rhs: &Quantity) -> Quantity {
+        self *= rhs;
+        self
+    }
+}
+
+impl<'a> MulAssign<&'a Quantity> for Quantity {
+    fn mul_assign(&mut self, rhs: &Quantity) {
+        self.0 *= &rhs.0;
+    }
+}
+
+impl MulAssign<Quantity> for Quantity {
+    fn mul_assign(&mut self, rhs: Quantity) {
+        self.0 *= rhs.0;
+    }
+}
+
+impl Mul<u64> for Quantity {
+    type Output = Quantity;
+
+    fn mul(mut self, other: u64) -> Quantity {
+        self *= other;
+        self
+    }
+}
+
+impl MulAssign<u64> for Quantity {
+    fn mul_assign(&mut self, other: u64) {
+        self.0 *= other;
+    }
+}
+
+impl fmt::Display for Quantity {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.0.fmt(f)
+    }
+}
+
+impl cbor::Encode for Quantity {
+    fn is_empty(&self) -> bool {
+        self.0.is_zero()
+    }
+
+    fn into_cbor_value(self) -> cbor::Value {
+        if self.0.is_zero() {
+            cbor::Value::ByteString(vec![])
+        } else {
+            cbor::Value::ByteString(self.0.to_bytes_be())
+        }
+    }
+}
+
+impl cbor::Decode for Quantity {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Default::default())
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => Ok(Quantity(BigUint::from_bytes_be(&data))),
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use rustc_hex::ToHex;
+
+    use crate::common::quantity::Quantity;
+
+    #[test]
+    fn test_serialization() {
+        // NOTE: These should be synced with go/common/quantity/quantity_test.go.
+        let cases = vec![
+            (0u128, "40"),
+            (1, "4101"),
+            (10, "410a"),
+            (100, "4164"),
+            (1000, "4203e8"),
+            (1000000, "430f4240"),
+            (18446744073709551615, "48ffffffffffffffff"),
+        ];
+
+        for tc in cases {
+            let q = Quantity::from(tc.0);
+            let enc = cbor::to_vec(q.clone());
+            assert_eq!(enc.to_hex::<String>(), tc.1, "serialization should match");
+
+            let dec: Quantity = cbor::from_slice(&enc).expect("deserialization should succeed");
+            assert_eq!(dec, q, "serialization should round-trip");
+        }
+    }
+
+    #[test]
+    fn test_ops() {
+        // Add.
+        assert_eq!(
+            Quantity::from(1000u32) + Quantity::from(2000u32),
+            Quantity::from(3000u32)
+        );
+
+        let mut a = Quantity::from(1000u32);
+        a += Quantity::from(42u32);
+        assert_eq!(a, Quantity::from(1042u32));
+        a += &Quantity::from(42u32);
+        assert_eq!(a, Quantity::from(1084u32));
+
+        let mut a = Quantity::from(1000u32);
+        a += 42;
+        assert_eq!(a, Quantity::from(1042u32));
+
+        // Sub.
+        let a = Quantity::from(1000u32);
+        assert_eq!(
+            a.checked_sub(&Quantity::from(42u32)),
+            Some(Quantity::from(958u32))
+        );
+        assert_eq!(a.checked_sub(&Quantity::from(1100u32)), None);
+
+        // Mul.
+        assert_eq!(
+            Quantity::from(1000u32) * Quantity::from(1000u32),
+            Quantity::from(1_000_000u32)
+        );
+
+        let mut a = Quantity::from(1000u32);
+        a *= Quantity::from(1000u32);
+        assert_eq!(a, Quantity::from(1_000_000u32));
+        a *= &Quantity::from(1000u32);
+        assert_eq!(a, Quantity::from(1_000_000_000u32));
+
+        let mut a = Quantity::from(1000u32);
+        a *= 1000;
+        assert_eq!(a, Quantity::from(1_000_000u32));
+
+        // Div.
+        let a = Quantity::from(1000u32);
+        assert_eq!(
+            a.checked_div(&Quantity::from(3u32)),
+            Some(Quantity::from(333u32))
+        );
+        assert_eq!(
+            a.checked_div(&Quantity::from(1001u32)),
+            Some(Quantity::from(0u32))
+        );
+        assert_eq!(a.checked_div(&Quantity::from(0u32)), None);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/egetkey.rs.html b/rust/src/oasis_core_runtime/common/sgx/egetkey.rs.html new file mode 100644 index 0000000000..cbd402e138 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/egetkey.rs.html @@ -0,0 +1,213 @@ +egetkey.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+
//! SGX per-CPU package sealing key accessor.
+
+use sgx_isa::Keypolicy;
+use sp800_185::KMac;
+
+#[cfg(target_env = "sgx")]
+use sgx_isa::{Keyname, Keyrequest};
+#[cfg(target_env = "sgx")]
+use tiny_keccak::{Hasher, Sha3};
+
+const SEAL_KDF_CUSTOM: &[u8] = b"Ekiden Expand SGX Seal Key";
+
+cfg_if::cfg_if! {
+    if #[cfg(target_env = "sgx")] {
+        fn egetkey_impl(key_policy: Keypolicy, context: &[u8]) -> [u8; 16] {
+            let mut req = Keyrequest::default();
+
+            req.keyname = Keyname::Seal as u16;
+            req.keypolicy = key_policy;
+
+            let mut sha3 = Sha3::v256();
+            sha3.update(context);
+            let mut k = [0; 32];
+            sha3.finalize(&mut k);
+            req.keyid = k;
+
+            // Fucking sgx_isa::Attributes doesn't have a -> [u64;2].
+            req.attributemask[0] = 1 | 2 | 4; // SGX_FLAGS_INITTED | SGX_FLAGS_DEBUG | SGX_FLAGS_MODE64BIT
+            req.attributemask[1] = 3; // SGX_XFRM_LEGACY
+
+            match req.egetkey() {
+                Err(e) => panic!("EGETKEY failed: {:?}", e),
+                Ok(k) => k,
+            }
+        }
+    } else if #[cfg(feature = "tdx")] {
+        fn egetkey_impl(_key_policy: Keypolicy, _context: &[u8]) -> [u8; 16] {
+            unimplemented!("EGETKEY not implemented for TDX");
+        }
+    } else {
+        const MOCK_MRENCLAVE_KEY: &[u8] = b"Ekiden Test MRENCLAVE KEY";
+        const MOCK_MRSIGNER_KEY: &[u8] = b"Ekiden Test MRSIGNER KEY";
+        const MOCK_KDF_CUSTOM: &[u8] = b"Ekiden Extract Test SGX Seal Key";
+
+        fn egetkey_impl(key_policy: Keypolicy, context: &[u8]) -> [u8; 16] {
+            let mut k = [0u8; 16];
+
+            // Deterministically generate a test master key from the context.
+            let mut kdf = match key_policy {
+                Keypolicy::MRENCLAVE => KMac::new_kmac256(MOCK_MRENCLAVE_KEY, MOCK_KDF_CUSTOM),
+                Keypolicy::MRSIGNER => KMac::new_kmac256(MOCK_MRSIGNER_KEY, MOCK_KDF_CUSTOM),
+                _ => panic!("Invalid key_policy"),
+            };
+            kdf.update(context);
+            kdf.finalize(&mut k);
+
+            k
+        }
+    }
+}
+
+/// egetkey returns a 256 bit key suitable for sealing secrets to the
+/// enclave in cold storage, derived from the results of the `EGETKEY`
+/// instruction.  The `context` field is a domain separation tag.
+///
+/// Note: The key can also be used for other things (eg: as an X25519
+/// private key).
+pub fn egetkey(key_policy: Keypolicy, context: &[u8]) -> [u8; 32] {
+    let mut k = [0u8; 32];
+
+    // Obtain the per-CPU package SGX sealing key, with the requested
+    // policy.
+    let master_secret = egetkey_impl(key_policy, context);
+
+    // Expand the 128 bit EGETKEY result into a 256 bit key, suitable
+    // for use with our MRAE primitives.
+    let mut kdf = KMac::new_kmac256(&master_secret, SEAL_KDF_CUSTOM);
+    kdf.update(context);
+    kdf.finalize(&mut k);
+
+    k
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_egetkey() {
+        // Ensure key policies works.
+        let mr_signer_key = egetkey(Keypolicy::MRSIGNER, b"MRSIGNER");
+        assert!(mr_signer_key != [0u8; 32]);
+        let mr_enclave_key = egetkey(Keypolicy::MRENCLAVE, b"MRENCLAVE");
+        assert!(mr_enclave_key != [0u8; 32]);
+        assert!(mr_signer_key != mr_enclave_key);
+
+        // Ensure the context does something.
+        let a_key = egetkey(Keypolicy::MRENCLAVE, b"Context A");
+        let b_key = egetkey(Keypolicy::MRENCLAVE, b"Context B");
+        assert!(a_key != b_key);
+
+        // Ensure determinism.
+        let aa_key = egetkey(Keypolicy::MRENCLAVE, b"Context A");
+        assert!(a_key == aa_key);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/ias.rs.html b/rust/src/oasis_core_runtime/common/sgx/ias.rs.html new file mode 100644 index 0000000000..06b8c433af --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/ias.rs.html @@ -0,0 +1,1413 @@ +ias.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+
//! Intel Attestation Service (IAS) attestation verification report handling.
+use std::io::{Cursor, Read, Seek, SeekFrom};
+
+use anyhow::{anyhow, Result};
+use base64::prelude::*;
+use byteorder::{LittleEndian, ReadBytesExt};
+use chrono::prelude::*;
+use lazy_static::lazy_static;
+use oid_registry::{OID_PKCS1_RSAENCRYPTION, OID_PKCS1_SHA256WITHRSA};
+use rsa::{pkcs1::DecodeRsaPublicKey, pkcs1v15::Pkcs1v15Sign, RsaPublicKey};
+use sgx_isa::{AttributesFlags, Report};
+use sha2::{digest::Update as _, Digest, Sha256};
+use thiserror::Error;
+use x509_parser::prelude::*;
+
+use crate::common::{
+    sgx::{EnclaveIdentity, MrEnclave, MrSigner, VerifiedQuote},
+    time::{insecure_posix_time, update_insecure_posix_time},
+};
+
+/// AVR verification error.
+#[derive(Error, Debug)]
+enum AVRError {
+    #[error("failed to parse report body")]
+    MalformedReportBody,
+    #[error("report body did not contain timestamp")]
+    MissingTimestamp,
+    #[error("failed to parse timestamp")]
+    MalformedTimestamp,
+    #[error("timestamp differs by more than 1 day")]
+    TimestampOutOfRange,
+    #[error("rejecting quote status ({status:?})")]
+    QuoteStatusInvalid { status: String },
+    #[error("debug enclaves not allowed")]
+    DebugEnclave,
+    #[error("production enclaves not allowed")]
+    ProductionEnclave,
+    #[error("AVR did not contain quote status")]
+    MissingQuoteStatus,
+    #[error("AVR did not contain quote body")]
+    MissingQuoteBody,
+    #[error("failed to parse quote")]
+    MalformedQuote,
+    #[error("unable to find exactly 2 certificates")]
+    ChainNotTwoCertificates,
+    #[error("malformed certificate PEM")]
+    MalformedCertificatePEM,
+    #[error("malformed certificate DER")]
+    MalformedCertificateDER,
+    #[error("expired certificate")]
+    ExpiredCertificate,
+    #[error("invalid signature")]
+    InvalidSignature,
+    #[error("IAS quotes are disabled by policy")]
+    Disabled,
+    #[error("blacklisted IAS quote GID")]
+    BlacklistedGID,
+    #[error("TCB evaluation data number is invalid")]
+    TCBEvaluationDataNumberInvalid,
+}
+
+pub const QUOTE_CONTEXT_LEN: usize = 8;
+/// The purpose of `QuoteContext` is to prevent quotes from being used in
+/// different contexts. The value is included as a prefix in report data.
+pub type QuoteContext = [u8; QUOTE_CONTEXT_LEN];
+
+// AVR signature validation constants.
+const IAS_TRUST_ANCHOR_PEM: &str = r#"-----BEGIN CERTIFICATE-----
+MIIFSzCCA7OgAwIBAgIJANEHdl0yo7CUMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNV
+BAYTAlVTMQswCQYDVQQIDAJDQTEUMBIGA1UEBwwLU2FudGEgQ2xhcmExGjAYBgNV
+BAoMEUludGVsIENvcnBvcmF0aW9uMTAwLgYDVQQDDCdJbnRlbCBTR1ggQXR0ZXN0
+YXRpb24gUmVwb3J0IFNpZ25pbmcgQ0EwIBcNMTYxMTE0MTUzNzMxWhgPMjA0OTEy
+MzEyMzU5NTlaMH4xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEUMBIGA1UEBwwL
+U2FudGEgQ2xhcmExGjAYBgNVBAoMEUludGVsIENvcnBvcmF0aW9uMTAwLgYDVQQD
+DCdJbnRlbCBTR1ggQXR0ZXN0YXRpb24gUmVwb3J0IFNpZ25pbmcgQ0EwggGiMA0G
+CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQCfPGR+tXc8u1EtJzLA10Feu1Wg+p7e
+LmSRmeaCHbkQ1TF3Nwl3RmpqXkeGzNLd69QUnWovYyVSndEMyYc3sHecGgfinEeh
+rgBJSEdsSJ9FpaFdesjsxqzGRa20PYdnnfWcCTvFoulpbFR4VBuXnnVLVzkUvlXT
+L/TAnd8nIZk0zZkFJ7P5LtePvykkar7LcSQO85wtcQe0R1Raf/sQ6wYKaKmFgCGe
+NpEJUmg4ktal4qgIAxk+QHUxQE42sxViN5mqglB0QJdUot/o9a/V/mMeH8KvOAiQ
+byinkNndn+Bgk5sSV5DFgF0DffVqmVMblt5p3jPtImzBIH0QQrXJq39AT8cRwP5H
+afuVeLHcDsRp6hol4P+ZFIhu8mmbI1u0hH3W/0C2BuYXB5PC+5izFFh/nP0lc2Lf
+6rELO9LZdnOhpL1ExFOq9H/B8tPQ84T3Sgb4nAifDabNt/zu6MmCGo5U8lwEFtGM
+RoOaX4AS+909x00lYnmtwsDVWv9vBiJCXRsCAwEAAaOByTCBxjBgBgNVHR8EWTBX
+MFWgU6BRhk9odHRwOi8vdHJ1c3RlZHNlcnZpY2VzLmludGVsLmNvbS9jb250ZW50
+L0NSTC9TR1gvQXR0ZXN0YXRpb25SZXBvcnRTaWduaW5nQ0EuY3JsMB0GA1UdDgQW
+BBR4Q3t2pn680K9+QjfrNXw7hwFRPDAfBgNVHSMEGDAWgBR4Q3t2pn680K9+Qjfr
+NXw7hwFRPDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADANBgkq
+hkiG9w0BAQsFAAOCAYEAeF8tYMXICvQqeXYQITkV2oLJsp6J4JAqJabHWxYJHGir
+IEqucRiJSSx+HjIJEUVaj8E0QjEud6Y5lNmXlcjqRXaCPOqK0eGRz6hi+ripMtPZ
+sFNaBwLQVV905SDjAzDzNIDnrcnXyB4gcDFCvwDFKKgLRjOB/WAqgscDUoGq5ZVi
+zLUzTqiQPmULAQaB9c6Oti6snEFJiCQ67JLyW/E83/frzCmO5Ru6WjU4tmsmy8Ra
+Ud4APK0wZTGtfPXU7w+IBdG5Ez0kE1qzxGQaL4gINJ1zMyleDnbuS8UicjJijvqA
+152Sq049ESDz+1rRGc2NVEqh1KaGXmtXvqxXcTB+Ljy5Bw2ke0v8iGngFBPqCTVB
+3op5KBG3RjbF6RRSzwzuWfL7QErNC8WEy5yDVARzTA5+xmBc388v9Dm21HGfcC8O
+DD+gT9sSpssq0ascmvH49MOgjt1yoysLtdCtJW/9FZpoOypaHx0R+mJTLwPXVMrv
+DaVzWh5aiEx+idkSGMnX
+-----END CERTIFICATE-----"#;
+const PEM_CERTIFICATE_LABEL: &str = "CERTIFICATE";
+const IAS_TS_FMT: &str = "%FT%T%.6f";
+lazy_static! {
+    static ref IAS_TRUST_ANCHOR: Vec<u8> = {
+        let pem = match parse_x509_pem(IAS_TRUST_ANCHOR_PEM.as_bytes()) {
+            Ok((rem, pem)) => {
+                assert!(rem.is_empty(), "anchor PEM has trailing garbage");
+                assert!(
+                    pem.label == PEM_CERTIFICATE_LABEL,
+                    "PEM does not contain a certificate: '{:?}'",
+                    pem.label
+                );
+                pem
+            }
+            err => panic!("failed to decode anchor PEM: {:?}", err),
+        };
+
+        pem.contents.to_vec()
+    };
+}
+
+/// Quote validity policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct QuotePolicy {
+    /// Whether IAS quotes are disabled and will always be rejected.
+    #[cbor(optional)]
+    pub disabled: bool,
+
+    /// Allowed quote statuses.
+    ///
+    /// Note: QuoteOK and QuoteSwHardeningNeeded are ALWAYS allowed, and do not need to be
+    /// specified.
+    #[cbor(optional)]
+    pub allowed_quote_statuses: Vec<i64>, // TODO: Define ISVEnclaveQuoteStatus type.
+
+    /// List of blocked platform EPID group IDs.
+    #[cbor(optional)]
+    pub gid_blacklist: Vec<u32>,
+
+    /// The minimum TCB evaluation data number that should be accepted.
+    #[cbor(optional)]
+    pub min_tcb_evaluation_data_number: u32,
+}
+
+/// Decoded quote body.
+#[derive(Default, Debug)]
+struct QuoteBody {
+    version: u16,
+    signature_type: u16,
+    gid: u32,
+    isv_svn_qe: u16,
+    isv_svn_pce: u16,
+    basename: [u8; 32],
+    report_body: Report,
+}
+
+#[allow(clippy::unused_io_amount)]
+impl QuoteBody {
+    /// Decode quote body.
+    fn decode(quote_body: &[u8]) -> Result<QuoteBody> {
+        let mut reader = Cursor::new(quote_body);
+        let mut quote_body: QuoteBody = QuoteBody::default();
+
+        // TODO: Should we ensure that reserved bytes are all zero?
+
+        // Quote body.
+        quote_body.version = reader.read_u16::<LittleEndian>()?;
+        quote_body.signature_type = reader.read_u16::<LittleEndian>()?;
+        quote_body.gid = reader.read_u32::<LittleEndian>()?;
+        quote_body.isv_svn_qe = reader.read_u16::<LittleEndian>()?;
+        quote_body.isv_svn_pce = reader.read_u16::<LittleEndian>()?;
+        reader.seek(SeekFrom::Current(4))?; // 4 reserved bytes.
+        reader.read_exact(&mut quote_body.basename)?;
+
+        // Report body.
+        let mut report_buf = vec![0; Report::UNPADDED_SIZE];
+        reader.read(&mut report_buf)?;
+        quote_body.report_body = match Report::try_copy_from(&report_buf) {
+            Some(r) => r,
+            None => return Err(AVRError::MalformedReportBody.into()),
+        };
+
+        Ok(quote_body)
+    }
+}
+
+/// Attestation verification report.
+#[derive(Debug, Default, Clone, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct AVR {
+    pub body: Vec<u8>,
+    pub signature: Vec<u8>,
+    pub certificate_chain: Vec<u8>,
+}
+
+/// Parsed AVR body.
+#[derive(Debug, Clone)]
+pub(crate) struct ParsedAVR {
+    body: serde_json::Value,
+}
+
+impl ParsedAVR {
+    pub(crate) fn new(avr: &AVR) -> Result<Self> {
+        let body = match serde_json::from_slice(&avr.body) {
+            Ok(avr_body) => avr_body,
+            _ => return Err(AVRError::MalformedReportBody.into()),
+        };
+        Ok(Self { body })
+    }
+
+    fn isv_enclave_quote_status(&self) -> Result<String> {
+        match self.body["isvEnclaveQuoteStatus"].as_str() {
+            Some(status) => Ok(status.to_string()),
+            None => Err(AVRError::MissingQuoteStatus.into()),
+        }
+    }
+
+    fn isv_enclave_quote_body(&self) -> Result<String> {
+        match self.body["isvEnclaveQuoteBody"].as_str() {
+            Some(quote_body) => Ok(quote_body.to_string()),
+            None => Err(AVRError::MissingQuoteBody.into()),
+        }
+    }
+
+    fn tcb_evaluation_data_number(&self) -> Result<u32> {
+        match self.body["tcbEvaluationDataNumber"].as_u64() {
+            None => Ok(0),
+            Some(eval_num) if eval_num > u32::MAX.into() => {
+                Err(AVRError::TCBEvaluationDataNumberInvalid.into())
+            }
+            Some(eval_num) => Ok(eval_num as u32),
+        }
+    }
+
+    fn timestamp(&self) -> Result<i64> {
+        let timestamp = match self.body["timestamp"].as_str() {
+            Some(timestamp) => timestamp,
+            None => {
+                return Err(AVRError::MissingTimestamp.into());
+            }
+        };
+        parse_avr_timestamp(timestamp)
+    }
+}
+
+/// Verify attestation report.
+pub fn verify(avr: &AVR, policy: &QuotePolicy) -> Result<VerifiedQuote> {
+    if policy.disabled {
+        return Err(AVRError::Disabled.into());
+    }
+
+    let unsafe_skip_avr_verification = option_env!("OASIS_UNSAFE_SKIP_AVR_VERIFY").is_some();
+    let unsafe_lax_avr_verification = option_env!("OASIS_UNSAFE_LAX_AVR_VERIFY").is_some();
+
+    // Get the time.
+    let timestamp_now = insecure_posix_time();
+
+    // Verify IAS signature.
+    if !unsafe_skip_avr_verification {
+        validate_avr_signature(
+            &avr.certificate_chain,
+            &avr.body,
+            &avr.signature,
+            timestamp_now as u64,
+        )?;
+    }
+
+    // Parse AV report body.
+    let avr_body = ParsedAVR::new(avr)?;
+
+    // Check timestamp, reject if report is too old.
+    let timestamp = avr_body.timestamp()?;
+    if !timestamp_is_fresh(timestamp_now, timestamp) {
+        return Err(AVRError::TimestampOutOfRange.into());
+    }
+
+    let quote_status = avr_body.isv_enclave_quote_status()?;
+    match quote_status.as_str() {
+        "OK" | "SW_HARDENING_NEEDED" => {}
+        "GROUP_OUT_OF_DATE" | "CONFIGURATION_NEEDED" | "CONFIGURATION_AND_SW_HARDENING_NEEDED" => {
+            if !unsafe_lax_avr_verification {
+                return Err(AVRError::QuoteStatusInvalid {
+                    status: quote_status.to_owned(),
+                }
+                .into());
+            }
+        }
+        _ => {
+            return Err(AVRError::QuoteStatusInvalid {
+                status: quote_status.to_owned(),
+            }
+            .into());
+        }
+    };
+
+    let quote_body = avr_body.isv_enclave_quote_body()?;
+    let quote_body = match BASE64_STANDARD.decode(quote_body) {
+        Ok(quote_body) => quote_body,
+        _ => return Err(AVRError::MalformedQuote.into()),
+    };
+    let quote_body = match QuoteBody::decode(&quote_body) {
+        Ok(quote_body) => quote_body,
+        _ => return Err(AVRError::MalformedQuote.into()),
+    };
+
+    // Verify EPID GID not blacklisted.
+    if policy
+        .gid_blacklist
+        .iter()
+        .any(|gid| gid == &quote_body.gid)
+    {
+        return Err(AVRError::BlacklistedGID.into());
+    }
+
+    // Disallow debug enclaves, if we are in production environment and disallow production enclaves,
+    // if we are in debug environment.
+    let is_debug = quote_body
+        .report_body
+        .attributes
+        .flags
+        .contains(AttributesFlags::DEBUG);
+    let allow_debug = option_env!("OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES").is_some();
+    if is_debug && !allow_debug {
+        return Err(AVRError::DebugEnclave.into());
+    } else if !is_debug && allow_debug {
+        return Err(AVRError::ProductionEnclave.into());
+    }
+
+    // If the minimum TCB evaluation data number is present in the policy,
+    // then the report's shouldn't be too low.
+    if avr_body.tcb_evaluation_data_number()? < policy.min_tcb_evaluation_data_number {
+        return Err(AVRError::TCBEvaluationDataNumberInvalid.into());
+    }
+
+    // Force-ratchet the clock forward, to at least the time in the AVR.
+    update_insecure_posix_time(timestamp);
+
+    Ok(VerifiedQuote {
+        report_data: quote_body.report_body.reportdata.to_vec(),
+        identity: EnclaveIdentity {
+            mr_enclave: MrEnclave::from(quote_body.report_body.mrenclave.to_vec()),
+            mr_signer: MrSigner::from(quote_body.report_body.mrsigner.to_vec()),
+        },
+        timestamp,
+    })
+}
+
+fn parse_avr_timestamp(timestamp: &str) -> Result<i64> {
+    let timestamp_unix = match NaiveDateTime::parse_from_str(timestamp, IAS_TS_FMT) {
+        Ok(timestamp) => timestamp.and_utc().timestamp(),
+        _ => return Err(AVRError::MalformedTimestamp.into()),
+    };
+    Ok(timestamp_unix)
+}
+
+fn validate_avr_signature(
+    cert_chain: &[u8],
+    message: &[u8],
+    signature: &[u8],
+    unix_time: u64,
+) -> Result<()> {
+    // WARNING: This is the entirely wrong way to validate a certificate
+    // chain as it does not come close to implementing anything resembling
+    // what is specified in RFC 5280 6.1.  There probably should be a CRL
+    // check here as well, now that I think about it.
+    //
+    // The main assumptions made about how exactly the signing key is
+    // certified/distributed, and the AVR is signed are based on the
+    // following documentation:
+    //
+    //  * 4.2.2 Report Signature:
+    //    * "The Attestation Verification Report is cryptographically
+    //       signed by Report Signing Key (owned by the Attestation
+    //       Service) using the RSA-SHA256 algorithm."
+    //  * 4.2.3 Report Signing Certificate Chain:
+    //    * "The public part of Report Key is distributed in the form
+    //       of an x.509 digital certificate called Attestation Report
+    //       Signing Certificate. It is a leaf certificate issued by
+    //       the Attestation Report Signing CA Certificate"
+    //    * "A PEM-encoded certificate chain consisting of Attestation
+    //       Report Signing Certificate and Attestation Report Signing
+    //       CA Certificate is returned..."
+    //
+    // See: "Attestation Service for Intel(R) Software Guard Extensions
+    // (Intel(R) SGX): API Documentation" (Revision: 6.0)
+
+    // Decode the certificate chain from percent encoded PEM to DER.
+    let raw_pem = percent_encoding::percent_decode(cert_chain).decode_utf8()?;
+    let mut cert_ders = Vec::new();
+    for pem in pem::Pem::iter_from_buffer(raw_pem.as_bytes()) {
+        let pem = match pem {
+            Ok(p) => p,
+            Err(_) => return Err(AVRError::MalformedCertificatePEM.into()),
+        };
+        if pem.label != PEM_CERTIFICATE_LABEL {
+            return Err(AVRError::MalformedCertificatePEM.into());
+        }
+        cert_ders.push(pem.contents);
+    }
+
+    // IAS per the API will only ever send two certificates.
+    if cert_ders.len() != 2 {
+        return Err(AVRError::ChainNotTwoCertificates.into());
+    }
+
+    // Convert our timestamp to something that can be used to check
+    // certificate expiration.
+    let time = ASN1Time::from_timestamp(unix_time as i64)?;
+
+    // Attestation Report Signing CA Certificate:
+    //
+    // Ensure that it matches the hard-coded copy, and decode it, so
+    // that the expiration can be validated and the public key can
+    // be used to verify the leaf certificate's signature.
+    //
+    // This could be more paranoid and check that the cert doesn't
+    // have trailing garbage, the usage is correct, etc, but we can
+    // take it as a matter of faith that it is well-formed since
+    // it is the same as the hard-coded one.
+    //
+    // TODO/perf: In theory this can be done once and only once, but
+    // the borrow checker thwarted my attempts to initialize a tuple
+    // containing a X509Certificate and Pem via lazy_static.
+    if cert_ders[1] != *IAS_TRUST_ANCHOR {
+        return Err(anyhow!("AVR certificate chain trust anchor mismatch"));
+    }
+    let anchor = match parse_x509_certificate(&cert_ders[1]) {
+        Ok((_, cert)) => cert,
+        Err(_) => return Err(AVRError::MalformedCertificateDER.into()),
+    };
+    if !anchor.validity().is_valid_at(time) {
+        return Err(AVRError::ExpiredCertificate.into());
+    }
+    let anchor_pk = extract_certificate_rsa_public_key(&anchor)?;
+    if !check_certificate_rsa_signature(&anchor, &anchor_pk) {
+        // The hard-coded cert is self-signed.  This will need to be
+        // changed if it ever isn't.
+        return Err(anyhow!(
+            "AVR certificate chain trust anchor has invalid signature"
+        ));
+    }
+    if !anchor.tbs_certificate.is_ca() {
+        return Err(anyhow!("AVR certificate trust anchor is not a CA"));
+    }
+
+    // Attestation Report Signing Certificate (leaf):
+    //
+    // Decode the certificate, ensure that it appears to be sensible,
+    // and then pull out the public key that presumably signs the AVR.
+    let leaf = match parse_x509_certificate(&cert_ders[0]) {
+        Ok((rem, cert)) => {
+            if !rem.is_empty() {
+                return Err(AVRError::MalformedCertificateDER.into());
+            }
+            cert
+        }
+        Err(_) => return Err(AVRError::MalformedCertificateDER.into()),
+    };
+    if !check_certificate_rsa_signature(&leaf, &anchor_pk) {
+        return Err(anyhow!("invalid leaf certificate signature"));
+    }
+
+    if !leaf.validity().is_valid_at(time) {
+        return Err(AVRError::ExpiredCertificate.into());
+    }
+    match leaf.tbs_certificate.key_usage()? {
+        Some(ku) => {
+            if !ku.value.digital_signature() {
+                return Err(anyhow!("leaf certificate can't sign"));
+            }
+        }
+        None => {
+            return Err(anyhow!("leaf cert missing key usage"));
+        }
+    }
+
+    // Validate the actual signature.
+    let leaf_pk = extract_certificate_rsa_public_key(&leaf)?;
+    let scheme = Pkcs1v15Sign::new::<sha2::Sha256>();
+    let digest = Sha256::new().chain(message).finalize();
+    let signature = BASE64_STANDARD.decode(signature)?;
+    leaf_pk
+        .verify(scheme, &digest, &signature)
+        .map_err(|_| AVRError::InvalidSignature)?;
+    Ok(())
+}
+
+fn extract_certificate_rsa_public_key(cert: &X509Certificate) -> Result<RsaPublicKey> {
+    let cert_spki = &cert.tbs_certificate.subject_pki;
+    if cert_spki.algorithm.algorithm != OID_PKCS1_RSAENCRYPTION {
+        return Err(anyhow!("invalid certificate public key algorithm"));
+    }
+
+    match RsaPublicKey::from_pkcs1_der(&cert_spki.subject_public_key.data) {
+        Ok(pk) => Ok(pk),
+        Err(err) => Err(anyhow!("invalid certificate public key: {:?}", err)),
+    }
+}
+
+fn check_certificate_rsa_signature(cert: &X509Certificate, public_key: &RsaPublicKey) -> bool {
+    if cert.signature_algorithm.algorithm != OID_PKCS1_SHA256WITHRSA {
+        return false;
+    }
+    let scheme = Pkcs1v15Sign::new::<sha2::Sha256>();
+    let digest = Sha256::new()
+        .chain(cert.tbs_certificate.as_ref())
+        .finalize();
+
+    public_key
+        .verify(scheme, &digest, &cert.signature_value.data)
+        .is_ok()
+}
+
+/// Return true iff the (POXIX) timestamp is considered "fresh" for the purposes
+/// of a cached AVR, given the current time.
+pub(crate) fn timestamp_is_fresh(now: i64, timestamp: i64) -> bool {
+    (now - timestamp).abs() < 60 * 60 * 24
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    const IAS_CERT_CHAIN: &[u8] =
+        include_bytes!("../../../testdata/avr_certificates_urlencoded.pem");
+
+    #[test]
+    fn test_validate_avr_signature() {
+        const MSG: &[u8] = include_bytes!("../../../testdata/avr_body_group_out_of_date.json");
+        const SIG: &[u8] = include_bytes!("../../../testdata/avr_signature_group_out_of_date.sig");
+        const SIG_AT: u64 = 1522447346; // 2018-03-30T22:02:26
+
+        // Positive test.
+        let result = validate_avr_signature(IAS_CERT_CHAIN, MSG, SIG, SIG_AT);
+        assert!(result.is_ok());
+
+        // Invalid timestamp.
+        let result = validate_avr_signature(IAS_CERT_CHAIN, MSG, SIG, 0);
+        assert!(result.is_err());
+
+        // Bad message.
+        let bad_msg: &mut [u8] = &mut MSG.to_owned();
+        bad_msg[0] ^= 0x23;
+        let result = validate_avr_signature(IAS_CERT_CHAIN, bad_msg, SIG, SIG_AT);
+        assert!(result.is_err());
+
+        // Bad signature.
+        let bad_sig = BASE64_STANDARD.decode(SIG).unwrap();
+        let bad_sig = &mut bad_sig.to_owned();
+        bad_sig[0] ^= 0x42;
+        let bad_sig = BASE64_STANDARD.encode(bad_sig);
+        let result = validate_avr_signature(IAS_CERT_CHAIN, MSG, bad_sig.as_bytes(), SIG_AT);
+        assert!(result.is_err());
+
+        // Test timestamp validation while we're at it.
+        let timestamp = parse_avr_timestamp("2018-03-30T22:02:26.123456").unwrap();
+        assert_eq!(timestamp, SIG_AT as i64);
+    }
+
+    #[test]
+    fn test_decode_avr_v4() {
+        const AVR: &[u8] = include_bytes!(
+            "../../../../go/common/sgx/ias/testdata/avr_v4_body_sw_hardening_needed.json"
+        );
+        const SIG: &[u8] = include_bytes!(
+            "../../../../go/common/sgx/ias/testdata/avr_v4_body_sw_hardening_needed.sig"
+        );
+        const SIG_AT: u64 = 1589188875; // 2020-05-11T09:21:15
+        const ID: &str = "323119119247496566074708526703373820736";
+        const NONCE: &str = "biNMqBAuTPF2hp/0fXa4P3splRkLHJf0";
+        const EPID_PSEUDONYM: &str = "uAFRLXADu90LsPq9Btgx8MWUPOzmDHE51pwLlUlU3hzFUk2EmvWpF6fZsyokOVkQUJ0UwZk0nCF8XPaCcSmLwqXAzLa+n/K7TdwlxKofEyTgG8da8mmrShNoFw3BSD74wSA4aAc753IfrbnnmuYk00lkmSUOTzqsqHlAORcweqg=";
+
+        let result = validate_avr_signature(IAS_CERT_CHAIN, AVR, SIG, SIG_AT);
+        assert!(result.is_ok());
+
+        let raw_avr = AVR {
+            body: AVR.to_vec(),
+            signature: SIG.to_vec(),
+            certificate_chain: IAS_CERT_CHAIN.to_vec(),
+        };
+        let avr = ParsedAVR::new(&raw_avr).expect("parsing raw AVR should succeed");
+        assert_eq!(avr.body["id"].as_str().expect("id should be present"), ID);
+        assert_eq!(
+            avr.timestamp().expect("timestamp should exist"),
+            SIG_AT as i64
+        );
+        assert_eq!(
+            avr.body["version"].as_u64().expect("version should exist"),
+            4
+        );
+        assert_eq!(
+            avr.isv_enclave_quote_status()
+                .expect("isv enclave quote status should exist"),
+            "SW_HARDENING_NEEDED"
+        );
+
+        let isv_enclave_quote_body = BASE64_STANDARD
+            .decode(
+                avr.isv_enclave_quote_body()
+                    .expect("isv enclave quote body should exist"),
+            )
+            .expect("decoding isv enclave quote body should succeed");
+        assert_eq!(isv_enclave_quote_body.len(), 432);
+        assert!(avr.body.get("revocationReason").is_none());
+        assert!(avr.body.get("pseManifestStatus").is_none());
+        assert!(avr.body.get("pseManifestHash").is_none());
+        assert!(avr.body.get("platformInfoBlob").is_none());
+        assert_eq!(
+            avr.body["nonce"].as_str().expect("nonce should exist"),
+            NONCE
+        );
+        assert_eq!(
+            avr.body["epidPseudonym"]
+                .as_str()
+                .expect("epid pseudonym should exist"),
+            EPID_PSEUDONYM
+        );
+        assert_eq!(
+            avr.body["advisoryURL"]
+                .as_str()
+                .expect("advisory URL should exist"),
+            "https://security-center.intel.com"
+        );
+        for (avr_id, known_id) in avr.body["advisoryIDs"]
+            .as_array()
+            .expect("advisory ID array should exist")
+            .iter()
+            .zip(["INTEL-SA-00334"])
+        {
+            assert_eq!(
+                avr_id.as_str().expect("advisory ID should be a string"),
+                known_id
+            );
+        }
+    }
+
+    #[test]
+    fn test_decode_avr_v5() {
+        const AVR: &[u8] = include_bytes!(
+            "../../../../go/common/sgx/ias/testdata/avr_v5_body_sw_hardening_needed.json"
+        );
+        const SIG: &[u8] = include_bytes!(
+            "../../../../go/common/sgx/ias/testdata/avr_v5_body_sw_hardening_needed.sig"
+        );
+        const SIG_AT: u64 = 1695829918; // 2023-09-27T15:51:58
+        const ID: &str = "325753020347524304899139732345489823748";
+        const EPID_PSEUDONYM: &str = "twLvZuBD1sOHsNPsHGbZOVlGh9rXw9XzVQTVKUuvsqypw0iWcFKwR7aNoHmDSoeFc/+pH6LLCI2bQBKx/ygwXphePD4GTTRwBi9EIBFRlURTk4p4NosbA7xcCG4hRuCDaEKPtAX6XHjNKEvWA+4f1aAfD7jwOtGAzHeaqBldaD8=";
+
+        let result = validate_avr_signature(IAS_CERT_CHAIN, AVR, SIG, SIG_AT);
+        assert!(result.is_ok());
+
+        let raw_avr = AVR {
+            body: AVR.to_vec(),
+            signature: SIG.to_vec(),
+            certificate_chain: IAS_CERT_CHAIN.to_vec(),
+        };
+        let avr = ParsedAVR::new(&raw_avr).expect("parsing raw AVR should succeed");
+        assert_eq!(avr.body["id"].as_str().expect("id should be present"), ID);
+        assert_eq!(
+            avr.timestamp().expect("timestamp should exist"),
+            SIG_AT as i64
+        );
+        assert_eq!(
+            avr.body["version"].as_u64().expect("version should exist"),
+            5
+        );
+        assert_eq!(
+            avr.isv_enclave_quote_status()
+                .expect("isv enclave quote status should exist"),
+            "SW_HARDENING_NEEDED"
+        );
+
+        let isv_enclave_quote_body = BASE64_STANDARD
+            .decode(
+                avr.isv_enclave_quote_body()
+                    .expect("isv enclave quote body should exist"),
+            )
+            .expect("decoding isv enclave quote body should succeed");
+        assert_eq!(isv_enclave_quote_body.len(), 432);
+        assert!(avr.body.get("revocationReason").is_none());
+        assert!(avr.body.get("pseManifestStatus").is_none());
+        assert!(avr.body.get("pseManifestHash").is_none());
+        assert!(avr.body.get("platformInfoBlob").is_none());
+        assert!(avr.body.get("nonce").is_none());
+        assert_eq!(
+            avr.body["epidPseudonym"]
+                .as_str()
+                .expect("epid pseudonym should exist"),
+            EPID_PSEUDONYM
+        );
+        assert_eq!(
+            avr.body["advisoryURL"]
+                .as_str()
+                .expect("advisory URL should exist"),
+            "https://security-center.intel.com"
+        );
+        for (avr_id, known_id) in avr.body["advisoryIDs"]
+            .as_array()
+            .expect("advisory ID array should exist")
+            .iter()
+            .zip(["INTEL-SA-00334", "INTEL-SA-00615"])
+        {
+            assert_eq!(
+                avr_id.as_str().expect("advisory ID should be a string"),
+                known_id
+            );
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/mod.rs.html b/rust/src/oasis_core_runtime/common/sgx/mod.rs.html new file mode 100644 index 0000000000..42ed84864d --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/mod.rs.html @@ -0,0 +1,299 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+
//! SGX-specific functionality.
+
+pub mod egetkey;
+pub mod ias;
+pub mod pcs;
+pub mod seal;
+
+use anyhow::Result;
+use chrono::prelude::*;
+
+use crate::common::time::{insecure_posix_time, update_insecure_posix_time};
+
+/// Maximum age of a quote from the viewpoint of the enclave.
+pub const MAX_QUOTE_AGE: i64 = 24 * 60 * 60; // 24 hours
+
+impl_bytes!(MrEnclave, 32, "Enclave hash (MRENCLAVE).");
+impl_bytes!(MrSigner, 32, "Enclave signer hash (MRSIGNER).");
+
+/// Enclave identity.
+#[derive(Debug, Default, Clone, Hash, Eq, PartialEq, cbor::Encode, cbor::Decode)]
+pub struct EnclaveIdentity {
+    pub mr_enclave: MrEnclave,
+    pub mr_signer: MrSigner,
+}
+
+impl EnclaveIdentity {
+    /// Enclave identity for the current enclave (when available).
+    pub fn current() -> Option<Self> {
+        cfg_if::cfg_if! {
+            if #[cfg(target_env = "sgx")] {
+                // SGX builds, generate actual report.
+                let report = sgx_isa::Report::for_self();
+                Some(EnclaveIdentity {
+                    mr_enclave: MrEnclave(report.mrenclave),
+                    mr_signer: MrSigner(report.mrsigner),
+                })
+            } else if #[cfg(feature = "tdx")] {
+                // TDX builds, generate TD report.
+                let report = crate::common::tdx::report::get_report(&[0; 64]).expect("failed to get report");
+                Some(report.as_enclave_identity())
+            } else if #[cfg(feature = "debug-mock-sgx")] {
+                // Non-SGX builds, mock SGX enabled, generate mock report. The mock MRENCLAVE is
+                // expected to be passed in by the mock SGX runner.
+                Some(Self::fortanix_test(std::env::var("OASIS_MOCK_MRENCLAVE").unwrap().parse().unwrap()))
+            } else {
+                // Non-SGX builds, mock SGX disabled, no enclave identity.
+                None
+            }
+        }
+    }
+
+    /// Enclave identity using a test MRSIGNER from Fortanix with a well-known private key.
+    pub fn fortanix_test(mr_enclave: MrEnclave) -> Self {
+        Self {
+            mr_enclave,
+            mr_signer: MrSigner::from(
+                "9affcfae47b848ec2caf1c49b4b283531e1cc425f93582b36806e52a43d78d1a",
+            ),
+        }
+    }
+}
+
+/// An unverified SGX remote attestation quote, depending on the attestation scheme.
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub enum Quote {
+    #[cbor(rename = "ias")]
+    Ias(ias::AVR),
+
+    #[cbor(rename = "pcs")]
+    Pcs(pcs::QuoteBundle),
+}
+
+impl Quote {
+    /// Verify the remote attestation quote.
+    pub fn verify(&self, policy: &QuotePolicy) -> Result<VerifiedQuote> {
+        let mut verified_quote = match self {
+            Quote::Ias(avr) => ias::verify(avr, &policy.ias.clone().unwrap_or_default()),
+            Quote::Pcs(qb) => {
+                let now = Utc.timestamp_opt(insecure_posix_time(), 0).unwrap();
+                Ok(qb.verify(&policy.pcs.clone().unwrap_or_default(), now)?)
+            }
+        }?;
+
+        // Force-ratchet the clock forward, to at least the time in the verified quote.
+        update_insecure_posix_time(verified_quote.timestamp);
+        verified_quote.timestamp = insecure_posix_time();
+
+        Ok(verified_quote)
+    }
+
+    /// Whether the quote should be considered fresh.
+    pub fn is_fresh(&self, now: i64, ts: i64, policy: &QuotePolicy) -> bool {
+        // Check general freshness requirement.
+        if (now - ts).abs() > MAX_QUOTE_AGE {
+            return false;
+        }
+
+        // Check quote-specific expiration policy.
+        match self {
+            Quote::Ias(_) => true, // No additional checks for IAS quotes.
+            Quote::Pcs(_) => !policy.pcs.clone().unwrap_or_default().is_expired(now, ts),
+        }
+    }
+}
+
+/// Quote validity policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct QuotePolicy {
+    #[cbor(rename = "ias")]
+    pub ias: Option<ias::QuotePolicy>,
+
+    #[cbor(rename = "pcs")]
+    pub pcs: Option<pcs::QuotePolicy>,
+}
+
+/// A remote attestation quote that has undergone verification.
+#[derive(Debug, Default, Clone)]
+pub struct VerifiedQuote {
+    pub report_data: Vec<u8>,
+    pub identity: EnclaveIdentity,
+    pub timestamp: i64,
+}
+
+/// Generate a report for the given target enclave.
+#[cfg(target_env = "sgx")]
+pub fn report_for(target_info: &sgx_isa::Targetinfo, report_data: &[u8; 64]) -> sgx_isa::Report {
+    sgx_isa::Report::for_target(target_info, report_data)
+}
+
+/// Generate a report for the given target enclave.
+#[cfg(not(target_env = "sgx"))]
+pub fn report_for(_target_info: &sgx_isa::Targetinfo, report_data: &[u8; 64]) -> sgx_isa::Report {
+    let ei = EnclaveIdentity::current().expect("mock enclave identity not available");
+
+    // In non-SGX mode, reports are mocked.
+    sgx_isa::Report {
+        mrenclave: ei.mr_enclave.into(),
+        mrsigner: ei.mr_signer.into(),
+        cpusvn: [8, 9, 14, 13, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+        attributes: sgx_isa::Attributes {
+            flags: sgx_isa::AttributesFlags::INIT
+                | sgx_isa::AttributesFlags::DEBUG
+                | sgx_isa::AttributesFlags::MODE64BIT,
+            xfrm: 3,
+        },
+        reportdata: *report_data,
+        ..Default::default()
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/pcs/certificates.rs.html b/rust/src/oasis_core_runtime/common/sgx/pcs/certificates.rs.html new file mode 100644 index 0000000000..e555acbff9 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/pcs/certificates.rs.html @@ -0,0 +1,67 @@ +certificates.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
use std::ffi::CString;
+
+use mbedtls::{alloc::List as MbedtlsList, x509::certificate::Certificate};
+
+/// Intel's PCS signing root certificate (PEM-encoded).
+pub const PCS_TRUST_ROOT_CERT: &str = r#"-----BEGIN CERTIFICATE-----
+MIICjzCCAjSgAwIBAgIUImUM1lqdNInzg7SVUr9QGzknBqwwCgYIKoZIzj0EAwIw
+aDEaMBgGA1UEAwwRSW50ZWwgU0dYIFJvb3QgQ0ExGjAYBgNVBAoMEUludGVsIENv
+cnBvcmF0aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExCzAJ
+BgNVBAYTAlVTMB4XDTE4MDUyMTEwNDUxMFoXDTQ5MTIzMTIzNTk1OVowaDEaMBgG
+A1UEAwwRSW50ZWwgU0dYIFJvb3QgQ0ExGjAYBgNVBAoMEUludGVsIENvcnBvcmF0
+aW9uMRQwEgYDVQQHDAtTYW50YSBDbGFyYTELMAkGA1UECAwCQ0ExCzAJBgNVBAYT
+AlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEC6nEwMDIYZOj/iPWsCzaEKi7
+1OiOSLRFhWGjbnBVJfVnkY4u3IjkDYYL0MxO4mqsyYjlBalTVYxFP2sJBK5zlKOB
+uzCBuDAfBgNVHSMEGDAWgBQiZQzWWp00ifODtJVSv1AbOScGrDBSBgNVHR8ESzBJ
+MEegRaBDhkFodHRwczovL2NlcnRpZmljYXRlcy50cnVzdGVkc2VydmljZXMuaW50
+ZWwuY29tL0ludGVsU0dYUm9vdENBLmRlcjAdBgNVHQ4EFgQUImUM1lqdNInzg7SV
+Ur9QGzknBqwwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwCgYI
+KoZIzj0EAwIDSQAwRgIhAOW/5QkR+S9CiSDcNoowLuPRLsWGf/Yi7GSX94BgwTwg
+AiEA4J0lrHoMs+Xo5o/sX6O9QWxHRAvZUGOdRQ7cvqRXaqI=
+-----END CERTIFICATE-----"#;
+
+lazy_static::lazy_static! {
+    /// Intel's PCS signing root certificate.
+    pub static ref PCS_TRUST_ROOT: MbedtlsList<Certificate> = {
+        let mut cert_chain = MbedtlsList::new();
+        let raw_cert = CString::new(PCS_TRUST_ROOT_CERT.as_bytes()).unwrap();
+        let cert = Certificate::from_pem(raw_cert.as_bytes_with_nul()).unwrap();
+        cert_chain.push(cert);
+
+        cert_chain
+    };
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/pcs/constants.rs.html b/rust/src/oasis_core_runtime/common/sgx/pcs/constants.rs.html new file mode 100644 index 0000000000..50ebe3b76f --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/pcs/constants.rs.html @@ -0,0 +1,69 @@ +constants.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
use chrono::Duration;
+
+// Required values of various TCB fields.
+pub const REQUIRED_TCB_INFO_VERSION: u32 = 3;
+pub const REQUIRED_QE_IDENTITY_VERSION: u32 = 2;
+
+pub const DEFAULT_MIN_TCB_EVALUATION_DATA_NUMBER: u32 = 12; // As of 2022-08-01.
+pub const DEFAULT_TCB_VALIDITY_PERIOD: Duration = Duration::try_days(30).unwrap();
+
+// PCS timestamp format.
+pub const PCS_TS_FMT: &str = "%FT%T%.9fZ";
+
+// OIDs for PCK X509 certificate extensions.
+pub const PCK_SGX_EXTENSIONS_OID: &[u64] = &[1, 2, 840, 113741, 1, 13, 1];
+pub const PCK_SGX_EXTENSIONS_FMSPC_OID: &[u64] = &[1, 2, 840, 113741, 1, 13, 1, 4];
+pub const PCK_SGX_EXTENSIONS_TCB_OID: &[u64] = &[1, 2, 840, 113741, 1, 13, 1, 2];
+
+pub const QE_VENDOR_ID_INTEL: [u8; 16] = [
+    0x93, 0x9a, 0x72, 0x33, 0xf7, 0x9c, 0x4c, 0xa9, 0x94, 0x0a, 0x0d, 0xb3, 0x95, 0x7f, 0x06, 0x07,
+];
+
+pub const TDX_MRSIGNER_INTEL: [u8; 48] = [0; 48];
+
+pub const QUOTE_HEADER_LEN: usize = 48;
+pub const ECDSA_P256_SIGNATURE_LEN: usize = 64;
+pub const ECDSA_P256_PUBLIC_KEY_LEN: usize = 64;
+pub const QE_VENDOR_ID_LEN: usize = 16;
+pub const QE_USER_DATA_LEN: usize = 20;
+pub const SGX_REPORT_BODY_LEN: usize = 384;
+pub const TDX_REPORT_BODY_LEN: usize = 584;
+pub const CPUSVN_LEN: usize = 16;
+
+pub const QUOTE_VERSION_3: u16 = 3;
+pub const QUOTE_VERSION_4: u16 = 4;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/pcs/mod.rs.html b/rust/src/oasis_core_runtime/common/sgx/pcs/mod.rs.html new file mode 100644 index 0000000000..e41de1c83c --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/pcs/mod.rs.html @@ -0,0 +1,473 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+
//! Intel Provisioning Certification Services (PCS) quote handling.
+
+mod certificates;
+mod constants;
+mod policy;
+mod quote;
+mod report;
+mod tcb;
+mod utils;
+
+/// Possible errors returned by this module.
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+    #[error("unsupported QE vendor")]
+    UnsupportedQEVendor,
+    #[error("unsupported attestation key type")]
+    UnsupportedAttestationKeyType,
+    #[error("unsupported TEE type")]
+    UnsupportedTeeType,
+    #[error("failed to parse quote: {0}")]
+    QuoteParseError(String),
+    #[error("failed to verify quote: {0}")]
+    VerificationFailed(String),
+    #[error("unexpected certificate chain")]
+    UnexpectedCertificateChain,
+    #[error("unexpected certification data")]
+    UnexpectedCertificationData,
+    #[error("malformed certification data")]
+    MalformedCertificationData,
+    #[error("PCK is malformed")]
+    MalformedPCK,
+    #[error("failed to parse TCB bundle: {0}")]
+    TCBParseError(anyhow::Error),
+    #[error("TCB verification failed")]
+    TCBVerificationFailed,
+    #[error("TCB is expired or not yet valid")]
+    TCBExpired,
+    #[error("TCB is out of date")]
+    TCBOutOfDate,
+    #[error("TCB does not match the quote")]
+    TCBMismatch,
+    #[error("TCB evaluation data number is invalid")]
+    TCBEvaluationDataNumberInvalid,
+    #[error("FMSPC is blacklisted")]
+    BlacklistedFMSPC,
+    #[error("QE report is malformed")]
+    MalformedQEReport,
+    #[error("report is malformed")]
+    MalformedReport,
+    #[error("debug enclaves not allowed")]
+    DebugEnclave,
+    #[error("production enclaves not allowed")]
+    ProductionEnclave,
+    #[error("TEE type not allowed by policy")]
+    TeeTypeNotAllowed,
+    #[error("TDX module not allowed by policy")]
+    TdxModuleNotAllowed,
+    #[error("PCS quotes are disabled by policy")]
+    Disabled,
+    #[error(transparent)]
+    Other(#[from] anyhow::Error),
+}
+
+pub use policy::{QuotePolicy, TdxModulePolicy, TdxQuotePolicy};
+pub use quote::{Quote, QuoteBundle};
+pub use report::{td_enclave_identity, TdAttributes, TdReport};
+pub use tcb::TCBBundle;
+
+#[cfg(test)]
+mod tests {
+    use chrono::prelude::*;
+
+    use super::*;
+
+    #[test]
+    fn test_quote_v3_ecdsa_p256_pck_certificatechain() {
+        const RAW_QUOTE: &[u8] =
+            include_bytes!("../../../../testdata/quote_v3_ecdsa_p256_pck_chain.bin");
+        const RAW_TCB_INFO: &[u8] =
+            include_bytes!("../../../../testdata/tcb_info_v3_fmspc_00606A000000.json"); // From PCS V4 response.
+        const RAW_CERTS: &[u8] =
+            include_bytes!("../../../../testdata/tcb_info_v3_fmspc_00606A000000_certs.pem"); // From PCS V4 response (TCB-Info-Issuer-Chain header).
+        const RAW_QE_IDENTITY: &[u8] = include_bytes!("../../../../testdata/qe_identity_v2.json"); // From PCS V4 response.
+
+        let qb = QuoteBundle {
+            quote: RAW_QUOTE.to_owned(),
+            tcb: TCBBundle {
+                tcb_info: serde_json::from_slice(RAW_TCB_INFO).unwrap(),
+                qe_identity: serde_json::from_slice(RAW_QE_IDENTITY).unwrap(),
+                certificates: RAW_CERTS.to_owned(),
+            },
+        };
+
+        let now = Utc.timestamp_opt(1671497404, 0).unwrap();
+
+        let verified_quote = qb.verify(&QuotePolicy::default(), now).unwrap();
+        assert_eq!(
+            verified_quote.identity.mr_signer,
+            "9affcfae47b848ec2caf1c49b4b283531e1cc425f93582b36806e52a43d78d1a".into()
+        );
+        assert_eq!(
+            verified_quote.identity.mr_enclave,
+            "68823bc62f409ee33a32ea270cfe45d4b19a6fb3c8570d7bc186cbe062398e8f".into()
+        );
+    }
+
+    #[test]
+    fn test_quote_v4_tdx_ecdsa_p256() {
+        const RAW_QUOTE: &[u8] = include_bytes!("../../../../testdata/quote_v4_tdx_ecdsa_p256.bin");
+        const RAW_TCB_INFO: &[u8] =
+            include_bytes!("../../../../testdata/tcb_info_v3_tdx_fmspc_C0806F000000.json"); // From PCS V4 response.
+        const RAW_CERTS: &[u8] =
+            include_bytes!("../../../../testdata/tcb_info_v3_fmspc_00606A000000_certs.pem"); // From PCS V4 response (TCB-Info-Issuer-Chain header).
+        const RAW_QE_IDENTITY: &[u8] =
+            include_bytes!("../../../../testdata/qe_identity_v2_tdx2.json"); // From PCS V4 response.
+
+        let qb = QuoteBundle {
+            quote: RAW_QUOTE.to_owned(),
+            tcb: TCBBundle {
+                tcb_info: serde_json::from_slice(RAW_TCB_INFO).unwrap(),
+                qe_identity: serde_json::from_slice(RAW_QE_IDENTITY).unwrap(),
+                certificates: RAW_CERTS.to_owned(),
+            },
+        };
+
+        let now = Utc.timestamp_opt(1725263032, 0).unwrap();
+        let policy = QuotePolicy {
+            tdx: Some(TdxQuotePolicy::default()), // Allow TDX.
+            ..Default::default()
+        };
+
+        let verified_quote = qb.verify(&policy, now).unwrap();
+        assert_eq!(
+            verified_quote.identity.mr_signer,
+            "0000000000000000000000000000000000000000000000000000000000000000".into()
+        );
+        assert_eq!(
+            verified_quote.identity.mr_enclave,
+            "63d522d975f7de879a8f3368b4f32dd1e8db635f5a24b651ce8ff81705028813".into()
+        );
+
+        // Ensure TDX quote verification fails in case it is not allowed.
+        let policy = QuotePolicy {
+            tdx: None,
+            ..Default::default()
+        };
+
+        let result = qb.verify(&policy, now);
+        assert!(matches!(result, Err(Error::TeeTypeNotAllowed)));
+
+        // Ensure TDX quote verification fails in case the given TDX Module is not allowed.
+        let policy = QuotePolicy {
+            tdx: Some(TdxQuotePolicy {
+                allowed_tdx_modules: vec![TdxModulePolicy {
+                    mr_seam: None,
+                    mr_signer_seam: [1; 48],
+                }],
+            }),
+            ..Default::default()
+        };
+
+        let result = qb.verify(&policy, now);
+        assert!(matches!(result, Err(Error::TdxModuleNotAllowed)));
+    }
+
+    #[test]
+    fn test_quote_v4_tdx_ecdsa_p256_out_of_date() {
+        const RAW_QUOTE: &[u8] =
+            include_bytes!("../../../../testdata/quote_v4_tdx_ecdsa_p256_out_of_date.bin");
+        const RAW_TCB_INFO: &[u8] =
+            include_bytes!("../../../../testdata/tcb_info_v3_tdx_fmspc_50806F000000.json"); // From PCS V4 response.
+        const RAW_CERTS: &[u8] =
+            include_bytes!("../../../../testdata/tcb_info_v3_fmspc_00606A000000_certs.pem"); // From PCS V4 response (TCB-Info-Issuer-Chain header).
+        const RAW_QE_IDENTITY: &[u8] =
+            include_bytes!("../../../../testdata/qe_identity_v2_tdx.json"); // From PCS V4 response.
+
+        let qb = QuoteBundle {
+            quote: RAW_QUOTE.to_owned(),
+            tcb: TCBBundle {
+                tcb_info: serde_json::from_slice(RAW_TCB_INFO).unwrap(),
+                qe_identity: serde_json::from_slice(RAW_QE_IDENTITY).unwrap(),
+                certificates: RAW_CERTS.to_owned(),
+            },
+        };
+
+        let now = Utc.timestamp_opt(1687091776, 0).unwrap();
+        let policy = QuotePolicy {
+            tdx: Some(TdxQuotePolicy::default()), // Allow TDX.
+            ..Default::default()
+        };
+
+        let result = qb.verify(&policy, now);
+
+        // NOTE: The quote is out of date.
+        assert!(matches!(result, Err(Error::TCBOutOfDate)));
+    }
+
+    #[test]
+    fn test_quote_bundle_decoding() {
+        // From Go implementation.
+        const RAW_QUOTE_BUNDLE: &[u8] =
+            include_bytes!("../../../../testdata/pcs_quote_bundle.cbor");
+
+        let qb: QuoteBundle = cbor::from_slice(RAW_QUOTE_BUNDLE).unwrap();
+
+        let now = Utc.timestamp_opt(1671497404, 0).unwrap();
+
+        let verified_quote = qb.verify(&QuotePolicy::default(), now).unwrap();
+        assert_eq!(
+            verified_quote.identity.mr_signer,
+            "9affcfae47b848ec2caf1c49b4b283531e1cc425f93582b36806e52a43d78d1a".into()
+        );
+        assert_eq!(
+            verified_quote.identity.mr_enclave,
+            "68823bc62f409ee33a32ea270cfe45d4b19a6fb3c8570d7bc186cbe062398e8f".into()
+        );
+    }
+
+    #[test]
+    fn test_quote_blacklisted_fmscp() {
+        // From Go implementation.
+        const RAW_QUOTE_BUNDLE: &[u8] =
+            include_bytes!("../../../../testdata/pcs_quote_bundle.cbor");
+
+        let qb: QuoteBundle = cbor::from_slice(RAW_QUOTE_BUNDLE).unwrap();
+
+        let now = Utc.timestamp_opt(1671497404, 0).unwrap();
+        let policy = &QuotePolicy {
+            fmspc_blacklist: vec!["00606A000000".to_string()],
+            ..Default::default()
+        };
+
+        qb.verify(policy, now)
+            .expect_err("quote verification should fail for blacklisted FMSPCs");
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/pcs/policy.rs.html b/rust/src/oasis_core_runtime/common/sgx/pcs/policy.rs.html new file mode 100644 index 0000000000..2ab240439e --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/pcs/policy.rs.html @@ -0,0 +1,229 @@ +policy.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+
//! Quote policy.
+use super::{constants::*, report::TdReport, Error};
+
+/// Quote validity policy.
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct QuotePolicy {
+    /// Whether PCS quotes are disabled and will always be rejected.
+    #[cbor(optional)]
+    pub disabled: bool,
+
+    /// Validity (in days) of the TCB collateral.
+    pub tcb_validity_period: u16,
+
+    /// Minimum TCB evaluation data number that is considered to be valid. TCB bundles containing
+    /// smaller values will be invalid.
+    pub min_tcb_evaluation_data_number: u32,
+
+    /// A list of hexadecimal encoded FMSPCs specifying which processor packages and platform
+    /// instances are blocked.
+    #[cbor(optional)]
+    pub fmspc_blacklist: Vec<String>,
+
+    /// Optional TDX-specific policy. In case this is `None`, TDX quotes are disallowed.
+    #[cbor(optional)]
+    pub tdx: Option<TdxQuotePolicy>,
+}
+
+impl Default for QuotePolicy {
+    fn default() -> Self {
+        Self {
+            disabled: false,
+            tcb_validity_period: 30,
+            min_tcb_evaluation_data_number: DEFAULT_MIN_TCB_EVALUATION_DATA_NUMBER,
+            fmspc_blacklist: Vec::new(),
+            tdx: None,
+        }
+    }
+}
+
+impl QuotePolicy {
+    /// Whether the quote with timestamp `ts` is expired.
+    pub fn is_expired(&self, now: i64, ts: i64) -> bool {
+        if self.disabled {
+            return true;
+        }
+
+        now.checked_sub(ts)
+            .map(|d| d > 60 * 60 * 24 * (self.tcb_validity_period as i64))
+            .expect("quote timestamp is in the future") // This should never happen.
+    }
+}
+
+/// TDX-specific quote policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct TdxQuotePolicy {
+    /// Allowed TDX modules. Empty to allow ANY Intel-signed module.
+    pub allowed_tdx_modules: Vec<TdxModulePolicy>,
+}
+
+impl TdxQuotePolicy {
+    /// Verify whether the TDX policy is satisfied for the given report.
+    pub fn verify(&self, report: &TdReport) -> Result<(), Error> {
+        self.verify_tdx_module(report)?;
+        Ok(())
+    }
+
+    fn verify_tdx_module(&self, report: &TdReport) -> Result<(), Error> {
+        // If at least one TDX Module matches, then we are good.
+        for allowed_module in &self.allowed_tdx_modules {
+            if allowed_module.matches(report) {
+                return Ok(());
+            }
+        }
+
+        // No module matched. Iff the list of modules is empty, allow ANY Intel-signed module.
+        // As per the TDX specifications, MRSIGNER is all-zero for Intel.
+        if self.allowed_tdx_modules.is_empty() && report.mr_signer_seam == TDX_MRSIGNER_INTEL {
+            return Ok(());
+        }
+
+        Err(Error::TdxModuleNotAllowed)
+    }
+}
+
+/// TDX module policy.
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct TdxModulePolicy {
+    /// Optional allowed measurement of the TDX Module. In case it is `None`, ANY measurement is
+    /// allowed and only the signer is checked.
+    pub mr_seam: Option<[u8; 48]>,
+
+    /// Allowed signer of the TDX Module (zero for Intel).
+    pub mr_signer_seam: [u8; 48],
+}
+
+impl TdxModulePolicy {
+    /// Returns true iff the TDX module in the given report matches this module policy.
+    pub fn matches(&self, report: &TdReport) -> bool {
+        // Check MRSEAM if set.
+        if let Some(mr_seam) = self.mr_seam {
+            if mr_seam != report.mr_seam {
+                return false;
+            }
+        }
+
+        // Check MRSIGNER.
+        if self.mr_signer_seam != report.mr_signer_seam {
+            return false;
+        }
+
+        true
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/pcs/quote.rs.html b/rust/src/oasis_core_runtime/common/sgx/pcs/quote.rs.html new file mode 100644 index 0000000000..32499ff20a --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/pcs/quote.rs.html @@ -0,0 +1,1881 @@ +quote.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+
use std::{borrow::Cow, convert::TryInto, ffi::CString, mem};
+
+use byteorder::{ByteOrder, LittleEndian};
+use chrono::prelude::*;
+use mbedtls::{
+    alloc::List as MbedtlsList,
+    ecp::{EcGroup, EcPoint},
+    hash::{self, Md},
+    pk::{EcGroupId, Pk},
+    x509::certificate::Certificate,
+};
+use num_derive::{FromPrimitive, ToPrimitive};
+use num_traits::FromPrimitive;
+use sgx_isa::AttributesFlags;
+
+use super::{
+    certificates::PCS_TRUST_ROOT,
+    constants::*,
+    policy::QuotePolicy,
+    report::{SgxReport, TdAttributes, TdReport},
+    tcb::{QEIdentity, TCBBundle, TCBInfo, TCBLevel, TCBStatus},
+    utils::TakePrefix,
+    Error,
+};
+use crate::common::sgx::{EnclaveIdentity, MrEnclave, MrSigner, VerifiedQuote};
+
+/// An attestation quote together with the TCB bundle required for its verification.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct QuoteBundle {
+    #[cbor(rename = "quote")]
+    pub quote: Vec<u8>,
+
+    #[cbor(rename = "tcb")]
+    pub tcb: TCBBundle,
+}
+
+impl QuoteBundle {
+    /// Verify the quote bundle.
+    pub fn verify(&self, policy: &QuotePolicy, ts: DateTime<Utc>) -> Result<VerifiedQuote, Error> {
+        if policy.disabled {
+            return Err(Error::Disabled);
+        }
+
+        // XXX: We reuse the IAS specific variables to avoid having additional environment
+        // variables. Rename these variables when IAS support is removed.
+        let unsafe_skip_quote_verification = option_env!("OASIS_UNSAFE_SKIP_AVR_VERIFY").is_some();
+        let unsafe_lax_quote_verification = option_env!("OASIS_UNSAFE_LAX_AVR_VERIFY").is_some();
+
+        // Parse the quote.
+        let quote = Quote::parse(&self.quote)?;
+        let tee_type = quote.header().tee_type();
+
+        // Ensure given TEE type is allowed by the policy.
+        match (tee_type, &policy.tdx) {
+            (TeeType::SGX, _) => { /* Ok. */ }
+            (TeeType::TDX, &None) => return Err(Error::TeeTypeNotAllowed),
+            (TeeType::TDX, &Some(_)) => { /* Ok. */ }
+        }
+
+        // Ensure correct QE vendor.
+        if quote.header().qe_vendor_id() != QE_VENDOR_ID_INTEL {
+            return Err(Error::UnsupportedQEVendor);
+        }
+
+        // Verify TCB bundle and get TCB info and QE identity.
+        let mut tcb_cert = self.tcb.verify_certificates(ts)?;
+        let qe_identity =
+            self.tcb
+                .qe_identity
+                .open(tee_type, ts, policy, tcb_cert.public_key_mut())?;
+        let tcb_info = self
+            .tcb
+            .tcb_info
+            .open(tee_type, ts, policy, tcb_cert.public_key_mut())?;
+
+        // We use the TCB info issue date as the timestamp.
+        let timestamp = NaiveDateTime::parse_from_str(&tcb_info.issue_date, PCS_TS_FMT)
+            .map_err(|err| Error::TCBParseError(err.into()))?
+            .and_utc()
+            .timestamp();
+
+        // Perform quote verification.
+        if !unsafe_skip_quote_verification {
+            let tcb_level = quote.verify(tcb_info, qe_identity)?;
+
+            // Validate TCB level.
+            match tcb_level.status {
+                TCBStatus::UpToDate | TCBStatus::SWHardeningNeeded => {}
+                TCBStatus::OutOfDate
+                | TCBStatus::ConfigurationNeeded
+                | TCBStatus::OutOfDateConfigurationNeeded
+                    if unsafe_lax_quote_verification => {}
+                _ => {
+                    return Err(Error::TCBOutOfDate);
+                }
+            }
+        }
+
+        // Disallow debug enclaves, if we are in production environment and disallow production
+        // enclaves, if we are in debug environment.
+        let is_debug = quote.report_body().is_debug();
+        let allow_debug = option_env!("OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES").is_some();
+        if is_debug && !allow_debug {
+            return Err(Error::DebugEnclave);
+        } else if !is_debug && allow_debug {
+            return Err(Error::ProductionEnclave);
+        }
+
+        // Verify report against TDX policy.
+        if let ReportBody::Tdx(report) = quote.report_body() {
+            let tdx_policy = policy.tdx.as_ref().ok_or(Error::TeeTypeNotAllowed)?;
+            tdx_policy.verify(report)?;
+        }
+
+        Ok(VerifiedQuote {
+            report_data: quote.report_body().report_data(),
+            identity: quote.report_body().as_enclave_identity(),
+            timestamp,
+        })
+    }
+}
+
+/// An enclave quote.
+#[derive(Debug)]
+pub struct Quote<'a> {
+    header: Header<'a>,
+    report_body: ReportBody,
+    signature: QuoteSignatureEcdsaP256<'a>,
+    signed_data: Cow<'a, [u8]>,
+}
+
+impl<'a> Quote<'a> {
+    pub fn parse<T: Into<Cow<'a, [u8]>>>(quote: T) -> Result<Quote<'a>, Error> {
+        let mut quote = quote.into();
+        let mut raw = quote.clone();
+
+        // Parse header, depending on version.
+        let version = quote
+            .take_prefix(mem::size_of::<u16>())
+            .map(|v| LittleEndian::read_u16(&v))?;
+        match version {
+            QUOTE_VERSION_3 => {
+                // Version 3 (SGX-ECDSA).
+                let att_key_type = quote
+                    .take_prefix(mem::size_of::<u16>())
+                    .map(|v| LittleEndian::read_u16(&v))?;
+                let attestation_key_type = AttestationKeyType::from_u16(att_key_type)
+                    .ok_or(Error::UnsupportedAttestationKeyType)?;
+                let reserved = quote
+                    .take_prefix(mem::size_of::<u32>())
+                    .map(|v| LittleEndian::read_u32(&v))?;
+                if reserved != 0 {
+                    return Err(Error::QuoteParseError("data in reserved field".to_string()));
+                }
+
+                let qe_svn = quote
+                    .take_prefix(mem::size_of::<u16>())
+                    .map(|v| LittleEndian::read_u16(&v))?;
+                let pce_svn = quote
+                    .take_prefix(mem::size_of::<u16>())
+                    .map(|v| LittleEndian::read_u16(&v))?;
+                let qe_vendor_id = quote.take_prefix(QE_VENDOR_ID_LEN)?;
+                let user_data = quote.take_prefix(QE_USER_DATA_LEN)?;
+                let report_body = quote.take_prefix(SGX_REPORT_BODY_LEN)?;
+                let report_body = ReportBody::parse(TeeType::SGX, &report_body)?;
+
+                if attestation_key_type != AttestationKeyType::EcdsaP256 {
+                    return Err(Error::UnsupportedAttestationKeyType);
+                }
+                let signature = QuoteSignatureEcdsaP256::parse(version, quote)?;
+                let signed_data = raw.take_prefix(QUOTE_HEADER_LEN + SGX_REPORT_BODY_LEN)?;
+
+                Ok(Quote {
+                    header: Header::V3 {
+                        attestation_key_type,
+                        qe_svn,
+                        pce_svn,
+                        qe_vendor_id,
+                        user_data,
+                    },
+                    report_body,
+                    signature,
+                    signed_data,
+                })
+            }
+            QUOTE_VERSION_4 => {
+                // Version 4 (TDX-ECDSA, SGX-ECDSA).
+                let att_key_type = quote
+                    .take_prefix(mem::size_of::<u16>())
+                    .map(|v| LittleEndian::read_u16(&v))?;
+                let attestation_key_type = AttestationKeyType::from_u16(att_key_type)
+                    .ok_or(Error::UnsupportedAttestationKeyType)?;
+
+                let tee_type_raw = quote
+                    .take_prefix(mem::size_of::<u32>())
+                    .map(|v| LittleEndian::read_u32(&v))?;
+                let tee_type = TeeType::from_u32(tee_type_raw).ok_or(Error::UnsupportedTeeType)?;
+
+                let reserved1 = quote
+                    .take_prefix(mem::size_of::<u16>())
+                    .map(|v| LittleEndian::read_u16(&v))?;
+                let reserved2 = quote
+                    .take_prefix(mem::size_of::<u16>())
+                    .map(|v| LittleEndian::read_u16(&v))?;
+
+                if reserved1 != 0 || reserved2 != 0 {
+                    return Err(Error::QuoteParseError("data in reserved field".to_string()));
+                }
+
+                let qe_vendor_id = quote.take_prefix(QE_VENDOR_ID_LEN)?;
+                let user_data = quote.take_prefix(QE_USER_DATA_LEN)?;
+
+                let header = Header::V4 {
+                    attestation_key_type,
+                    tee_type,
+                    qe_vendor_id,
+                    user_data,
+                };
+                let report_body = quote.take_prefix(header.report_body_len())?;
+                let report_body = ReportBody::parse(tee_type, &report_body)?;
+
+                if attestation_key_type != AttestationKeyType::EcdsaP256 {
+                    return Err(Error::UnsupportedAttestationKeyType);
+                }
+                let signature = QuoteSignatureEcdsaP256::parse(version, quote)?;
+                let signed_data = raw.take_prefix(QUOTE_HEADER_LEN + header.report_body_len())?;
+
+                Ok(Quote {
+                    header,
+                    report_body,
+                    signature,
+                    signed_data,
+                })
+            }
+            _ => Err(Error::QuoteParseError(format!(
+                "unsupported quote version: {}",
+                version
+            ))),
+        }
+    }
+
+    /// Quote header.
+    pub fn header(&self) -> &Header<'a> {
+        &self.header
+    }
+
+    /// Report body.
+    pub fn report_body(&self) -> &ReportBody {
+        &self.report_body
+    }
+
+    /// Verify quote.
+    pub fn verify(&self, tcb_info: TCBInfo, qe_identity: QEIdentity) -> Result<TCBLevel, Error> {
+        let tdx_comp_svn = self.report_body.tdx_comp_svn();
+
+        let mut verifier: QeEcdsaP256Verifier =
+            QeEcdsaP256Verifier::new(tcb_info, qe_identity, tdx_comp_svn);
+        self.signature.verify(&self.signed_data, &mut verifier)?;
+
+        Ok(verifier.tcb_level().unwrap())
+    }
+}
+
+/// An enclave quote header.
+#[derive(Debug)]
+pub enum Header<'a> {
+    V3 {
+        attestation_key_type: AttestationKeyType,
+        qe_svn: u16,
+        pce_svn: u16,
+        qe_vendor_id: Cow<'a, [u8]>,
+        user_data: Cow<'a, [u8]>,
+    },
+
+    V4 {
+        attestation_key_type: AttestationKeyType,
+        tee_type: TeeType,
+        qe_vendor_id: Cow<'a, [u8]>,
+        user_data: Cow<'a, [u8]>,
+    },
+}
+
+impl<'a> Header<'a> {
+    /// Quote header version.
+    pub fn version(&self) -> u16 {
+        match self {
+            Self::V3 { .. } => QUOTE_VERSION_3,
+            Self::V4 { .. } => QUOTE_VERSION_4,
+        }
+    }
+
+    /// Attestation key type.
+    pub fn attestation_key_type(&self) -> AttestationKeyType {
+        match self {
+            Self::V3 {
+                attestation_key_type,
+                ..
+            } => *attestation_key_type,
+            Self::V4 {
+                attestation_key_type,
+                ..
+            } => *attestation_key_type,
+        }
+    }
+
+    /// TEE type the quote is for.
+    pub fn tee_type(&self) -> TeeType {
+        match self {
+            Self::V3 { .. } => TeeType::SGX,
+            Self::V4 { tee_type, .. } => *tee_type,
+        }
+    }
+
+    /// Quoting Enclave (QE) vendor identifier.
+    pub fn qe_vendor_id(&self) -> &[u8] {
+        match self {
+            Self::V3 { qe_vendor_id, .. } => qe_vendor_id,
+            Self::V4 { qe_vendor_id, .. } => qe_vendor_id,
+        }
+    }
+
+    /// Length of the report body field.
+    pub fn report_body_len(&self) -> usize {
+        match self.tee_type() {
+            TeeType::SGX => SGX_REPORT_BODY_LEN,
+            TeeType::TDX => TDX_REPORT_BODY_LEN,
+        }
+    }
+}
+
+/// TEE type.
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, FromPrimitive, ToPrimitive)]
+#[repr(u32)]
+pub enum TeeType {
+    SGX = 0x00000000,
+    TDX = 0x00000081,
+}
+
+/// Attestation key type.
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, FromPrimitive, ToPrimitive)]
+#[repr(u16)]
+pub enum AttestationKeyType {
+    EcdsaP256 = 2,
+}
+
+/// Report body.
+#[derive(Debug)]
+pub enum ReportBody {
+    Sgx(SgxReport),
+    Tdx(TdReport),
+}
+
+impl ReportBody {
+    /// Parse the report body.
+    pub fn parse(tee_type: TeeType, raw: &[u8]) -> Result<Self, Error> {
+        match tee_type {
+            TeeType::SGX => {
+                // Parse SGX report body.
+                let mut report_body = Vec::with_capacity(SgxReport::UNPADDED_SIZE);
+                report_body.extend(raw);
+                report_body.resize_with(SgxReport::UNPADDED_SIZE, Default::default);
+                let report =
+                    SgxReport::try_copy_from(&report_body).ok_or(Error::MalformedReport)?;
+
+                Ok(Self::Sgx(report))
+            }
+            TeeType::TDX => {
+                // Parse TDX TD report body.
+                let report = TdReport::parse(raw)?;
+
+                Ok(Self::Tdx(report))
+            }
+        }
+    }
+
+    /// TDX TEE Component SVNs.
+    ///
+    /// Returns `None` in case of a non-TDX report body.
+    pub fn tdx_comp_svn(&self) -> Option<[u32; 16]> {
+        match self {
+            Self::Sgx(_) => None,
+            Self::Tdx(report) => Some(
+                report
+                    .tee_tcb_svn
+                    .iter()
+                    .map(|x| *x as u32)
+                    .collect::<Vec<u32>>()
+                    .try_into()
+                    .unwrap(),
+            ),
+        }
+    }
+
+    /// Whether the report indicates a debug TEE.
+    pub fn is_debug(&self) -> bool {
+        match self {
+            Self::Sgx(report) => report.attributes.flags.contains(AttributesFlags::DEBUG),
+            Self::Tdx(report) => report.td_attributes.contains(TdAttributes::DEBUG),
+        }
+    }
+
+    /// Converts this report into an enclave identity.
+    pub fn as_enclave_identity(&self) -> EnclaveIdentity {
+        match self {
+            Self::Sgx(report) => EnclaveIdentity {
+                mr_enclave: MrEnclave::from(report.mrenclave.to_vec()),
+                mr_signer: MrSigner::from(report.mrsigner.to_vec()),
+            },
+            Self::Tdx(report) => report.as_enclave_identity(),
+        }
+    }
+
+    /// Data contained in the report.
+    pub fn report_data(&self) -> Vec<u8> {
+        match self {
+            Self::Sgx(report) => report.reportdata.to_vec(),
+            Self::Tdx(report) => report.report_data.to_vec(),
+        }
+    }
+}
+
+/// Quote signature trait.
+pub trait QuoteSignature<'a>: Sized {
+    /// Parse the quote signature from the passed data.
+    fn parse(version: u16, data: Cow<'a, [u8]>) -> Result<Self, Error>;
+}
+
+/// ECDSA-P256 quote signature.
+#[derive(Debug)]
+pub struct QuoteSignatureEcdsaP256<'a> {
+    signature: Cow<'a, [u8]>,
+    attestation_public_key: Cow<'a, [u8]>,
+
+    qe: CertificationDataQeReport<'a>,
+}
+
+impl<'a> QuoteSignature<'a> for QuoteSignatureEcdsaP256<'a> {
+    fn parse(version: u16, mut data: Cow<'a, [u8]>) -> Result<Self, Error> {
+        let sig_len = data
+            .take_prefix(mem::size_of::<u32>())
+            .map(|v| LittleEndian::read_u32(&v))?;
+        if sig_len as usize != data.len() {
+            return Err(Error::QuoteParseError(
+                "unexpected trailing data after signature".to_string(),
+            ));
+        }
+        let signature = data.take_prefix(ECDSA_P256_SIGNATURE_LEN)?;
+        let attestation_public_key = data.take_prefix(ECDSA_P256_PUBLIC_KEY_LEN)?;
+
+        // In version 4 quotes, there is an intermediate certification data tuple.
+        if version == QUOTE_VERSION_4 {
+            let cd_type = data
+                .take_prefix(mem::size_of::<u16>())
+                .map(|v| LittleEndian::read_u16(&v))?;
+            let certification_data_type =
+                CertificationDataType::from_u16(cd_type).ok_or_else(|| {
+                    Error::QuoteParseError(format!("unknown certification data type: {}", cd_type))
+                })?;
+            let certdata_len = data
+                .take_prefix(mem::size_of::<u32>())
+                .map(|v| LittleEndian::read_u32(&v))?;
+            if certdata_len as usize != data.len() {
+                return Err(Error::QuoteParseError(
+                    "invalid certification data length".to_string(),
+                ));
+            }
+
+            if certification_data_type != CertificationDataType::QeReport {
+                return Err(Error::UnexpectedCertificationData);
+            }
+        }
+
+        let qe = CertificationDataQeReport::parse(data)?;
+
+        Ok(QuoteSignatureEcdsaP256 {
+            signature,
+            attestation_public_key,
+            qe,
+        })
+    }
+}
+
+impl<'a> QuoteSignatureEcdsaP256<'a> {
+    /// Raw signature.
+    pub fn signature(&self) -> &[u8] {
+        &self.signature
+    }
+
+    /// Raw attestation public key.
+    pub fn attestation_public_key(&self) -> &[u8] {
+        &self.attestation_public_key
+    }
+
+    /// Verify signature against quote using the attestation public key.
+    ///
+    /// The passed `data` must cover the Quote Header and the Report Data.
+    pub fn verify_quote_signature(&'a self, data: &[u8]) -> Result<&'a Self, Error> {
+        let sig = raw_ecdsa_sig_to_der(self.signature())?;
+        let mut pk = parse_ecdsa_pk(self.attestation_public_key())?;
+
+        let mut hash = [0u8; 32];
+        Md::hash(hash::Type::Sha256, data, &mut hash).map_err(|err| Error::Other(err.into()))?;
+        pk.verify(hash::Type::Sha256, &hash, &sig)
+            .map_err(|_| Error::VerificationFailed("quote signature is invalid".to_string()))?;
+
+        Ok(self)
+    }
+
+    /// Verify QE Report signature using the PCK public key.
+    pub fn verify_qe_report_signature(&self, pck_pk: &[u8]) -> Result<(), Error> {
+        self.qe
+            .verify_qe_report_signature(self.attestation_public_key(), pck_pk)
+    }
+}
+
+/// Convert IEEE P1363 ECDSA signature to RFC5480 ASN.1 representation.
+fn raw_ecdsa_sig_to_der(sig: &[u8]) -> Result<Vec<u8>, Error> {
+    if sig.len() % 2 != 0 {
+        return Err(Error::QuoteParseError(
+            "malformed ECDSA signature".to_string(),
+        ));
+    }
+
+    let (r_bytes, s_bytes) = sig.split_at(sig.len() / 2);
+    let r = num_bigint::BigUint::from_bytes_be(r_bytes);
+    let s = num_bigint::BigUint::from_bytes_be(s_bytes);
+
+    let der = yasna::construct_der(|writer| {
+        writer.write_sequence(|writer| {
+            writer.next().write_biguint(&r);
+            writer.next().write_biguint(&s);
+        })
+    });
+
+    Ok(der)
+}
+
+/// Parse Secp256r1 public key.
+fn parse_ecdsa_pk(pk: &[u8]) -> Result<Pk, Error> {
+    let mut pt = vec![0x4]; // Add SEC 1 tag (uncompressed).
+    pt.extend_from_slice(pk);
+
+    let group = EcGroup::new(EcGroupId::SecP256R1).map_err(|err| Error::Other(err.into()))?;
+    let pt = EcPoint::from_binary(&group, &pt).map_err(|err| Error::Other(err.into()))?;
+    Pk::public_from_ec_components(group, pt).map_err(|err| Error::Other(err.into()))
+}
+
+/// Quote signature verifier for ECDSA-P256 signatures.
+pub trait QuoteSignatureEcdsaP256Verifier {
+    /// Verify the platform certification data.
+    ///
+    /// The certification data is in `signature.certification_data()`.
+    ///
+    /// On success, should return the platform certification public key (PCK) in DER format.
+    fn verify_certification_data(
+        &mut self,
+        signature: &QuoteSignatureEcdsaP256,
+    ) -> Result<Vec<u8>, Error>;
+
+    /// Verify the quoting enclave.
+    fn verify_qe(&mut self, qe_report: &[u8], authentication_data: &[u8]) -> Result<(), Error>;
+}
+
+pub trait QuoteSignatureVerify<'a>: QuoteSignature<'a> {
+    type TrustRoot;
+
+    fn verify(&self, quote: &[u8], root_of_trust: Self::TrustRoot) -> Result<(), Error>;
+}
+
+impl<'a> QuoteSignatureVerify<'a> for QuoteSignatureEcdsaP256<'a> {
+    type TrustRoot = &'a mut dyn QuoteSignatureEcdsaP256Verifier;
+
+    fn verify(&self, quote: &[u8], verifier: Self::TrustRoot) -> Result<(), Error> {
+        let pck_pk = verifier.verify_certification_data(self)?;
+        self.verify_qe_report_signature(&pck_pk)?;
+        verifier.verify_qe(self.qe.qe_report(), self.qe.authentication_data())?;
+        self.verify_quote_signature(quote)?;
+        Ok(())
+    }
+}
+
+/// Certification data type.
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, FromPrimitive, ToPrimitive)]
+#[repr(u16)]
+pub enum CertificationDataType {
+    PpidCleartext = 1,
+    PpidEncryptedRsa2048 = 2,
+    PpidEncryptedRsa3072 = 3,
+    PckCertificate = 4,
+    PckCertificateChain = 5,
+    QeReport = 6,
+    PlatformManifest = 7,
+}
+
+/// Certification data trait.
+pub trait CertificationData<'a>: Sized {
+    /// Parse certification data of the given type from the given raw data.
+    fn parse(r#type: CertificationDataType, data: Cow<'a, [u8]>) -> Result<Self, Error>;
+}
+
+/// PPID certification data.
+#[derive(Clone, Debug, Hash, PartialEq, Eq)]
+pub struct CertificationDataPpid<'a> {
+    pub ppid: Cow<'a, [u8]>,
+    pub cpusvn: Cow<'a, [u8]>,
+    pub pcesvn: u16,
+    pub pceid: u16,
+}
+
+impl<'a> CertificationData<'a> for CertificationDataPpid<'a> {
+    fn parse(r#type: CertificationDataType, mut data: Cow<'a, [u8]>) -> Result<Self, Error> {
+        let ppid_len = match r#type {
+            CertificationDataType::PpidEncryptedRsa2048 => 256,
+            CertificationDataType::PpidEncryptedRsa3072 => 384,
+            _ => return Err(Error::UnexpectedCertificationData),
+        };
+
+        let ppid = data.take_prefix(ppid_len)?;
+        let cpusvn = data.take_prefix(CPUSVN_LEN)?;
+        let pcesvn = data
+            .take_prefix(mem::size_of::<u16>())
+            .map(|v| LittleEndian::read_u16(&v))?;
+        let pceid = data
+            .take_prefix(mem::size_of::<u16>())
+            .map(|v| LittleEndian::read_u16(&v))?;
+        if !data.is_empty() {
+            return Err(Error::MalformedCertificationData);
+        }
+
+        Ok(CertificationDataPpid {
+            ppid,
+            cpusvn,
+            pcesvn,
+            pceid,
+        })
+    }
+}
+
+/// PCK certificate chain certification data.
+#[derive(Clone, Debug, Hash, PartialEq, Eq)]
+pub struct CertificationDataPckCertificateChain<'a> {
+    pub certs: Vec<Cow<'a, str>>,
+}
+
+impl<'a> CertificationData<'a> for CertificationDataPckCertificateChain<'a> {
+    fn parse(r#type: CertificationDataType, data: Cow<'a, [u8]>) -> Result<Self, Error> {
+        if r#type != CertificationDataType::PckCertificateChain {
+            return Err(Error::UnexpectedCertificationData);
+        }
+
+        let mut data = match data {
+            Cow::Borrowed(s) => std::str::from_utf8(s)
+                .map(Cow::Borrowed)
+                .map_err(|_| Error::MalformedPCK)?,
+            Cow::Owned(s) => String::from_utf8(s)
+                .map(Cow::Owned)
+                .map_err(|_| Error::MalformedPCK)?,
+        };
+
+        let mut certs = vec![];
+        let mark = "-----END CERTIFICATE-----";
+        while let Some(pos) = data.find(mark) {
+            certs.push(data.take_prefix(pos + mark.len()).unwrap()); // Pos is always valid.
+            if let Some(start) = data.find("-") {
+                data.take_prefix(start).unwrap(); // Start is always valid.
+            }
+        }
+
+        Ok(CertificationDataPckCertificateChain { certs })
+    }
+}
+
+/// QE report certification data.
+#[derive(Debug)]
+pub struct CertificationDataQeReport<'a> {
+    qe_report: Cow<'a, [u8]>,
+    qe_report_signature: Cow<'a, [u8]>,
+    authentication_data: Cow<'a, [u8]>,
+    certification_data_type: CertificationDataType,
+    certification_data: Cow<'a, [u8]>,
+}
+
+impl<'a> CertificationDataQeReport<'a> {
+    fn parse(mut data: Cow<'a, [u8]>) -> Result<Self, Error> {
+        let qe_report = data.take_prefix(SGX_REPORT_BODY_LEN)?;
+        let qe_report_signature = data.take_prefix(ECDSA_P256_SIGNATURE_LEN)?;
+        let authdata_len = data
+            .take_prefix(mem::size_of::<u16>())
+            .map(|v| LittleEndian::read_u16(&v))?;
+        let authentication_data = data.take_prefix(authdata_len as _)?;
+
+        let cd_type = data
+            .take_prefix(mem::size_of::<u16>())
+            .map(|v| LittleEndian::read_u16(&v))?;
+        let certification_data_type =
+            CertificationDataType::from_u16(cd_type).ok_or_else(|| {
+                Error::QuoteParseError(format!("unknown certification data type: {}", cd_type))
+            })?;
+        let certdata_len = data
+            .take_prefix(mem::size_of::<u32>())
+            .map(|v| LittleEndian::read_u32(&v))?;
+        if certdata_len as usize != data.len() {
+            return Err(Error::QuoteParseError(
+                "invalid certification data length".to_string(),
+            ));
+        }
+
+        Ok(CertificationDataQeReport {
+            qe_report,
+            qe_report_signature,
+            authentication_data,
+            certification_data_type,
+            certification_data: data,
+        })
+    }
+
+    /// Raw QE report.
+    pub fn qe_report(&self) -> &[u8] {
+        &self.qe_report
+    }
+
+    /// Raw QE report signature.
+    pub fn qe_report_signature(&self) -> &[u8] {
+        &self.qe_report_signature
+    }
+
+    /// Raw authentication data.
+    pub fn authentication_data(&self) -> &[u8] {
+        &self.authentication_data
+    }
+
+    /// Inner certification data type.
+    pub fn certification_data_type(&self) -> CertificationDataType {
+        self.certification_data_type
+    }
+
+    /// Parse inner certification data.
+    pub fn certification_data<T: CertificationData<'a>>(&self) -> Result<T, Error> {
+        T::parse(
+            self.certification_data_type,
+            self.certification_data.clone(),
+        )
+    }
+
+    /// Verify QE Report signature using the PCK public key.
+    pub fn verify_qe_report_signature(
+        &self,
+        attestation_pk: &[u8],
+        pck_pk: &[u8],
+    ) -> Result<(), Error> {
+        // Verify QE report signature using PCK public key.
+        let sig = raw_ecdsa_sig_to_der(self.qe_report_signature())?;
+        let mut hash = [0u8; 32];
+        Md::hash(hash::Type::Sha256, self.qe_report(), &mut hash)
+            .map_err(|err| Error::Other(err.into()))?;
+        let mut pck_pk = Pk::from_public_key(pck_pk).map_err(|err| Error::Other(err.into()))?;
+        pck_pk
+            .verify(mbedtls::hash::Type::Sha256, &hash, &sig)
+            .map_err(|_| Error::VerificationFailed("QE report signature is invalid".to_string()))?;
+
+        // Verify QE report data. First 32 bytes MUST be:
+        //   SHA-256(AttestationPublicKey || AuthenticationData)
+        // and the remaining 32 bytes MUST be zero.
+        let mut hash = [0u8; 32];
+        let mut sha256 = Md::new(hash::Type::Sha256).map_err(|err| Error::Other(err.into()))?;
+        sha256
+            .update(attestation_pk)
+            .map_err(|err| Error::Other(err.into()))?;
+        sha256
+            .update(self.authentication_data())
+            .map_err(|err| Error::Other(err.into()))?;
+        sha256
+            .finish(&mut hash)
+            .map_err(|err| Error::Other(err.into()))?;
+
+        let mut qe_report = Vec::with_capacity(SgxReport::UNPADDED_SIZE);
+        qe_report.extend(self.qe_report());
+        qe_report.resize_with(SgxReport::UNPADDED_SIZE, Default::default);
+        let qe_report = SgxReport::try_copy_from(&qe_report).ok_or(Error::MalformedQEReport)?;
+
+        if qe_report.reportdata[0..32] != hash {
+            return Err(Error::VerificationFailed(
+                "QE report data does not match expected value".to_string(),
+            ));
+        }
+        if qe_report.reportdata[32..64] != [0; 32] {
+            return Err(Error::VerificationFailed(
+                "QE report data does not match expected value".to_string(),
+            ));
+        }
+
+        Ok(())
+    }
+}
+
+/// Quoting Enclave ECDSA P-256 verifier.
+pub struct QeEcdsaP256Verifier {
+    tcb_info: TCBInfo,
+    qe_identity: QEIdentity,
+    tdx_comp_svn: Option<[u32; 16]>,
+    tcb_level: Option<TCBLevel>,
+}
+
+impl QeEcdsaP256Verifier {
+    /// Create a new verifier.
+    pub fn new(
+        tcb_info: TCBInfo,
+        qe_identity: QEIdentity,
+        tdx_comp_svn: Option<[u32; 16]>,
+    ) -> Self {
+        Self {
+            tcb_info,
+            qe_identity,
+            tdx_comp_svn,
+            tcb_level: None,
+        }
+    }
+
+    /// Get the TCB level.
+    /// This will return `None` if the quote has not been verified yet.
+    pub fn tcb_level(&self) -> Option<TCBLevel> {
+        self.tcb_level.clone()
+    }
+}
+
+impl QuoteSignatureEcdsaP256Verifier for QeEcdsaP256Verifier {
+    fn verify_certification_data(
+        &mut self,
+        signature: &QuoteSignatureEcdsaP256,
+    ) -> Result<Vec<u8>, Error> {
+        // Only PCK certificate chain is supported as certification data.
+        let certs = signature
+            .qe
+            .certification_data::<CertificationDataPckCertificateChain>()?
+            .certs;
+        if certs.len() != 3 {
+            return Err(Error::UnexpectedCertificateChain);
+        }
+
+        // Verify certificate chain.
+        let mut cert_chain = MbedtlsList::new();
+        for raw_cert in &certs {
+            let raw_cert = CString::new(raw_cert.as_ref()).map_err(|_| Error::MalformedPCK)?;
+            let cert = Certificate::from_pem(raw_cert.as_bytes_with_nul())
+                .map_err(|_| Error::MalformedPCK)?;
+            cert_chain.push(cert);
+        }
+        // TODO: Specify current timestamp.
+        Certificate::verify(&cert_chain, &PCS_TRUST_ROOT, None, None).map_err(|_| {
+            Error::VerificationFailed("PCK certificate chain is invalid".to_string())
+        })?;
+
+        // Extract TCB parameters from the PCK certificate.
+        let mut pck_cert = cert_chain.pop_front().unwrap();
+
+        let sgx_extensions = pck_cert
+            .extensions()
+            .map_err(|_| Error::MalformedPCK)?
+            .into_iter()
+            .find(|ext| ext.oid.as_ref() == PCK_SGX_EXTENSIONS_OID)
+            .ok_or(Error::TCBVerificationFailed)?;
+        let mut fmspc: Option<Vec<u8>> = None;
+        let mut tcb_comp_svn: Option<[u32; 16]> = None;
+        let mut pcesvn: Option<u32> = None;
+        yasna::parse_der(&sgx_extensions.value, |reader| {
+            reader.read_sequence_of(|reader| {
+                reader.read_sequence(|reader| {
+                    match reader.next().read_oid()?.as_ref() {
+                        PCK_SGX_EXTENSIONS_FMSPC_OID => {
+                            // FMSPC
+                            let raw_fmspc = reader.next().read_bytes()?;
+                            if raw_fmspc.len() != 6 {
+                                return Err(yasna::ASN1Error::new(yasna::ASN1ErrorKind::Invalid));
+                            }
+                            fmspc = Some(raw_fmspc);
+                        }
+                        PCK_SGX_EXTENSIONS_TCB_OID => {
+                            // TCB
+                            reader.next().read_sequence_of(|reader| {
+                                reader.read_sequence(|reader| {
+                                    let comp_id =
+                                        *reader.next().read_oid()?.as_ref().last().unwrap();
+                                    if (1..=16).contains(&comp_id) {
+                                        // TCB Component SVNs
+                                        tcb_comp_svn.get_or_insert([0; 16])
+                                            [(comp_id - 1) as usize] = reader.next().read_u32()?;
+                                    } else if comp_id == 17 {
+                                        // PCESVN
+                                        pcesvn = Some(reader.next().read_u32()?);
+                                    } else if comp_id == 18 {
+                                        // CPUSVN
+                                        reader.next().read_bytes()?;
+                                    }
+                                    Ok(())
+                                })
+                            })?;
+                        }
+                        _ => {
+                            reader.next().read_der()?;
+                        }
+                    }
+
+                    Ok(())
+                })
+            })
+        })
+        .map_err(|_| Error::MalformedPCK)?;
+        if fmspc.is_none() || tcb_comp_svn.is_none() || pcesvn.is_none() {
+            return Err(Error::MalformedPCK);
+        }
+
+        // Verify TCB level.
+        let tcb_level = self.tcb_info.verify(
+            &fmspc.unwrap(),
+            &tcb_comp_svn.unwrap(),
+            self.tdx_comp_svn.as_ref(),
+            pcesvn.unwrap(),
+        )?;
+        self.tcb_level = Some(tcb_level);
+
+        // Extract PCK public key.
+        let pck_pk = pck_cert
+            .public_key_mut()
+            .write_public_der_vec()
+            .map_err(|_| Error::MalformedPCK)?;
+
+        Ok(pck_pk)
+    }
+
+    fn verify_qe(&mut self, qe_report: &[u8], _authentication_data: &[u8]) -> Result<(), Error> {
+        let mut report = Vec::with_capacity(SgxReport::UNPADDED_SIZE);
+        report.extend(qe_report);
+        report.resize_with(SgxReport::UNPADDED_SIZE, Default::default);
+
+        let report = SgxReport::try_copy_from(&report).ok_or(Error::MalformedQEReport)?;
+        self.qe_identity.verify(&report)?;
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/pcs/report.rs.html b/rust/src/oasis_core_runtime/common/sgx/pcs/report.rs.html new file mode 100644 index 0000000000..2fbd9c5490 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/pcs/report.rs.html @@ -0,0 +1,491 @@ +report.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+
//! TDX structures.
+use std::convert::TryInto;
+
+use byteorder::{ByteOrder, LittleEndian};
+pub use sgx_isa::Report as SgxReport;
+use tiny_keccak::{Hasher, TupleHash};
+
+use super::{constants::*, utils::*, Error};
+use crate::common::sgx::{EnclaveIdentity, MrEnclave};
+
+/// TDX TD report.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub struct TdReport {
+    /// Describes the TCB of TDX.
+    pub tee_tcb_svn: [u8; 16],
+    /// Measurement of the TDX Module.
+    pub mr_seam: [u8; 48],
+    /// Signer of the TDX Module (zero for Intel).
+    pub mr_signer_seam: [u8; 48],
+    /// TDX Module attributes (must be zero for TDX 1.0).
+    pub seam_attributes: [u8; 8],
+    /// TD attributes.
+    pub td_attributes: TdAttributes,
+    /// XFAM (eXtended Features Available Mask).
+    pub xfam: [u8; 8],
+    /// Measurement of the initial contents of the TD.
+    pub mr_td: [u8; 48],
+    /// Software-defined ID for non-owner-defined configuration of the TD, e.g., runtime or OS
+    /// configuration.
+    pub mr_config_id: [u8; 48],
+    /// Software-defined ID for the TD’s owner.
+    pub mr_owner: [u8; 48],
+    /// Software-defined ID for owner-defined configuration of the TD, e.g., specific to the
+    /// workload rather than the runtime or OS.
+    pub mr_owner_config: [u8; 48],
+    /// Runtime extendable measurement register 0.
+    pub rtmr0: [u8; 48],
+    /// Runtime extendable measurement register 1.
+    pub rtmr1: [u8; 48],
+    /// Runtime extendable measurement register 2.
+    pub rtmr2: [u8; 48],
+    /// Runtime extendable measurement register 3.
+    pub rtmr3: [u8; 48],
+    /// Custom report data.
+    pub report_data: [u8; 64],
+}
+
+impl TdReport {
+    /// Parse a TDX report.
+    pub fn parse(mut data: &[u8]) -> Result<Self, Error> {
+        if data.len() != TDX_REPORT_BODY_LEN {
+            return Err(Error::MalformedReport);
+        }
+
+        let report = Self {
+            tee_tcb_svn: data
+                .take_prefix(16)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            mr_seam: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            mr_signer_seam: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            seam_attributes: data
+                .take_prefix(8)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            td_attributes: TdAttributes::parse(
+                data.take_prefix(8).map_err(|_| Error::MalformedReport)?,
+            )?,
+            xfam: data
+                .take_prefix(8)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            mr_td: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            mr_config_id: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            mr_owner: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            mr_owner_config: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            rtmr0: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            rtmr1: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            rtmr2: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            rtmr3: data
+                .take_prefix(48)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+            report_data: data
+                .take_prefix(64)
+                .map_err(|_| Error::MalformedReport)?
+                .try_into()
+                .unwrap(),
+        };
+
+        // SEAM attributes must be zero for TDX 1.0.
+        if report.seam_attributes != [0; 8] {
+            return Err(Error::MalformedReport);
+        }
+
+        Ok(report)
+    }
+
+    /// Converts this report into an enclave identity.
+    pub fn as_enclave_identity(&self) -> EnclaveIdentity {
+        td_enclave_identity(
+            &self.mr_td,
+            &self.rtmr0,
+            &self.rtmr1,
+            &self.rtmr2,
+            &self.rtmr3,
+        )
+    }
+}
+
+/// Compute enclave identity from the given measurements.
+pub fn td_enclave_identity(
+    mr_td: &[u8; 48],
+    rtmr0: &[u8; 48],
+    rtmr1: &[u8; 48],
+    rtmr2: &[u8; 48],
+    rtmr3: &[u8; 48],
+) -> EnclaveIdentity {
+    // TODO: Change the EnclaveIdentity structure to allow specifying all the different things.
+
+    // Compute MRENCLAVE as TupleHash[TD_ENCLAVE_IDENTITY_CONTEXT](MRTD, RTMR0, RTMR1, RTMR2, RTMR3).
+    //
+    // MRTD  -- Measurement of virtual firmware.
+    // RTMR0 -- Measurement of virtual firmware data and configuration.
+    // RTMR1 -- Measurement of OS loader, option ROM, boot parameters.
+    // RTMR2 -- Measurement of OS kernel, initrd, boot parameters.
+    // RTMR3 -- Reserved.
+    //
+    let mut mr_enclave = MrEnclave::default();
+    let mut h = TupleHash::v256(TD_ENCLAVE_IDENTITY_CONTEXT);
+    h.update(mr_td);
+    h.update(rtmr0);
+    h.update(rtmr1);
+    h.update(rtmr2);
+    h.update(rtmr3);
+    h.finalize(&mut mr_enclave.0);
+
+    EnclaveIdentity {
+        mr_signer: Default::default(), // All-zero MRSIGNER (invalid in SGX).
+        mr_enclave,
+    }
+}
+
+/// TD enclave identity conversion context.
+pub const TD_ENCLAVE_IDENTITY_CONTEXT: &[u8] = b"oasis-core/tdx: TD enclave identity";
+
+bitflags::bitflags! {
+    /// TDX TD attributes.
+    #[derive(Debug, Clone, Copy, PartialEq, Eq)]
+    pub struct TdAttributes: u64 {
+        /// TUD.DEBUG (TD runs in debug mode).
+        const DEBUG = 0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000001;
+        // TUD bits 7:1 reserved for future use and must be zero.
+
+        // SEC bits 27:8 reserved for future use and must be zero.
+        /// SEC.SEPT_VE_DISABLE (Disable EPT violation conversion to #VE on TD access of PENDING pages).
+        const SEPT_VE_DISABLE = 0b00000000_00000000_00000000_00000000_00010000_00000000_00000000_00000000;
+        // SEC bit 28 reserved for future use and must be zero.
+        /// SEC.PKS (TD is allowed to use Supervisor Protection Keys).
+        const PKS = 0b00000000_00000000_00000000_00000000_01000000_00000000_00000000_00000000;
+        /// SEC.KL (TD is allowed to use Key Locker).
+        const KL = 0b00000000_00000000_00000000_00000000_10000000_00000000_00000000_00000000;
+
+        // OTHER bits 62:32 reserved for future use and must be zero.
+        /// OTHER.PERFMON (TD is allowed to use Perfmon and PERF_METRICS capabilities).
+        const PERFMON = 0b10000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000;
+    }
+}
+
+impl TdAttributes {
+    /// Parse raw TDX attributes.
+    pub fn parse(data: &[u8]) -> Result<Self, Error> {
+        if data.len() != 8 {
+            return Err(Error::MalformedReport);
+        }
+
+        let attrs = LittleEndian::read_u64(data);
+
+        Self::from_bits(attrs).ok_or(Error::MalformedReport)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn test_td_attributes() {
+        let attrs = TdAttributes::DEBUG | TdAttributes::SEPT_VE_DISABLE | TdAttributes::PKS;
+        assert!(attrs.contains(TdAttributes::DEBUG));
+        assert!(attrs.contains(TdAttributes::SEPT_VE_DISABLE));
+        assert!(attrs.contains(TdAttributes::PKS));
+        assert!(attrs.contains(TdAttributes::DEBUG | TdAttributes::SEPT_VE_DISABLE));
+        assert!(!attrs.contains(TdAttributes::KL));
+        assert!(!attrs.contains(TdAttributes::DEBUG | TdAttributes::KL));
+
+        let reserved = vec![0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff];
+        let result = TdAttributes::parse(&reserved);
+        assert!(matches!(result, Err(Error::MalformedReport)));
+
+        let reserved = vec![0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01];
+        let result = TdAttributes::parse(&reserved);
+        assert!(matches!(result, Err(Error::MalformedReport)));
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/pcs/tcb.rs.html b/rust/src/oasis_core_runtime/common/sgx/pcs/tcb.rs.html new file mode 100644 index 0000000000..0962d46fe9 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/pcs/tcb.rs.html @@ -0,0 +1,1375 @@ +tcb.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+
use std::ffi::CString;
+
+use byteorder::{ByteOrder, LittleEndian};
+use chrono::{prelude::*, Duration};
+use mbedtls::{alloc::Box as MbedtlsBox, x509::certificate::Certificate};
+use rustc_hex::FromHex;
+use serde_json::value::RawValue;
+use sgx_isa::Report;
+
+use super::{
+    certificates::PCS_TRUST_ROOT, constants::*, policy::QuotePolicy, quote::TeeType, Error,
+};
+
+/// The TCB bundle contains all the required components to verify a quote's TCB.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct TCBBundle {
+    #[cbor(rename = "tcb_info")]
+    pub tcb_info: SignedTCBInfo,
+
+    #[cbor(rename = "qe_id")]
+    pub qe_identity: SignedQEIdentity,
+
+    #[cbor(rename = "certs")]
+    pub certificates: Vec<u8>,
+}
+
+impl TCBBundle {
+    pub(super) fn verify_certificates(
+        &self,
+        _ts: DateTime<Utc>,
+    ) -> Result<MbedtlsBox<Certificate>, Error> {
+        let raw_certs =
+            CString::new(&*self.certificates).map_err(|err| Error::TCBParseError(err.into()))?;
+        let mut cert_chain = Certificate::from_pem_multiple(raw_certs.as_bytes_with_nul())
+            .map_err(|err| Error::TCBParseError(err.into()))?;
+        if cert_chain.iter().count() != 2 {
+            return Err(Error::UnexpectedCertificateChain);
+        }
+
+        // TODO: Specify current timestamp.
+        Certificate::verify(&cert_chain, &PCS_TRUST_ROOT, None, None)
+            .map_err(|_| Error::TCBVerificationFailed)?;
+
+        Ok(cert_chain.pop_front().unwrap())
+    }
+}
+
+#[inline]
+fn encode_raw_value(value: &Box<RawValue>) -> Vec<u8> {
+    value.get().as_bytes().to_owned()
+}
+
+#[inline]
+fn decode_raw_value(value: Vec<u8>) -> Result<Box<RawValue>, cbor::DecodeError> {
+    RawValue::from_string(String::from_utf8(value).map_err(|_| cbor::DecodeError::UnexpectedType)?)
+        .map_err(|_| cbor::DecodeError::UnexpectedType)
+}
+
+/// A signed TCB info structure.
+#[derive(Clone, Debug, Default, serde::Deserialize, cbor::Encode, cbor::Decode)]
+pub struct SignedTCBInfo {
+    #[cbor(
+        rename = "tcb_info",
+        serialize_with = "encode_raw_value",
+        deserialize_with = "decode_raw_value"
+    )]
+    #[serde(rename = "tcbInfo")]
+    pub tcb_info: Box<RawValue>,
+
+    #[cbor(rename = "signature")]
+    #[serde(rename = "signature")]
+    pub signature: String,
+}
+
+impl PartialEq for SignedTCBInfo {
+    fn eq(&self, other: &SignedTCBInfo) -> bool {
+        self.tcb_info.get() == other.tcb_info.get() && self.signature == other.signature
+    }
+}
+
+impl Eq for SignedTCBInfo {}
+
+fn open_signed_tcb<'a, T: serde::Deserialize<'a>>(
+    data: &'a str,
+    signature: &str,
+    pk: &mut mbedtls::pk::Pk,
+) -> Result<T, Error> {
+    let mut hash = [0u8; 32];
+    mbedtls::hash::Md::hash(mbedtls::hash::Type::Sha256, data.as_bytes(), &mut hash)
+        .map_err(|_| Error::TCBVerificationFailed)?;
+    let sig: Vec<u8> = signature
+        .from_hex()
+        .map_err(|_| Error::TCBVerificationFailed)?;
+
+    // Convert IEEE P1363 ECDSA signature to RFC5480 ASN.1 representation.
+    if sig.len() % 2 != 0 {
+        return Err(Error::TCBVerificationFailed);
+    }
+
+    let (r_bytes, s_bytes) = sig.split_at(sig.len() / 2);
+    let r = num_bigint::BigUint::from_bytes_be(r_bytes);
+    let s = num_bigint::BigUint::from_bytes_be(s_bytes);
+
+    let sig = yasna::construct_der(|writer| {
+        writer.write_sequence(|writer| {
+            writer.next().write_biguint(&r);
+            writer.next().write_biguint(&s);
+        })
+    });
+
+    pk.verify(mbedtls::hash::Type::Sha256, &hash, &sig)
+        .map_err(|_| Error::TCBVerificationFailed)?;
+
+    serde_json::from_str(data).map_err(|err| Error::TCBParseError(err.into()))
+}
+
+impl SignedTCBInfo {
+    pub fn open(
+        &self,
+        tee_type: TeeType,
+        ts: DateTime<Utc>,
+        policy: &QuotePolicy,
+        pk: &mut mbedtls::pk::Pk,
+    ) -> Result<TCBInfo, Error> {
+        let ti: TCBInfo = open_signed_tcb(self.tcb_info.get(), &self.signature, pk)?;
+        ti.validate(tee_type, ts, policy)?;
+
+        Ok(ti)
+    }
+}
+
+/// TCB info identifier.
+#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, serde::Deserialize)]
+pub enum TCBInfoID {
+    SGX,
+    TDX,
+    #[serde(other)]
+    #[default]
+    Invalid,
+}
+
+/// TCB info body.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct TCBInfo {
+    #[serde(rename = "id")]
+    pub id: TCBInfoID,
+
+    #[serde(rename = "version")]
+    pub version: u32,
+
+    #[serde(rename = "issueDate")]
+    pub issue_date: String,
+
+    #[serde(rename = "nextUpdate")]
+    pub next_update: String,
+
+    #[serde(rename = "fmspc")]
+    pub fmspc: String,
+
+    #[serde(rename = "pceId")]
+    pub pceid: String,
+
+    #[serde(rename = "tcbType")]
+    pub tcb_type: u32,
+
+    #[serde(rename = "tcbEvaluationDataNumber")]
+    pub tcb_evaluation_data_number: u32,
+
+    #[serde(default, rename = "tdxModule")]
+    pub tdx_module: TDXModule,
+
+    #[serde(default, rename = "tdxModuleIdentities")]
+    pub tdx_module_identities: Vec<TDXModuleIdentity>,
+
+    #[serde(rename = "tcbLevels")]
+    pub tcb_levels: Vec<TCBLevel>,
+}
+
+impl TCBInfo {
+    /// Validate the TCB info against the quote policy.
+    pub fn validate(
+        &self,
+        tee_type: TeeType,
+        ts: DateTime<Utc>,
+        policy: &QuotePolicy,
+    ) -> Result<(), Error> {
+        match (self.id, tee_type) {
+            (TCBInfoID::SGX, TeeType::SGX) => {}
+            (TCBInfoID::TDX, TeeType::TDX) => {}
+            _ => {
+                return Err(Error::TCBParseError(anyhow::anyhow!(
+                    "unexpected TCB info identifier"
+                )))
+            }
+        }
+
+        if self.version != REQUIRED_TCB_INFO_VERSION {
+            return Err(Error::TCBParseError(anyhow::anyhow!(
+                "unexpected TCB info version"
+            )));
+        }
+
+        // Validate TCB info is not expired/not yet valid based on current time.
+        let issue_date = NaiveDateTime::parse_from_str(&self.issue_date, PCS_TS_FMT)
+            .map_err(|err| Error::TCBParseError(err.into()))?
+            .and_utc();
+        let _next_update = NaiveDateTime::parse_from_str(&self.next_update, PCS_TS_FMT)
+            .map_err(|err| Error::TCBParseError(err.into()))?
+            .and_utc();
+        if issue_date > ts {
+            return Err(Error::TCBExpired);
+        }
+        if ts - issue_date
+            > Duration::try_days(policy.tcb_validity_period.into())
+                .unwrap_or(DEFAULT_TCB_VALIDITY_PERIOD)
+        {
+            return Err(Error::TCBExpired);
+        }
+
+        if self.tcb_evaluation_data_number < policy.min_tcb_evaluation_data_number {
+            return Err(Error::TCBEvaluationDataNumberInvalid);
+        }
+
+        // Validate FMSPC not blacklisted.
+        let blocked = policy
+            .fmspc_blacklist
+            .iter()
+            .any(|blocked| blocked == &self.fmspc);
+        if blocked {
+            return Err(Error::BlacklistedFMSPC);
+        }
+
+        Ok(())
+    }
+
+    /// Verify and return the TCB level matching the given TCB components and PCESVN.
+    pub fn verify(
+        &self,
+        fmspc: &[u8],
+        sgx_comp_svn: &[u32; 16],
+        tdx_comp_svn: Option<&[u32; 16]>,
+        pcesvn: u32,
+    ) -> Result<TCBLevel, Error> {
+        // Validate FMSPC matches.
+        let expected_fmspc: Vec<u8> = self
+            .fmspc
+            .from_hex()
+            .map_err(|err| Error::TCBParseError(err.into()))?;
+        if fmspc != expected_fmspc {
+            return Err(Error::TCBMismatch);
+        }
+
+        // Find first matching TCB level.
+        let level = self
+            .tcb_levels
+            .iter()
+            .find(|level| level.matches(sgx_comp_svn, tdx_comp_svn, pcesvn))
+            .ok_or(Error::TCBOutOfDate)?
+            .clone();
+
+        if self.id == TCBInfoID::TDX {
+            // Perform additional TCB status evaluation for TDX module in case TEE TCB SVN at index
+            // 1 is greater or equal to 1, otherwise finish the comparison logic.
+            let tdx_comp_svn = tdx_comp_svn.ok_or(Error::TCBMismatch)?;
+            let tdx_module_version = tdx_comp_svn[1];
+            if tdx_module_version >= 1 {
+                // In order to determine TCB status of TDX module, find a matching TDX Module
+                // Identity (in tdxModuleIdentities array of TCB Info) with its id set to
+                // "TDX_<version>" where <version> matches the value of TEE TCB SVN at index 1. If a
+                // matching TDX Module Identity cannot be found, fail.
+                let tdx_module_id = format!("TDX_{:02}", tdx_module_version);
+                let tdx_module = self
+                    .tdx_module_identities
+                    .iter()
+                    .find(|tm| tm.id == tdx_module_id)
+                    .ok_or(Error::TCBOutOfDate)?;
+
+                // Otherwise, for the selected TDX Module Identity go over the sorted collection of
+                // TCB Levels starting from the first item on the list and compare its isvsvn value
+                // to the TEE TCB SVN at index 0. If TEE TCB SVN at index 0 is greater or equal to
+                // its value, read tcbStatus assigned to this TCB level, otherwise move to the next
+                // item on TCB levels list.
+                let tdx_module_level = tdx_module
+                    .tcb_levels
+                    .iter()
+                    .find(|level| level.tcb.isv_svn as u32 <= tdx_comp_svn[0])
+                    .ok_or(Error::TCBOutOfDate)?;
+                if tdx_module_level.status != TCBStatus::UpToDate {
+                    return Err(Error::TCBOutOfDate);
+                }
+            }
+        }
+
+        Ok(level)
+    }
+}
+
+/// A representation of the properties of Intel's TDX SEAM module.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct TDXModule {
+    #[serde(rename = "mrsigner")]
+    pub mr_signer: String,
+
+    #[serde(rename = "attributes")]
+    pub attributes: String,
+
+    #[serde(rename = "attributesMask")]
+    pub attributes_mask: String,
+}
+
+/// A representation of the identity of the Intel's TDX SEAM module in case the platform supports
+/// more than one TDX SEAM module.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct TDXModuleIdentity {
+    #[serde(rename = "id")]
+    pub id: String,
+
+    #[serde(flatten)]
+    pub module: TDXModule,
+
+    #[serde(rename = "tcbLevels")]
+    pub tcb_levels: Vec<EnclaveTCBLevel>,
+}
+
+/// A platform TCB level.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct TCBLevel {
+    #[serde(rename = "tcb")]
+    pub tcb: TCBVersions,
+
+    #[serde(rename = "tcbDate")]
+    pub date: String,
+
+    #[serde(rename = "tcbStatus")]
+    pub status: TCBStatus,
+
+    #[serde(default, rename = "advisoryIDs")]
+    pub advisory_ids: Vec<String>,
+}
+
+impl TCBLevel {
+    /// Whether the TCB level matches the given TCB components and PCESVN.
+    pub fn matches(
+        &self,
+        sgx_comp_svn: &[u32],
+        tdx_comp_svn: Option<&[u32; 16]>,
+        pcesvn: u32,
+    ) -> bool {
+        // a) Compare all of the SGX TCB Comp SVNs retrieved from the SGX PCK Certificate (from 01 to
+        //    16) with the corresponding values in the TCB Level. If all SGX TCB Comp SVNs in the
+        //    certificate are greater or equal to the corresponding values in TCB Level, go to b,
+        //    otherwise move to the next item on TCB Levels list.
+        for (i, comp) in self.tcb.sgx_components.iter().enumerate() {
+            // At least one SVN is lower, no match.
+            if sgx_comp_svn[i] < comp.svn {
+                return false;
+            }
+        }
+
+        // b) Compare PCESVN value retrieved from the SGX PCK certificate with the corresponding value
+        //    in the TCB Level. If it is greater or equal to the value in TCB Level, read status
+        //    assigned to this TCB level (in case of SGX) or go to c (in case of TDX). Otherwise,
+        //    move to the next item on TCB Levels list.
+        if self.tcb.pcesvn < pcesvn {
+            return false;
+        }
+
+        if let Some(tdx_comp_svn) = tdx_comp_svn {
+            // c) Compare SVNs in TEE TCB SVN array retrieved from TD Report in Quote (from index 0 to
+            //    15 if TEE TCB SVN at index 1 is set to 0, or from index 2 to 15 otherwise) with the
+            //    corresponding values of SVNs in tdxtcbcomponents array of TCB Level. If all TEE TCB
+            //    SVNs in the TD Report are greater or equal to the corresponding values in TCB Level,
+            //    read tcbStatus assigned to this TCB level. Otherwise, move to the next item on TCB
+            //    Levels list.
+            let comps = self.tcb.tdx_components.iter().enumerate();
+            let offset = if tdx_comp_svn[1] != 0 { 2 } else { 0 };
+
+            for (i, comp) in comps.skip(offset) {
+                // At least one SVN is lower, no match.
+                if tdx_comp_svn[i] < comp.svn {
+                    return false;
+                }
+            }
+        }
+
+        // Match.
+        true
+    }
+}
+
+/// TCB versions.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct TCBVersions {
+    #[serde(rename = "pcesvn")]
+    pub pcesvn: u32,
+
+    #[serde(rename = "sgxtcbcomponents")]
+    pub sgx_components: [TCBComponent; 16],
+
+    #[serde(default, rename = "tdxtcbcomponents")]
+    pub tdx_components: [TCBComponent; 16],
+}
+
+/// A TCB component.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct TCBComponent {
+    #[serde(rename = "svn")]
+    pub svn: u32,
+
+    #[serde(default, rename = "category")]
+    pub category: String,
+
+    #[serde(default, rename = "type")]
+    pub tcb_comp_type: String,
+}
+
+/// TCB status.
+#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, serde::Deserialize)]
+pub enum TCBStatus {
+    UpToDate,
+    SWHardeningNeeded,
+    ConfigurationNeeded,
+    ConfigurationAndSWHardeningNeeded,
+    OutOfDate,
+    OutOfDateConfigurationNeeded,
+    Revoked,
+    #[serde(other)]
+    #[default]
+    Invalid,
+}
+
+/// A signed QE identity structure.
+#[derive(Clone, Debug, Default, serde::Deserialize, cbor::Encode, cbor::Decode)]
+pub struct SignedQEIdentity {
+    #[cbor(
+        rename = "enclave_identity",
+        serialize_with = "encode_raw_value",
+        deserialize_with = "decode_raw_value"
+    )]
+    #[serde(rename = "enclaveIdentity")]
+    pub enclave_identity: Box<RawValue>,
+
+    #[cbor(rename = "signature")]
+    #[serde(rename = "signature")]
+    pub signature: String,
+}
+
+impl PartialEq for SignedQEIdentity {
+    fn eq(&self, other: &SignedQEIdentity) -> bool {
+        self.enclave_identity.get() == other.enclave_identity.get()
+            && self.signature == other.signature
+    }
+}
+
+impl Eq for SignedQEIdentity {}
+
+impl SignedQEIdentity {
+    pub fn open(
+        &self,
+        tee_type: TeeType,
+        ts: DateTime<Utc>,
+        policy: &QuotePolicy,
+        pk: &mut mbedtls::pk::Pk,
+    ) -> Result<QEIdentity, Error> {
+        let qe: QEIdentity = open_signed_tcb(self.enclave_identity.get(), &self.signature, pk)?;
+        qe.validate(tee_type, ts, policy)?;
+
+        Ok(qe)
+    }
+}
+
+/// QE identity identifier.
+#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, serde::Deserialize)]
+#[allow(non_camel_case_types)]
+pub enum QEIdentityID {
+    QE,
+    TD_QE,
+    #[serde(other)]
+    #[default]
+    Invalid,
+}
+
+/// QE identity body.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct QEIdentity {
+    #[serde(rename = "id")]
+    pub id: QEIdentityID,
+
+    #[serde(rename = "version")]
+    pub version: u32,
+
+    #[serde(rename = "issueDate")]
+    pub issue_date: String,
+
+    #[serde(rename = "nextUpdate")]
+    pub next_update: String,
+
+    #[serde(rename = "tcbEvaluationDataNumber")]
+    pub tcb_evaluation_data_number: u32,
+
+    #[serde(rename = "miscselect")]
+    pub miscselect: String,
+
+    #[serde(rename = "miscselectMask")]
+    pub miscselect_mask: String,
+
+    #[serde(rename = "attributes")]
+    pub attributes: String,
+
+    #[serde(rename = "attributesMask")]
+    pub attributes_mask: String,
+
+    #[serde(rename = "mrsigner")]
+    pub mr_signer: String,
+
+    #[serde(rename = "isvprodid")]
+    pub isv_prod_id: u16,
+
+    #[serde(rename = "tcbLevels")]
+    pub tcb_levels: Vec<EnclaveTCBLevel>,
+
+    #[serde(default, rename = "advisoryIDs")]
+    pub advisory_ids: Vec<String>,
+}
+
+impl QEIdentity {
+    /// Validate the QE identity against the quote policy.
+    pub fn validate(
+        &self,
+        tee_type: TeeType,
+        ts: DateTime<Utc>,
+        policy: &QuotePolicy,
+    ) -> Result<(), Error> {
+        match (self.id, tee_type) {
+            (QEIdentityID::QE, TeeType::SGX) => {}
+            (QEIdentityID::TD_QE, TeeType::TDX) => {}
+            _ => return Err(Error::TCBParseError(anyhow::anyhow!("unexpected QE ID"))),
+        }
+
+        if self.version != REQUIRED_QE_IDENTITY_VERSION {
+            return Err(Error::TCBParseError(anyhow::anyhow!(
+                "unexpected QE identity version"
+            )));
+        }
+
+        // Validate QE identity is not expired/not yet valid based on current time.
+        let issue_date = NaiveDateTime::parse_from_str(&self.issue_date, PCS_TS_FMT)
+            .map_err(|err| Error::TCBParseError(err.into()))?
+            .and_utc();
+        let _next_update = NaiveDateTime::parse_from_str(&self.next_update, PCS_TS_FMT)
+            .map_err(|err| Error::TCBParseError(err.into()))?
+            .and_utc();
+        if issue_date > ts {
+            return Err(Error::TCBExpired);
+        }
+        if ts - issue_date
+            > Duration::try_days(policy.tcb_validity_period.into())
+                .unwrap_or(DEFAULT_TCB_VALIDITY_PERIOD)
+        {
+            return Err(Error::TCBExpired);
+        }
+
+        if self.tcb_evaluation_data_number < policy.min_tcb_evaluation_data_number {
+            return Err(Error::TCBEvaluationDataNumberInvalid);
+        }
+
+        Ok(())
+    }
+
+    /// Verify the QE report against the QE identity.
+    pub fn verify(&self, report: &Report) -> Result<(), Error> {
+        // Verify if MRSIGNER field retrieved from SGX Enclave Report is equal to the value of
+        // mrsigner field in QE Identity.
+        let expected_mr_signer: Vec<u8> = self
+            .mr_signer
+            .from_hex()
+            .map_err(|_| Error::TCBParseError(anyhow::anyhow!("malformed QE MRSIGNER")))?;
+        if expected_mr_signer != report.mrsigner {
+            return Err(Error::TCBVerificationFailed);
+        }
+
+        // Verify if ISVPRODID field retrieved from SGX Enclave Report is equal to the value of
+        // isvprodid field in QE Identity.
+        if self.isv_prod_id != report.isvprodid {
+            return Err(Error::TCBVerificationFailed);
+        }
+
+        // Apply miscselectMask (binary mask) from QE Identity to MISCSELECT field retrieved from
+        // SGX Enclave Report. Verify if the outcome (miscselectMask & MISCSELECT) is equal to the
+        // value of miscselect field in QE Identity.
+        let raw_miscselect: Vec<u8> = self
+            .miscselect
+            .from_hex()
+            .map_err(|_| Error::TCBParseError(anyhow::anyhow!("malformed QE miscselect")))?;
+        if raw_miscselect.len() != 4 {
+            return Err(Error::TCBParseError(anyhow::anyhow!(
+                "malformed QE miscselect"
+            )));
+        }
+        let raw_miscselect_mask: Vec<u8> = self
+            .miscselect_mask
+            .from_hex()
+            .map_err(|_| Error::TCBParseError(anyhow::anyhow!("malformed QE miscselect mask")))?;
+        if raw_miscselect_mask.len() != 4 {
+            return Err(Error::TCBParseError(anyhow::anyhow!(
+                "malformed QE miscselect"
+            )));
+        }
+        let expected_miscselect = LittleEndian::read_u32(&raw_miscselect);
+        let miscselect_mask = LittleEndian::read_u32(&raw_miscselect_mask);
+        if report.miscselect.bits() & miscselect_mask != expected_miscselect {
+            return Err(Error::TCBVerificationFailed);
+        }
+
+        // Apply attributesMask (binary mask) from QE Identity to ATTRIBUTES field retrieved from
+        // SGX Enclave Report. Verify if the outcome (attributesMask & ATTRIBUTES) is equal to the
+        // value of attributes field in QE Identity.
+        let raw_attributes: Vec<u8> = self
+            .attributes
+            .from_hex()
+            .map_err(|_| Error::TCBParseError(anyhow::anyhow!("malformed QE attributes")))?;
+        if raw_attributes.len() != 16 {
+            return Err(Error::TCBParseError(anyhow::anyhow!(
+                "malformed QE attributes"
+            )));
+        }
+        let raw_attributes_mask: Vec<u8> = self
+            .attributes_mask
+            .from_hex()
+            .map_err(|_| Error::TCBParseError(anyhow::anyhow!("malformed QE attributes mask")))?;
+        if raw_attributes_mask.len() != 16 {
+            return Err(Error::TCBParseError(anyhow::anyhow!(
+                "malformed QE attributes"
+            )));
+        }
+        let expected_flags = LittleEndian::read_u64(&raw_attributes[..8]);
+        let expected_xfrm = LittleEndian::read_u64(&raw_attributes[8..]);
+        let flags_mask = LittleEndian::read_u64(&raw_attributes_mask[..8]);
+        let xfrm_mask = LittleEndian::read_u64(&raw_attributes_mask[8..]);
+        if report.attributes.flags.bits() & flags_mask != expected_flags {
+            return Err(Error::TCBVerificationFailed);
+        }
+        if report.attributes.xfrm & xfrm_mask != expected_xfrm {
+            return Err(Error::TCBVerificationFailed);
+        }
+
+        // Determine a TCB status of the Quoting Enclave.
+        //
+        // Go over the list of TCB Levels (descending order) and find the one that has ISVSVN that
+        // is lower or equal to the ISVSVN value from SGX Enclave Report.
+        if let Some(level) = self
+            .tcb_levels
+            .iter()
+            .find(|level| level.tcb.isv_svn <= report.isvsvn)
+        {
+            // Ensure that the TCB is up to date.
+            if level.status == TCBStatus::UpToDate {
+                return Ok(());
+            }
+        }
+
+        Err(Error::TCBOutOfDate)
+    }
+}
+
+/// An enclave TCB level.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct EnclaveTCBLevel {
+    #[serde(rename = "tcb")]
+    pub tcb: EnclaveTCBVersions,
+
+    #[serde(rename = "tcbDate")]
+    pub date: String,
+
+    #[serde(rename = "tcbStatus")]
+    pub status: TCBStatus,
+
+    #[serde(default, rename = "advisoryIDs")]
+    pub advisory_ids: Vec<String>,
+}
+
+/// Enclave TCB versions.
+#[derive(Clone, Debug, Default, serde::Deserialize)]
+pub struct EnclaveTCBVersions {
+    #[serde(rename = "isvsvn")]
+    pub isv_svn: u16,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/pcs/utils.rs.html b/rust/src/oasis_core_runtime/common/sgx/pcs/utils.rs.html new file mode 100644 index 0000000000..eade18d97c --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/pcs/utils.rs.html @@ -0,0 +1,141 @@ +utils.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+
//! Various parsing utilities.
+use std::{borrow::Cow, mem};
+
+use super::Error;
+
+pub trait TakePrefix: Sized {
+    fn take_prefix(&mut self, mid: usize) -> Result<Self, Error>;
+}
+
+impl<'a, T: 'a> TakePrefix for &'a [T] {
+    fn take_prefix(&mut self, mid: usize) -> Result<Self, Error> {
+        if let (Some(prefix), Some(rest)) = (self.get(..mid), self.get(mid..)) {
+            *self = rest;
+            Ok(prefix)
+        } else {
+            Err(Error::QuoteParseError(
+                "unexpected end of quote".to_string(),
+            ))
+        }
+    }
+}
+
+impl<'a, T: 'a + Clone> TakePrefix for Cow<'a, [T]> {
+    fn take_prefix(&mut self, mid: usize) -> Result<Self, Error> {
+        if mid <= self.len() {
+            match *self {
+                Cow::Borrowed(ref mut slice) => slice.take_prefix(mid).map(Cow::Borrowed),
+                Cow::Owned(ref mut vec) => {
+                    let rest = vec.split_off(mid);
+                    Ok(Cow::Owned(mem::replace(vec, rest)))
+                }
+            }
+        } else {
+            Err(Error::QuoteParseError(
+                "unexpected end of quote".to_string(),
+            ))
+        }
+    }
+}
+
+impl<'a> TakePrefix for &'a str {
+    fn take_prefix(&mut self, mid: usize) -> Result<Self, Error> {
+        if let (Some(prefix), Some(rest)) = (self.get(..mid), self.get(mid..)) {
+            *self = rest;
+            Ok(prefix)
+        } else {
+            Err(Error::QuoteParseError(
+                "unexpected end of quote".to_string(),
+            ))
+        }
+    }
+}
+
+impl<'a> TakePrefix for Cow<'a, str> {
+    fn take_prefix(&mut self, mid: usize) -> Result<Self, Error> {
+        if mid <= self.len() {
+            match *self {
+                Cow::Borrowed(ref mut slice) => slice.take_prefix(mid).map(Cow::Borrowed),
+                Cow::Owned(ref mut vec) => {
+                    let rest = vec.split_off(mid);
+                    Ok(Cow::Owned(mem::replace(vec, rest)))
+                }
+            }
+        } else {
+            Err(Error::QuoteParseError(
+                "unexpected end of quote".to_string(),
+            ))
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/sgx/seal.rs.html b/rust/src/oasis_core_runtime/common/sgx/seal.rs.html new file mode 100644 index 0000000000..b2b291c618 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/sgx/seal.rs.html @@ -0,0 +1,225 @@ +seal.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+
//! Wrappers for sealing secrets to the enclave in cold storage.
+use anyhow::{format_err, Error};
+use rand::{rngs::OsRng, Rng};
+use sgx_isa::Keypolicy;
+use zeroize::Zeroize;
+
+use crate::common::{
+    crypto::mrae::deoxysii::{DeoxysII, NONCE_SIZE, TAG_SIZE},
+    sgx::egetkey::egetkey,
+};
+
+/// Seal a secret to the enclave.
+///
+/// The `context` field is a domain separation tag.
+pub fn seal(key_policy: Keypolicy, context: &[u8], data: &[u8]) -> Vec<u8> {
+    let mut rng = OsRng {};
+
+    // Encrypt the raw policy.
+    let mut nonce = [0u8; NONCE_SIZE];
+    rng.fill(&mut nonce);
+    let d2 = new_deoxysii(key_policy, context);
+    let mut ciphertext = d2.seal(&nonce, data, vec![]);
+    ciphertext.extend_from_slice(&nonce);
+
+    ciphertext
+}
+
+/// Unseal a previously sealed secret to the enclave.
+///
+/// The `context` field is a domain separation tag.
+pub fn unseal(
+    key_policy: Keypolicy,
+    context: &[u8],
+    ciphertext: &[u8],
+) -> Result<Option<Vec<u8>>, Error> {
+    let ct_len = ciphertext.len();
+    if ct_len == 0 {
+        return Ok(None);
+    }
+    if ct_len < TAG_SIZE + NONCE_SIZE {
+        return Err(format_err!("ciphertext is corrupted: invalid size"));
+    }
+    let ct_len = ct_len - NONCE_SIZE;
+
+    // Split the ciphertext || tag || nonce.
+    let mut nonce = [0u8; NONCE_SIZE];
+    nonce.copy_from_slice(&ciphertext[ct_len..]);
+    let ciphertext = &ciphertext[..ct_len];
+
+    let d2 = new_deoxysii(key_policy, context);
+
+    match d2.open(&nonce, ciphertext.to_vec(), vec![]) {
+        Ok(plaintext) => Ok(Some(plaintext)),
+        Err(_) => Err(format_err!("ciphertext is corrupted")),
+    }
+}
+
+/// Creates a new Deoxys-II instance initialized with an SGX sealing key derived
+/// from the results of the `EGETKEY`instruction.
+///
+/// The `context` field is a domain separation tag.
+pub fn new_deoxysii(key_policy: Keypolicy, context: &[u8]) -> DeoxysII {
+    let mut seal_key = egetkey(key_policy, context);
+    let d2 = DeoxysII::new(&seal_key);
+    seal_key.zeroize();
+
+    d2
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_seal_unseal() {
+        // Test different policies.
+        let sealed_a = seal(Keypolicy::MRSIGNER, b"MRSIGNER", b"Mr. Signer");
+        let unsealed_a = unseal(Keypolicy::MRSIGNER, b"MRSIGNER", &sealed_a);
+        assert_eq!(unsealed_a.unwrap(), Some(b"Mr. Signer".to_vec()));
+
+        let sealed_b = seal(Keypolicy::MRENCLAVE, b"MRENCLAVE", b"Mr. Enclave");
+        let unsealed_b = unseal(Keypolicy::MRENCLAVE, b"MRENCLAVE", &sealed_b);
+        assert_eq!(unsealed_b.unwrap(), Some(b"Mr. Enclave".to_vec()));
+
+        // Test zero-length ciphertext.
+        let unsealed_c = unseal(Keypolicy::MRENCLAVE, b"MRENCLAVE", b"");
+        assert_eq!(unsealed_c.unwrap(), None);
+    }
+
+    #[test]
+    fn test_incorrect_context() {
+        // Test incorrect context.
+        let sealed_b = seal(Keypolicy::MRENCLAVE, b"MRENCLAVE1", b"Mr. Enclave");
+        let unsealed_b = unseal(Keypolicy::MRENCLAVE, b"MRENCLAVE2", &sealed_b);
+        assert_eq!(unsealed_b.is_err(), true);
+    }
+
+    #[test]
+    fn test_incorrect_ciphertext_a() {
+        let sealed_b = seal(Keypolicy::MRENCLAVE, b"MRENCLAVE", b"Mr. Enclave");
+        let unsealed_b = unseal(Keypolicy::MRENCLAVE, b"MRENCLAVE", &sealed_b[..2]);
+        assert_eq!(unsealed_b.is_err(), true);
+    }
+
+    #[test]
+    fn test_incorrect_ciphertext_b() {
+        let mut sealed_b = seal(Keypolicy::MRENCLAVE, b"MRENCLAVE", b"Mr. Enclave");
+        sealed_b[0] = sealed_b[0].wrapping_add(1);
+        let unsealed_b = unseal(Keypolicy::MRENCLAVE, b"MRENCLAVE", &sealed_b);
+        assert_eq!(unsealed_b.is_err(), true);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/time.rs.html b/rust/src/oasis_core_runtime/common/time.rs.html new file mode 100644 index 0000000000..6828c6a00c --- /dev/null +++ b/rust/src/oasis_core_runtime/common/time.rs.html @@ -0,0 +1,147 @@ +time.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
//! Runtime time source.
+use std::{
+    sync::Mutex,
+    time::{Duration, SystemTime, UNIX_EPOCH},
+};
+
+use lazy_static::lazy_static;
+use slog::error;
+
+use crate::common::{logger::get_logger, process};
+
+const INITIAL_MINIMUM_TIME: i64 = 1704067200; // Mon, 01 Jan 2024 00:00:00 UTC
+
+struct TimeSource {
+    inner: Mutex<Inner>,
+}
+
+struct Inner {
+    timestamp: i64,
+}
+
+/// Returns the number of seconds since the UNIX epoch.  The time returned
+/// is guaranteed to never decrease within each enclave instance (though it
+/// may decrease iff the enclave is re-launched).
+///
+/// The returned timestamp MUST NOT be trusted on in any way, as the underlying
+/// time source is reliant on the host operating system.
+pub fn insecure_posix_time() -> i64 {
+    let mut inner = TIME_SOURCE.inner.lock().unwrap();
+
+    let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
+    let now = now.as_secs() as i64;
+
+    if now < inner.timestamp {
+        error!(
+            get_logger("runtime/time"),
+            "clock appeared to have ran backwards"
+        );
+        process::abort();
+    }
+    inner.timestamp = now;
+
+    inner.timestamp
+}
+
+// Returns `insecure_posix_time` as SystemTime.
+pub fn insecure_posix_system_time() -> SystemTime {
+    UNIX_EPOCH + Duration::from_secs(insecure_posix_time() as u64)
+}
+
+/// Force update the minimum timestamp from a semi-trusted source (eg: the AVR
+/// timestamp), under the assumption that the semi-trusted source is more trust
+/// worthy than the host operating system.
+pub(crate) fn update_insecure_posix_time(timestamp: i64) {
+    let mut inner = TIME_SOURCE.inner.lock().unwrap();
+
+    if timestamp > inner.timestamp {
+        inner.timestamp = timestamp;
+    }
+
+    // The IAS clock and local clock should be closely synced, and minor
+    // differences in NTP implementations (eg: smear vs no smear), should
+    // be masked by the fact that the AVR timestamp will be a minimum of
+    // 1 RTT in the past.
+}
+
+lazy_static! {
+    static ref TIME_SOURCE: TimeSource = TimeSource {
+        inner: Mutex::new(Inner {
+            timestamp: INITIAL_MINIMUM_TIME,
+        })
+    };
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/version.rs.html b/rust/src/oasis_core_runtime/common/version.rs.html new file mode 100644 index 0000000000..50c1bb90fe --- /dev/null +++ b/rust/src/oasis_core_runtime/common/version.rs.html @@ -0,0 +1,279 @@ +version.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+
//! Protocol and runtime versioning.
+// NOTE: This should be kept in sync with go/common/version/version.go.
+
+/// A protocol or runtime version.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Version {
+    #[cbor(optional)]
+    pub major: u16,
+
+    #[cbor(optional)]
+    pub minor: u16,
+
+    #[cbor(optional)]
+    pub patch: u16,
+}
+
+#[macro_export]
+macro_rules! version_from_cargo {
+    () => {
+        Version::new(
+            env!("CARGO_PKG_VERSION_MAJOR").parse::<u16>().unwrap(),
+            env!("CARGO_PKG_VERSION_MINOR").parse::<u16>().unwrap(),
+            env!("CARGO_PKG_VERSION_PATCH").parse::<u16>().unwrap(),
+        )
+    };
+}
+
+impl Version {
+    /// Creates a new version with given major, minor, and patch segments.
+    pub const fn new(major: u16, minor: u16, patch: u16) -> Version {
+        Version {
+            major,
+            minor,
+            patch,
+        }
+    }
+
+    /// Checks if two versions are compatible.
+    pub fn is_compatible_with(&self, other: &Version) -> bool {
+        self.major == other.major
+    }
+}
+
+// Returns the version as a platform-dependent u64.
+impl From<Version> for u64 {
+    fn from(val: Version) -> Self {
+        ((val.major as u64) << 32) | ((val.minor as u64) << 16) | (val.patch as u64)
+    }
+}
+
+// Creates the version from a platform-dependent u64.
+impl From<u64> for Version {
+    fn from(v: u64) -> Version {
+        Version {
+            major: ((v >> 32) & 0xffff) as u16,
+            minor: ((v >> 16) & 0xffff) as u16,
+            patch: (v & 0xffff) as u16,
+        }
+    }
+}
+
+// Version of the protocol used for communication between the Oasis node(s)
+// and the runtime. This version MUST be compatible with the one supported by
+// the worker host.
+pub const PROTOCOL_VERSION: Version = Version {
+    major: 5,
+    minor: 1,
+    patch: 0,
+};
+
+/// Protocol versions.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ProtocolVersions {
+    pub consensus_protocol: Version,
+    pub runtime_host_protocol: Version,
+    pub runtime_committee_protocol: Version,
+}
+
+#[cfg(test)]
+mod test {
+    use super::Version;
+
+    #[test]
+    fn test_version() {
+        assert!(Version {
+            major: 32,
+            minor: 25,
+            patch: 10,
+        }
+        .is_compatible_with(&Version {
+            major: 32,
+            minor: 10,
+            patch: 100,
+        }),);
+
+        let v = Version {
+            major: 17,
+            minor: 11,
+            patch: 1,
+        };
+        let vi: u64 = v.into();
+        assert_eq!(v, Version::from(vi));
+    }
+
+    #[test]
+    fn test_version_u64() {
+        for v in vec![
+            Version::default(),
+            Version {
+                major: 0,
+                minor: 0,
+                patch: 0,
+            },
+            Version {
+                major: 1,
+                minor: 1,
+                patch: 1,
+            },
+            Version {
+                major: 10,
+                minor: 20,
+                patch: 30,
+            },
+            Version {
+                major: 300,
+                minor: 400,
+                patch: 500,
+            },
+            Version {
+                major: 30000,
+                minor: 40000,
+                patch: 50000,
+            },
+        ] {
+            let vi: u64 = v.into();
+            assert_eq!(Version::from(vi), v)
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/common/versioned.rs.html b/rust/src/oasis_core_runtime/common/versioned.rs.html new file mode 100644 index 0000000000..32bac471f0 --- /dev/null +++ b/rust/src/oasis_core_runtime/common/versioned.rs.html @@ -0,0 +1,99 @@ +versioned.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+
/// Version key used in serialized form.
+pub const VERSION_KEY: &str = "v";
+
+/// A generic versioned serializable data structure.
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+pub struct Versioned<T> {
+    pub version: u16,
+    pub inner: T,
+}
+
+impl<T> Versioned<T> {
+    /// Create a new versioned structure.
+    pub fn new(version: u16, inner: T) -> Self {
+        Self { version, inner }
+    }
+}
+
+impl<T: cbor::EncodeAsMap> cbor::Encode for Versioned<T> {
+    fn into_cbor_value(self) -> cbor::Value {
+        let mut inner = cbor::EncodeAsMap::into_cbor_map(self.inner);
+        // Add version to the given map.
+        let key = cbor::values::IntoCborValue::into_cbor_value(VERSION_KEY);
+        inner.push((key, self.version.into_cbor_value()));
+        cbor::Value::Map(inner)
+    }
+}
+
+impl<T: cbor::Decode> cbor::Decode for Versioned<T> {
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::Map(mut items) => {
+                // Take the version field from the map and decode the rest.
+                let key = cbor::values::IntoCborValue::into_cbor_value(VERSION_KEY);
+                let (index, _) = items
+                    .iter()
+                    .enumerate()
+                    .find(|(_, v)| v.0 == key)
+                    .ok_or(cbor::DecodeError::MissingField)?;
+                let version = items.remove(index).1;
+
+                Ok(Self {
+                    version: cbor::Decode::try_from_cbor_value(version)?,
+                    inner: cbor::Decode::try_from_cbor_value(cbor::Value::Map(items))?,
+                })
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/config.rs.html b/rust/src/oasis_core_runtime/config.rs.html new file mode 100644 index 0000000000..b862bf4f60 --- /dev/null +++ b/rust/src/oasis_core_runtime/config.rs.html @@ -0,0 +1,77 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
//! Runtime configuration.
+use crate::{common::version::Version, consensus::verifier::TrustRoot, types::Features};
+
+/// Global runtime configuration.
+#[derive(Clone, Debug, Default)]
+pub struct Config {
+    /// Semantic runtime version.
+    pub version: Version,
+    /// Optional trust root for consensus layer integrity verification.
+    pub trust_root: Option<TrustRoot>,
+    /// Storage configuration.
+    pub storage: Storage,
+    /// Advertised runtime features.
+    pub features: Features,
+    /// Whether storage state should be persisted between transaction check invocations. The state
+    /// is invalidated on the next round.
+    pub persist_check_tx_state: bool,
+}
+
+/// Storage-related configuration.
+#[derive(Clone, Debug)]
+pub struct Storage {
+    /// The maximum number of tree nodes held by the cache before eviction.
+    /// A zero value denotes unlimited capacity.
+    pub cache_node_capacity: usize,
+    /// The total size, in bytes, of values held by the cache before eviction.
+    /// A zero value denotes unlimited capacity.
+    pub cache_value_capacity: usize,
+}
+
+impl Default for Storage {
+    fn default() -> Self {
+        Self {
+            cache_node_capacity: 100_000,
+            cache_value_capacity: 32 * 1024 * 1024, // 32 MiB
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/address.rs.html b/rust/src/oasis_core_runtime/consensus/address.rs.html new file mode 100644 index 0000000000..e624b4b369 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/address.rs.html @@ -0,0 +1,417 @@ +address.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+
//! Consensus account address structures.
+use std::{convert::TryInto, fmt};
+
+use anyhow::{anyhow, Result};
+use bech32::{Bech32, Hrp};
+use lazy_static::lazy_static;
+
+use crate::common::{
+    crypto::{hash::Hash, signature::PublicKey},
+    key_format::KeyFormatAtom,
+    namespace::Namespace,
+};
+
+lazy_static! {
+    /// Common pool reserved address.
+    pub static ref COMMON_POOL_ADDRESS: Address = Address::from_pk(&PublicKey::from("1abe11edc001ffffffffffffffffffffffffffffffffffffffffffffffffffff"));
+
+    /// Per-block fee accumulator reserved address.
+    pub static ref FEE_ACC_ADDRESS: Address = Address::from_pk(&PublicKey::from("1abe11edfeeaccffffffffffffffffffffffffffffffffffffffffffffffffff"));
+
+    /// Governance deposits reserved address.
+    pub static ref GOVERNANCE_DEPOSITS_ADDRESS: Address = Address::from_pk(&PublicKey::from("1abe11eddeaccfffffffffffffffffffffffffffffffffffffffffffffffffff"));
+}
+
+const ADDRESS_VERSION_SIZE: usize = 1;
+const ADDRESS_DATA_SIZE: usize = 20;
+const ADDRESS_SIZE: usize = ADDRESS_VERSION_SIZE + ADDRESS_DATA_SIZE;
+
+// V0 staking addres.
+const ADDRESS_V0_CONTEXT: &[u8] = b"oasis-core/address: staking";
+const ADDRESS_V0_VERSION: u8 = 0;
+
+// V0 runtime address.
+const ADDRESS_RUNTIME_V0_CONTEXT: &[u8] = b"oasis-core/address: runtime";
+const ADDRESS_RUNTIME_V0_VERSION: u8 = 0;
+
+const ADDRESS_BECH32_HRP: Hrp = Hrp::parse_unchecked("oasis");
+
+/// A staking account address.
+#[derive(Clone, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
+pub struct Address([u8; ADDRESS_SIZE]);
+
+impl Address {
+    /// Creates a new address from a context, version and data.
+    pub fn new(ctx: &'static [u8], version: u8, data: &[u8]) -> Self {
+        let h = Hash::digest_bytes_list(&[ctx, &[version], data]);
+
+        let mut a = [0; ADDRESS_SIZE];
+        a[..ADDRESS_VERSION_SIZE].copy_from_slice(&[version]);
+        a[ADDRESS_VERSION_SIZE..].copy_from_slice(h.truncated(ADDRESS_DATA_SIZE));
+
+        Address(a)
+    }
+
+    /// Creates a new address from a public key.
+    pub fn from_pk(pk: &PublicKey) -> Self {
+        Address::new(ADDRESS_V0_CONTEXT, ADDRESS_V0_VERSION, pk.as_ref())
+    }
+
+    /// Creates a new runtime address.
+    pub fn from_runtime_id(id: &Namespace) -> Self {
+        Address::new(
+            ADDRESS_RUNTIME_V0_CONTEXT,
+            ADDRESS_RUNTIME_V0_VERSION,
+            id.as_ref(),
+        )
+    }
+
+    /// Tries to create a new address from Bech32-encoded string.
+    pub fn from_bech32(data: &str) -> Result<Self> {
+        let (hrp, data) = bech32::decode(data).map_err(|_| anyhow!("malformed address"))?;
+
+        if hrp != ADDRESS_BECH32_HRP {
+            return Err(anyhow!("malformed address"));
+        }
+
+        let sized: &[u8; ADDRESS_SIZE] = &data.as_slice().try_into()?;
+        Ok(sized.into())
+    }
+
+    /// Converts an address to Bech32 representation.
+    pub fn to_bech32(&self) -> String {
+        bech32::encode::<Bech32>(ADDRESS_BECH32_HRP, &self.0).unwrap()
+    }
+}
+
+impl fmt::LowerHex for Address {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        for i in &self.0[..] {
+            write!(f, "{i:02x}")?;
+        }
+        Ok(())
+    }
+}
+
+impl<'a> From<&'a str> for Address {
+    fn from(s: &'a str) -> Address {
+        Address::from_bech32(s).unwrap()
+    }
+}
+
+impl AsRef<[u8]> for Address {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl From<Address> for [u8; ADDRESS_SIZE] {
+    fn from(val: Address) -> Self {
+        val.0
+    }
+}
+
+impl From<&[u8; ADDRESS_SIZE]> for Address {
+    fn from(b: &[u8; ADDRESS_SIZE]) -> Address {
+        let mut data = [0; ADDRESS_SIZE];
+        data.copy_from_slice(b);
+        Address(data)
+    }
+}
+
+impl fmt::Debug for Address {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{}", self.to_bech32())?;
+        Ok(())
+    }
+}
+
+impl cbor::Encode for Address {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::Value::ByteString(self.as_ref().to_vec())
+    }
+}
+
+impl cbor::Decode for Address {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Default::default())
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => Ok(Address(
+                data.try_into()
+                    .map_err(|_| cbor::DecodeError::UnexpectedType)?,
+            )),
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+impl KeyFormatAtom for Address {
+    fn size() -> usize {
+        ADDRESS_SIZE
+    }
+
+    fn encode_atom(self) -> Vec<u8> {
+        self.as_ref().to_vec()
+    }
+
+    fn decode_atom(data: &[u8]) -> Self
+    where
+        Self: Sized,
+    {
+        let sized: &[u8; ADDRESS_SIZE] =
+            &data.try_into().expect("address: invalid decode atom data");
+        sized.into()
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::Address;
+    use crate::common::{crypto::signature::PublicKey, namespace::Namespace};
+
+    #[test]
+    fn test_address() {
+        let pk =
+            PublicKey::from("badadd1e55ffffffffffffffffffffffffffffffffffffffffffffffffffffff");
+
+        let addr = Address::from_pk(&pk);
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qryqqccycvckcxp453tflalujvlf78xymcdqw4vz"
+        );
+
+        assert_eq!(
+            Address::from("oasis1qryqqccycvckcxp453tflalujvlf78xymcdqw4vz").to_bech32(),
+            "oasis1qryqqccycvckcxp453tflalujvlf78xymcdqw4vz"
+        );
+
+        let runtime_id =
+            Namespace::from("80000000000000002aff7f6dfb62720cfd735f2b037b81572fad1b7937d826b3");
+        let addr = Address::from_runtime_id(&runtime_id);
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qpllh99nhwzrd56px4txvl26atzgg4f3a58jzzad"
+        );
+    }
+
+    #[test]
+    fn test_deserialization() {
+        let addr: Address = cbor::from_slice(&[0xF6]).unwrap();
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq0ltrq9"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/beacon.rs.html b/rust/src/oasis_core_runtime/consensus/beacon.rs.html new file mode 100644 index 0000000000..c20fa2fd1f --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/beacon.rs.html @@ -0,0 +1,25 @@ +beacon.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
/// The number of intervals (epochs) since a fixed instant in time/block height (epoch date/height).
+pub type EpochTime = u64;
+
+/// An invalid epoch time.
+pub const EPOCH_INVALID: EpochTime = 0xffffffffffffffff;
+
+/// The epoch state.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct EpochTimeState {
+    pub epoch: EpochTime,
+    pub height: i64,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/governance.rs.html b/rust/src/oasis_core_runtime/consensus/governance.rs.html new file mode 100644 index 0000000000..804e6451fa --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/governance.rs.html @@ -0,0 +1,391 @@ +governance.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+
//! Governance structures.
+//!
+//! # Note
+//!
+//! This **MUST** be kept in sync with go/governance/api.
+//!
+use std::collections::BTreeMap;
+
+use crate::{
+    common::{quantity::Quantity, version::ProtocolVersions},
+    consensus::beacon::EpochTime,
+};
+
+/// A governance vote.
+#[derive(
+    Clone, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord, cbor::Encode, cbor::Decode,
+)]
+#[repr(u8)]
+pub enum Vote {
+    /// Invalid vote that should never be explicitly set.
+    #[default]
+    Invalid = 0,
+    /// Yes Vote.
+    Yes = 1,
+    /// No vote.
+    No = 2,
+    /// Abstained.
+    Abstain = 3,
+}
+
+/// Vote for a proposal.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ProposalVote {
+    /// Unique identifier of a proposal.
+    pub id: u64,
+
+    /// Proposal vote.
+    pub vote: Vote,
+}
+
+/// Upgrade proposal content.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct UpgradeProposal {
+    pub v: u16,
+    pub handler: String,
+    pub target: ProtocolVersions,
+    pub epoch: EpochTime,
+}
+
+/// Cancel proposal content.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct CancelUpgradeProposal {
+    pub proposal_id: u64,
+}
+
+/// Change parameters proposal content.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct ChangeParametersProposal {
+    pub module: String,
+    pub changes: Option<cbor::Value>,
+}
+
+/// Consensus layer governance proposal content.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct ProposalContent {
+    #[cbor(optional)]
+    pub upgrade: Option<UpgradeProposal>,
+    #[cbor(optional)]
+    pub cancel_upgrade: Option<CancelUpgradeProposal>,
+    #[cbor(optional)]
+    pub change_parameters: Option<ChangeParametersProposal>,
+}
+
+// Allowed governance consensus parameter changes.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ConsensusParameterChanges {
+    #[cbor(optional)]
+    pub gas_costs: BTreeMap<String, u64>,
+    #[cbor(optional)]
+    pub min_proposal_deposit: Option<Quantity>,
+    #[cbor(optional)]
+    pub voting_period: Option<EpochTime>,
+    #[cbor(optional)]
+    pub stake_threshold: Option<u8>,
+    #[cbor(optional)]
+    pub upgrade_min_epoch_diff: Option<EpochTime>,
+    #[cbor(optional)]
+    pub upgrade_cancel_min_epoch_diff: Option<EpochTime>,
+    #[cbor(optional)]
+    pub enable_change_parameters_proposal: Option<bool>,
+}
+
+#[cfg(test)]
+mod tests {
+    use base64::prelude::*;
+
+    use super::*;
+
+    #[test]
+    fn test_consistent_proposal_vote() {
+        // NOTE: These tests MUST be synced with go/governance/api/api_test.go.
+        let tcs = vec![
+            (
+                "omJpZAtkdm90ZQE=",
+                ProposalVote {
+                    id: 11,
+                    vote: Vote::Yes,
+                },
+            ),
+            (
+                "omJpZAxkdm90ZQI=",
+                ProposalVote {
+                    id: 12,
+                    vote: Vote::No,
+                },
+            ),
+            (
+                "omJpZA1kdm90ZQM=",
+                ProposalVote {
+                    id: 13,
+                    vote: Vote::Abstain,
+                },
+            ),
+        ];
+        for (encoded_base64, vote) in tcs {
+            let dec: ProposalVote =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("proposal vote should deserialize correctly");
+            assert_eq!(
+                dec, vote,
+                "decoded proposal vote should match the expected value"
+            );
+
+            let ser = BASE64_STANDARD.encode(cbor::to_vec(dec));
+            assert_eq!(
+                ser, encoded_base64,
+                "proposal vote should serialize correctly"
+            );
+        }
+    }
+
+    #[test]
+    fn test_consistent_proposal_content() {
+        // NOTE: These tests MUST be synced with go/governance/api/api_test.go.
+        let tcs = vec![
+            (
+                "oW5jYW5jZWxfdXBncmFkZaFrcHJvcG9zYWxfaWQYKg==",
+                ProposalContent {
+                    cancel_upgrade: Some(CancelUpgradeProposal { proposal_id: 42 }),
+                    ..Default::default()
+                },
+            ),
+            (
+                "oWd1cGdyYWRlpGF2AmVlcG9jaBgqZnRhcmdldKNyY29uc2Vuc3VzX3Byb3RvY29soWVwYXRjaBh7dXJ1bnRpbWVfaG9zdF9wcm90b2NvbKFlcGF0Y2gZAch4GnJ1bnRpbWVfY29tbWl0dGVlX3Byb3RvY29soWVwYXRjaBkDFWdoYW5kbGVybHRlc3QtaGFuZGxlcg==",
+                ProposalContent {
+                    upgrade: Some(UpgradeProposal {
+                        v: 2,
+                        handler: "test-handler".into(),
+                        target: ProtocolVersions { consensus_protocol: 123.into(), runtime_host_protocol: 456.into(), runtime_committee_protocol: 789.into() } ,
+                        epoch: 42,
+                    }),
+                    ..Default::default()
+                },
+            ),
+            (
+                "oXFjaGFuZ2VfcGFyYW1ldGVyc6JmbW9kdWxla3Rlc3QtbW9kdWxlZ2NoYW5nZXOhbXZvdGluZ19wZXJpb2QYew==",
+                ProposalContent {
+                    change_parameters: Some(ChangeParametersProposal {
+                        module: "test-module".into(),
+                        changes: Some(cbor::to_value(ConsensusParameterChanges{
+                            voting_period: Some(123),
+                            ..Default::default()
+                        })),
+                     }),
+                    ..Default::default()
+                }
+            ),
+        ];
+        for (encoded_base64, content) in tcs {
+            let dec: ProposalContent =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("proposal content should deserialize correctly");
+            assert_eq!(
+                dec, content,
+                "decoded proposal content should match the expected value"
+            );
+
+            let ser = BASE64_STANDARD.encode(cbor::to_vec(dec));
+            assert_eq!(
+                ser, encoded_base64,
+                "proposal content should serialize correctly"
+            );
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/keymanager.rs.html b/rust/src/oasis_core_runtime/consensus/keymanager.rs.html new file mode 100644 index 0000000000..d5386d6e8e --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/keymanager.rs.html @@ -0,0 +1,311 @@ +keymanager.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+
use std::{collections::HashMap, sync::Arc};
+
+use anyhow::Result;
+use thiserror::Error;
+
+use crate::common::{
+    crypto::{
+        signature::{Signature, SignatureBundle, Signer},
+        x25519,
+    },
+    namespace::Namespace,
+    sgx::EnclaveIdentity,
+};
+
+use super::beacon::EpochTime;
+
+pub mod churp;
+
+/// Context used to sign key manager policies.
+const POLICY_SIGNATURE_CONTEXT: &[u8] = b"oasis-core/keymanager: policy";
+
+/// Context used to sign encrypted key manager master secrets.
+const ENCRYPTED_MASTER_SECRET_SIGNATURE_CONTEXT: &[u8] =
+    b"oasis-core/keymanager: encrypted master secret";
+
+/// Context used to sign encrypted key manager ephemeral secrets.
+const ENCRYPTED_EPHEMERAL_SECRET_SIGNATURE_CONTEXT: &[u8] =
+    b"oasis-core/keymanager: encrypted ephemeral secret";
+
+/// Errors emitted by the key manager module.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("invalid signature")]
+    InvalidSignature,
+}
+
+/// Key manager access control policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct PolicySGX {
+    pub serial: u32,
+    pub id: Namespace,
+    pub enclaves: HashMap<EnclaveIdentity, EnclavePolicySGX>,
+    #[cbor(optional)]
+    pub master_secret_rotation_interval: EpochTime,
+    #[cbor(optional)]
+    pub max_ephemeral_secret_age: EpochTime,
+}
+
+/// Per enclave key manager access control policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct EnclavePolicySGX {
+    /// A map of runtime IDs to the vector of enclave IDs that may query
+    /// private key material.
+    pub may_query: HashMap<Namespace, Vec<EnclaveIdentity>>,
+
+    /// A vector of enclave IDs that may retrieve the master secret.
+    ///
+    /// NOTE: Each enclave ID may always implicitly replicate from other
+    /// instances of itself.
+    pub may_replicate: Vec<EnclaveIdentity>,
+}
+
+/// Signed key manager access control policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct SignedPolicySGX {
+    pub policy: PolicySGX,
+    pub signatures: Vec<SignatureBundle>,
+}
+
+impl SignedPolicySGX {
+    /// Verify the signatures.
+    pub fn verify(&self) -> Result<&PolicySGX> {
+        let raw_policy = cbor::to_vec(self.policy.clone());
+        for sig in &self.signatures {
+            sig.signature
+                .verify(&sig.public_key, POLICY_SIGNATURE_CONTEXT, &raw_policy)
+                .map_err(|_| Error::InvalidSignature)?;
+        }
+
+        Ok(&self.policy)
+    }
+}
+
+/// A secret encrypted with Deoxys-II MRAE algorithm.
+#[derive(Clone, Default, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct EncryptedSecret {
+    /// Checksum for validating decrypted secret.
+    pub checksum: Vec<u8>,
+    /// Public key to derive the symmetric key for decryption.
+    pub pub_key: x25519::PublicKey,
+    /// A map of REK encrypted secrets.
+    pub ciphertexts: HashMap<x25519::PublicKey, Vec<u8>>,
+}
+
+/// Encrypted master secret.
+#[derive(Clone, Default, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct EncryptedMasterSecret {
+    /// Runtime ID of the key manager.
+    pub runtime_id: Namespace,
+    /// Generation of the secret.
+    pub generation: u64,
+    /// Epoch time in which the secret was created.
+    pub epoch: EpochTime,
+    /// Encrypted secret.
+    pub secret: EncryptedSecret,
+}
+
+/// Encrypted ephemeral secret.
+#[derive(Clone, Default, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct EncryptedEphemeralSecret {
+    /// Runtime ID of the key manager.
+    pub runtime_id: Namespace,
+    /// Epoch time to which the ephemeral secret belongs.
+    pub epoch: EpochTime,
+    /// Encrypted secret.
+    pub secret: EncryptedSecret,
+}
+
+/// Signed encrypted master secret (RAK).
+#[derive(Clone, Default, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct SignedEncryptedMasterSecret {
+    /// Encrypted master secret.
+    pub secret: EncryptedMasterSecret,
+    /// Signature of the encrypted master secret.
+    pub signature: Signature,
+}
+
+impl SignedEncryptedMasterSecret {
+    pub fn new(secret: EncryptedMasterSecret, signer: &Arc<dyn Signer>) -> Result<Self> {
+        let signature = signer.sign(
+            ENCRYPTED_MASTER_SECRET_SIGNATURE_CONTEXT,
+            &cbor::to_vec(secret.clone()),
+        )?;
+        Ok(Self { secret, signature })
+    }
+}
+
+/// Signed encrypted ephemeral secret (RAK).
+#[derive(Clone, Default, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct SignedEncryptedEphemeralSecret {
+    /// Encrypted ephemeral secret.
+    pub secret: EncryptedEphemeralSecret,
+    /// Signature of the encrypted ephemeral secret.
+    pub signature: Signature,
+}
+
+impl SignedEncryptedEphemeralSecret {
+    pub fn new(secret: EncryptedEphemeralSecret, signer: &Arc<dyn Signer>) -> Result<Self> {
+        let signature = signer.sign(
+            ENCRYPTED_EPHEMERAL_SECRET_SIGNATURE_CONTEXT,
+            &cbor::to_vec(secret.clone()),
+        )?;
+        Ok(Self { secret, signature })
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/keymanager/churp.rs.html b/rust/src/oasis_core_runtime/consensus/keymanager/churp.rs.html new file mode 100644 index 0000000000..a1a34db21b --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/keymanager/churp.rs.html @@ -0,0 +1,369 @@ +churp.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+
//! Key manager state in the consensus layer.
+use std::collections::HashMap;
+
+use anyhow::Result;
+use thiserror::Error;
+
+use crate::{
+    common::{
+        crypto::{
+            hash::Hash,
+            signature::{PublicKey, SignatureBundle},
+        },
+        namespace::Namespace,
+        sgx::EnclaveIdentity,
+    },
+    consensus::beacon::EpochTime,
+};
+
+/// Context used to sign key manager CHURP policies.
+const POLICY_SIGNATURE_CONTEXT: &[u8] = b"oasis-core/keymanager/churp: policy";
+
+/// Errors emitted by the CHURP module.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("invalid signature")]
+    InvalidSignature,
+}
+
+/// Cipher suite identifier.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Decode, cbor::Encode)]
+#[repr(u8)]
+pub enum SuiteId {
+    /// The NIST P-384 elliptic curve group with the SHA3-384 hash function
+    /// used to encode arbitrary-length byte strings to elements of the
+    /// underlying prime field or elliptic curve points.
+    #[default]
+    NistP384Sha3_384 = 0,
+}
+
+/// Status represents the current state of a CHURP instance.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Decode, cbor::Encode)]
+pub struct Status {
+    /// A unique identifier within the key manager runtime.
+    pub id: u8,
+
+    /// The identifier of the key manager runtime.
+    pub runtime_id: Namespace,
+
+    /// The identifier of a cipher suite used for verifiable secret sharing
+    /// and key derivation.
+    pub suite_id: SuiteId,
+
+    /// The degree of the secret-sharing polynomial.
+    ///
+    /// In a (t,n) secret-sharing scheme, where t represents the threshold,
+    /// any combination of t+1 or more shares can reconstruct the secret,
+    /// while losing n-t or fewer shares still allows the secret to be
+    /// recovered.
+    pub threshold: u8,
+
+    /// The minimum number of shares that can be lost to render the secret
+    /// unrecoverable.
+    ///
+    /// If t and e represent the threshold and extra shares, respectively,
+    /// then the minimum size of the committee is t+e+1.
+    pub extra_shares: u8,
+
+    /// The time interval in epochs between handoffs.
+    ///
+    /// A zero value disables handoffs.
+    pub handoff_interval: EpochTime,
+
+    /// A signed SGX access control policy.
+    pub policy: SignedPolicySGX,
+
+    /// The epoch of the last successfully completed handoff.
+    ///
+    /// The zero value indicates that no handoffs have been completed so far.
+    /// Note that the first handoff is special and is called the dealer phase,
+    /// in which nodes do not reshare or randomize shares but instead construct
+    /// the secret and shares.
+    pub handoff: EpochTime,
+
+    /// The hash of the verification matrix from the last successfully completed
+    /// handoff.
+    #[cbor(optional)]
+    pub checksum: Option<Hash>,
+
+    /// A vector of nodes holding a share of the secret in the active handoff.
+    ///
+    /// A client needs to obtain more than a threshold number of key shares
+    /// from the nodes in this vector to construct the key.
+    #[cbor(optional)]
+    pub committee: Vec<PublicKey>,
+
+    /// The epoch in which the next handoff will occur.
+    ///
+    /// If an insufficient number of applications is received, the next handoff
+    /// will be delayed by one epoch.
+    pub next_handoff: EpochTime,
+
+    /// The hash of the verification matrix from the current handoff.
+    ///
+    /// The first candidate to confirm share reconstruction is the source
+    /// of truth for the checksum. All other candidates need to confirm
+    /// with the same checksum; otherwise, the applications will be annulled,
+    /// and the nodes will need to apply for the new committee again.
+    #[cbor(optional)]
+    pub next_checksum: Option<Hash>,
+
+    /// A map of nodes that wish to form the new committee.
+    ///
+    /// Candidates are expected to generate a random bivariate polynomial,
+    /// construct a verification matrix, compute its checksum, and submit
+    /// an application one epoch in advance of the next scheduled handoff.
+    /// Subsequently, upon the arrival of the handoff epoch, nodes must execute
+    /// the handoff protocol and confirm the reconstruction of its share.
+    #[cbor(optional)]
+    pub applications: HashMap<PublicKey, Application>,
+}
+
+/// Application represents a node's application to form a new committee.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Decode, cbor::Encode)]
+pub struct Application {
+    /// The hash of the random verification matrix.
+    ///
+    /// In all handoffs, except in the dealer phase, the verification matrix
+    /// needs to be zero-hole.
+    pub checksum: Hash,
+
+    /// Reconstructed is true if and only if the node verified all matrices
+    /// and successfully reconstructed its share during the handoff.
+    pub reconstructed: bool,
+}
+
+/// Key manager access control policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct PolicySGX {
+    /// A unique identifier within the key manager runtime.
+    pub id: u8,
+
+    /// The identifier of the key manager runtime.
+    pub runtime_id: Namespace,
+
+    /// A monotonically increasing policy serial number.
+    pub serial: u32,
+
+    /// A vector of enclave identities from which a share can be obtained
+    /// during handoffs.
+    pub may_share: Vec<EnclaveIdentity>,
+
+    /// A vector of enclave identities that may form the new committee
+    /// in the next handoffs.
+    pub may_join: Vec<EnclaveIdentity>,
+
+    /// A map of runtime identities to the vector of enclave identities
+    /// that may query key shares.
+    pub may_query: HashMap<Namespace, Vec<EnclaveIdentity>>,
+}
+
+/// Signed key manager access control policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct SignedPolicySGX {
+    /// An SGX access control policy.
+    pub policy: PolicySGX,
+
+    /// A vector of signatures.
+    #[cbor(optional)]
+    pub signatures: Vec<SignatureBundle>,
+}
+
+impl SignedPolicySGX {
+    /// Verify the signatures.
+    pub fn verify(&self) -> Result<&PolicySGX> {
+        let raw_policy = cbor::to_vec(self.policy.clone());
+        for sig in &self.signatures {
+            sig.signature
+                .verify(&sig.public_key, POLICY_SIGNATURE_CONTEXT, &raw_policy)
+                .map_err(|_| Error::InvalidSignature)?;
+        }
+
+        Ok(&self.policy)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/mod.rs.html b/rust/src/oasis_core_runtime/consensus/mod.rs.html new file mode 100644 index 0000000000..8faa0afe8c --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/mod.rs.html @@ -0,0 +1,105 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+
//! Consensus service interfaces.
+
+use crate::common::crypto::hash::Hash;
+
+pub mod address;
+pub mod beacon;
+pub mod governance;
+pub mod keymanager;
+pub mod registry;
+pub mod roothash;
+pub mod scheduler;
+pub mod staking;
+pub mod state;
+pub mod tendermint;
+pub mod transaction;
+pub mod verifier;
+
+/// A unique module name for the consensus module.
+pub const MODULE_NAME: &str = "consensus";
+
+// Method name for the special block metadata transaction.
+pub const METHOD_META: &str = "consensus.Meta";
+
+/// The height that represents the most recent block height.
+pub const HEIGHT_LATEST: u64 = 0;
+
+/// Light consensus block.
+#[derive(Clone, Default, Debug, cbor::Encode, cbor::Decode)]
+pub struct LightBlock {
+    pub height: u64,
+    pub meta: Vec<u8>,
+}
+
+/// An event emitted by the consensus layer.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum Event {
+    #[cbor(rename = "staking")]
+    Staking(staking::Event),
+    // TODO: Add support for other kind of events.
+}
+
+/// BlockMetadata contains additional metadata related to the executing block.
+///
+/// The metadata is included in the form of a special transaction where this structure is the
+/// transaction body.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct BlockMetadata {
+    /// State root after executing all logic in the block.
+    pub state_root: Hash,
+    // EventsRoot is the provable events root.
+    pub events_root: Vec<u8>,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/registry.rs.html b/rust/src/oasis_core_runtime/consensus/registry.rs.html new file mode 100644 index 0000000000..b9234b7c38 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/registry.rs.html @@ -0,0 +1,2969 @@ +registry.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+
//! Registry structures.
+//!
+//! # Note
+//!
+//! This **MUST** be kept in sync with go/registry/api.
+//!
+use std::collections::BTreeMap;
+
+use anyhow::{anyhow, bail};
+use num_traits::Zero;
+use tiny_keccak::{Hasher, TupleHash};
+
+use crate::{
+    common::{
+        crypto::{
+            hash::Hash,
+            signature::{self, Signature},
+            x25519,
+        },
+        namespace::Namespace,
+        quantity, sgx,
+        version::Version,
+    },
+    consensus::{beacon::EpochTime, scheduler, staking},
+    identity::Identity,
+};
+
+/// A unique module name for the registry module.
+pub const MODULE_NAME: &str = "registry";
+
+/// The method name for freshness proofs.
+pub const METHOD_PROVE_FRESHNESS: &str = "registry.ProveFreshness";
+
+/// Attestation signature context.
+pub const ATTESTATION_SIGNATURE_CONTEXT: &[u8] = b"oasis-core/node: TEE attestation signature";
+
+/// TEE capability endorsement signature context.
+pub const ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT: &[u8] =
+    b"oasis-core/node: endorse TEE capability";
+
+/// Represents the address of a TCP endpoint.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct TCPAddress {
+    #[cbor(rename = "IP")]
+    pub ip: Vec<u8>,
+    #[cbor(rename = "Port")]
+    pub port: i64,
+    #[cbor(rename = "Zone")]
+    pub zone: String,
+}
+
+/// Represents an Oasis committee address that includes a TLS public key and a TCP address.
+///
+/// NOTE: The address TLS public key can be different from the actual node TLS public key to allow
+/// using a sentry node's addresses.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct TLSAddress {
+    /// Public key used for establishing TLS connections.
+    pub pub_key: signature::PublicKey,
+
+    /// Address at which the node can be reached.
+    pub address: TCPAddress,
+}
+
+/// Node's TLS information.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct TLSInfo {
+    /// Public key used for establishing TLS connections.
+    pub pub_key: signature::PublicKey,
+
+    #[cbor(rename = "next_pub_key", optional)]
+    pub _deprecated_next_pub_key: Option<signature::PublicKey>,
+
+    #[cbor(rename = "addresses", optional)]
+    pub _deprecated_addresses: Option<Vec<TLSAddress>>,
+}
+
+/// Node's P2P information.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct P2PInfo {
+    /// Unique identifier of the node on the P2P transport.
+    pub id: signature::PublicKey,
+
+    /// List of addresses at which the node can be reached.
+    pub addresses: Option<Vec<TCPAddress>>,
+}
+
+/// Represents a consensus address that includes an ID and a TCP address.
+///
+/// NOTE: The consensus address ID could be different from the consensus ID
+/// to allow using a sentry node's ID and address instead of the validator's.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ConsensusAddress {
+    /// Public key identifying the node.
+    pub id: signature::PublicKey,
+
+    /// Address at which the node can be reached.
+    pub address: TCPAddress,
+}
+
+/// Node's consensus member information.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ConsensusInfo {
+    /// Unique identifier of the node as a consensus member.
+    pub id: signature::PublicKey,
+
+    /// List of addresses at which the node can be reached.
+    pub addresses: Option<Vec<ConsensusAddress>>,
+}
+
+/// Contains information for this node's participation in VRF based elections.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct VRFInfo {
+    /// Unique identifier of the node used to generate VRF proofs.
+    pub id: signature::PublicKey,
+}
+
+/// Represents the node's TEE capability.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct CapabilityTEE {
+    /// Hardware type.
+    pub hardware: TEEHardware,
+
+    /// Runtime attestation key.
+    pub rak: signature::PublicKey,
+
+    /// Runtime encryption key.
+    #[cbor(optional)]
+    pub rek: Option<x25519::PublicKey>,
+
+    /// Attestation.
+    pub attestation: Vec<u8>,
+}
+
+impl CapabilityTEE {
+    /// Tries to decode the TEE-specific attestation.
+    pub fn try_decode_attestation<T>(&self) -> Result<T, cbor::DecodeError>
+    where
+        T: cbor::Decode,
+    {
+        cbor::from_slice_non_strict(&self.attestation)
+    }
+
+    /// Checks whether the TEE capability matches the given TEE identity.
+    pub fn matches(&self, identity: &Identity) -> bool {
+        match self.hardware {
+            TEEHardware::TEEHardwareInvalid => false,
+            TEEHardware::TEEHardwareIntelSGX => {
+                // Decode SGX attestation and check quote equality.
+                let attestation: SGXAttestation = match self.try_decode_attestation() {
+                    Ok(a) => a,
+                    _ => return false,
+                };
+                identity.rak_matches(&self.rak, &attestation.quote())
+            }
+        }
+    }
+
+    /// Verifies the TEE capability.
+    pub fn verify(
+        &self,
+        policy: &sgx::QuotePolicy,
+        node_id: &signature::PublicKey,
+    ) -> anyhow::Result<VerifiedAttestation> {
+        match self.hardware {
+            TEEHardware::TEEHardwareInvalid => bail!("invalid TEE hardware"),
+            TEEHardware::TEEHardwareIntelSGX => {
+                // Decode SGX attestation and verify it.
+                let attestation: SGXAttestation = self.try_decode_attestation()?;
+                attestation.verify(
+                    policy,
+                    node_id,
+                    &self.rak,
+                    self.rek.as_ref().ok_or(anyhow!("missing REK"))?,
+                )
+            }
+        }
+    }
+}
+
+/// An endorsed CapabilityTEE structure.
+///
+///
+/// Endorsement is needed for off-chain runtime components where their RAK is not published in the
+/// consensus layer and verification is part of the runtime itself. Via endorsement one can enforce
+/// policies like "only components executed by the current compute committee are authorized".
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct EndorsedCapabilityTEE {
+    /// TEE capability structure to be endorsed.
+    pub capability_tee: CapabilityTEE,
+
+    /// Node endorsement signature.
+    pub node_endorsement: signature::SignatureBundle,
+}
+
+impl EndorsedCapabilityTEE {
+    /// Verify the endorsement signature is valid.
+    ///
+    /// **This does not verify the TEE capability itself, use `verify` for that.**
+    pub fn verify_endorsement(&self) -> anyhow::Result<()> {
+        if !self.node_endorsement.verify(
+            ENDORSE_CAPABILITY_TEE_SIGNATURE_CONTEXT,
+            &cbor::to_vec(self.capability_tee.clone()),
+        ) {
+            bail!("invalid node endorsement signature");
+        }
+        Ok(())
+    }
+
+    /// Verify endorsed TEE capability is valid.
+    pub fn verify(
+        &self,
+        policy: &sgx::QuotePolicy,
+    ) -> anyhow::Result<VerifiedEndorsedCapabilityTEE> {
+        // Verify node endorsement.
+        self.verify_endorsement()?;
+
+        // Verify TEE capability.
+        let verified_attestation = self
+            .capability_tee
+            .verify(policy, &self.node_endorsement.public_key)?;
+
+        Ok(VerifiedEndorsedCapabilityTEE {
+            verified_attestation,
+            node_id: Some(self.node_endorsement.public_key),
+        })
+    }
+}
+
+/// A verified endorsed CapabilityTEE structure.
+#[derive(Clone, Debug, Default)]
+pub struct VerifiedEndorsedCapabilityTEE {
+    /// Verified TEE remote attestation.
+    pub verified_attestation: VerifiedAttestation,
+    /// Optional identifier of the node that endorsed the TEE capability.
+    pub node_id: Option<signature::PublicKey>,
+}
+
+impl From<VerifiedAttestation> for VerifiedEndorsedCapabilityTEE {
+    fn from(verified_attestation: VerifiedAttestation) -> Self {
+        Self {
+            verified_attestation,
+            node_id: None,
+        }
+    }
+}
+
+impl From<sgx::VerifiedQuote> for VerifiedEndorsedCapabilityTEE {
+    fn from(verified_quote: sgx::VerifiedQuote) -> Self {
+        Self {
+            verified_attestation: verified_quote.into(),
+            node_id: None,
+        }
+    }
+}
+
+/// Represents a node's capabilities.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Capabilities {
+    /// Is the capability of a node executing batches in a TEE.
+    #[cbor(optional)]
+    pub tee: Option<CapabilityTEE>,
+}
+
+/// Represents the runtimes supported by a given Oasis node.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct NodeRuntime {
+    /// Public key identifying the runtime.
+    pub id: Namespace,
+
+    /// Version of the runtime.
+    pub version: Version,
+
+    /// Node's capabilities for a given runtime.
+    pub capabilities: Capabilities,
+
+    /// Extra per node + per runtime opaque data associated with the current instance.
+    pub extra_info: Option<Vec<u8>>,
+}
+
+/// Oasis node roles bitmask.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[cbor(transparent)]
+pub struct RolesMask(pub u32);
+
+// XXX: Would be nicer to use bitflags crate for this, but there is no way to add
+// custom derives to the enum at the moment.
+// Should be possible in v2.0 (https://github.com/bitflags/bitflags/issues/262).
+impl RolesMask {
+    /// Empty roles mask.
+    pub const ROLE_EMPTY: RolesMask = RolesMask(0);
+    /// Compute worker role.
+    pub const ROLE_COMPUTE_WORKER: RolesMask = RolesMask(1 << 0);
+    /// Observer role.
+    pub const ROLE_OBSERVER: RolesMask = RolesMask(1 << 1);
+    /// Key manager role.
+    pub const ROLE_KEY_MANAGER: RolesMask = RolesMask(1 << 2);
+    /// Validator role.
+    pub const ROLE_VALIDATOR: RolesMask = RolesMask(1 << 3);
+    /// Public consensus RPC services worker role.
+    pub const ROLE_RESERVED_3: RolesMask = RolesMask(1 << 4);
+    /// Public storage RPC services worker role.
+    pub const ROLE_STORAGE_RPC: RolesMask = RolesMask(1 << 5);
+
+    // Bits of the Oasis node roles bitmask that are reserved and must not be used.
+    pub const ROLES_RESERVED: RolesMask =
+        RolesMask(u32::MAX & !((Self::ROLE_STORAGE_RPC.0 << 1) - 1) | Self::ROLE_RESERVED_3.0);
+
+    /// Whether the roles mask contains any of the specified roles.
+    pub fn contains(&self, role: RolesMask) -> bool {
+        (self.0 & role.0) != 0
+    }
+
+    /// Whether the roles mask encodes a single valid role.
+    pub fn is_single_role(&self) -> bool {
+        // Ensures exactly one bit is set, and the set bit is a valid role.
+        self.0 != 0 && self.0 & (self.0 - 1) == 0 && self.0 & Self::ROLES_RESERVED.0 == 0
+    }
+}
+
+impl std::ops::BitAnd for RolesMask {
+    type Output = Self;
+
+    fn bitand(self, rhs: Self) -> Self::Output {
+        Self(self.0.bitand(rhs.0))
+    }
+}
+
+impl std::ops::BitOr for RolesMask {
+    type Output = Self;
+
+    fn bitor(self, rhs: Self) -> Self::Output {
+        Self(self.0.bitor(rhs.0))
+    }
+}
+
+impl PartialOrd for RolesMask {
+    fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for RolesMask {
+    fn cmp(&self, other: &Self) -> std::cmp::Ordering {
+        self.0.cmp(&other.0)
+    }
+}
+
+impl Default for RolesMask {
+    fn default() -> Self {
+        Self::ROLE_EMPTY
+    }
+}
+
+/// Node registry descriptor.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct Node {
+    /// Structure version.
+    pub v: u16,
+
+    /// Public key identifying the node.
+    pub id: signature::PublicKey,
+
+    /// Public key identifying the Entity controlling the node.
+    pub entity_id: signature::PublicKey,
+
+    /// Epoch in which the node's commitment expires.
+    pub expiration: u64,
+
+    /// Information for connecting to this node via TLS.
+    pub tls: TLSInfo,
+
+    /// Information for connecting to this node via P2P.
+    pub p2p: P2PInfo,
+
+    /// Information for connecting to this node as a consensus member.
+    pub consensus: ConsensusInfo,
+
+    /// Information for this node's participation in VRF based elections.
+    pub vrf: VRFInfo,
+
+    /// Node's runtimes.
+    pub runtimes: Option<Vec<NodeRuntime>>,
+
+    /// Bitmask representing the node roles.
+    pub roles: RolesMask,
+
+    /// Node's oasis-node software version.
+    #[cbor(optional)]
+    pub software_version: Option<String>,
+}
+
+impl Node {
+    /// Checks whether the node has any of the specified roles.
+    pub fn has_roles(&self, roles: RolesMask) -> bool {
+        self.roles.contains(roles)
+    }
+
+    /// Checks whether the node has the provided TEE identity configured.
+    pub fn has_tee(&self, identity: &Identity, runtime_id: &Namespace, version: &Version) -> bool {
+        if let Some(rts) = &self.runtimes {
+            for rt in rts {
+                if runtime_id != &rt.id {
+                    continue;
+                }
+                if version != &rt.version {
+                    continue;
+                }
+                if let Some(tee) = &rt.capabilities.tee {
+                    if tee.matches(identity) {
+                        return true;
+                    }
+                }
+            }
+        }
+        false
+    }
+
+    /// Searches for an existing supported runtime descriptor
+    /// in runtimes with the specified version and returns it.
+    pub fn get_runtime(&self, runtime_id: &Namespace, version: &Version) -> Option<NodeRuntime> {
+        if let Some(rts) = &self.runtimes {
+            for rt in rts {
+                if runtime_id != &rt.id {
+                    continue;
+                }
+                if version != &rt.version {
+                    continue;
+                }
+                return Some(rt.clone());
+            }
+        }
+        None
+    }
+}
+
+/// Runtime kind.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[repr(u32)]
+pub enum RuntimeKind {
+    /// Invalid runtime that should never be explicitly set.
+    #[default]
+    KindInvalid = 0,
+    /// Generic compute runtime.
+    KindCompute = 1,
+    /// Key manager runtime.
+    KindKeyManager = 2,
+}
+
+/// Parameters for the executor committee.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ExecutorParameters {
+    /// Size of the committee.
+    pub group_size: u16,
+    /// Size of the discrepancy resolution group.
+    pub group_backup_size: u16,
+    /// Number of allowed stragglers.
+    pub allowed_stragglers: u16,
+    /// Round timeout in consensus blocks.
+    pub round_timeout: i64,
+    /// Maximum number of messages that can be emitted by the runtime
+    /// in a single round.
+    pub max_messages: u32,
+    /// Minimum percentage of rounds in an epoch that a node must participate in positively in order
+    /// to be considered live. Nodes not satisfying this may be penalized.
+    #[cbor(optional)]
+    pub min_live_rounds_percent: u8,
+    /// Maximum percentage of proposed rounds in an epoch that can fail for a node
+    /// to be considered live. Nodes not satisfying this may be penalized. Zero means
+    /// that all proposed rounds can fail.
+    #[cbor(optional)]
+    pub max_missed_proposals_percent: u8,
+    /// Minimum number of live rounds in an epoch for the liveness calculations to be considered for
+    /// evaluation.
+    #[cbor(optional)]
+    pub min_live_rounds_eval: u64,
+    /// Maximum number of liveness failures that are tolerated before suspending and/or slashing the
+    /// node. Zero means unlimited.
+    #[cbor(optional)]
+    pub max_liveness_fails: u8,
+}
+
+/// Parameters for the runtime transaction scheduler.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct TxnSchedulerParameters {
+    /// How long to wait for a scheduled batch in nanoseconds (when using the
+    /// "simple" scheduling algorithm).
+    #[cbor(optional)]
+    pub batch_flush_timeout: i64,
+    /// Maximum size of a scheduled batch.
+    #[cbor(optional)]
+    pub max_batch_size: u64,
+    /// Maximum size of a scheduled batch in bytes.
+    #[cbor(optional)]
+    pub max_batch_size_bytes: u64,
+    /// Maximum size of the incoming message queue.
+    #[cbor(optional)]
+    pub max_in_messages: u32,
+    /// How long to wait before accepting proposal from the next backup scheduler in nanoseconds.
+    #[cbor(optional)]
+    pub propose_batch_timeout: i64,
+}
+
+/// Storage parameters.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct StorageParameters {
+    /// Expected runtime state checkpoint interval (in rounds).
+    pub checkpoint_interval: u64,
+    /// Expected minimum number of checkpoints to keep.
+    pub checkpoint_num_kept: u64,
+    /// Chunk size parameter for checkpoint creation.
+    pub checkpoint_chunk_size: u64,
+}
+
+/// The node scheduling constraints.
+///
+/// Multiple fields may be set in which case the ALL the constraints must be satisfied.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct SchedulingConstraints {
+    #[cbor(optional)]
+    pub validator_set: Option<ValidatorSetConstraint>,
+
+    #[cbor(optional)]
+    pub max_nodes: Option<MaxNodesConstraint>,
+
+    #[cbor(optional)]
+    pub min_pool_size: Option<MinPoolSizeConstraint>,
+}
+
+/// A constraint which specifies that the entity must have a node that is part of the validator set.
+/// No other options can currently be specified.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ValidatorSetConstraint {}
+
+/// A constraint which specifies that only the given number of nodes may be eligible per entity.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct MaxNodesConstraint {
+    pub limit: u16,
+}
+
+/// A constraint which specifies the minimum required candidate pool size.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct MinPoolSizeConstraint {
+    pub limit: u16,
+}
+
+/// Stake-related parameters for a runtime.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct RuntimeStakingParameters {
+    /// Minimum stake thresholds for a runtime. These per-runtime thresholds are
+    /// in addition to the global thresholds. May be left unspecified.
+    ///
+    /// In case a node is registered for multiple runtimes, it will need to
+    /// satisfy the maximum threshold of all the runtimes.
+    #[cbor(optional)]
+    pub thresholds: BTreeMap<staking::ThresholdKind, quantity::Quantity>,
+
+    /// Per-runtime misbehavior slashing parameters.
+    #[cbor(optional)]
+    pub slashing: BTreeMap<staking::SlashReason, staking::Slash>,
+
+    /// The percentage of the reward obtained when slashing for equivocation that is transferred to
+    /// the runtime's account.
+    #[cbor(optional)]
+    pub reward_equivocation: u8,
+
+    /// The percentage of the reward obtained when slashing for incorrect results that is
+    /// transferred to the runtime's account.
+    #[cbor(optional)]
+    pub reward_bad_results: u8,
+
+    /// Specifies the minimum fee that the incoming message must include for the
+    /// message to be queued.
+    #[cbor(optional)]
+    pub min_in_message_fee: quantity::Quantity,
+}
+
+/// Policy that allows only whitelisted entities' nodes to register.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct EntityWhitelistRuntimeAdmissionPolicy {
+    /// Entity whitelist configuration for each whitelisted entity.
+    #[cbor(optional)]
+    pub entities: BTreeMap<signature::PublicKey, EntityWhitelistConfig>,
+}
+
+/// Entity whitelist configuration.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct EntityWhitelistConfig {
+    /// Maximum number of nodes that an entity can register under the given
+    /// runtime for a specific role. If the map is empty or absent, the number
+    /// of nodes is unlimited. If the map is present and non-empty, the number
+    /// of nodes is restricted to the specified maximum (where zero
+    /// means no nodes allowed), any missing roles imply zero nodes.
+    #[cbor(optional)]
+    pub max_nodes: BTreeMap<RolesMask, u16>,
+}
+
+/// A per-entity whitelist configuration for a given role.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct EntityWhitelistRoleConfig {
+    #[cbor(optional)]
+    pub max_nodes: u16,
+}
+
+/// A per-role entity whitelist policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct EntityWhitelistRoleAdmissionPolicy {
+    pub entities: BTreeMap<signature::PublicKey, EntityWhitelistRoleConfig>,
+}
+
+/// A per-role admission policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct PerRoleAdmissionPolicy {
+    #[cbor(optional)]
+    pub entity_whitelist: Option<EntityWhitelistRoleAdmissionPolicy>,
+}
+
+/// Admission policy that allows any node to register.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct AnyNodeRuntimeAdmissionPolicy {}
+
+/// Specification of which nodes are allowed to register for a runtime.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct RuntimeAdmissionPolicy {
+    /// Allow any node to register.
+    #[cbor(optional)]
+    pub any_node: Option<AnyNodeRuntimeAdmissionPolicy>,
+
+    /// Allow only the whitelisted entities' nodes to register.
+    #[cbor(optional)]
+    pub entity_whitelist: Option<EntityWhitelistRuntimeAdmissionPolicy>,
+
+    /// A per-role admission policy that must be satisfied in addition to the global admission
+    /// policy for a specific role.
+    #[cbor(optional)]
+    pub per_role: BTreeMap<RolesMask, PerRoleAdmissionPolicy>,
+}
+
+/// Runtime governance model.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum RuntimeGovernanceModel {
+    /// Invalid model that should never be explicitly set.
+    #[default]
+    GovernanceInvalid = 0,
+    /// Entity governance model.
+    GovernanceEntity = 1,
+    /// Runtime governance model.
+    GovernanceRuntime = 2,
+    /// Consensus governance model.
+    GovernanceConsensus = 3,
+}
+
+/// Per-runtime version information.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct VersionInfo {
+    /// Version of the runtime.
+    pub version: Version,
+    /// The epoch at which this version is valid.
+    pub valid_from: EpochTime,
+    /// Enclave version information, in an enclave provided specific format (if any).
+    #[cbor(optional)]
+    pub tee: Vec<u8>,
+    /// The SHA256 hash of the runtime bundle (optional).
+    #[cbor(optional)]
+    pub bundle_checksum: Vec<u8>,
+}
+
+impl VersionInfo {
+    /// Tries to decode the TEE-specific version information.
+    pub fn try_decode_tee<T>(&self) -> Result<T, cbor::DecodeError>
+    where
+        T: cbor::Decode,
+    {
+        cbor::from_slice_non_strict(&self.tee)
+    }
+}
+
+/// Intel SGX TEE constraints.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(tag = "v")]
+pub enum SGXConstraints {
+    /// Old V0 format that only supported IAS policies.
+    #[cbor(rename = 0, missing)]
+    V0 {
+        /// The allowed MRENCLAVE/MRSIGNER pairs.
+        #[cbor(optional)]
+        enclaves: Vec<sgx::EnclaveIdentity>,
+
+        /// A set of allowed quote statuses.
+        #[cbor(optional)]
+        allowed_quote_statuses: Vec<i64>,
+    },
+
+    /// New V1 format that supports both IAS and PCS policies.
+    #[cbor(rename = 1)]
+    V1 {
+        /// The allowed MRENCLAVE/MRSIGNER pairs.
+        #[cbor(optional)]
+        enclaves: Vec<sgx::EnclaveIdentity>,
+
+        /// The quote policy.
+        #[cbor(optional)]
+        policy: sgx::QuotePolicy,
+
+        /// The maximum attestation age (in blocks).
+        #[cbor(optional)]
+        max_attestation_age: u64,
+    },
+}
+
+impl SGXConstraints {
+    /// Identities of allowed enclaves.
+    pub fn enclaves(&self) -> &Vec<sgx::EnclaveIdentity> {
+        match self {
+            Self::V0 { ref enclaves, .. } => enclaves,
+            Self::V1 { ref enclaves, .. } => enclaves,
+        }
+    }
+
+    /// Checks whether the given enclave identity is whitelisted.
+    pub fn contains_enclave(&self, eid: &sgx::EnclaveIdentity) -> bool {
+        self.enclaves().contains(eid)
+    }
+
+    /// SGX quote policy.
+    pub fn policy(&self) -> sgx::QuotePolicy {
+        match self {
+            Self::V0 {
+                ref allowed_quote_statuses,
+                ..
+            } => sgx::QuotePolicy {
+                ias: Some(sgx::ias::QuotePolicy {
+                    disabled: false,
+                    allowed_quote_statuses: allowed_quote_statuses.clone(),
+                    gid_blacklist: Vec::new(),
+                    min_tcb_evaluation_data_number: 0,
+                }),
+                ..Default::default()
+            },
+            Self::V1 { ref policy, .. } => policy.clone(),
+        }
+    }
+}
+
+/// Verified remote attestation.
+#[derive(Clone, Debug, Default)]
+pub struct VerifiedAttestation {
+    /// Verified enclave quote.
+    pub quote: sgx::VerifiedQuote,
+    /// Enclave's view of the consensus layer height at the time of attestation.
+    pub height: Option<u64>,
+}
+
+impl From<sgx::VerifiedQuote> for VerifiedAttestation {
+    fn from(quote: sgx::VerifiedQuote) -> Self {
+        Self {
+            quote,
+            height: None,
+        }
+    }
+}
+
+/// Intel SGX remote attestation.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(tag = "v")]
+pub enum SGXAttestation {
+    /// Old V0 format that only supported IAS quotes.
+    #[cbor(rename = 0, missing)]
+    V0(sgx::ias::AVR),
+
+    /// New V1 format that supports both IAS and PCS policies.
+    #[cbor(rename = 1)]
+    V1 {
+        /// An Intel SGX quote.
+        quote: sgx::Quote,
+        /// The runtime's view of the consensus layer height at the time of attestation.
+        height: u64,
+        /// The signature of the attestation by the enclave (RAK).
+        signature: Signature,
+    },
+}
+
+impl SGXAttestation {
+    /// SGX attestation quote.
+    pub fn quote(&self) -> sgx::Quote {
+        match self {
+            Self::V0(avr) => sgx::Quote::Ias(avr.clone()),
+            Self::V1 { quote, .. } => quote.clone(),
+        }
+    }
+
+    /// Hashes the required data that needs to be signed by RAK producing the attestation signature.
+    pub fn hash(
+        report_data: &[u8],
+        node_id: &signature::PublicKey,
+        height: u64,
+        rek: &x25519::PublicKey,
+    ) -> [u8; 32] {
+        let mut h = TupleHash::v256(ATTESTATION_SIGNATURE_CONTEXT);
+        h.update(report_data);
+        h.update(node_id.as_ref());
+        h.update(&height.to_le_bytes());
+        h.update(rek.0.as_bytes());
+        let mut result = [0u8; 32];
+        h.finalize(&mut result);
+        result
+    }
+
+    /// Verifies the SGX attestation.
+    pub fn verify(
+        &self,
+        policy: &sgx::QuotePolicy,
+        node_id: &signature::PublicKey,
+        rak: &signature::PublicKey,
+        rek: &x25519::PublicKey,
+    ) -> anyhow::Result<VerifiedAttestation> {
+        // Verify the quote.
+        let verified_quote = self.quote().verify(policy)?;
+
+        // Ensure that the report data includes the hash of the node's RAK.
+        Identity::verify_binding(&verified_quote, rak)?;
+
+        // Verify the attestation signature.
+        match self {
+            Self::V1 {
+                height, signature, ..
+            } => {
+                let h = Self::hash(&verified_quote.report_data, node_id, *height, rek);
+                signature.verify(rak, ATTESTATION_SIGNATURE_CONTEXT, &h)?;
+
+                Ok(VerifiedAttestation {
+                    quote: verified_quote,
+                    height: Some(*height),
+                })
+            }
+            _ => bail!("V0 attestation not supported"),
+        }
+    }
+}
+
+/// TEE hardware implementation.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum TEEHardware {
+    /// Non-TEE implementation.
+    #[default]
+    TEEHardwareInvalid = 0,
+    /// Intel SGX TEE implementation.
+    TEEHardwareIntelSGX = 1,
+}
+
+/// The latest entity descriptor version that should be used for all new descriptors. Using earlier
+/// versions may be rejected.
+pub const LATEST_RUNTIME_DESCRIPTOR_VERSION: u16 = 3;
+
+/// Runtime.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Runtime {
+    /// Structure version.
+    pub v: u16,
+    /// Globally unique long term identifier of the runtime.
+    pub id: Namespace,
+    /// Public key identifying the Entity controlling the runtime.
+    pub entity_id: signature::PublicKey,
+    /// Runtime genesis information.
+    pub genesis: RuntimeGenesis,
+    /// Type of runtime.
+    pub kind: RuntimeKind,
+    /// Runtime's TEE hardware requirements.
+    pub tee_hardware: TEEHardware,
+    /// Runtime deployment information.
+    #[cbor(optional)]
+    pub deployments: Vec<VersionInfo>,
+    /// Key manager runtime ID for this runtime.
+    #[cbor(optional)]
+    pub key_manager: Option<Namespace>,
+    /// Parameters of the executor committee.
+    #[cbor(optional)]
+    pub executor: ExecutorParameters,
+    /// Transaction scheduling parameters of the executor committee.
+    #[cbor(optional)]
+    pub txn_scheduler: TxnSchedulerParameters,
+    /// Parameters of the storage committee.
+    #[cbor(optional)]
+    pub storage: StorageParameters,
+    /// Which nodes are allowed to register for this runtime.
+    pub admission_policy: RuntimeAdmissionPolicy,
+    /// Node scheduling constraints.
+    #[cbor(optional)]
+    pub constraints:
+        BTreeMap<scheduler::CommitteeKind, BTreeMap<scheduler::Role, SchedulingConstraints>>,
+    /// Runtime's staking-related parameters.
+    #[cbor(optional, skip_serializing_if = "staking_params_are_empty")]
+    pub staking: RuntimeStakingParameters,
+    /// Runtime governance model.
+    pub governance_model: RuntimeGovernanceModel,
+}
+
+fn staking_params_are_empty(p: &RuntimeStakingParameters) -> bool {
+    p.thresholds.is_empty()
+        && p.slashing.is_empty()
+        && p.reward_equivocation == 0
+        && p.reward_bad_results == 0
+        && p.min_in_message_fee.is_zero()
+}
+
+impl Runtime {
+    /// The currently active deployment for the specified epoch if it exists.
+    pub fn active_deployment(&self, now: EpochTime) -> Option<VersionInfo> {
+        self.deployments
+            .iter()
+            .filter(|vi| vi.valid_from <= now) // Ignore versions that are not valid yet.
+            .fold(None, |acc, vi| match acc {
+                None => Some(vi.clone()),
+                Some(ad) if ad.valid_from < vi.valid_from => Some(vi.clone()),
+                _ => acc,
+            })
+    }
+
+    /// Deployment corresponding to the specified version if it exists.
+    pub fn deployment_for_version(&self, version: Version) -> Option<VersionInfo> {
+        self.deployments
+            .iter()
+            .find(|vi| vi.version == version)
+            .cloned()
+    }
+}
+
+/// Runtime genesis information that is used to initialize runtime state in the first block.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct RuntimeGenesis {
+    /// State root that should be used at genesis time. If the runtime should start with empty state,
+    /// this must be set to the empty hash.
+    pub state_root: Hash,
+
+    /// Runtime round in the genesis.
+    pub round: u64,
+}
+
+#[cfg(test)]
+mod tests {
+    use std::{convert::TryInto, net::Ipv4Addr};
+
+    use base64::prelude::*;
+    use rustc_hex::{FromHex, ToHex};
+
+    use crate::common::quantity::Quantity;
+
+    use super::*;
+
+    /// Constructs a BTreeMap using a `btreemap! { key => value, ... }` syntax.
+    macro_rules! btreemap {
+    // allow trailing comma
+    ( $($key:expr => $value:expr,)+ ) => (btreemap!($($key => $value),+));
+    ( $($key:expr => $value:expr),* ) => {
+        {
+            let mut m = BTreeMap::new();
+            $( m.insert($key.into(), $value); )*
+            m
+        }
+    };
+}
+
+    #[test]
+    fn test_consistent_runtime() {
+        // NOTE: These tests MUST be synced with go/registry/api/runtime.go.
+        let tcs = vec![
+            // FIXME: Change to "qmF2AGJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABka2luZABnZ2VuZXNpc6Jlcm91bmQAanN0YXRlX3Jvb3RYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ3N0b3JhZ2Wjc2NoZWNrcG9pbnRfaW50ZXJ2YWwAc2NoZWNrcG9pbnRfbnVtX2tlcHQAdWNoZWNrcG9pbnRfY2h1bmtfc2l6ZQBoZXhlY3V0b3Klamdyb3VwX3NpemUAbG1heF9tZXNzYWdlcwBtcm91bmRfdGltZW91dABxZ3JvdXBfYmFja3VwX3NpemUAcmFsbG93ZWRfc3RyYWdnbGVycwBpZW50aXR5X2lkWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGx0ZWVfaGFyZHdhcmUAcGFkbWlzc2lvbl9wb2xpY3mhaGFueV9ub2RloHBnb3Zlcm5hbmNlX21vZGVsAA==" once cbor is fixed.
+            ("q2F2AGJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABka2luZABnZ2VuZXNpc6Jlcm91bmQAanN0YXRlX3Jvb3RYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ3N0b3JhZ2Wjc2NoZWNrcG9pbnRfaW50ZXJ2YWwAc2NoZWNrcG9pbnRfbnVtX2tlcHQAdWNoZWNrcG9pbnRfY2h1bmtfc2l6ZQBoZXhlY3V0b3Klamdyb3VwX3NpemUAbG1heF9tZXNzYWdlcwBtcm91bmRfdGltZW91dABxZ3JvdXBfYmFja3VwX3NpemUAcmFsbG93ZWRfc3RyYWdnbGVycwBpZW50aXR5X2lkWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGx0ZWVfaGFyZHdhcmUAbXR4bl9zY2hlZHVsZXKgcGFkbWlzc2lvbl9wb2xpY3mhaGFueV9ub2RloHBnb3Zlcm5hbmNlX21vZGVsAA==", Runtime {
+                admission_policy: RuntimeAdmissionPolicy {
+                    any_node: Some(AnyNodeRuntimeAdmissionPolicy {}),
+                    ..Default::default()
+                },
+                ..Default::default()
+            }),
+            // FIXME: Change to "qmF2AGJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABka2luZABnZ2VuZXNpc6Jlcm91bmQAanN0YXRlX3Jvb3RYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ3N0b3JhZ2Wjc2NoZWNrcG9pbnRfaW50ZXJ2YWwAc2NoZWNrcG9pbnRfbnVtX2tlcHQAdWNoZWNrcG9pbnRfY2h1bmtfc2l6ZQBoZXhlY3V0b3Klamdyb3VwX3NpemUAbG1heF9tZXNzYWdlcwBtcm91bmRfdGltZW91dABxZ3JvdXBfYmFja3VwX3NpemUAcmFsbG93ZWRfc3RyYWdnbGVycwBpZW50aXR5X2lkWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGx0ZWVfaGFyZHdhcmUAcGFkbWlzc2lvbl9wb2xpY3mhaGFueV9ub2RloHBnb3Zlcm5hbmNlX21vZGVsAA==" once cbor is fixed.
+            (
+                "q2F2AGJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABka2luZABnZ2VuZXNpc6Jlcm91bmQAanN0YXRlX3Jvb3RYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ3N0b3JhZ2Wjc2NoZWNrcG9pbnRfaW50ZXJ2YWwAc2NoZWNrcG9pbnRfbnVtX2tlcHQAdWNoZWNrcG9pbnRfY2h1bmtfc2l6ZQBoZXhlY3V0b3Klamdyb3VwX3NpemUAbG1heF9tZXNzYWdlcwBtcm91bmRfdGltZW91dABxZ3JvdXBfYmFja3VwX3NpemUAcmFsbG93ZWRfc3RyYWdnbGVycwBpZW50aXR5X2lkWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGx0ZWVfaGFyZHdhcmUAbXR4bl9zY2hlZHVsZXKgcGFkbWlzc2lvbl9wb2xpY3mhaGFueV9ub2RloHBnb3Zlcm5hbmNlX21vZGVsAA==",
+                Runtime {
+                    admission_policy: RuntimeAdmissionPolicy {
+                        any_node: Some(AnyNodeRuntimeAdmissionPolicy {}),
+                        ..Default::default()
+                    },
+                    staking: RuntimeStakingParameters {
+                        thresholds: BTreeMap::new(),
+                        slashing: BTreeMap::new(),
+                        reward_equivocation: 0,
+                        reward_bad_results: 0,
+                        min_in_message_fee: Quantity::from(0u32),
+                    },
+                    ..Default::default()
+                },
+            ),
+            // FIXME: Change to "q2F2AGJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABka2luZABnZ2VuZXNpc6Jlcm91bmQAanN0YXRlX3Jvb3RYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ3N0YWtpbmehcnJld2FyZF9iYWRfcmVzdWx0cwpnc3RvcmFnZaNzY2hlY2twb2ludF9pbnRlcnZhbABzY2hlY2twb2ludF9udW1fa2VwdAB1Y2hlY2twb2ludF9jaHVua19zaXplAGhleGVjdXRvcqVqZ3JvdXBfc2l6ZQBsbWF4X21lc3NhZ2VzAG1yb3VuZF90aW1lb3V0AHFncm91cF9iYWNrdXBfc2l6ZQByYWxsb3dlZF9zdHJhZ2dsZXJzAGllbnRpdHlfaWRYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbHRlZV9oYXJkd2FyZQBwYWRtaXNzaW9uX3BvbGljeaFoYW55X25vZGWgcGdvdmVybmFuY2VfbW9kZWwA" once cbor is fixed.
+            (
+                "rGF2AGJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABka2luZABnZ2VuZXNpc6Jlcm91bmQAanN0YXRlX3Jvb3RYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ3N0YWtpbmehcnJld2FyZF9iYWRfcmVzdWx0cwpnc3RvcmFnZaNzY2hlY2twb2ludF9pbnRlcnZhbABzY2hlY2twb2ludF9udW1fa2VwdAB1Y2hlY2twb2ludF9jaHVua19zaXplAGhleGVjdXRvcqVqZ3JvdXBfc2l6ZQBsbWF4X21lc3NhZ2VzAG1yb3VuZF90aW1lb3V0AHFncm91cF9iYWNrdXBfc2l6ZQByYWxsb3dlZF9zdHJhZ2dsZXJzAGllbnRpdHlfaWRYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbHRlZV9oYXJkd2FyZQBtdHhuX3NjaGVkdWxlcqBwYWRtaXNzaW9uX3BvbGljeaFoYW55X25vZGWgcGdvdmVybmFuY2VfbW9kZWwA",
+                Runtime {
+                    admission_policy: RuntimeAdmissionPolicy {
+                        any_node: Some(AnyNodeRuntimeAdmissionPolicy {}),
+                        ..Default::default()
+                    },
+                    staking: RuntimeStakingParameters {
+                        thresholds: BTreeMap::new(),
+                        slashing: BTreeMap::new(),
+                        reward_equivocation: 0,
+                        reward_bad_results: 10,
+                        min_in_message_fee: Quantity::from(0u32),
+                    },
+                    ..Default::default()
+                },
+            ),
+            (
+                "r2F2GCpiaWRYIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZGtpbmQCZ2dlbmVzaXOiZXJvdW5kGCtqc3RhdGVfcm9vdFggseUhAZ+3vd413IH+55BlYQy937jvXCXihJg2aBkqbQ1nc3Rha2luZ6FycmV3YXJkX2JhZF9yZXN1bHRzCmdzdG9yYWdlo3NjaGVja3BvaW50X2ludGVydmFsGCFzY2hlY2twb2ludF9udW1fa2VwdAZ1Y2hlY2twb2ludF9jaHVua19zaXplGGVoZXhlY3V0b3Kpamdyb3VwX3NpemUJbG1heF9tZXNzYWdlcwVtcm91bmRfdGltZW91dAZxZ3JvdXBfYmFja3VwX3NpemUIcmFsbG93ZWRfc3RyYWdnbGVycwdybWF4X2xpdmVuZXNzX2ZhaWxzAXRtaW5fbGl2ZV9yb3VuZHNfZXZhbAJ3bWluX2xpdmVfcm91bmRzX3BlcmNlbnQEeBxtYXhfbWlzc2VkX3Byb3Bvc2Fsc19wZXJjZW50A2llbnRpdHlfaWRYIBI0VniQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa2NvbnN0cmFpbnRzoQGhAaNpbWF4X25vZGVzoWVsaW1pdAptbWluX3Bvb2xfc2l6ZaFlbGltaXQFbXZhbGlkYXRvcl9zZXSga2RlcGxveW1lbnRzgaRjdGVlS3ZlcnNpb24gdGVlZ3ZlcnNpb26iZW1ham9yGCxlcGF0Y2gBanZhbGlkX2Zyb20Ab2J1bmRsZV9jaGVja3N1bVggAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFra2V5X21hbmFnZXJYIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABbHRlZV9oYXJkd2FyZQFtdHhuX3NjaGVkdWxlcqVubWF4X2JhdGNoX3NpemUZJxBvbWF4X2luX21lc3NhZ2VzGCBzYmF0Y2hfZmx1c2hfdGltZW91dBo7msoAdG1heF9iYXRjaF9zaXplX2J5dGVzGgCYloB1cHJvcG9zZV9iYXRjaF90aW1lb3V0Gnc1lABwYWRtaXNzaW9uX3BvbGljeaFwZW50aXR5X3doaXRlbGlzdKFoZW50aXRpZXOhWCASNFZ4kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKFpbWF4X25vZGVzogEDBAFwZ292ZXJuYW5jZV9tb2RlbAM=",
+                Runtime {
+                    v: 42,
+                    id: Namespace::from(
+                        "8000000000000000000000000000000000000000000000000000000000000000",
+                    ),
+                    entity_id: signature::PublicKey::from(
+                        "1234567890000000000000000000000000000000000000000000000000000000",
+                    ),
+                    genesis: RuntimeGenesis {
+                        round: 43,
+                        state_root: Hash::digest_bytes(b"stateroot hash"),
+                    },
+                    kind: RuntimeKind::KindKeyManager,
+                    tee_hardware: TEEHardware::TEEHardwareIntelSGX,
+                    deployments: vec![VersionInfo {
+                        version: Version {
+                            major: 44,
+                            minor: 0,
+                            patch: 1,
+                        },
+                        valid_from: 0,
+                        tee: b"version tee".to_vec(),
+                        bundle_checksum: vec![0x1; 32],
+                    }],
+                    key_manager: Some(Namespace::from(
+                        "8000000000000000000000000000000000000000000000000000000000000001",
+                    )),
+                    executor: ExecutorParameters {
+                        group_size: 9,
+                        group_backup_size: 8,
+                        allowed_stragglers: 7,
+                        round_timeout: 6,
+                        max_messages: 5,
+                        min_live_rounds_percent: 4,
+                        max_missed_proposals_percent: 3,
+                        min_live_rounds_eval: 2,
+                        max_liveness_fails: 1,
+                    },
+                    txn_scheduler: TxnSchedulerParameters {
+                        batch_flush_timeout: 1_000_000_000, // 1 second.
+                        max_batch_size: 10_000,
+                        max_batch_size_bytes: 10_000_000,
+                        max_in_messages: 32,
+                        propose_batch_timeout: 2_000_000_000, // 2 seconds.
+                    },
+                    storage: StorageParameters {
+                        checkpoint_interval: 33,
+                        checkpoint_num_kept: 6,
+                        checkpoint_chunk_size: 101,
+                    },
+                    admission_policy: RuntimeAdmissionPolicy {
+                        entity_whitelist: Some(EntityWhitelistRuntimeAdmissionPolicy {
+                            entities: btreemap! {
+                                signature::PublicKey::from("1234567890000000000000000000000000000000000000000000000000000000") => EntityWhitelistConfig {
+                                     max_nodes: btreemap! {
+                                         RolesMask::ROLE_COMPUTE_WORKER => 3,
+                                         RolesMask::ROLE_KEY_MANAGER => 1,
+                                    }
+                                }
+                            },
+                        }),
+                        ..Default::default()
+                    },
+                    constraints: btreemap! {
+                        scheduler::CommitteeKind::ComputeExecutor => btreemap! {
+                            scheduler::Role::Worker => SchedulingConstraints{
+                                max_nodes: Some(
+                                    MaxNodesConstraint{
+                                        limit: 10,
+                                    }
+                                ),
+                                min_pool_size: Some(
+                                    MinPoolSizeConstraint {
+                                        limit: 5,
+                                    }
+                                ),
+                                validator_set: Some(ValidatorSetConstraint{}),
+                            },
+                        }
+                    },
+                    staking: RuntimeStakingParameters {
+                        thresholds: BTreeMap::new(),
+                        slashing: BTreeMap::new(),
+                        reward_equivocation: 0,
+                        reward_bad_results: 10,
+                        min_in_message_fee: Quantity::from(0u32),
+                    },
+                    governance_model: RuntimeGovernanceModel::GovernanceConsensus,
+                },
+            ),
+        ];
+        for (encoded_base64, rr) in tcs {
+            let dec: Runtime = cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                .expect("runtime should deserialize correctly");
+            assert_eq!(dec, rr, "decoded runtime should match the expected value");
+            let ser = BASE64_STANDARD.encode(cbor::to_vec(dec));
+            assert_eq!(ser, encoded_base64, "runtime should serialize correctly");
+        }
+    }
+
+    #[test]
+    fn test_consistent_node() {
+        // NOTE: These tests MUST be synced with go/common/node/node_test.go.
+        let tcs = vec![
+            (
+                "qmF2A2JpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABjcDJwomJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpYWRkcmVzc2Vz9mN0bHOhZ3B1Yl9rZXlYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY3ZyZqFiaWRYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZXJvbGVzAGhydW50aW1lc/ZpY29uc2Vuc3VzomJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpYWRkcmVzc2Vz9mllbnRpdHlfaWRYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAamV4cGlyYXRpb24A",
+                Node{v: 3, ..Default::default()},
+                true,
+            ),
+			(
+                "qmF2A2JpZFgg//////////////////////////////////////////BjcDJwomJpZFgg//////////////////////////////////////////VpYWRkcmVzc2Vz9mN0bHOhZ3B1Yl9rZXlYIP/////////////////////////////////////////yY3ZyZqFiaWRYIP/////////////////////////////////////////3ZXJvbGVzAGhydW50aW1lc4KkYmlkWCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEGd2ZXJzaW9uoWVwYXRjaBkBQWpleHRyYV9pbmZv9mxjYXBhYmlsaXRpZXOgpGJpZFgggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFndmVyc2lvbqFlcGF0Y2gYe2pleHRyYV9pbmZvRAUDAgFsY2FwYWJpbGl0aWVzoWN0ZWWjY3Jha1gg//////////////////////////////////////////hoaGFyZHdhcmUBa2F0dGVzdGF0aW9uRgABAgMEBWljb25zZW5zdXOiYmlkWCD/////////////////////////////////////////9mlhZGRyZXNzZXOAaWVudGl0eV9pZFgg//////////////////////////////////////////FqZXhwaXJhdGlvbhgg",
+                Node{
+                    v: 3,
+                    id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"),
+                    entity_id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1"),
+                    expiration: 32,
+                    tls: TLSInfo{
+                        pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2"),
+                        ..Default::default()
+                    },
+                    p2p: P2PInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5"),
+                        ..Default::default()
+                    },
+                    consensus: ConsensusInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6"),
+                        addresses: Some(Vec::new()),
+                    },
+                    vrf: VRFInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7"),
+                    },
+                    runtimes: Some(vec![
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000010"),
+                            version: Version::from(321u64),
+                            ..Default::default()
+                        },
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000011"),
+                            version: Version::from(123),
+                            capabilities: Capabilities{
+                               tee: Some(CapabilityTEE{
+                                   hardware: TEEHardware::TEEHardwareIntelSGX,
+                                    rak: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8"),
+                                    attestation: vec![0, 1,2,3,4,5],
+                                    ..Default::default()
+                               }),
+                            },
+                            extra_info: Some(vec![5,3,2,1]),
+                        },
+                    ]),
+                    ..Default::default()
+                },
+                true,
+            ),
+            (
+                "qWF2A2JpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABjcDJwomJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpYWRkcmVzc2Vz9mN0bHOhZ3B1Yl9rZXlYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZXJvbGVzAGhydW50aW1lc4GkYmlkWCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEGd2ZXJzaW9uoGpleHRyYV9pbmZv9mxjYXBhYmlsaXRpZXOgaWNvbnNlbnN1c6JiaWRYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaWFkZHJlc3Nlc/ZpZW50aXR5X2lkWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGpleHBpcmF0aW9uAA==",
+                Node{
+                    v: 3,
+                    runtimes: Some(vec![
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000010"),
+                            version: Version::from(0u64),
+                            ..Default::default()
+                        },
+                    ]),
+                    ..Default::default()
+                },
+                false,
+            ),
+        ];
+        for (encoded_base64, node, round_trip) in tcs {
+            println!("{:?}", node);
+            let dec: Node = cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                .expect("node should deserialize correctly");
+            assert_eq!(dec, node, "decoded node should match the expected value");
+
+            if round_trip {
+                let ser = BASE64_STANDARD.encode(cbor::to_vec(dec));
+                assert_eq!(ser, encoded_base64, "node should serialize correctly");
+            }
+        }
+    }
+
+    #[test]
+    fn test_deserialize_node_v2() {
+        // NOTE: These tests MUST be synced with go/common/node/node_test.go.
+        let tcs = vec![
+            (
+                "qWF2AmJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABjcDJwomJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpYWRkcmVzc2Vz9mN0bHOiZ3B1Yl9rZXlYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaWFkZHJlc3Nlc/Zlcm9sZXMAaHJ1bnRpbWVz9mljb25zZW5zdXOiYmlkWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGlhZGRyZXNzZXP2aWVudGl0eV9pZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABqZXhwaXJhdGlvbgA=",
+                Node{v: 2, ..Default::default()},
+            ),
+            (
+                "qmF2AmJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABjcDJwomJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpYWRkcmVzc2Vz9mN0bHOjZ3B1Yl9rZXlYIP/////////////////////////////////////////yaWFkZHJlc3Nlc4BsbmV4dF9wdWJfa2V5WCD/////////////////////////////////////////82N2cmahYmlkWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGVyb2xlcwBocnVudGltZXP2aWNvbnNlbnN1c6JiaWRYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaWFkZHJlc3Nlc/ZpZW50aXR5X2lkWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGpleHBpcmF0aW9uAA==",
+                Node{
+                    v: 2,
+                    tls: TLSInfo{
+                        pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2"),
+                        _deprecated_next_pub_key: Some(signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3")),
+                        _deprecated_addresses: Some(vec![]),
+                    },
+                    ..Default::default()
+                },
+            ),
+            (
+                "qmF2AmJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABjcDJwomJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpYWRkcmVzc2Vz9mN0bHOjZ3B1Yl9rZXlYIP/////////////////////////////////////////yaWFkZHJlc3Nlc4OiZ2FkZHJlc3OjYklQUAAAAAAAAAAAAAD//38AAAFkUG9ydBh7ZFpvbmVgZ3B1Yl9rZXlYIP/////////////////////////////////////////0omdhZGRyZXNzo2JJUFAAAAAAAAAAAAAA///AqAEBZFBvcnQZD6BkWm9uZWBncHViX2tleVgg/////////////////////////////////////////8SiZ2FkZHJlc3OjYklQUAAAAAAAAAAAAAD//+pkY1hkUG9ydBkfQGRab25lYGdwdWJfa2V5WCD/////////////////////////////////////////1GxuZXh0X3B1Yl9rZXlYIP/////////////////////////////////////////zY3ZyZqFiaWRYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZXJvbGVzAGhydW50aW1lc/ZpY29uc2Vuc3VzomJpZFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABpYWRkcmVzc2Vz9mllbnRpdHlfaWRYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAamV4cGlyYXRpb24A",
+                Node{
+                    v: 2,
+                    tls: TLSInfo{
+                        pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2"),
+                        _deprecated_next_pub_key: Some(signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3")),
+                        _deprecated_addresses: Some(vec![
+                            TLSAddress{
+                                pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4"),
+                                address: TCPAddress { ip: Ipv4Addr::new(127, 0, 0, 1).to_ipv6_mapped().octets().to_vec(), port: 123, ..Default::default() }
+                            },
+                            TLSAddress{
+                                pub_key: signature::PublicKey::from("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc4"),
+                                address: TCPAddress { ip: Ipv4Addr::new(192, 168, 1, 1).to_ipv6_mapped().octets().to_vec(), port: 4000, ..Default::default() }
+                            },
+                            TLSAddress{
+                                pub_key: signature::PublicKey::from("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd4"),
+                                address: TCPAddress { ip: Ipv4Addr::new(234, 100, 99, 88).to_ipv6_mapped().octets().to_vec(), port: 8000, ..Default::default() }
+                            },
+
+                            ])
+                    },
+                    ..Default::default()
+                },
+            ),
+            (
+                "qmF2AmJpZFgg//////////////////////////////////////////BjcDJwomJpZFgg//////////////////////////////////////////VpYWRkcmVzc2Vz9mN0bHOjZ3B1Yl9rZXlYIP/////////////////////////////////////////yaWFkZHJlc3Nlc4GiZ2FkZHJlc3OjYklQUAAAAAAAAAAAAAD//38AAAFkUG9ydBh7ZFpvbmVgZ3B1Yl9rZXlYIP/////////////////////////////////////////0bG5leHRfcHViX2tleVgg//////////////////////////////////////////NjdnJmoWJpZFgg//////////////////////////////////////////dlcm9sZXMAaHJ1bnRpbWVzgqRiaWRYIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQZ3ZlcnNpb26hZXBhdGNoGQFBamV4dHJhX2luZm/2bGNhcGFiaWxpdGllc6CkYmlkWCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWd2ZXJzaW9uoWVwYXRjaBh7amV4dHJhX2luZm9EBQMCAWxjYXBhYmlsaXRpZXOhY3RlZaNjcmFrWCD/////////////////////////////////////////+GhoYXJkd2FyZQFrYXR0ZXN0YXRpb25GAAECAwQFaWNvbnNlbnN1c6JiaWRYIP/////////////////////////////////////////2aWFkZHJlc3Nlc4BpZW50aXR5X2lkWCD/////////////////////////////////////////8WpleHBpcmF0aW9uGCA=",
+                Node{
+                    v: 2,
+                    id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"),
+                    entity_id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1"),
+                    expiration: 32,
+                    tls: TLSInfo{
+                        pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2"),
+                        _deprecated_next_pub_key: Some(signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3")),
+                        _deprecated_addresses: Some(vec![TLSAddress{
+                                pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4"),
+                                address: TCPAddress { ip: Ipv4Addr::new(127, 0, 0, 1).to_ipv6_mapped().octets().to_vec(), port: 123, ..Default::default() }
+                            }])
+                    },
+                    p2p: P2PInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5"),
+                        ..Default::default()
+                    },
+                    consensus: ConsensusInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6"),
+                        addresses: Some(Vec::new()),
+                    },
+                    vrf: VRFInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7"),
+                    },
+                    runtimes: Some(vec![
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000010"),
+                            version: Version::from(321u64),
+                            ..Default::default()
+                        },
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000011"),
+                            version: Version::from(123),
+                            capabilities: Capabilities{
+                                tee: Some(CapabilityTEE{
+                                    hardware: TEEHardware::TEEHardwareIntelSGX,
+                                    rak: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8"),
+                                    attestation: vec![0, 1,2,3,4,5],
+                                    ..Default::default()
+                                }),
+                            },
+                            extra_info: Some(vec![5,3,2,1]),
+                        },
+                    ]),
+                    ..Default::default()
+                },
+            ),
+            (
+                "qmF2AmJpZFgg//////////////////////////////////////////BjcDJwomJpZFgg//////////////////////////////////////////VpYWRkcmVzc2Vz9mN0bHOjZ3B1Yl9rZXlYIP/////////////////////////////////////////yaWFkZHJlc3Nlc4GiZ2FkZHJlc3OjYklQUAAAAAAAAAAAAAD//38AAAFkUG9ydBh7ZFpvbmVgZ3B1Yl9rZXlYIP/////////////////////////////////////////0bG5leHRfcHViX2tleVgg//////////////////////////////////////////NjdnJmoWJpZFgg//////////////////////////////////////////dlcm9sZXMAaHJ1bnRpbWVzgqRiaWRYIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQZ3ZlcnNpb26hZXBhdGNoGQFBamV4dHJhX2luZm/2bGNhcGFiaWxpdGllc6CkYmlkWCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWd2ZXJzaW9uoWVwYXRjaBh7amV4dHJhX2luZm9EBQMCAWxjYXBhYmlsaXRpZXOhY3RlZaRjcmFrWCD/////////////////////////////////////////+GNyZWtYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaGhhcmR3YXJlAWthdHRlc3RhdGlvbkYAAQIDBAVpY29uc2Vuc3VzomJpZFgg//////////////////////////////////////////ZpYWRkcmVzc2VzgGllbnRpdHlfaWRYIP/////////////////////////////////////////xamV4cGlyYXRpb24YIA==",
+                Node{
+                    v: 2,
+                    id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"),
+                    entity_id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1"),
+                    expiration: 32,
+                    tls: TLSInfo{
+                        pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2"),
+                        _deprecated_next_pub_key: Some(signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3")),
+                        _deprecated_addresses: Some(vec![TLSAddress{
+                                pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4"),
+                                address: TCPAddress { ip: Ipv4Addr::new(127, 0, 0, 1).to_ipv6_mapped().octets().to_vec(), port: 123, ..Default::default() }
+                            }])
+                    },
+                    p2p: P2PInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5"),
+                        ..Default::default()
+                    },
+                    consensus: ConsensusInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6"),
+                        addresses: Some(Vec::new()),
+                    },
+                    vrf: VRFInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7"),
+                    },
+                    runtimes: Some(vec![
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000010"),
+                            version: Version::from(321u64),
+                            ..Default::default()
+                        },
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000011"),
+                            version: Version::from(123),
+                            capabilities: Capabilities{
+                                tee: Some(CapabilityTEE{
+                                    hardware: TEEHardware::TEEHardwareIntelSGX,
+                                    rak: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8"),
+                                    rek: Some(x25519::PublicKey::from([0;32])),
+                                    attestation: vec![0, 1,2,3,4,5],
+                                }),
+                            },
+                            extra_info: Some(vec![5,3,2,1]),
+                        },
+                    ]),
+                    ..Default::default()
+                },
+            ),
+        ];
+        for (encoded_base64, node) in tcs {
+            println!("{:?}", node);
+            let dec: Node = cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                .expect("node should deserialize correctly");
+            assert_eq!(dec, node, "decoded node should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_runtime_deployments() {
+        let rt = Runtime::default();
+        assert_eq!(rt.active_deployment(0), None);
+
+        let rt = Runtime {
+            deployments: vec![
+                VersionInfo {
+                    version: Version {
+                        major: 0,
+                        minor: 1,
+                        patch: 0,
+                    },
+                    valid_from: 0,
+                    ..Default::default()
+                },
+                VersionInfo {
+                    version: Version {
+                        major: 0,
+                        minor: 2,
+                        patch: 0,
+                    },
+                    valid_from: 10,
+                    ..Default::default()
+                },
+                VersionInfo {
+                    version: Version {
+                        major: 0,
+                        minor: 3,
+                        patch: 0,
+                    },
+                    valid_from: 20,
+                    ..Default::default()
+                },
+            ],
+            ..Default::default()
+        };
+
+        let ad = rt.active_deployment(0).unwrap();
+        assert_eq!(ad.version.minor, 1);
+        let ad = rt.active_deployment(1).unwrap();
+        assert_eq!(ad.version.minor, 1);
+        let ad = rt.active_deployment(9).unwrap();
+        assert_eq!(ad.version.minor, 1);
+        let ad = rt.active_deployment(10).unwrap();
+        assert_eq!(ad.version.minor, 2);
+        let ad = rt.active_deployment(20).unwrap();
+        assert_eq!(ad.version.minor, 3);
+        let ad = rt.active_deployment(50).unwrap();
+        assert_eq!(ad.version.minor, 3);
+        let ad = rt.active_deployment(100).unwrap();
+        assert_eq!(ad.version.minor, 3);
+        let ad = rt.active_deployment(1000).unwrap();
+        assert_eq!(ad.version.minor, 3);
+
+        let ad = rt
+            .deployment_for_version(Version {
+                major: 0,
+                minor: 1,
+                patch: 0,
+            })
+            .unwrap();
+        assert_eq!(ad.valid_from, 0);
+        let ad = rt
+            .deployment_for_version(Version {
+                major: 0,
+                minor: 2,
+                patch: 0,
+            })
+            .unwrap();
+        assert_eq!(ad.valid_from, 10);
+        let ad = rt
+            .deployment_for_version(Version {
+                major: 0,
+                minor: 3,
+                patch: 0,
+            })
+            .unwrap();
+        assert_eq!(ad.valid_from, 20);
+        let ad = rt.deployment_for_version(Version {
+            major: 0,
+            minor: 99,
+            patch: 0,
+        });
+        assert_eq!(ad, None);
+    }
+
+    #[test]
+    fn test_hash_attestation() {
+        let report_data = b"foo bar";
+        let node_id = signature::PublicKey::from(
+            "47aadd91516ac548decdb436fde957992610facc09ba2f850da0fe1b2be96119",
+        );
+        let height = 42;
+        let rek: [u8; x25519::PUBLIC_KEY_LENGTH] =
+            "7992610facc09ba2f850da0fe1b2be9611947aadd91516ac548decdb436fde95"
+                .from_hex::<Vec<u8>>()
+                .unwrap()
+                .try_into()
+                .unwrap();
+        let rek = x25519::PublicKey::from(rek);
+
+        let h = SGXAttestation::hash(report_data, &node_id, height, &rek);
+        assert_eq!(
+            h.to_hex::<String>(),
+            "9a288bd33ba7a4c2eefdee68e4c08c1a34c369302ef8176a3bfdb4fedcec333e"
+        );
+    }
+
+    #[test]
+    fn test_roles_mask() {
+        let mask = RolesMask::ROLE_OBSERVER | RolesMask::ROLE_COMPUTE_WORKER;
+        assert!(mask.contains(RolesMask::ROLE_OBSERVER));
+        assert!(mask.contains(RolesMask::ROLE_COMPUTE_WORKER));
+        assert!(!mask.contains(RolesMask::ROLE_KEY_MANAGER));
+        assert!(!mask.contains(RolesMask::ROLE_VALIDATOR));
+        assert!(!mask.contains(RolesMask::ROLE_STORAGE_RPC));
+        assert!(!mask.is_single_role());
+
+        let mask = RolesMask::ROLE_OBSERVER;
+        assert!(mask.is_single_role());
+
+        let node = Node {
+            roles: RolesMask::ROLE_COMPUTE_WORKER | RolesMask::ROLE_VALIDATOR,
+            ..Default::default()
+        };
+        assert!(node.has_roles(RolesMask::ROLE_COMPUTE_WORKER));
+        assert!(node.has_roles(RolesMask::ROLE_VALIDATOR));
+        assert!(node.has_roles(RolesMask::ROLE_COMPUTE_WORKER | RolesMask::ROLE_VALIDATOR));
+        assert!(!node.has_roles(RolesMask::ROLE_KEY_MANAGER));
+        assert!(!node.has_roles(RolesMask::ROLE_STORAGE_RPC));
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/roothash/block.rs.html b/rust/src/oasis_core_runtime/consensus/roothash/block.rs.html new file mode 100644 index 0000000000..d198d05460 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/roothash/block.rs.html @@ -0,0 +1,283 @@ +block.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+
//! Roothash block and header.
+//!
+//! # Note
+//!
+//! This **MUST** be kept in sync with go/roothash/api/block.
+//!
+use crate::common::{crypto::hash::Hash, namespace::Namespace};
+
+/// Runtime block.
+///
+/// # Note
+///
+/// This should be kept in sync with go/roothash/api/block/block.go.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Block {
+    /// Header.
+    pub header: Header,
+}
+
+impl Block {
+    /// Creates a new empty genesis block given a runtime id and POSIX timestamp.
+    pub fn new_genesis_block(id: Namespace, timestamp: u64) -> Block {
+        Block {
+            header: Header {
+                version: 0,
+                round: 0,
+                timestamp,
+                header_type: HeaderType::Normal,
+                namespace: id,
+                previous_hash: Hash::empty_hash(),
+                io_root: Hash::empty_hash(),
+                state_root: Hash::empty_hash(),
+                messages_hash: Hash::empty_hash(),
+                in_msgs_hash: Hash::empty_hash(),
+            },
+        }
+    }
+
+    /// Creates a new empty block with a specific type.
+    pub fn new_empty_block(child: &Block, timestamp: u64, header_type: HeaderType) -> Block {
+        Block {
+            header: Header {
+                version: child.header.version,
+                namespace: child.header.namespace,
+                round: child.header.round + 1,
+                timestamp,
+                header_type,
+                previous_hash: child.header.encoded_hash(),
+                io_root: Hash::empty_hash(),
+                // State root is unchanged.
+                state_root: child.header.state_root,
+                messages_hash: Hash::empty_hash(),
+                in_msgs_hash: Hash::empty_hash(),
+            },
+        }
+    }
+}
+
+/// Header type.
+///
+/// # Note
+///
+/// This should be kept in sync with go/roothash/api/block/header.go.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum HeaderType {
+    #[default]
+    Invalid = 0,
+    Normal = 1,
+    RoundFailed = 2,
+    EpochTransition = 3,
+    Suspended = 4,
+}
+
+/// Block header.
+///
+/// # Note
+///
+/// This should be kept in sync with go/roothash/api/block/header.go.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Header {
+    /// Protocol version number.
+    pub version: u16,
+    /// Chain namespace.
+    pub namespace: Namespace,
+    /// Round number.
+    pub round: u64,
+    /// Timestamp (POSIX time).
+    pub timestamp: u64,
+    /// Header type.
+    pub header_type: HeaderType,
+    /// Previous block hash.
+    pub previous_hash: Hash,
+    /// I/O merkle root.
+    pub io_root: Hash,
+    /// State merkle root.
+    pub state_root: Hash,
+    /// Messages hash.
+    pub messages_hash: Hash,
+    /// Hash of processed incoming messages.
+    pub in_msgs_hash: Hash,
+}
+
+impl Header {
+    /// Returns a hash of an encoded header.
+    pub fn encoded_hash(&self) -> Hash {
+        Hash::digest_bytes(&cbor::to_vec(self.clone()))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_consistent_hash_header() {
+        // NOTE: These hashes MUST be synced with go/roothash/api/block/header_test.go.
+        let empty = Header::default();
+        assert_eq!(
+            empty.encoded_hash(),
+            Hash::from("677ad1a6b9f5e99ed94e5d598b6f92a4641a5f952f2d753b2a6122b6dceeb792")
+        );
+
+        let populated = Header {
+            version: 42,
+            namespace: Namespace::from(Hash::empty_hash().as_ref()),
+            round: 1000,
+            timestamp: 1560257841,
+            header_type: HeaderType::RoundFailed,
+            previous_hash: empty.encoded_hash(),
+            io_root: Hash::empty_hash(),
+            state_root: Hash::empty_hash(),
+            messages_hash: Hash::empty_hash(),
+            in_msgs_hash: Hash::empty_hash(),
+        };
+        assert_eq!(
+            populated.encoded_hash(),
+            Hash::from("b17374d9b36796752a787d0726ef44826bfdb3ece52545e126c8e7592663544d")
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/roothash/commitment/executor.rs.html b/rust/src/oasis_core_runtime/consensus/roothash/commitment/executor.rs.html new file mode 100644 index 0000000000..296191f65e --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/roothash/commitment/executor.rs.html @@ -0,0 +1,819 @@ +executor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+
use std::any::Any;
+
+use anyhow::{anyhow, Result};
+
+use crate::{
+    common::{
+        crypto::{
+            hash::Hash,
+            signature::{
+                signature_context_with_chain_separation, signature_context_with_runtime_separation,
+                PublicKey, Signature, Signer,
+            },
+        },
+        namespace::Namespace,
+    },
+    consensus::roothash::{Header, Message},
+};
+
+use super::OpenCommitment;
+
+/// The signature context used to sign compute results headers with RAK.
+pub const COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT: &[u8] =
+    b"oasis-core/roothash: compute results header";
+
+/// The signature context used to sign executor worker commitments.
+pub const EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT: &[u8] =
+    b"oasis-core/roothash: executor commitment";
+
+fn executor_commitment_signature_context(
+    runtime_id: &Namespace,
+    chain_context: &String,
+) -> Vec<u8> {
+    let context = EXECUTOR_COMMITMENT_SIGNATURE_CONTEXT.to_vec();
+    let context = signature_context_with_runtime_separation(context, runtime_id);
+    signature_context_with_chain_separation(context, chain_context)
+}
+
+/// The header of a computed batch output by a runtime. This header is a
+/// compressed representation (e.g., hashes instead of full content) of
+/// the actual results.
+///
+/// # Note
+///
+/// This should be kept in sync with go/roothash/api/commitment/executor.go.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ComputeResultsHeader {
+    /// Round number.
+    pub round: u64,
+    /// Hash of the previous block header this batch was computed against.
+    pub previous_hash: Hash,
+
+    /// The I/O merkle root.
+    #[cbor(optional)]
+    pub io_root: Option<Hash>,
+    /// The root hash of the state after computing this batch.
+    #[cbor(optional)]
+    pub state_root: Option<Hash>,
+    /// Hash of messages sent from this batch.
+    #[cbor(optional)]
+    pub messages_hash: Option<Hash>,
+
+    /// The hash of processed incoming messages.
+    #[cbor(optional)]
+    pub in_msgs_hash: Option<Hash>,
+    /// The number of processed incoming messages.
+    #[cbor(optional)]
+    pub in_msgs_count: u32,
+}
+
+impl ComputeResultsHeader {
+    /// Returns a hash of an encoded header.
+    pub fn encoded_hash(&self) -> Hash {
+        Hash::digest_bytes(&cbor::to_vec(self.clone()))
+    }
+
+    /// Returns true iff the header is the parent of a child header.
+    pub fn is_parent_of(&self, child: &Header) -> bool {
+        if self.round != child.round + 1 {
+            return false;
+        }
+        self.previous_hash == child.encoded_hash()
+    }
+}
+
+/// The executor commitment failure reason.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum ExecutorCommitmentFailure {
+    /// Indicates that no failure has occurred.
+    #[default]
+    FailureNone = 0,
+
+    /// Indicates a generic failure.
+    FailureUnknown = 1,
+
+    /// Indicates that batch processing failed due to the state being
+    /// unavailable.
+    FailureStateUnavailable = 2,
+}
+
+/// The header of an executor commitment.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct ExecutorCommitmentHeader {
+    /// The compute results header.
+    pub header: ComputeResultsHeader,
+
+    /// The executor commitment failure reason.
+    #[cbor(optional)]
+    pub failure: ExecutorCommitmentFailure,
+
+    // Optional fields (may be absent for failure indication).
+    #[cbor(optional, rename = "rak_sig")]
+    pub rak_signature: Option<Signature>,
+}
+
+impl ExecutorCommitmentHeader {
+    /// Signs the executor commitment header.
+    pub fn sign(
+        &self,
+        signer: &impl Signer,
+        runtime_id: &Namespace,
+        chain_context: &String,
+    ) -> Result<Signature> {
+        let context = executor_commitment_signature_context(runtime_id, chain_context);
+        let message = cbor::to_vec(self.clone());
+
+        signer.sign(&context, &message)
+    }
+
+    /// Verifies the RAK signature.
+    pub fn verify_rak(&self, rak: PublicKey) -> Result<()> {
+        let sig = self.rak_signature.ok_or(anyhow!("missing RAK signature"))?;
+        let message = cbor::to_vec(self.header.clone());
+
+        sig.verify(&rak, COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT, &message)
+            .map_err(|_| anyhow!("RAK signature verification failed"))
+    }
+}
+
+/// A commitment to results of processing a proposed runtime block.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct ExecutorCommitment {
+    // The public key of the node that generated this commitment.
+    pub node_id: PublicKey,
+
+    // The commitment header.
+    pub header: ExecutorCommitmentHeader,
+
+    // The commitment header signature.
+    #[cbor(rename = "sig")]
+    pub signature: Signature,
+
+    // The messages emitted by the runtime.
+    //
+    // This field is only present in case this commitment belongs to the proposer. In case of
+    // the commitment being submitted as equivocation evidence, this field should be omitted.
+    #[cbor(optional)]
+    pub messages: Vec<Message>,
+}
+
+impl ExecutorCommitment {
+    /// Signs the executor commitment header and sets the signature on the commitment.
+    pub fn sign(
+        &mut self,
+        signer: &impl Signer,
+        runtime_id: &Namespace,
+        chain_context: &String,
+    ) -> Result<()> {
+        let pk = signer.public();
+        if self.node_id != pk {
+            return Err(anyhow!(
+                "node ID does not match signer (ID: {} signer: {})",
+                self.node_id,
+                pk,
+            ));
+        }
+
+        self.signature = self.header.sign(signer, runtime_id, chain_context)?;
+
+        Ok(())
+    }
+
+    /// Verifies that the header signature is valid.
+    pub fn verify(&self, runtime_id: &Namespace, chain_context: &String) -> Result<()> {
+        let context = executor_commitment_signature_context(runtime_id, chain_context);
+        let message = cbor::to_vec(self.header.clone());
+
+        self.signature
+            .verify(&self.node_id, &context, &message)
+            .map_err(|_| anyhow!("roothash/commitment: signature verification failed"))
+    }
+
+    pub fn validate_basic(&self) -> Result<()> {
+        match self.header.failure {
+            ExecutorCommitmentFailure::FailureNone => {
+                // Ensure header fields are present.
+                if self.header.header.io_root.is_none() {
+                    return Err(anyhow!("missing IORoot"));
+                }
+                if self.header.header.state_root.is_none() {
+                    return Err(anyhow!("missing StateRoot"));
+                }
+                if self.header.header.messages_hash.is_none() {
+                    return Err(anyhow!("missing messages hash"));
+                }
+                if self.header.header.in_msgs_hash.is_none() {
+                    return Err(anyhow!("missing incoming messages hash"));
+                }
+
+                // Validate any included runtime messages.
+                for msg in self.messages.iter() {
+                    msg.validate_basic()
+                        .map_err(|err| anyhow!("bad runtime message: {:?}", err))?;
+                }
+            }
+            ExecutorCommitmentFailure::FailureUnknown
+            | ExecutorCommitmentFailure::FailureStateUnavailable => {
+                // Ensure header fields are empty.
+                if self.header.header.io_root.is_some() {
+                    return Err(anyhow!("failure indicating body includes IORoot"));
+                }
+                if self.header.header.state_root.is_some() {
+                    return Err(anyhow!("failure indicating commitment includes StateRoot"));
+                }
+                if self.header.header.messages_hash.is_some() {
+                    return Err(anyhow!(
+                        "failure indicating commitment includes MessagesHash"
+                    ));
+                }
+                if self.header.header.in_msgs_hash.is_some()
+                    || self.header.header.in_msgs_count != 0
+                {
+                    return Err(anyhow!(
+                        "failure indicating commitment includes InMessagesHash/Count"
+                    ));
+                }
+                // In case of failure indicating commitment make sure RAK signature is empty.
+                if self.header.rak_signature.is_some() {
+                    return Err(anyhow!("failure indicating body includes RAK signature"));
+                }
+                // In case of failure indicating commitment make sure messages are empty.
+                if !self.messages.is_empty() {
+                    return Err(anyhow!("failure indicating body includes messages"));
+                }
+            }
+        }
+
+        Ok(())
+    }
+}
+
+impl OpenCommitment for ExecutorCommitment {
+    fn mostly_equal(&self, other: &Self) -> bool {
+        self.to_vote() == other.to_vote()
+    }
+
+    fn is_indicating_failure(&self) -> bool {
+        self.header.failure != ExecutorCommitmentFailure::FailureNone
+    }
+
+    fn to_vote(&self) -> Hash {
+        self.header.header.encoded_hash()
+    }
+
+    fn to_dd_result(&self) -> &dyn Any {
+        self
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_consistent_hash() {
+        // NOTE: These hashes MUST be synced with go/roothash/api/commitment/executor_test.go.
+        let empty = ComputeResultsHeader::default();
+        assert_eq!(
+            empty.encoded_hash(),
+            Hash::from("57d73e02609a00fcf4ca43cbf8c9f12867c46942d246fb2b0bce42cbdb8db844")
+        );
+
+        let populated = ComputeResultsHeader {
+            round: 42,
+            previous_hash: empty.encoded_hash(),
+            io_root: Some(Hash::empty_hash()),
+            state_root: Some(Hash::empty_hash()),
+            messages_hash: Some(Hash::empty_hash()),
+            in_msgs_hash: Some(Hash::empty_hash()),
+            in_msgs_count: 0,
+        };
+        assert_eq!(
+            populated.encoded_hash(),
+            Hash::from("8459a9e6e3341cd2df5ada5737469a505baf92397aaa88b7100915324506d843")
+        );
+    }
+
+    #[test]
+    fn test_validate_basic() {
+        // NOTE: These hashes MUST be synced with go/roothash/api/commitment/executor_test.go.
+        let empty = ComputeResultsHeader::default();
+        assert_eq!(
+            empty.encoded_hash(),
+            Hash::from("57d73e02609a00fcf4ca43cbf8c9f12867c46942d246fb2b0bce42cbdb8db844")
+        );
+
+        let body = ExecutorCommitment {
+            header: ExecutorCommitmentHeader {
+                header: ComputeResultsHeader {
+                    round: 42,
+                    previous_hash: empty.encoded_hash(),
+                    io_root: Some(Hash::empty_hash()),
+                    state_root: Some(Hash::empty_hash()),
+                    messages_hash: Some(Hash::empty_hash()),
+                    in_msgs_hash: Some(Hash::empty_hash()),
+                    in_msgs_count: 0,
+                },
+                failure: ExecutorCommitmentFailure::FailureNone,
+                rak_signature: None,
+            },
+            messages: vec![],
+            node_id: PublicKey::default(),
+            signature: Signature::default(),
+        };
+
+        let tcs: Vec<(&str, fn(&mut ExecutorCommitment), bool)> = vec![
+            (
+                "Ok",
+                |ec: &mut ExecutorCommitment| {
+                    ec.header.header.round -= 1;
+                },
+                false,
+            ),
+            (
+                "Bad io_root",
+                |ec: &mut ExecutorCommitment| ec.header.header.io_root = None,
+                true,
+            ),
+            (
+                "Bad state_root",
+                |ec: &mut ExecutorCommitment| ec.header.header.state_root = None,
+                true,
+            ),
+            (
+                "Bad messages_hash",
+                |ec: &mut ExecutorCommitment| ec.header.header.messages_hash = None,
+                true,
+            ),
+            (
+                "Bad Failure (existing io_root)",
+                |ec: &mut ExecutorCommitment| {
+                    ec.header.failure = ExecutorCommitmentFailure::FailureUnknown;
+                    // ec.header.compute_results_header.io_root is set.
+                    ec.header.header.state_root = None;
+                    ec.header.header.messages_hash = None;
+                    ec.header.header.in_msgs_hash = None;
+                },
+                true,
+            ),
+            (
+                "Bad Failure (existing state_root)",
+                |ec: &mut ExecutorCommitment| {
+                    ec.header.failure = ExecutorCommitmentFailure::FailureUnknown;
+                    ec.header.header.io_root = None;
+                    // ec.header.compute_results_header.state_root is set.
+                    ec.header.header.messages_hash = None;
+                    ec.header.header.in_msgs_hash = None;
+                },
+                true,
+            ),
+            (
+                "Bad Failure (existing messages_hash)",
+                |ec: &mut ExecutorCommitment| {
+                    ec.header.failure = ExecutorCommitmentFailure::FailureUnknown;
+                    ec.header.header.io_root = None;
+                    ec.header.header.state_root = None;
+                    // ec.header.compute_results_header.messages_hash is set.
+                    ec.header.header.in_msgs_hash = None;
+                },
+                true,
+            ),
+            (
+                "Bad Failure (existing in_msgs_hash)",
+                |ec: &mut ExecutorCommitment| {
+                    ec.header.failure = ExecutorCommitmentFailure::FailureUnknown;
+                    ec.header.header.io_root = None;
+                    ec.header.header.state_root = None;
+                    ec.header.header.messages_hash = None;
+                    // ec.header.compute_results_header.in_msgs_hash is set.
+                },
+                true,
+            ),
+            (
+                "Ok Failure",
+                |ec: &mut ExecutorCommitment| {
+                    ec.header.failure = ExecutorCommitmentFailure::FailureUnknown;
+                },
+                true,
+            ),
+        ];
+
+        for (name, f, should_err) in tcs {
+            let mut b = body.clone();
+            f(&mut b);
+            let res = b.validate_basic();
+            assert_eq!(res.is_err(), should_err, "validate_basic({})", name)
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/roothash/commitment/mod.rs.html b/rust/src/oasis_core_runtime/consensus/roothash/commitment/mod.rs.html new file mode 100644 index 0000000000..036d519a8c --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/roothash/commitment/mod.rs.html @@ -0,0 +1,81 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+
//! Roothash commitments.
+//!
+//! # Note
+//!
+//! This **MUST** be kept in sync with go/roothash/api/commitment.
+//!
+use std::any::Any;
+
+use crate::common::crypto::hash::Hash;
+
+// Modules.
+mod executor;
+mod pool;
+
+// Re-exports.
+pub use executor::*;
+pub use pool::*;
+
+/// Verified roothash commitment.
+pub trait OpenCommitment {
+    /// Returns true if the commitment is mostly equal to another
+    /// specified commitment as per discrepancy detection criteria.
+    ///
+    /// The caller MUST guarantee that the passed commitment is of the same
+    /// type.
+    fn mostly_equal(&self, other: &Self) -> bool
+    where
+        Self: Sized;
+
+    /// Returns true if this commitment indicates a failure.
+    fn is_indicating_failure(&self) -> bool;
+
+    /// Returns a hash that represents a vote for this commitment as
+    /// per discrepancy resolution criteria.
+    fn to_vote(&self) -> Hash;
+
+    /// Returns a commitment-specific result after discrepancy
+    /// detection.
+    fn to_dd_result(&self) -> &dyn Any;
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/roothash/commitment/pool.rs.html b/rust/src/oasis_core_runtime/consensus/roothash/commitment/pool.rs.html new file mode 100644 index 0000000000..59d57c8ff4 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/roothash/commitment/pool.rs.html @@ -0,0 +1,1295 @@ +pool.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+
use std::collections::{HashMap, HashSet};
+
+use anyhow::Result;
+
+use crate::{
+    common::crypto::{hash::Hash, signature::PublicKey},
+    consensus::{
+        registry::{Node, Runtime, TEEHardware},
+        roothash::{Block, Error, Message, OpenCommitment},
+        scheduler::{Committee, CommitteeKind, Role},
+    },
+};
+
+use super::ExecutorCommitment;
+
+/// A trait for looking up registry node descriptors.
+pub trait NodeLookup {
+    fn node(&self, id: PublicKey) -> Result<Node, Error>;
+}
+
+/// A trait that validates messages for validity. It can be used for gas accounting.
+pub trait MessageValidator {
+    fn validate(&self, msgs: &[Message]) -> Result<()>;
+}
+
+impl<F> MessageValidator for F
+where
+    F: Fn(&[Message]) -> Result<()>,
+{
+    fn validate(&self, msgs: &[Message]) -> Result<()> {
+        (*self)(msgs)
+    }
+}
+
+/// A pool of commitments that can be used to perform
+/// discrepancy detection.
+///
+/// The pool is not safe for concurrent use.
+pub struct Pool {
+    /// The runtime descriptor this pool is collecting
+    /// the commitments for.
+    runtime: Runtime,
+    /// The committee this pool is collecting the commitments for.
+    committee: Committee,
+    /// The current protocol round.
+    round: u64,
+    // The commitments in the pool iff Committee.Kind
+    // is scheduler.KindComputeExecutor.
+    execute_commitments: HashMap<PublicKey, ExecutorCommitment>,
+    // A flag signalling that a discrepancy has been detected.
+    discrepancy: bool,
+    // The time when the next call to TryFinalize(true) should
+    // be scheduled to be executed. Zero means that no timeout is to be scheduled.
+    _next_timeout: i64,
+
+    // A cached committee member set. It will be automatically
+    // constructed based on the passed Committee.
+    member_set: HashSet<PublicKey>,
+    // A cached committee worker set. It will be automatically
+    // constructed based on the passed Committee.
+    _worker_set: HashSet<PublicKey>,
+}
+
+impl Pool {
+    /// Creates a new pool.
+    pub fn new(runtime: Runtime, committee: Committee, round: u64) -> Self {
+        let mut member_set = HashSet::new();
+        let mut _worker_set = HashSet::new();
+
+        for m in &committee.members {
+            member_set.insert(m.public_key);
+            if m.role == Role::Worker {
+                _worker_set.insert(m.public_key);
+            }
+        }
+
+        Pool {
+            runtime,
+            committee,
+            round,
+            execute_commitments: HashMap::new(),
+            discrepancy: false,
+            _next_timeout: 0,
+            member_set,
+            _worker_set,
+        }
+    }
+
+    fn is_member(&self, id: &PublicKey) -> bool {
+        self.member_set.contains(id)
+    }
+
+    fn _is_worker(&self, id: &PublicKey) -> bool {
+        self._worker_set.contains(id)
+    }
+
+    fn is_scheduler(&self, id: &PublicKey) -> bool {
+        if let Ok(scheduler) = self.committee.transaction_scheduler(self.round) {
+            return &scheduler.public_key == id;
+        }
+        false
+    }
+
+    /// Verifies and adds a new executor commitment to the pool.
+    fn add_verified_executor_commitment(
+        &mut self,
+        blk: &Block,
+        nl: &impl NodeLookup,
+        msg_validator: &impl MessageValidator,
+        commit: ExecutorCommitment,
+    ) -> Result<()> {
+        if self.committee.kind != CommitteeKind::ComputeExecutor {
+            return Err(Error::InvalidCommitteeKind.into());
+        }
+
+        // Ensure that the node is actually a committee member. We do not enforce specific
+        // roles based on current discrepancy state to allow commitments arriving in any
+        // order (e.g., a backup worker can submit a commitment even before there is a
+        // discrepancy).
+        if !self.is_member(&commit.node_id) {
+            return Err(Error::NotInCommittee.into());
+        }
+
+        // Ensure the node did not already submit a commitment.
+        if self.execute_commitments.contains_key(&commit.node_id) {
+            return Err(Error::AlreadyCommitted.into());
+        }
+
+        if self.round != blk.header.round {
+            return Err(Error::InvalidRound.into());
+        }
+
+        // Check if the block is based on the previous block.
+        if !commit.header.header.is_parent_of(&blk.header) {
+            return Err(Error::NotBasedOnCorrectBlock.into());
+        }
+
+        if commit.validate_basic().is_err() {
+            return Err(Error::BadExecutorCommitment.into());
+        }
+
+        // TODO: Check for evidence of equivocation (oasis-core#3685).
+
+        if !commit.is_indicating_failure() {
+            // Verify RAK-attestation.
+            if self.runtime.tee_hardware != TEEHardware::TEEHardwareInvalid {
+                let n = nl.node(commit.node_id).map_err(|_|
+                    // This should never happen as nodes cannot disappear mid-epoch.
+                    Error::NotInCommittee)?;
+
+                let ad = self
+                    .runtime
+                    .active_deployment(self.committee.valid_for)
+                    .ok_or(
+                        // This should never happen as we prevent this elsewhere.
+                        Error::NoRuntime,
+                    )?;
+
+                let rt = n.get_runtime(&self.runtime.id, &ad.version).ok_or(
+                    // We currently prevent this case throughout the rest of the system.
+                    // Still, it's prudent to check.
+                    Error::NotInCommittee,
+                )?;
+
+                let tee = rt.capabilities.tee.ok_or(
+                    // This should never happen as we prevent this elsewhere.
+                    Error::RakSigInvalid,
+                )?;
+
+                commit
+                    .header
+                    .verify_rak(tee.rak)
+                    .map_err(|_| Error::RakSigInvalid)?;
+            }
+
+            // Check emitted runtime messages.
+            match self.is_scheduler(&commit.node_id) {
+                true => {
+                    // The transaction scheduler can include messages.
+                    if commit.messages.len() as u32 > self.runtime.executor.max_messages {
+                        return Err(Error::InvalidMessages.into());
+                    }
+
+                    let messages_hash = commit
+                        .header
+                        .header
+                        .messages_hash
+                        .ok_or(Error::InvalidMessages)?;
+                    let h = Message::messages_hash(&commit.messages);
+                    if h != messages_hash {
+                        return Err(Error::InvalidMessages.into());
+                    }
+
+                    // Perform custom message validation and propagate the error unchanged.
+                    if !commit.messages.is_empty() {
+                        msg_validator.validate(&commit.messages)?;
+                    }
+                }
+                false => {
+                    // Other workers cannot include any messages.
+                    if !commit.messages.is_empty() {
+                        return Err(Error::InvalidMessages.into());
+                    }
+                }
+            }
+        }
+
+        self.execute_commitments.insert(commit.node_id, commit);
+
+        Ok(())
+    }
+
+    /// Verifies and adds a new executor commitment to the pool.
+    pub fn add_executor_commitment(
+        &mut self,
+        blk: &Block,
+        nl: &impl NodeLookup,
+        commit: ExecutorCommitment,
+        msg_validator: &impl MessageValidator,
+        chain_context: &String,
+    ) -> Result<()> {
+        // Check executor commitment signature.
+        commit.verify(&self.runtime.id, chain_context)?;
+
+        self.add_verified_executor_commitment(blk, nl, msg_validator, commit)
+    }
+
+    /// Performs a single round of commitment checks. If there are enough commitments
+    /// in the pool, it performs discrepancy detection or resolution.
+    pub fn process_commitments(&mut self, did_timeout: bool) -> Result<&dyn OpenCommitment> {
+        if self.committee.kind != CommitteeKind::ComputeExecutor {
+            panic!(
+                "roothash/commitment: unknown committee kind: {:?}",
+                self.committee.kind
+            );
+        }
+
+        #[derive(Default)]
+        struct Vote<'a> {
+            commit: Option<&'a ExecutorCommitment>,
+            tally: u16,
+        }
+
+        let mut total = 0;
+        let mut commits = 0;
+        let mut failures = 0;
+
+        // Gather votes.
+        let mut votes: HashMap<Hash, Vote> = HashMap::new();
+        for n in &self.committee.members {
+            if !self.discrepancy && n.role != Role::Worker {
+                continue;
+            }
+            if self.discrepancy && n.role != Role::BackupWorker {
+                continue;
+            }
+
+            total += 1;
+            let commit = match self.execute_commitments.get(&n.public_key) {
+                Some(commit) => commit,
+                None => continue,
+            };
+            commits += 1;
+
+            if commit.is_indicating_failure() {
+                failures += 1;
+                continue;
+            }
+
+            let k = commit.to_vote();
+            match votes.get_mut(&k) {
+                Some(v) => v.tally += 1,
+                None => {
+                    votes.insert(
+                        k,
+                        Vote {
+                            tally: 1,
+                            commit: Some(commit),
+                        },
+                    );
+                }
+            }
+
+            if !self.discrepancy && votes.len() > 1 {
+                self.discrepancy = true;
+                return Err(Error::DiscrepancyDetected.into());
+            }
+        }
+
+        // Determine whether the proposer has submitted a commitment.
+        let proposer = self
+            .committee
+            .transaction_scheduler(self.round)
+            .map_err(|_| Error::NoCommittee)?;
+        let proposer_commit = self.execute_commitments.get(&proposer.public_key);
+        if proposer_commit.is_none() && did_timeout {
+            return Err(Error::NoProposerCommitment.into());
+        }
+
+        match self.discrepancy {
+            false => {
+                // Discrepancy detection.
+                let allowed_stragglers = self.runtime.executor.allowed_stragglers;
+
+                // If it is already known that the number of valid commitments will not exceed the required
+                // threshold, there is no need to wait for the timer to expire. Instead, proceed directly to
+                // the discrepancy resolution mode, regardless of any additional commits.
+                if failures > allowed_stragglers {
+                    self.discrepancy = true;
+                    return Err(Error::DiscrepancyDetected.into());
+                }
+
+                // While a timer is running, all nodes are required to answer.
+                let mut required = total;
+
+                // After the timeout has elapsed, a limited number of stragglers are allowed.
+                if did_timeout {
+                    required -= allowed_stragglers;
+                    commits -= failures // Since failures count as stragglers.
+                }
+
+                // Check if the majority has been reached.
+                if commits < required || proposer_commit.is_none() {
+                    return Err(Error::StillWaiting.into());
+                }
+            }
+            true => {
+                // Discrepancy resolution.
+                let required = total / 2 + 1;
+
+                // Find the commit with the highest number of votes.
+                let mut top_vote = &Vote::default();
+                for v in votes.values() {
+                    if v.tally > top_vote.tally {
+                        top_vote = v;
+                    }
+                }
+
+                // Fail the round if the majority cannot be reached due to insufficient votes remaining
+                // (e.g. too many nodes have failed),
+                let remaining = total - commits;
+                if top_vote.tally + remaining < required {
+                    return Err(Error::InsufficientVotes.into());
+                }
+
+                // Check if the majority has been reached.
+                if top_vote.tally < required || proposer_commit.is_none() {
+                    if did_timeout {
+                        return Err(Error::InsufficientVotes.into());
+                    }
+                    return Err(Error::StillWaiting.into());
+                }
+
+                let proposer_commit = proposer_commit.expect("proposer commit should be set");
+                let top_vote_commit = top_vote.commit.expect("top vote commit should be set");
+
+                // Make sure that the majority commitment is the same as the proposer commitment.
+                if !proposer_commit.mostly_equal(top_vote_commit) {
+                    return Err(Error::BadProposerCommitment.into());
+                }
+            }
+        }
+
+        // We must return the proposer commitment as that one contains additional data.
+        let proposer_commit = proposer_commit.expect("proposer commit should be set");
+        Ok(proposer_commit)
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use anyhow::{anyhow, Result};
+
+    use crate::{
+        common::{
+            crypto::{
+                hash::Hash,
+                signature::{self, PublicKey, Signature},
+            },
+            namespace::Namespace,
+            versioned::Versioned,
+        },
+        consensus::{
+            registry::{
+                ExecutorParameters, Node, NodeRuntime, Runtime, RuntimeGovernanceModel,
+                RuntimeKind, TEEHardware,
+            },
+            roothash::{
+                Block, ComputeResultsHeader, Error, ExecutorCommitment, ExecutorCommitmentFailure,
+                ExecutorCommitmentHeader, HeaderType, Message, Pool, RegistryMessage,
+                StakingMessage,
+            },
+            scheduler::{Committee, CommitteeKind, CommitteeNode, Role},
+            staking::Transfer,
+        },
+    };
+
+    use super::NodeLookup;
+
+    struct StaticNodeLookup {
+        runtime: NodeRuntime,
+    }
+
+    impl NodeLookup for StaticNodeLookup {
+        fn node(&self, id: PublicKey) -> Result<Node, Error> {
+            Ok(Node {
+                id,
+                runtimes: Some(vec![self.runtime.clone()]),
+                ..Default::default()
+            })
+        }
+    }
+
+    #[test]
+    fn test_pool_single_commitment() {
+        let chain_context = "test: oasis-core tests".to_owned();
+
+        // Generate a non-TEE runtime.
+        let id =
+            Namespace::from("0000000000000000000000000000000000000000000000000000000000000000");
+
+        let rt = Runtime {
+            id,
+            kind: RuntimeKind::KindCompute,
+            tee_hardware: TEEHardware::TEEHardwareInvalid,
+            executor: ExecutorParameters {
+                max_messages: 32,
+                ..Default::default()
+            },
+            governance_model: RuntimeGovernanceModel::GovernanceEntity,
+            ..Default::default()
+        };
+
+        // Generate a commitment signing key.
+        let sk = signature::PrivateKey::generate();
+
+        // Generate a committee.
+        let committee = Committee {
+            kind: CommitteeKind::ComputeExecutor,
+            members: vec![CommitteeNode {
+                role: Role::Worker,
+                public_key: sk.public_key(),
+            }],
+            runtime_id: id,
+            valid_for: 0,
+        };
+
+        // Create a pool.
+        let mut pool = Pool::new(rt, committee, 0);
+
+        // Generate a commitment.
+        let (child_blk, _, mut ec) = generate_executor_commitment(id, pool.round);
+
+        let nl = StaticNodeLookup {
+            runtime: NodeRuntime {
+                id,
+                ..Default::default()
+            },
+        };
+
+        // Test invalid commitments.
+        let tcs: Vec<(&str, fn(&mut ExecutorCommitment), Error)> = vec![
+            (
+                "BlockBadRound",
+                |ec: &mut ExecutorCommitment| ec.header.header.round -= 1,
+                Error::NotBasedOnCorrectBlock,
+            ),
+            (
+                "BlockBadPreviousHash",
+                |ec: &mut ExecutorCommitment| {
+                    ec.header.header.previous_hash = Hash::digest_bytes(b"invalid")
+                },
+                Error::NotBasedOnCorrectBlock,
+            ),
+            (
+                "MissingIORootHash",
+                |ec: &mut ExecutorCommitment| ec.header.header.io_root = None,
+                Error::BadExecutorCommitment,
+            ),
+            (
+                "MissingStateRootHash",
+                |ec: &mut ExecutorCommitment| ec.header.header.state_root = None,
+                Error::BadExecutorCommitment,
+            ),
+            (
+                "MissingMessagesHash",
+                |ec: &mut ExecutorCommitment| ec.header.header.messages_hash = None,
+                Error::BadExecutorCommitment,
+            ),
+            (
+                "MissingInMessagesHash",
+                |ec: &mut ExecutorCommitment| ec.header.header.in_msgs_hash = None,
+                Error::BadExecutorCommitment,
+            ),
+            (
+                "BadFailureIndicating",
+                |ec: &mut ExecutorCommitment| {
+                    ec.header.failure = ExecutorCommitmentFailure::FailureUnknown
+                },
+                Error::BadExecutorCommitment,
+            ),
+        ];
+
+        let msg_validator = |_: &_| Ok(());
+        for (name, f, expected_err) in tcs {
+            let (_, _, mut invalid_ec) = generate_executor_commitment(id, pool.round);
+            f(&mut invalid_ec);
+
+            invalid_ec.node_id = sk.public_key();
+            let res = invalid_ec.sign(&sk, &id, &chain_context);
+            assert!(res.is_ok(), "invalid_ec.sign({})", name);
+
+            let res = pool.add_executor_commitment(
+                &child_blk,
+                &nl,
+                invalid_ec,
+                &msg_validator,
+                &chain_context,
+            );
+            assert!(res.is_err(), "add_executor_commitment({})", name);
+            assert_eq!(
+                res.err().unwrap().to_string(),
+                expected_err.to_string(),
+                "add_executor_commitment({})",
+                name
+            );
+        }
+
+        // Generate a valid commitment.
+        ec.node_id = sk.public_key();
+        let res = ec.sign(&sk, &id, &chain_context);
+        assert!(res.is_ok(), "ec.sign");
+
+        // There should not be enough executor commitments.
+        let res = pool.process_commitments(false);
+        assert_eq!(
+            res.err().unwrap().to_string(),
+            Error::StillWaiting.to_string(),
+            "process_commitments",
+        );
+
+        let res = pool.process_commitments(true);
+        assert_eq!(
+            res.err().unwrap().to_string(),
+            Error::NoProposerCommitment.to_string(),
+            "process_commitments",
+        );
+
+        // Test message validator function.
+        let mut ec_with_msgs = ec.clone();
+        ec_with_msgs.messages = vec![
+            Message::Staking(Versioned {
+                version: 0,
+                inner: StakingMessage::Transfer(Transfer::default()),
+            }),
+            Message::Registry(Versioned {
+                version: 0,
+                inner: RegistryMessage::UpdateRuntime(Runtime::default()),
+            }),
+        ];
+        let msg_hash = Message::messages_hash(&ec_with_msgs.messages);
+        ec_with_msgs.header.header.messages_hash = Some(msg_hash);
+
+        let res = ec_with_msgs.sign(&sk, &id, &chain_context);
+        assert!(res.is_ok(), "ec_with_msgs.sign");
+
+        let error_msg = "message validation error";
+        let always_fail_msg_validator = |_: &_| -> Result<()> { Err(anyhow!(error_msg)) };
+        let res = pool.add_executor_commitment(
+            &child_blk,
+            &nl,
+            ec_with_msgs,
+            &always_fail_msg_validator,
+            &chain_context,
+        );
+        assert!(res.is_err(), "add_executor_commitment");
+        assert_eq!(
+            res.err().unwrap().to_string(),
+            error_msg,
+            "add_executor_commitment",
+        );
+
+        // Adding a commitment should succeed.
+        let res = pool.add_executor_commitment(
+            &child_blk,
+            &nl,
+            ec.clone(),
+            &msg_validator,
+            &chain_context,
+        );
+        assert!(res.is_ok(), "add_executor_commitment");
+
+        // Adding a commitment twice for the same node should fail.
+        let res = pool.add_executor_commitment(
+            &child_blk,
+            &nl,
+            ec.clone(),
+            &msg_validator,
+            &chain_context,
+        );
+        assert!(res.is_err(), "add_executor_commitment, duplicate");
+
+        // There should be enough executor commitments and no discrepancy.
+        let res = pool.process_commitments(false);
+        assert!(res.is_ok(), "process_commitments");
+        let dd_ec = res
+            .unwrap()
+            .to_dd_result()
+            .downcast_ref::<ExecutorCommitment>();
+        assert_eq!(dd_ec, Some(&ec), "DD should return the correct commitment");
+        assert_eq!(false, pool.discrepancy);
+    }
+
+    fn generate_executor_commitment(
+        id: Namespace,
+        round: u64,
+    ) -> (Block, Block, ExecutorCommitment) {
+        let child_blk = Block::new_genesis_block(id, round);
+        let parent_blk = Block::new_empty_block(&child_blk, 1, HeaderType::Normal);
+
+        // TODO: Add tests with some emitted messages.
+        let msgs_hash = Message::messages_hash(&vec![]);
+        // TODO: Add tests with some incoming messages.
+        let in_msgs_hash = Message::in_messages_hash(&vec![]);
+
+        let ec = ExecutorCommitment {
+            header: ExecutorCommitmentHeader {
+                header: ComputeResultsHeader {
+                    round: parent_blk.header.round,
+                    previous_hash: parent_blk.header.previous_hash,
+                    io_root: Some(parent_blk.header.io_root),
+                    state_root: Some(parent_blk.header.state_root),
+                    messages_hash: Some(msgs_hash),
+                    in_msgs_hash: Some(in_msgs_hash),
+                    in_msgs_count: 0,
+                },
+                failure: ExecutorCommitmentFailure::FailureNone,
+                rak_signature: None,
+            },
+            node_id: PublicKey::default(),
+            signature: Signature::default(),
+            messages: vec![],
+        };
+
+        (child_blk, parent_blk, ec)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/roothash/message.rs.html b/rust/src/oasis_core_runtime/consensus/roothash/message.rs.html new file mode 100644 index 0000000000..440f84d939 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/roothash/message.rs.html @@ -0,0 +1,699 @@ +message.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+
use anyhow::Result;
+
+use crate::{
+    common::{crypto::hash::Hash, quantity::Quantity, versioned::Versioned},
+    consensus::{address::Address, governance, registry, staking},
+};
+
+/// A message that can be emitted by the runtime to be processed by the consensus layer.
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub enum Message {
+    #[cbor(rename = "staking")]
+    Staking(Versioned<StakingMessage>),
+
+    #[cbor(rename = "registry")]
+    Registry(Versioned<RegistryMessage>),
+
+    #[cbor(rename = "governance")]
+    Governance(Versioned<GovernanceMessage>),
+}
+
+impl Message {
+    /// Returns a hash of provided runtime messages.
+    pub fn messages_hash(msgs: &[Message]) -> Hash {
+        if msgs.is_empty() {
+            // Special case if there are no messages.
+            return Hash::empty_hash();
+        }
+        Hash::digest_bytes(&cbor::to_vec(msgs.to_vec()))
+    }
+
+    /// Returns a hash of provided incoming runtime messages.
+    pub fn in_messages_hash(msgs: &[IncomingMessage]) -> Hash {
+        if msgs.is_empty() {
+            // Special case if there are no messages.
+            return Hash::empty_hash();
+        }
+        Hash::digest_bytes(&cbor::to_vec(msgs.to_vec()))
+    }
+
+    /// Performs basic validation of the runtime message.
+    pub fn validate_basic(&self) -> Result<()> {
+        match self {
+            Message::Staking(msg) => msg.inner.validate_basic(),
+            Message::Registry(msg) => msg.inner.validate_basic(),
+            Message::Governance(msg) => msg.inner.validate_basic(),
+        }
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub enum StakingMessage {
+    #[cbor(rename = "transfer")]
+    Transfer(staking::Transfer),
+
+    #[cbor(rename = "withdraw")]
+    Withdraw(staking::Withdraw),
+
+    #[cbor(rename = "add_escrow")]
+    AddEscrow(staking::Escrow),
+
+    #[cbor(rename = "reclaim_escrow")]
+    ReclaimEscrow(staking::ReclaimEscrow),
+}
+
+impl StakingMessage {
+    /// Performs basic validation of the staking message.
+    pub fn validate_basic(&self) -> Result<()> {
+        match self {
+            StakingMessage::Transfer(_) => {
+                // No validation at this time.
+                Ok(())
+            }
+            StakingMessage::Withdraw(_) => {
+                // No validation at this time.
+                Ok(())
+            }
+            StakingMessage::AddEscrow(_) => {
+                // No validation at this time.
+                Ok(())
+            }
+            StakingMessage::ReclaimEscrow(_) => {
+                // No validation at this time.
+                Ok(())
+            }
+        }
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub enum RegistryMessage {
+    #[cbor(rename = "update_runtime")]
+    UpdateRuntime(registry::Runtime),
+}
+
+impl RegistryMessage {
+    /// Performs basic validation of the registry message.
+    pub fn validate_basic(&self) -> Result<()> {
+        match self {
+            RegistryMessage::UpdateRuntime(_) => {
+                // The runtime descriptor will already be validated in registerRuntime
+                // in the registry app when it processes the message, so we don't have
+                // to do any validation here.
+                Ok(())
+            }
+        }
+    }
+}
+
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub enum GovernanceMessage {
+    #[cbor(rename = "cast_vote")]
+    CastVote(governance::ProposalVote),
+    #[cbor(rename = "submit_proposal")]
+    SubmitProposal(governance::ProposalContent),
+}
+
+impl GovernanceMessage {
+    /// Performs basic validation of the governance message.
+    pub fn validate_basic(&self) -> Result<()> {
+        match self {
+            GovernanceMessage::CastVote(_) => {
+                // No validation at this time.
+                Ok(())
+            }
+            GovernanceMessage::SubmitProposal(_) => {
+                // No validation at this time.
+                Ok(())
+            }
+        }
+    }
+}
+
+/// An incoming message emitted by the consensus layer to be processed by the runtime.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct IncomingMessage {
+    /// Unique identifier of the message.
+    pub id: u64,
+    /// Address of the caller authenticated by the consensus layer.
+    pub caller: Address,
+    /// An optional tag provided by the caller which is ignored and can be used to match processed
+    /// incoming message events later.
+    #[cbor(optional)]
+    pub tag: u64,
+    /// Fee sent into the runtime as part of the message being sent. The fee is transferred before
+    /// the message is processed by the runtime.
+    #[cbor(optional)]
+    pub fee: Quantity,
+    /// Tokens sent into the runtime as part of the message being sent. The tokens are transferred
+    /// before the message is processed by the runtime.
+    #[cbor(optional)]
+    pub tokens: Quantity,
+    /// Arbitrary runtime-dependent data.
+    #[cbor(optional)]
+    pub data: Vec<u8>,
+}
+
+impl IncomingMessage {
+    /// Returns a hash of provided runtime messages.
+    pub fn in_messages_hash(msgs: &[IncomingMessage]) -> Hash {
+        if msgs.is_empty() {
+            // Special case if there are no messages.
+            return Hash::empty_hash();
+        }
+        Hash::digest_bytes(&cbor::to_vec(msgs.to_vec()))
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use std::collections::BTreeMap;
+
+    use crate::{
+        common::{crypto::signature::PublicKey, namespace::Namespace, quantity},
+        consensus::scheduler,
+    };
+
+    use super::*;
+
+    #[test]
+    fn test_consistent_messages_hash() {
+        // NOTE: This runtime structure must be synced with go/roothash/api/messages_test.go.
+        let test_ent_id =
+            PublicKey::from("4ea5328f943ef6f66daaed74cb0e99c3b1c45f76307b425003dbc7cb3638ed35");
+
+        let q = quantity::Quantity::from(1000u32);
+
+        let mut st = BTreeMap::new();
+        st.insert(staking::ThresholdKind::KindNodeCompute, q.clone());
+
+        let mut wlc = BTreeMap::new();
+        wlc.insert(registry::RolesMask::ROLE_COMPUTE_WORKER, 2);
+
+        let mut wl = BTreeMap::new();
+        wl.insert(
+            test_ent_id,
+            registry::EntityWhitelistConfig { max_nodes: wlc },
+        );
+
+        let rt = registry::Runtime {
+            v: registry::LATEST_RUNTIME_DESCRIPTOR_VERSION,
+            id: Namespace::default(),
+            entity_id: test_ent_id,
+            genesis: registry::RuntimeGenesis {
+                state_root: Hash::empty_hash(),
+                round: 0,
+            },
+            kind: registry::RuntimeKind::KindCompute,
+            tee_hardware: registry::TEEHardware::TEEHardwareInvalid,
+            deployments: vec![registry::VersionInfo::default()],
+            key_manager: None,
+            executor: registry::ExecutorParameters {
+                group_size: 3,
+                group_backup_size: 5,
+                allowed_stragglers: 1,
+                round_timeout: 10,
+                max_messages: 32,
+                ..Default::default()
+            },
+            txn_scheduler: registry::TxnSchedulerParameters {
+                batch_flush_timeout: 1_000_000_000, // 1 second.
+                max_batch_size: 1,
+                max_batch_size_bytes: 1024,
+                max_in_messages: 0,
+                propose_batch_timeout: 2_000_000_000, // 2 seconds.
+            },
+            storage: registry::StorageParameters {
+                checkpoint_interval: 0,
+                checkpoint_num_kept: 0,
+                checkpoint_chunk_size: 0,
+            },
+            admission_policy: registry::RuntimeAdmissionPolicy {
+                entity_whitelist: Some(registry::EntityWhitelistRuntimeAdmissionPolicy {
+                    entities: wl,
+                }),
+                ..Default::default()
+            },
+            constraints: {
+                let mut cs = BTreeMap::new();
+                cs.insert(scheduler::CommitteeKind::ComputeExecutor, {
+                    let mut ce = BTreeMap::new();
+                    ce.insert(
+                        scheduler::Role::Worker,
+                        registry::SchedulingConstraints {
+                            min_pool_size: Some(registry::MinPoolSizeConstraint { limit: 1 }),
+                            validator_set: Some(registry::ValidatorSetConstraint {}),
+                            ..Default::default()
+                        },
+                    );
+                    ce.insert(
+                        scheduler::Role::BackupWorker,
+                        registry::SchedulingConstraints {
+                            min_pool_size: Some(registry::MinPoolSizeConstraint { limit: 2 }),
+                            ..Default::default()
+                        },
+                    );
+                    ce
+                });
+
+                cs
+            },
+            staking: registry::RuntimeStakingParameters {
+                thresholds: st,
+                ..Default::default()
+            },
+            governance_model: registry::RuntimeGovernanceModel::GovernanceEntity,
+        };
+
+        // NOTE: These hashes MUST be synced with go/roothash/api/message/message_test.go.
+        let tcs = vec![
+            (
+                vec![],
+                "c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a",
+            ),
+            (
+                vec![Message::Staking(Versioned::new(
+                    0,
+                    StakingMessage::Transfer(staking::Transfer::default()),
+                ))],
+                "a6b91f974b34a9192efd12025659a768520d2f04e1dae9839677456412cdb2be",
+            ),
+            (
+                vec![Message::Staking(Versioned::new(
+                    0,
+                    StakingMessage::Withdraw(staking::Withdraw::default()),
+                ))],
+                "069b0fda76d804e3fd65d4bbd875c646f15798fb573ac613100df67f5ba4c3fd",
+            ),
+            (
+                vec![Message::Staking(Versioned::new(
+                    0,
+                    StakingMessage::AddEscrow(staking::Escrow::default()),
+                ))],
+                "65049870b9dae657390e44065df0c78176816876e67b96dac7791ee6a1aa42e2",
+            ),
+            (
+                vec![Message::Staking(Versioned::new(
+                    0,
+                    StakingMessage::ReclaimEscrow(staking::ReclaimEscrow::default()),
+                ))],
+                "c78547eae2f104268e49827cbe624cf2b350ee59e8d693dec0673a70a4664a2e",
+            ),
+            (
+                vec![Message::Registry(Versioned::new(
+                    0,
+                    RegistryMessage::UpdateRuntime(registry::Runtime {
+                        admission_policy: registry::RuntimeAdmissionPolicy {
+                            any_node: Some(registry::AnyNodeRuntimeAdmissionPolicy {}),
+                            ..Default::default()
+                        },
+                        ..Default::default()
+                    }),
+                ))],
+                // FIXME: Change to e6e170fb771583147255e0c96dc88615d4fd2fd28488ae489df01da201affe72 once cbor is fixed.
+                "baf9eeaa4860e363a9c27d99555839afc535f0cd32d23dc640f0f020677460e0",
+            ),
+            (
+                vec![Message::Registry(Versioned::new(
+                    0,
+                    RegistryMessage::UpdateRuntime(rt),
+                ))],
+                "03e77fbeda1a2291c87c06c59335a49fe18852266d58608c1ddec8ef64209458",
+            ),
+            (
+                vec![Message::Governance(Versioned::new(
+                    0,
+                    GovernanceMessage::CastVote(governance::ProposalVote {
+                        id: 32,
+                        vote: governance::Vote::Yes,
+                    }),
+                ))],
+                "f45e26eb8ace807ad5bd02966cde1f012d1d978d4cbddd59e9bfd742dcf39b90",
+            ),
+            (
+                vec![Message::Governance(Versioned::new(
+                    0,
+                    GovernanceMessage::SubmitProposal(governance::ProposalContent {
+                        cancel_upgrade: Some(governance::CancelUpgradeProposal { proposal_id: 32 }),
+                        ..Default::default()
+                    }),
+                ))],
+                "03312ddb5c41a30fbd29fb91cf6bf26d58073996f89657ca4f3b3a43a98bfd0b",
+            ),
+        ];
+        for (msgs, expected_hash) in tcs {
+            println!("{:?}", cbor::to_vec(msgs.clone()));
+            assert_eq!(Message::messages_hash(&msgs), Hash::from(expected_hash));
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/roothash/mod.rs.html b/rust/src/oasis_core_runtime/consensus/roothash/mod.rs.html new file mode 100644 index 0000000000..9580355145 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/roothash/mod.rs.html @@ -0,0 +1,445 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+
//! Consensus roothash structures.
+//!
+//! # Note
+//!
+//! This **MUST** be kept in sync with go/roothash/api.
+//!
+use thiserror::Error;
+
+use crate::{
+    common::{
+        crypto::{hash::Hash, signature::PublicKey},
+        namespace::Namespace,
+    },
+    consensus::state::StateError,
+};
+
+// Modules.
+mod block;
+mod commitment;
+mod message;
+
+// Re-exports.
+pub use block::*;
+pub use commitment::*;
+pub use message::*;
+
+/// Errors emitted by the roothash module.
+#[derive(Debug, Error)]
+pub enum Error {
+    #[error("roothash: invalid runtime {0}")]
+    InvalidRuntime(Namespace),
+
+    #[error(transparent)]
+    State(#[from] StateError),
+
+    #[error("roothash/commitment: no runtime configured")]
+    NoRuntime,
+
+    #[error("roothash/commitment: no committee configured")]
+    NoCommittee,
+
+    #[error("roothash/commitment: invalid committee kind")]
+    InvalidCommitteeKind,
+
+    #[error("roothash/commitment: batch RAK signature invalid")]
+    RakSigInvalid,
+
+    #[error("roothash/commitment: node not part of committee")]
+    NotInCommittee,
+
+    #[error("roothash/commitment: node already sent commitment")]
+    AlreadyCommitted,
+
+    #[error("roothash/commitment: submitted commitment is not based on correct block")]
+    NotBasedOnCorrectBlock,
+
+    #[error("roothash/commitment: discrepancy detected")]
+    DiscrepancyDetected,
+
+    #[error("roothash/commitment: still waiting for commits")]
+    StillWaiting,
+
+    #[error("roothash/commitment: insufficient votes to finalize discrepancy resolution round")]
+    InsufficientVotes,
+
+    #[error("roothash/commitment: bad executor commitment")]
+    BadExecutorCommitment,
+
+    #[error("roothash/commitment: invalid messages")]
+    InvalidMessages,
+
+    #[error("roothash/commitment: invalid round")]
+    InvalidRound,
+
+    #[error("roothash/commitment: no proposer commitment")]
+    NoProposerCommitment,
+
+    #[error("roothash/commitment: bad proposer commitment")]
+    BadProposerCommitment,
+}
+
+/// Runtime block annotated with consensus information.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct AnnotatedBlock {
+    /// Consensus height at which this runtime block was produced.
+    pub consensus_height: i64,
+    /// Runtime block.
+    pub block: Block,
+}
+
+/// Result of a message being processed by the consensus layer.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct MessageEvent {
+    #[cbor(optional)]
+    pub module: String,
+
+    #[cbor(optional)]
+    pub code: u32,
+
+    #[cbor(optional)]
+    pub index: u32,
+
+    #[cbor(optional)]
+    pub result: Option<cbor::Value>,
+}
+
+impl MessageEvent {
+    /// Returns true if the event indicates that the message was successfully processed.
+    pub fn is_success(&self) -> bool {
+        self.code == 0
+    }
+}
+
+/// Information about how a particular round was executed by the consensus layer.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct RoundResults {
+    /// Results of executing emitted runtime messages.
+    #[cbor(optional)]
+    pub messages: Vec<MessageEvent>,
+
+    /// Public keys of compute nodes' controlling entities that positively contributed to the round
+    /// by replicating the computation correctly.
+    #[cbor(optional)]
+    pub good_compute_entities: Vec<PublicKey>,
+    /// Public keys of compute nodes' controlling entities that negatively contributed to the round
+    /// by causing discrepancies.
+    #[cbor(optional)]
+    pub bad_compute_entities: Vec<PublicKey>,
+}
+
+/// Per-round state and I/O roots that are stored in consensus state.
+#[derive(Clone, Debug, Default, Eq, PartialEq, Hash, cbor::Encode, cbor::Decode)]
+#[cbor(as_array)]
+pub struct RoundRoots {
+    pub state_root: Hash,
+    pub io_root: Hash,
+}
+
+#[cfg(test)]
+mod tests {
+    use base64::prelude::*;
+
+    use super::*;
+
+    #[test]
+    fn test_consistent_round_results() {
+        let tcs = vec![
+            ("oA==", RoundResults::default()),
+            ("oWhtZXNzYWdlc4GiZGNvZGUBZm1vZHVsZWR0ZXN0", RoundResults {
+                messages: vec![MessageEvent{module: "test".to_owned(), code: 1, index: 0, result: None}],
+                ..Default::default()
+            }),
+            ("omhtZXNzYWdlc4GkZGNvZGUYKmVpbmRleAFmbW9kdWxlZHRlc3RmcmVzdWx0a3Rlc3QtcmVzdWx0dWdvb2RfY29tcHV0ZV9lbnRpdGllc4NYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI=",
+                RoundResults {
+                    messages: vec![MessageEvent{module: "test".to_owned(), code: 42, index: 1, result: Some(cbor::Value::TextString("test-result".to_string()))}],
+                    good_compute_entities: vec![
+                        "0000000000000000000000000000000000000000000000000000000000000000".into(),
+                        "0000000000000000000000000000000000000000000000000000000000000001".into(),
+                        "0000000000000000000000000000000000000000000000000000000000000002".into(),
+                    ],
+                    ..Default::default()
+                }),
+            ("o2htZXNzYWdlc4GkZGNvZGUYKmVpbmRleAFmbW9kdWxlZHRlc3RmcmVzdWx0a3Rlc3QtcmVzdWx0dGJhZF9jb21wdXRlX2VudGl0aWVzgVggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF1Z29vZF9jb21wdXRlX2VudGl0aWVzglggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC",
+                RoundResults {
+                    messages: vec![MessageEvent{module: "test".to_owned(), code: 42, index: 1, result: Some(cbor::Value::TextString("test-result".to_string()))}],
+                    good_compute_entities: vec![
+                        "0000000000000000000000000000000000000000000000000000000000000000".into(),
+                        "0000000000000000000000000000000000000000000000000000000000000002".into(),
+                    ],
+                    bad_compute_entities: vec![
+                        "0000000000000000000000000000000000000000000000000000000000000001".into(),
+                    ],
+                }),
+        ];
+        for (encoded_base64, rr) in tcs {
+            let dec: RoundResults =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("round results should deserialize correctly");
+            assert_eq!(dec, rr, "decoded results should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_consistent_round_roots() {
+        let tcs = vec![
+            ("glggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", RoundRoots::default()),
+            ("glggPTf+WENeDYcyPe5KLBsznvlU3mNxbuefV0f5TZdPkT9YIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", RoundRoots {
+                state_root: Hash::digest_bytes(b"test"),
+                ..Default::default()
+            }),
+            ("glggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYID03/lhDXg2HMj3uSiwbM575VN5jcW7nn1dH+U2XT5E/", RoundRoots {
+                io_root: Hash::digest_bytes(b"test"),
+                ..Default::default()
+            }),
+            ("glggPTf+WENeDYcyPe5KLBsznvlU3mNxbuefV0f5TZdPkT9YID03/lhDXg2HMj3uSiwbM575VN5jcW7nn1dH+U2XT5E/",
+                RoundRoots {
+                    state_root: Hash::digest_bytes(b"test"),
+                    io_root: Hash::digest_bytes(b"test"),
+                }),
+            ("glggC4+lzfqNgLxCHLxwDp+Bf5PLLb0DILrUZWwF+lp6Z/NYIJ3seczGUDFDvmAEdVCeep6Xsn8XRosTKWpu9wZ3mQRq",
+                RoundRoots {
+                    state_root: Hash::digest_bytes(b"test1"),
+                    io_root: Hash::digest_bytes(b"test2"),
+                }),
+            ("glggnex5zMZQMUO+YAR1UJ56npeyfxdGixMpam73BneZBGpYIAuPpc36jYC8Qhy8cA6fgX+Tyy29AyC61GVsBfpaemfz",
+                RoundRoots {
+                    state_root: Hash::digest_bytes(b"test2"),
+                    io_root: Hash::digest_bytes(b"test1"),
+                }),
+        ];
+
+        for (encoded_base64, rr) in tcs {
+            let dec: RoundRoots =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("round roots should deserialize correctly");
+            assert_eq!(
+                dec, rr,
+                "decoded round roots should match the expected value"
+            );
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/scheduler.rs.html b/rust/src/oasis_core_runtime/consensus/scheduler.rs.html new file mode 100644 index 0000000000..40ca51e799 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/scheduler.rs.html @@ -0,0 +1,163 @@ +scheduler.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+
//! Scheduler structures.
+use anyhow::{anyhow, Result};
+
+use crate::{
+    common::{crypto::signature::PublicKey, namespace::Namespace},
+    consensus::beacon::EpochTime,
+};
+
+/// The role a given node plays in a committee.
+#[derive(
+    Clone, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord, cbor::Encode, cbor::Decode,
+)]
+#[repr(u8)]
+pub enum Role {
+    /// An invalid role (should never appear on the wire).
+    #[default]
+    Invalid = 0,
+    /// Indicates the node is a worker.
+    Worker = 1,
+    /// Indicates the node is a backup worker.
+    BackupWorker = 2,
+}
+
+/// A node participating in a committee.
+pub struct CommitteeNode {
+    /// The node's role in a committee.
+    pub role: Role,
+
+    /// The node's public key.
+    pub public_key: PublicKey,
+}
+
+/// The functionality a committee exists to provide.
+#[derive(
+    Clone, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord, cbor::Encode, cbor::Decode,
+)]
+#[repr(u8)]
+pub enum CommitteeKind {
+    /// An invalid committee (should never appear on the wire).
+    #[default]
+    Invalid = 0,
+    /// A compute executor committee.
+    ComputeExecutor = 1,
+}
+
+/// A per-runtime (instance) committee.
+pub struct Committee {
+    /// The functionality a committee exists to provide.
+    pub kind: CommitteeKind,
+
+    /// The committee members.
+    pub members: Vec<CommitteeNode>,
+
+    /// The runtime ID that this committee is for.
+    pub runtime_id: Namespace,
+
+    /// The epoch for which the committee is valid.
+    pub valid_for: EpochTime,
+}
+
+impl Committee {
+    /// Returns committee nodes with Worker role.
+    pub fn workers(&self) -> Vec<&CommitteeNode> {
+        self.members
+            .iter()
+            .filter(|&member| member.role == Role::Worker)
+            .collect()
+    }
+
+    /// Returns the transaction scheduler of the provided committee based on the provided round.
+    pub fn transaction_scheduler(&self, round: u64) -> Result<&CommitteeNode> {
+        let workers = self.workers();
+        if workers.is_empty() {
+            return Err(anyhow!("GetTransactionScheduler: no workers in committee"));
+        }
+        let scheduler_idx = round as usize % workers.len();
+        let scheduler = workers[scheduler_idx];
+
+        Ok(scheduler)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/staking.rs.html b/rust/src/oasis_core_runtime/consensus/staking.rs.html new file mode 100644 index 0000000000..6164550656 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/staking.rs.html @@ -0,0 +1,1453 @@ +staking.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+
//! Consensus staking structures.
+//!
+//! # Note
+//!
+//! This **MUST** be kept in sync with go/staking/api.
+//!
+use std::collections::BTreeMap;
+
+use crate::{
+    common::{crypto::hash::Hash, quantity::Quantity},
+    consensus::{address::Address, beacon::EpochTime},
+};
+
+/// A stake transfer.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Transfer {
+    pub to: Address,
+    pub amount: Quantity,
+}
+
+/// A withdrawal from an account.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Withdraw {
+    pub from: Address,
+    pub amount: Quantity,
+}
+
+/// A stake escrow.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Escrow {
+    pub account: Address,
+    pub amount: Quantity,
+}
+
+/// A reclaim escrow.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ReclaimEscrow {
+    pub account: Address,
+    pub shares: Quantity,
+}
+
+/// Kind of staking threshold.
+#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, cbor::Encode, cbor::Decode)]
+#[repr(i32)]
+pub enum ThresholdKind {
+    /// Entity staking threshold.
+    KindEntity = 0,
+    /// Validator node staking threshold.
+    KindNodeValidator = 1,
+    /// Compute node staking threshold.
+    KindNodeCompute = 2,
+    /// Keymanager node staking threshold.
+    KindNodeKeyManager = 4,
+    /// Compute runtime staking threshold.
+    KindRuntimeCompute = 5,
+    /// Keymanager runtime staking threshold.
+    KindRuntimeKeyManager = 6,
+}
+
+/// Entry in the staking ledger.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Account {
+    #[cbor(optional)]
+    pub general: GeneralAccount,
+
+    #[cbor(optional)]
+    pub escrow: EscrowAccount,
+}
+
+/// General purpose account.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct GeneralAccount {
+    #[cbor(optional)]
+    pub balance: Quantity,
+
+    #[cbor(optional)]
+    pub nonce: u64,
+
+    #[cbor(optional)]
+    pub allowances: BTreeMap<Address, Quantity>,
+}
+
+/// Escrow account.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct EscrowAccount {
+    #[cbor(optional)]
+    pub active: SharePool,
+
+    #[cbor(optional)]
+    pub debonding: SharePool,
+
+    #[cbor(optional)]
+    pub commission_schedule: CommissionSchedule,
+
+    #[cbor(optional)]
+    pub stake_accumulator: StakeAccumulator,
+}
+
+/// Combined balance of serval entries, the relative sizes of which are tracked through shares.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct SharePool {
+    #[cbor(optional)]
+    pub balance: Quantity,
+
+    #[cbor(optional)]
+    pub total_shares: Quantity,
+}
+
+/// Defines a list of commission rates and commission rate bounds with their starting times.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct CommissionSchedule {
+    #[cbor(optional)]
+    pub rates: Vec<CommissionRateStep>,
+
+    #[cbor(optional)]
+    pub bounds: Vec<CommissionRateBoundStep>,
+}
+
+/// Commission rate and its starting time.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct CommissionRateStep {
+    pub start: EpochTime,
+    pub rate: Quantity,
+}
+
+/// Commission rate bound and its starting time.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct CommissionRateBoundStep {
+    #[cbor(optional)]
+    pub start: EpochTime,
+
+    #[cbor(optional)]
+    pub rate_min: Quantity,
+
+    #[cbor(optional)]
+    pub rate_max: Quantity,
+}
+
+/// Per escrow account stake accumulator.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct StakeAccumulator {
+    #[cbor(optional)]
+    pub claims: BTreeMap<StakeClaim, Vec<StakeThreshold>>,
+}
+
+/// Unique stake claim identifier.
+pub type StakeClaim = String;
+
+/// Stake threshold used in the stake accumulator.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct StakeThreshold {
+    #[cbor(optional)]
+    pub global: Option<ThresholdKind>,
+
+    #[cbor(optional, rename = "const")]
+    pub constant: Option<Quantity>,
+}
+
+/// Delegation descriptor.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Delegation {
+    pub shares: Quantity,
+}
+
+/// Debonding delegation descriptor.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct DebondingDelegation {
+    pub shares: Quantity,
+
+    #[cbor(rename = "debond_end")]
+    pub debond_end_time: EpochTime,
+}
+
+/// Reason for slashing an entity.
+#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum SlashReason {
+    /// Slashing due to submission of incorrect results in runtime executor commitments.
+    RuntimeIncorrectResults = 0x80,
+    /// Slashing due to signing two different executor commits or proposed batches for the same
+    /// round.
+    RuntimeEquivocation = 0x81,
+    /// Slashing due to not doing the required work.
+    RuntimeLiveness = 0x82,
+}
+
+/// Per-reason slashing configuration.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Slash {
+    pub amount: Quantity,
+    pub freeze_interval: EpochTime,
+}
+
+/// Transfer result.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct TransferResult {
+    pub from: Address,
+    pub to: Address,
+    pub amount: Quantity,
+}
+
+/// Add escrow result.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct AddEscrowResult {
+    pub owner: Address,
+    pub escrow: Address,
+    pub amount: Quantity,
+    pub new_shares: Quantity,
+}
+
+/// Reclaim escrow result.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct ReclaimEscrowResult {
+    pub owner: Address,
+    pub escrow: Address,
+    pub amount: Quantity,
+    pub remaining_shares: Quantity,
+    pub debonding_shares: Quantity,
+    pub debond_end_time: EpochTime,
+}
+
+/// Withdraw result.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct WithdrawResult {
+    pub owner: Address,
+    pub beneficiary: Address,
+    pub allowance: Quantity,
+    pub amount_change: Quantity,
+}
+
+/// A staking-related event.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct Event {
+    #[cbor(optional)]
+    pub height: i64,
+    #[cbor(optional)]
+    pub tx_hash: Hash,
+
+    // TODO: Consider refactoring this to be an enum.
+    #[cbor(optional)]
+    pub transfer: Option<TransferEvent>,
+    #[cbor(optional)]
+    pub burn: Option<BurnEvent>,
+    #[cbor(optional)]
+    pub escrow: Option<EscrowEvent>,
+    #[cbor(optional)]
+    pub allowance_change: Option<AllowanceChangeEvent>,
+}
+
+/// Event emitted when stake is transferred, either by a call to Transfer or Withdraw.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct TransferEvent {
+    pub from: Address,
+    pub to: Address,
+    pub amount: Quantity,
+}
+
+/// Event emitted when stake is destroyed via a call to Burn.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct BurnEvent {
+    pub owner: Address,
+    pub amount: Quantity,
+}
+
+/// Escrow-related events.
+#[derive(Clone, Debug, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub enum EscrowEvent {
+    /// Event emitted when stake is transferred into an escrow account.
+    #[cbor(rename = "add")]
+    Add {
+        owner: Address,
+        escrow: Address,
+        amount: Quantity,
+        new_shares: Quantity,
+    },
+
+    /// Event emitted when stake is taken from an escrow account (i.e. stake is slashed).
+    #[cbor(rename = "take")]
+    Take {
+        owner: Address,
+        // The sum of amounts slashed from active and debonding escrow balances.
+        amount: Quantity,
+        // The amount slashed from the debonding escrow balance.
+        debonding_amount: Quantity,
+    },
+
+    /// Event emitted when the debonding process has started and the given number of active shares
+    /// have been moved into the debonding pool and started debonding.
+    ///
+    /// Note that the given amount is valid at the time of debonding start and may not correspond to
+    /// the final debonded amount in case any escrowed stake is subject to slashing.
+    #[cbor(rename = "debonding_start")]
+    DebondingStart {
+        owner: Address,
+        escrow: Address,
+        amount: Quantity,
+        active_shares: Quantity,
+        debonding_shares: Quantity,
+        debond_end_time: EpochTime,
+    },
+
+    /// Event emitted when stake is reclaimed from an escrow account back into owner's general
+    /// account.
+    #[cbor(rename = "reclaim")]
+    Reclaim {
+        owner: Address,
+        escrow: Address,
+        amount: Quantity,
+        shares: Quantity,
+    },
+}
+
+/// Event emitted when allowance is changed for a beneficiary.
+#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+pub struct AllowanceChangeEvent {
+    pub owner: Address,
+    pub beneficiary: Address,
+    pub allowance: Quantity,
+    #[cbor(optional)]
+    pub negative: bool,
+    pub amount_change: Quantity,
+}
+
+#[cfg(test)]
+mod tests {
+    use base64::prelude::*;
+
+    use super::*;
+    use crate::{
+        common::crypto::signature::PublicKey,
+        consensus::address::{COMMON_POOL_ADDRESS, GOVERNANCE_DEPOSITS_ADDRESS},
+    };
+
+    #[test]
+    fn test_consistent_accounts() {
+        let tcs = vec![
+        ("oA==", Account::default()),
+        (
+            "oWdnZW5lcmFsomVub25jZRghZ2JhbGFuY2VBCg==",
+            Account {
+                general: GeneralAccount {
+                    balance: Quantity::from(10u32),
+                    nonce: 33,
+                    ..Default::default()
+                },
+                ..Default::default()
+            },
+        ),
+        (
+            "oWdnZW5lcmFsoWphbGxvd2FuY2VzolUAdU/0RxQ6XsX0cbMPhna5TVaxV1BBIVUA98Te1iET4sKC6oZyI6VE7VXWum5BZA==",
+            {
+                Account {
+                    general: GeneralAccount {
+                        allowances: [
+                            (COMMON_POOL_ADDRESS.clone(), Quantity::from(100u32)),
+                            (GOVERNANCE_DEPOSITS_ADDRESS.clone(), Quantity::from(33u32))
+                        ].iter().cloned().collect(),
+                        ..Default::default()
+                        },
+                    ..Default::default()
+                }
+                },
+        ),
+        (
+            "oWZlc2Nyb3ejZmFjdGl2ZaJnYmFsYW5jZUIETGx0b3RhbF9zaGFyZXNBC3FzdGFrZV9hY2N1bXVsYXRvcqFmY2xhaW1zoWZlbnRpdHmCoWVjb25zdEFNoWZnbG9iYWwCc2NvbW1pc3Npb25fc2NoZWR1bGWhZmJvdW5kc4GjZXN0YXJ0GCFocmF0ZV9tYXhCA+hocmF0ZV9taW5BCg==",
+            Account {
+                escrow: EscrowAccount {
+                    active: SharePool{
+                        balance: Quantity::from(1100u32),
+                        total_shares: Quantity::from(11u32),
+                    },
+                    debonding: SharePool::default(),
+                    commission_schedule: CommissionSchedule {
+                        bounds: vec![CommissionRateBoundStep{
+                            start: 33,
+                            rate_min: Quantity::from(10u32),
+                            rate_max: Quantity::from(1000u32),
+                        }],
+                        ..Default::default()
+                    },
+                    stake_accumulator: StakeAccumulator {
+                        claims: [
+                            (
+                                "entity".to_string(),
+                                vec![
+                                    StakeThreshold{
+                                        constant: Some(Quantity::from(77u32)),
+                                        ..Default::default()
+                                    },
+                                    StakeThreshold{
+                                        global: Some(ThresholdKind::KindNodeCompute),
+                                        ..Default::default()
+                                    },
+                                ]
+                            )
+                        ].iter().cloned().collect()
+                    }
+                },
+                ..Default::default()
+            },
+        )
+    ];
+        for (encoded_base64, rr) in tcs {
+            let dec: Account = cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                .expect("account should deserialize correctly");
+            assert_eq!(dec, rr, "decoded account should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_consistent_delegations() {
+        let tcs = vec![
+            ("oWZzaGFyZXNA", Delegation::default()),
+            (
+                "oWZzaGFyZXNBZA==",
+                Delegation {
+                    shares: Quantity::from(100u32),
+                },
+            ),
+        ];
+        for (encoded_base64, rr) in tcs {
+            let dec: Delegation =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("delegation should deserialize correctly");
+            assert_eq!(dec, rr, "decoded account should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_consistent_debonding_delegations() {
+        let tcs = vec![
+            (
+                "omZzaGFyZXNAamRlYm9uZF9lbmQA",
+                DebondingDelegation::default(),
+            ),
+            (
+                "omZzaGFyZXNBZGpkZWJvbmRfZW5kFw==",
+                DebondingDelegation {
+                    shares: Quantity::from(100u32),
+                    debond_end_time: 23,
+                },
+            ),
+        ];
+        for (encoded_base64, rr) in tcs {
+            let dec: DebondingDelegation =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("debonding delegation should deserialize correctly");
+            assert_eq!(dec, rr, "decoded account should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_consistent_transfer_results() {
+        let addr1 = Address::from_pk(&PublicKey::from(
+            "aaafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+        let addr2 = Address::from_pk(&PublicKey::from(
+            "bbbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+
+        let tcs = vec![
+            ("o2J0b1UAAAAAAAAAAAAAAAAAAAAAAAAAAABkZnJvbVUAAAAAAAAAAAAAAAAAAAAAAAAAAABmYW1vdW50QA==", TransferResult::default()),
+            (
+                "o2J0b1UAuRI5eJXmRwxR+r7MndyD9wrthqFkZnJvbVUAIHIUNIk/YWwJgUjiz5+Z4+KCbhNmYW1vdW50QWQ=",
+                TransferResult {
+                    amount: Quantity::from(100u32),
+                    from: addr1,
+                    to: addr2,
+                },
+            ),
+        ];
+        for (encoded_base64, rr) in tcs {
+            let dec: TransferResult =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("transfer result should deserialize correctly");
+            assert_eq!(dec, rr, "decoded result should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_consistent_withdraw_results() {
+        let addr1 = Address::from_pk(&PublicKey::from(
+            "aaafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+        let addr2 = Address::from_pk(&PublicKey::from(
+            "bbbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+
+        let tcs = vec![
+            ("pGVvd25lclUAAAAAAAAAAAAAAAAAAAAAAAAAAABpYWxsb3dhbmNlQGtiZW5lZmljaWFyeVUAAAAAAAAAAAAAAAAAAAAAAAAAAABtYW1vdW50X2NoYW5nZUA=", WithdrawResult::default()),
+            (
+                "pGVvd25lclUAIHIUNIk/YWwJgUjiz5+Z4+KCbhNpYWxsb3dhbmNlQQprYmVuZWZpY2lhcnlVALkSOXiV5kcMUfq+zJ3cg/cK7YahbWFtb3VudF9jaGFuZ2VBBQ==",
+                WithdrawResult {
+                    owner: addr1,
+                    beneficiary: addr2,
+                    allowance: Quantity::from(10u32),
+                    amount_change: Quantity::from(5u32),
+                },
+            ),
+        ];
+        for (encoded_base64, rr) in tcs {
+            let dec: WithdrawResult =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("withdraw result should deserialize correctly");
+            assert_eq!(dec, rr, "decoded result should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_consistent_add_escrow_results() {
+        let addr1 = Address::from_pk(&PublicKey::from(
+            "aaafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+        let addr2 = Address::from_pk(&PublicKey::from(
+            "bbbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+
+        let tcs = vec![
+            ("pGVvd25lclUAAAAAAAAAAAAAAAAAAAAAAAAAAABmYW1vdW50QGZlc2Nyb3dVAAAAAAAAAAAAAAAAAAAAAAAAAAAAam5ld19zaGFyZXNA", AddEscrowResult::default()),
+            (
+                "pGVvd25lclUAIHIUNIk/YWwJgUjiz5+Z4+KCbhNmYW1vdW50QWRmZXNjcm93VQC5Ejl4leZHDFH6vsyd3IP3Cu2GoWpuZXdfc2hhcmVzQQU=",
+                AddEscrowResult {
+                    owner: addr1,
+                    escrow: addr2,
+                    amount: Quantity::from(100u32),
+                    new_shares: Quantity::from(5u32),
+                },
+            ),
+        ];
+        for (encoded_base64, rr) in tcs {
+            let dec: AddEscrowResult =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("add escrow result should deserialize correctly");
+            assert_eq!(dec, rr, "decoded result should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_consistent_reclaim_escrow_results() {
+        let addr1 = Address::from_pk(&PublicKey::from(
+            "aaafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+        let addr2 = Address::from_pk(&PublicKey::from(
+            "bbbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+
+        let tcs = vec![
+            ("pmVvd25lclUAAAAAAAAAAAAAAAAAAAAAAAAAAABmYW1vdW50QGZlc2Nyb3dVAAAAAAAAAAAAAAAAAAAAAAAAAAAAb2RlYm9uZF9lbmRfdGltZQBwZGVib25kaW5nX3NoYXJlc0BwcmVtYWluaW5nX3NoYXJlc0A=", ReclaimEscrowResult::default()),
+            (
+                "pmVvd25lclUAIHIUNIk/YWwJgUjiz5+Z4+KCbhNmYW1vdW50QWRmZXNjcm93VQC5Ejl4leZHDFH6vsyd3IP3Cu2GoW9kZWJvbmRfZW5kX3RpbWUYKnBkZWJvbmRpbmdfc2hhcmVzQRlwcmVtYWluaW5nX3NoYXJlc0Ey",
+                ReclaimEscrowResult {
+                    owner: addr1,
+                    escrow: addr2,
+                    amount: Quantity::from(100u32),
+                    remaining_shares: Quantity::from(50u32),
+                    debonding_shares: Quantity::from(25u32),
+                    debond_end_time: 42,
+                },
+            ),
+        ];
+        for (encoded_base64, rr) in tcs {
+            let dec: ReclaimEscrowResult =
+                cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                    .expect("reclaim escrow result should deserialize correctly");
+            assert_eq!(dec, rr, "decoded result should match the expected value");
+        }
+    }
+
+    #[test]
+    fn test_consistent_events() {
+        let addr1 = Address::from_pk(&PublicKey::from(
+            "aaafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+        let addr2 = Address::from_pk(&PublicKey::from(
+            "bbbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+        ));
+        let tx_hash = Hash::empty_hash();
+
+        let tcs = vec![
+            (
+                "oWd0eF9oYXNoWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
+                Event::default(),
+            ),
+            (
+                "omZoZWlnaHQYKmd0eF9oYXNoWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
+                Event {
+                    height: 42,
+                    ..Default::default()
+                },
+            ),
+            (
+                "omZoZWlnaHQYKmd0eF9oYXNoWCDGcrjR71btKKuHw2IsURQGm90617j5c3SY0MAezvCWeg==",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    ..Default::default()
+                },
+            ),
+
+            // Transfer.
+            (
+                "o2ZoZWlnaHQYKmd0eF9oYXNoWCDGcrjR71btKKuHw2IsURQGm90617j5c3SY0MAezvCWemh0cmFuc2ZlcqNidG9VALkSOXiV5kcMUfq+zJ3cg/cK7YahZGZyb21VACByFDSJP2FsCYFI4s+fmePigm4TZmFtb3VudEFk",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    transfer: Some(TransferEvent {
+                        from: addr1.clone(),
+                        to: addr2.clone(),
+                        amount: 100u32.into(),
+                    }),
+                    ..Default::default()
+                },
+            ),
+
+            // Burn.
+            (
+                "o2RidXJuomVvd25lclUAIHIUNIk/YWwJgUjiz5+Z4+KCbhNmYW1vdW50QWRmaGVpZ2h0GCpndHhfaGFzaFggxnK40e9W7Sirh8NiLFEUBpvdOte4+XN0mNDAHs7wlno=",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    burn: Some(BurnEvent {
+                        owner: addr1.clone(),
+                        amount: 100u32.into(),
+                    }),
+                    ..Default::default()
+                },
+            ),
+
+            // Escrow.
+            (
+                "o2Zlc2Nyb3ehY2FkZKRlb3duZXJVACByFDSJP2FsCYFI4s+fmePigm4TZmFtb3VudEFkZmVzY3Jvd1UAuRI5eJXmRwxR+r7MndyD9wrthqFqbmV3X3NoYXJlc0EyZmhlaWdodBgqZ3R4X2hhc2hYIMZyuNHvVu0oq4fDYixRFAab3TrXuPlzdJjQwB7O8JZ6",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    escrow: Some(EscrowEvent::Add {
+                        owner: addr1.clone(),
+                        escrow: addr2.clone(),
+                        amount: 100u32.into(),
+                        new_shares: 50u32.into(),
+                    }),
+                    ..Default::default()
+                },
+            ),
+            (
+                "o2Zlc2Nyb3ehZHRha2WjZW93bmVyVQAgchQ0iT9hbAmBSOLPn5nj4oJuE2ZhbW91bnRBZHBkZWJvbmRpbmdfYW1vdW50QRRmaGVpZ2h0GCpndHhfaGFzaFggxnK40e9W7Sirh8NiLFEUBpvdOte4+XN0mNDAHs7wlno=",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    escrow: Some(EscrowEvent::Take {
+                        owner: addr1.clone(),
+                        amount: 100u32.into(),
+                        debonding_amount: 20u32.into()
+                    }),
+                    ..Default::default()
+                },
+            ),
+            (
+                "o2Zlc2Nyb3ehb2RlYm9uZGluZ19zdGFydKZlb3duZXJVACByFDSJP2FsCYFI4s+fmePigm4TZmFtb3VudEFkZmVzY3Jvd1UAuRI5eJXmRwxR+r7MndyD9wrthqFtYWN0aXZlX3NoYXJlc0Eyb2RlYm9uZF9lbmRfdGltZRgqcGRlYm9uZGluZ19zaGFyZXNBGWZoZWlnaHQYKmd0eF9oYXNoWCDGcrjR71btKKuHw2IsURQGm90617j5c3SY0MAezvCWeg==",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    escrow: Some(EscrowEvent::DebondingStart {
+                        owner: addr1.clone(),
+                        escrow: addr2.clone(),
+                        amount: 100u32.into(),
+                        active_shares: 50u32.into(),
+                        debonding_shares: 25u32.into(),
+                        debond_end_time: 42,
+                    }),
+                    ..Default::default()
+                },
+            ),
+            (
+                "o2Zlc2Nyb3ehZ3JlY2xhaW2kZW93bmVyVQAgchQ0iT9hbAmBSOLPn5nj4oJuE2ZhbW91bnRBZGZlc2Nyb3dVALkSOXiV5kcMUfq+zJ3cg/cK7YahZnNoYXJlc0EZZmhlaWdodBgqZ3R4X2hhc2hYIMZyuNHvVu0oq4fDYixRFAab3TrXuPlzdJjQwB7O8JZ6",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    escrow: Some(EscrowEvent::Reclaim {
+                        owner: addr1.clone(),
+                        escrow: addr2.clone(),
+                        amount: 100u32.into(),
+                        shares: 25u32.into(),
+                    }),
+                    ..Default::default()
+                },
+            ),
+
+            // Allowance change.
+            (
+                "o2ZoZWlnaHQYKmd0eF9oYXNoWCDGcrjR71btKKuHw2IsURQGm90617j5c3SY0MAezvCWenBhbGxvd2FuY2VfY2hhbmdlpGVvd25lclUAIHIUNIk/YWwJgUjiz5+Z4+KCbhNpYWxsb3dhbmNlQWRrYmVuZWZpY2lhcnlVALkSOXiV5kcMUfq+zJ3cg/cK7YahbWFtb3VudF9jaGFuZ2VBMg==",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    allowance_change: Some(AllowanceChangeEvent {
+                        owner: addr1.clone(),
+                        beneficiary: addr2.clone(),
+                        allowance: 100u32.into(),
+                        negative: false,
+                        amount_change: 50u32.into(),
+                    }),
+                    ..Default::default()
+                },
+            ),
+            (
+                "o2ZoZWlnaHQYKmd0eF9oYXNoWCDGcrjR71btKKuHw2IsURQGm90617j5c3SY0MAezvCWenBhbGxvd2FuY2VfY2hhbmdlpWVvd25lclUAIHIUNIk/YWwJgUjiz5+Z4+KCbhNobmVnYXRpdmX1aWFsbG93YW5jZUFka2JlbmVmaWNpYXJ5VQC5Ejl4leZHDFH6vsyd3IP3Cu2GoW1hbW91bnRfY2hhbmdlQTI=",
+                Event {
+                    height: 42,
+                    tx_hash,
+                    allowance_change: Some(AllowanceChangeEvent {
+                        owner: addr1.clone(),
+                        beneficiary: addr2.clone(),
+                        allowance: 100u32.into(),
+                        negative: true,
+                        amount_change: 50u32.into(),
+                    }),
+                    ..Default::default()
+                },
+            ),
+        ];
+        for (encoded_base64, ev) in tcs {
+            let dec: Event = cbor::from_slice(&BASE64_STANDARD.decode(encoded_base64).unwrap())
+                .expect("event should deserialize correctly");
+            assert_eq!(dec, ev, "decoded event should match the expected value");
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/state/beacon.rs.html b/rust/src/oasis_core_runtime/consensus/state/beacon.rs.html new file mode 100644 index 0000000000..981ee4736d --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/state/beacon.rs.html @@ -0,0 +1,381 @@ +beacon.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+
//! Beacon state in the consensus layer.
+use anyhow::anyhow;
+
+use crate::{
+    common::key_format::{KeyFormat, KeyFormatAtom},
+    consensus::{
+        beacon::{EpochTime, EpochTimeState},
+        state::StateError,
+    },
+    key_format,
+    storage::mkvs::{FallibleMKVS, ImmutableMKVS},
+};
+
+/// Consensus beacon state wrapper.
+pub struct ImmutableState<'a, T: ImmutableMKVS> {
+    mkvs: &'a T,
+}
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Constructs a new ImmutableMKVS.
+    pub fn new(mkvs: &'a T) -> ImmutableState<'a, T> {
+        ImmutableState { mkvs }
+    }
+}
+
+key_format!(CurrentEpochKeyFmt, 0x40, ());
+key_format!(FutureEpochKeyFmt, 0x41, ());
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Returns the current epoch number.
+    pub fn epoch(&self) -> Result<EpochTime, StateError> {
+        self.epoch_state().map(|es| es.epoch)
+    }
+
+    /// Returns the current epoch state.
+    pub fn epoch_state(&self) -> Result<EpochTimeState, StateError> {
+        match self.mkvs.get(&CurrentEpochKeyFmt(()).encode()) {
+            Ok(Some(b)) => {
+                let state: EpochTimeState =
+                    cbor::from_slice(&b).map_err(|err| StateError::Unavailable(anyhow!(err)))?;
+                Ok(state)
+            }
+            Ok(None) => Ok(EpochTimeState::default()),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    /// Returns the future epoch number.
+    pub fn future_epoch(&self) -> Result<EpochTime, StateError> {
+        self.future_epoch_state().map(|es| es.epoch)
+    }
+
+    /// Returns the future epoch state.
+    pub fn future_epoch_state(&self) -> Result<EpochTimeState, StateError> {
+        match self.mkvs.get(&FutureEpochKeyFmt(()).encode()) {
+            Ok(Some(b)) => {
+                let state: EpochTimeState =
+                    cbor::from_slice(&b).map_err(|err| StateError::Unavailable(anyhow!(err)))?;
+                Ok(state)
+            }
+            Ok(None) => Ok(EpochTimeState::default()),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+}
+
+/// Mutable consensus beacon state wrapper.
+pub struct MutableState;
+
+impl MutableState {
+    /// Set current epoch state.
+    pub fn set_epoch_state<S: FallibleMKVS>(
+        mkvs: &mut S,
+        epoch_state: EpochTimeState,
+    ) -> Result<(), StateError> {
+        mkvs.insert(&CurrentEpochKeyFmt(()).encode(), &cbor::to_vec(epoch_state))?;
+        Ok(())
+    }
+
+    /// Set future epoch state.
+    pub fn set_future_epoch_state<S: FallibleMKVS>(
+        mkvs: &mut S,
+        epoch_state: EpochTimeState,
+    ) -> Result<(), StateError> {
+        mkvs.insert(&FutureEpochKeyFmt(()).encode(), &cbor::to_vec(epoch_state))?;
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::{
+        common::crypto::hash::Hash,
+        storage::mkvs::{
+            interop::{Fixture, ProtocolServer},
+            sync::NoopReadSyncer,
+            Root, RootType, Tree,
+        },
+    };
+
+    use super::*;
+
+    #[test]
+    fn test_mutable_state() {
+        let mut mkvs = Tree::builder()
+            .with_root_type(RootType::State)
+            .build(Box::new(NoopReadSyncer));
+
+        MutableState::set_epoch_state(
+            &mut mkvs,
+            EpochTimeState {
+                epoch: 10,
+                height: 100,
+            },
+        )
+        .unwrap();
+
+        MutableState::set_future_epoch_state(
+            &mut mkvs,
+            EpochTimeState {
+                epoch: 11,
+                height: 110,
+            },
+        )
+        .unwrap();
+
+        let beacon_state = ImmutableState::new(&mkvs);
+
+        // Test current epoch state.
+        let epoch_state = beacon_state
+            .epoch_state()
+            .expect("epoch state query should work");
+        assert_eq!(10u64, epoch_state.epoch, "expected epoch should match");
+        assert_eq!(100i64, epoch_state.height, "expected height should match");
+
+        // Test future epoch state.
+        let epoch_state = beacon_state
+            .future_epoch_state()
+            .expect("future epoch state query should work");
+        assert_eq!(11u64, epoch_state.epoch, "expected epoch should match");
+        assert_eq!(110i64, epoch_state.height, "expected height should match");
+    }
+
+    #[test]
+    fn test_beacon_state_interop() {
+        // Keep in sync with go/consensus/cometbft/apps/beacon/state/interop/interop.go.
+        // If mock consensus state changes, update the root hash bellow.
+        // See protocol server stdout for hash.
+        // To make the hash show up during tests, run "cargo test" as
+        // "cargo test -- --nocapture".
+
+        // Setup protocol server with initialized mock consensus state.
+        let server = ProtocolServer::new(Fixture::ConsensusMock.into());
+        let mock_consensus_root = Root {
+            version: 1,
+            root_type: RootType::State,
+            hash: Hash::from("8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3"),
+            ..Default::default()
+        };
+        let mkvs = Tree::builder()
+            .with_capacity(100_000, 10_000_000)
+            .with_root(mock_consensus_root)
+            .build(server.read_sync());
+        let beacon_state = ImmutableState::new(&mkvs);
+
+        // Test current epoch number.
+        let epoch = beacon_state.epoch().expect("epoch query should work");
+        assert_eq!(42u64, epoch, "expected epoch should match");
+
+        // Test current epoch state.
+        let epoch_state = beacon_state
+            .epoch_state()
+            .expect("epoch state query should work");
+        assert_eq!(42u64, epoch_state.epoch, "expected epoch should match");
+        assert_eq!(13i64, epoch_state.height, "expected height should match");
+
+        // Test future epoch number.
+        let epoch = beacon_state
+            .future_epoch()
+            .expect("future epoch query should work");
+        assert_eq!(43u64, epoch, "expected future epoch should match");
+
+        // Test future epoch state.
+        let epoch_state = beacon_state
+            .future_epoch_state()
+            .expect("future epoch state query should work");
+        assert_eq!(43u64, epoch_state.epoch, "expected epoch should match");
+        assert_eq!(15i64, epoch_state.height, "expected height should match");
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/state/keymanager.rs.html b/rust/src/oasis_core_runtime/consensus/state/keymanager.rs.html new file mode 100644 index 0000000000..e9770857ae --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/state/keymanager.rs.html @@ -0,0 +1,631 @@ +keymanager.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+
//! Key manager state in the consensus layer.
+use anyhow::anyhow;
+
+use crate::{
+    common::{
+        crypto::{hash::Hash, signature::PublicKey},
+        key_format::{KeyFormat, KeyFormatAtom},
+        namespace::Namespace,
+    },
+    consensus::{
+        beacon::EpochTime,
+        keymanager::{
+            SignedEncryptedEphemeralSecret, SignedEncryptedMasterSecret, SignedPolicySGX,
+        },
+        state::StateError,
+    },
+    key_format,
+    storage::mkvs::ImmutableMKVS,
+};
+
+pub mod churp;
+
+/// Consensus key manager state wrapper.
+pub struct ImmutableState<'a, T: ImmutableMKVS> {
+    mkvs: &'a T,
+}
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Constructs a new ImmutableMKVS.
+    pub fn new(mkvs: &'a T) -> ImmutableState<'a, T> {
+        ImmutableState { mkvs }
+    }
+}
+
+key_format!(StatusKeyFmt, 0x70, Hash);
+key_format!(MasterSecretKeyFmt, 0x72, Hash);
+key_format!(EphemeralSecretKeyFmt, 0x73, Hash);
+
+/// Current key manager status.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Decode, cbor::Encode)]
+pub struct Status {
+    /// Runtime ID of the key manager.
+    pub id: Namespace,
+    /// True iff the key manager is done initializing.
+    pub is_initialized: bool,
+    /// True iff the key manager is secure.
+    pub is_secure: bool,
+    /// Generation of the latest master secret.
+    pub generation: u64,
+    /// Epoch of the last master secret rotation.
+    pub rotation_epoch: EpochTime,
+    /// Key manager master secret verification checksum.
+    pub checksum: Vec<u8>,
+    /// List of currently active key manager node IDs.
+    pub nodes: Vec<PublicKey>,
+    /// Key manager policy.
+    pub policy: Option<SignedPolicySGX>,
+    /// Runtime signing key of the key manager.
+    pub rsk: Option<PublicKey>,
+}
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Looks up a specific key manager status by its namespace identifier.
+    pub fn status(&self, id: Namespace) -> Result<Option<Status>, StateError> {
+        let h = Hash::digest_bytes(id.as_ref());
+        match self.mkvs.get(&StatusKeyFmt(h).encode()) {
+            Ok(Some(b)) => Ok(Some(self.decode_status(&b)?)),
+            Ok(None) => Ok(None),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    /// Returns the list of all key manager statuses.
+    pub fn statuses(&self) -> Result<Vec<Status>, StateError> {
+        let mut it = self.mkvs.iter();
+        it.seek(&StatusKeyFmt::default().encode_partial(0));
+
+        let mut result: Vec<Status> = Vec::new();
+
+        while let Some(value) = it
+            .next()
+            .and_then(|(key, value)| StatusKeyFmt::decode(&key).map(|_| value))
+        {
+            result.push(self.decode_status(&value)?)
+        }
+
+        Ok(result)
+    }
+
+    /// Looks up a specific key manager master secret by its namespace identifier.
+    pub fn master_secret(
+        &self,
+        id: Namespace,
+    ) -> Result<Option<SignedEncryptedMasterSecret>, StateError> {
+        let h = Hash::digest_bytes(id.as_ref());
+        match self.mkvs.get(&MasterSecretKeyFmt(h).encode()) {
+            Ok(Some(b)) => Ok(Some(self.decode_master_secret(&b)?)),
+            Ok(None) => Ok(None),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    /// Looks up a specific key manager ephemeral secret by its namespace identifier and epoch.
+    pub fn ephemeral_secret(
+        &self,
+        id: Namespace,
+    ) -> Result<Option<SignedEncryptedEphemeralSecret>, StateError> {
+        let h = Hash::digest_bytes(id.as_ref());
+        match self.mkvs.get(&EphemeralSecretKeyFmt(h).encode()) {
+            Ok(Some(b)) => Ok(Some(self.decode_ephemeral_secret(&b)?)),
+            Ok(None) => Ok(None),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    fn decode_status(&self, data: &[u8]) -> Result<Status, StateError> {
+        cbor::from_slice(data).map_err(|err| StateError::Unavailable(anyhow!(err)))
+    }
+
+    fn decode_master_secret(&self, data: &[u8]) -> Result<SignedEncryptedMasterSecret, StateError> {
+        cbor::from_slice(data).map_err(|err| StateError::Unavailable(anyhow!(err)))
+    }
+
+    fn decode_ephemeral_secret(
+        &self,
+        data: &[u8],
+    ) -> Result<SignedEncryptedEphemeralSecret, StateError> {
+        cbor::from_slice(data).map_err(|err| StateError::Unavailable(anyhow!(err)))
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use std::collections::HashMap;
+
+    use rustc_hex::FromHex;
+
+    use super::*;
+    use crate::{
+        common::{
+            crypto::{
+                signature::{Signature, SignatureBundle},
+                x25519,
+            },
+            sgx::{EnclaveIdentity, MrEnclave, MrSigner},
+        },
+        consensus::keymanager::{
+            EnclavePolicySGX, EncryptedEphemeralSecret, EncryptedSecret, PolicySGX,
+        },
+        storage::mkvs::{
+            interop::{Fixture, ProtocolServer},
+            Root, RootType, Tree,
+        },
+    };
+
+    #[test]
+    fn test_keymanager_secrets_state_interop() {
+        // Keep in sync with go/consensus/cometbft/apps/keymanager/secrets/state/interop/interop.go.
+        // If mock consensus state changes, update the root hash bellow.
+        // See protocol server stdout for hash.
+        // To make the hash show up during tests, run "cargo test" as
+        // "cargo test -- --nocapture".
+
+        // Setup protocol server with initialized mock consensus state.
+        let server = ProtocolServer::new(Fixture::ConsensusMock.into());
+        let mock_consensus_root = Root {
+            version: 1,
+            root_type: RootType::State,
+            hash: Hash::from("8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3"),
+            ..Default::default()
+        };
+        let mkvs = Tree::builder()
+            .with_capacity(100_000, 10_000_000)
+            .with_root(mock_consensus_root)
+            .build(server.read_sync());
+        let keymanager_state = ImmutableState::new(&mkvs);
+
+        // Prepare expected results.
+        let runtime =
+            Namespace::from("8000000000000000000000000000000000000000000000000000000000000000");
+        let keymanager1 =
+            Namespace::from("c000000000000000fffffffffffffffffffffffffffffffffffffffffffffffe");
+        let keymanager2 =
+            Namespace::from("c000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff");
+        let runtime_enclave = EnclaveIdentity {
+            mr_enclave: MrEnclave::from(
+                "18256f783c071521be2da041cd9347b5bdb5a8ef58fb34658571a6e14cf1fcb0",
+            ),
+            mr_signer: MrSigner::from(
+                "e48049d1de0eb333523991671a6c93b97dd65bcf09273d5b6bfe8262dc968ec7",
+            ),
+        };
+        let keymanager_enclave1 = EnclaveIdentity {
+            mr_enclave: MrEnclave::from(
+                "c9a589851b1f35627177fd70378ed778170f737611e4dfbf0b6d25bdff55b474",
+            ),
+            mr_signer: MrSigner::from(
+                "7d310664780931ae103ab30a90171c201af385a72757bb4683578fdebde9adf5",
+            ),
+        };
+        let keymanager_enclave2 = EnclaveIdentity {
+            mr_enclave: MrEnclave::from(
+                "756eaf76f5482c5345808b1eaccdd5c60f864bb2aa2d2b870df00ce435af4e23",
+            ),
+            mr_signer: MrSigner::from(
+                "3597a2ff0743016f28e5d7e129304ee1c43dbdae3dba94e19cee3549038a5a32",
+            ),
+        };
+        let signer1 =
+            PublicKey::from("96533c123a6f4d33c68357109c2eb7c6e6a0f947be3ae1e320d153f561523ff2");
+        let signer2 =
+            PublicKey::from("4b97bfd95e829d5838131492b5c133e66ac6ef0db414c0be6207ec78c12d2b17");
+        let sig1 = Signature::from("eda666cff6e4030200737e0c7707ad4a378aab4cc0455306992c13da2155b97c91b0fde0325a7a6818f2cbf92813cc587723c8c205a7cb5389ca7b21a038b60a");
+        let sig2 = Signature::from("db90d354272e025aa9a5856f32ea4f5d6becb0ff6340f3cb7f9104ac04ef29ed4f9b5c21b7ea82924800b30f94724b40c376414f80780ff8b7b60a34edea9f02");
+        let checksum = "1bff211fae98c88ba82388ae954b88a71d3bbe327e162e9fa711fe7a1b759c3e"
+            .from_hex()
+            .unwrap();
+
+        let expected_statuses = vec![
+            Status {
+                id: keymanager1,
+                is_initialized: false,
+                is_secure: false,
+                generation: 0,
+                rotation_epoch: 0,
+                checksum: vec![],
+                nodes: vec![],
+                policy: None,
+                rsk: None,
+            },
+            Status {
+                id: keymanager2,
+                is_initialized: true,
+                is_secure: true,
+                generation: 0,
+                rotation_epoch: 0,
+                checksum: checksum,
+                nodes: vec![signer1, signer2],
+                policy: Some(SignedPolicySGX {
+                    policy: PolicySGX {
+                        serial: 1,
+                        id: keymanager2,
+                        enclaves: HashMap::from([(
+                            keymanager_enclave1,
+                            EnclavePolicySGX {
+                                may_query: HashMap::from([(runtime, vec![runtime_enclave])]),
+                                may_replicate: vec![keymanager_enclave2],
+                            },
+                        )]),
+                        master_secret_rotation_interval: 0,
+                        max_ephemeral_secret_age: 10,
+                    },
+                    signatures: vec![
+                        SignatureBundle {
+                            public_key: signer1,
+                            signature: sig1,
+                        },
+                        SignatureBundle {
+                            public_key: signer2,
+                            signature: sig2,
+                        },
+                    ],
+                }),
+                rsk: None,
+            },
+        ];
+
+        let rek1 = x25519::PrivateKey::from_test_seed("first rek".to_string());
+        let rek2 = x25519::PrivateKey::from_test_seed("second rek".to_string());
+
+        let expected_secret = SignedEncryptedEphemeralSecret {
+            secret: EncryptedEphemeralSecret {
+                runtime_id: keymanager1,
+                epoch: 1,
+                secret: EncryptedSecret{
+                    checksum: vec![1,2,3,4,5],
+                    pub_key: rek1.public_key(),
+                    ciphertexts: HashMap::from([
+                        (rek1.public_key(), vec![1, 2, 3]),
+                        (rek2.public_key(), vec![4, 5, 6]),
+                    ]),
+                },
+            },
+            signature: Signature::from("4a2d098e02411fdc14d6a36f91bb362fd4f4dbaadb4cbf70e20e038fe1740bc7dde0b20afd25657d6abc916be2b9ed0054d586aedb2b7951c99aab3206b24b02"),
+        };
+
+        // Test statuses.
+        let mut statuses = keymanager_state
+            .statuses()
+            .expect("statuses query should work");
+        statuses.sort_by(|a, b| a.id.partial_cmp(&b.id).unwrap());
+        assert_eq!(statuses, expected_statuses, "invalid statuses");
+
+        // Test status.
+        let status = keymanager_state
+            .status(expected_statuses[1].id)
+            .expect("status query should work")
+            .expect("status query should return a result");
+        assert_eq!(status, expected_statuses[1], "invalid status");
+
+        let id =
+            Namespace::from("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
+        let status = keymanager_state
+            .status(id)
+            .expect("status query should work");
+        assert_eq!(status, None, "invalid status");
+
+        // Test ephemeral secret (happy path, invalid epoch, invalid runtime).
+        let secret = keymanager_state
+            .ephemeral_secret(keymanager1)
+            .expect("ephemeral secret query should work")
+            .expect("ephemeral secret query should return a result");
+        assert_eq!(secret, expected_secret, "invalid ephemeral secret");
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/state/keymanager/churp.rs.html b/rust/src/oasis_core_runtime/consensus/state/keymanager/churp.rs.html new file mode 100644 index 0000000000..c3bd414a69 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/state/keymanager/churp.rs.html @@ -0,0 +1,375 @@ +churp.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+
//! Key manager state in the consensus layer.
+use anyhow::anyhow;
+
+use crate::{
+    common::{
+        crypto::hash::Hash,
+        key_format::{KeyFormat, KeyFormatAtom},
+        namespace::Namespace,
+    },
+    consensus::{keymanager::churp::Status, state::StateError},
+    key_format,
+    storage::mkvs::ImmutableMKVS,
+};
+
+key_format!(StatusKeyFmt, 0x75, (Hash, u8));
+
+/// Consensus CHURP state wrapper.
+pub struct ImmutableState<'a, T: ImmutableMKVS> {
+    mkvs: &'a T,
+}
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Constructs a new ImmutableMKVS.
+    pub fn new(mkvs: &'a T) -> ImmutableState<'a, T> {
+        ImmutableState { mkvs }
+    }
+}
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Looks up a specific key manager status by its namespace identifier.
+    pub fn status(
+        &self,
+        runtime_id: Namespace,
+        churp_id: u8,
+    ) -> Result<Option<Status>, StateError> {
+        let h = Hash::digest_bytes(runtime_id.as_ref());
+        match self.mkvs.get(&StatusKeyFmt((h, churp_id)).encode()) {
+            Ok(Some(b)) => Ok(Some(self.decode_status(&b)?)),
+            Ok(None) => Ok(None),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    fn decode_status(&self, data: &[u8]) -> Result<Status, StateError> {
+        cbor::from_slice(data).map_err(|err| StateError::Unavailable(anyhow!(err)))
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use std::collections::HashMap;
+
+    use super::*;
+    use crate::{
+        common::{
+            crypto::signature::{PublicKey, Signature, SignatureBundle},
+            sgx::{EnclaveIdentity, MrEnclave, MrSigner},
+        },
+        consensus::keymanager::churp::{Application, PolicySGX, SignedPolicySGX, SuiteId},
+        storage::mkvs::{
+            interop::{Fixture, ProtocolServer},
+            Root, RootType, Tree,
+        },
+    };
+
+    #[test]
+    fn test_keymanager_secrets_state_interop() {
+        // Keep in sync with go/consensus/cometbft/apps/keymanager/churp/state/interop/interop.go.
+        // If mock consensus state changes, update the root hash bellow.
+        // See protocol server stdout for hash.
+        // To make the hash show up during tests, run "cargo test" as
+        // "cargo test -- --nocapture".
+
+        // Setup protocol server with initialized mock consensus state.
+        let server = ProtocolServer::new(Fixture::ConsensusMock.into());
+        let mock_consensus_root = Root {
+            version: 1,
+            root_type: RootType::State,
+            hash: Hash::from("8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3"),
+            ..Default::default()
+        };
+        let mkvs = Tree::builder()
+            .with_capacity(100_000, 10_000_000)
+            .with_root(mock_consensus_root)
+            .build(server.read_sync());
+        let state = ImmutableState::new(&mkvs);
+
+        // Prepare expected results.
+        let runtime_id =
+            Namespace::from("8000000000000000000000000000000000000000000000000000000000000000");
+        let enclave1 = EnclaveIdentity {
+            mr_enclave: MrEnclave::from(
+                "c9a589851b1f35627177fd70378ed778170f737611e4dfbf0b6d25bdff55b474",
+            ),
+            mr_signer: MrSigner::from(
+                "7d310664780931ae103ab30a90171c201af385a72757bb4683578fdebde9adf5",
+            ),
+        };
+        let enclave2 = EnclaveIdentity {
+            mr_enclave: MrEnclave::from(
+                "756eaf76f5482c5345808b1eaccdd5c60f864bb2aa2d2b870df00ce435af4e23",
+            ),
+            mr_signer: MrSigner::from(
+                "3597a2ff0743016f28e5d7e129304ee1c43dbdae3dba94e19cee3549038a5a32",
+            ),
+        };
+        let signer1 =
+            PublicKey::from("96533c123a6f4d33c68357109c2eb7c6e6a0f947be3ae1e320d153f561523ff2");
+        let signer2 =
+            PublicKey::from("4b97bfd95e829d5838131492b5c133e66ac6ef0db414c0be6207ec78c12d2b17");
+        let sig1 = Signature::from("eda666cff6e4030200737e0c7707ad4a378aab4cc0455306992c13da2155b97c91b0fde0325a7a6818f2cbf92813cc587723c8c205a7cb5389ca7b21a038b60a");
+        let sig2 = Signature::from("db90d354272e025aa9a5856f32ea4f5d6becb0ff6340f3cb7f9104ac04ef29ed4f9b5c21b7ea82924800b30f94724b40c376414f80780ff8b7b60a34edea9f02");
+        let checksum =
+            Hash::from("1bff211fae98c88ba82388ae954b88a71d3bbe327e162e9fa711fe7a1b759c3e");
+        let committee = vec![signer1, signer2];
+        let mut applications = HashMap::new();
+        applications.insert(
+            signer1,
+            Application {
+                checksum: checksum.clone(),
+                reconstructed: false,
+            },
+        );
+        applications.insert(
+            signer2,
+            Application {
+                checksum: checksum.clone(),
+                reconstructed: true,
+            },
+        );
+        let checksum = Some(checksum);
+        let next_checksum = checksum;
+
+        // Test empty status.
+        let status = Status {
+            ..Default::default()
+        };
+
+        let status = state
+            .status(status.runtime_id, status.id)
+            .expect("status query should work")
+            .expect("status query should return a result");
+        assert_eq!(status, status, "invalid status");
+
+        // Test non-empty status.
+        let status = Status {
+            id: 1,
+            runtime_id,
+            suite_id: SuiteId::NistP384Sha3_384,
+            threshold: 2,
+            extra_shares: 1,
+            handoff_interval: 3,
+            policy: SignedPolicySGX {
+                policy: PolicySGX {
+                    id: 1,
+                    runtime_id,
+                    serial: 6,
+                    may_share: vec![enclave1],
+                    may_join: vec![enclave2],
+                    may_query: HashMap::new(),
+                },
+                signatures: vec![
+                    SignatureBundle {
+                        public_key: signer1,
+                        signature: sig1,
+                    },
+                    SignatureBundle {
+                        public_key: signer2,
+                        signature: sig2,
+                    },
+                ],
+            },
+            handoff: 4,
+            checksum,
+            committee,
+            next_handoff: 5,
+            next_checksum,
+            applications,
+        };
+
+        let status = state
+            .status(status.runtime_id, status.id)
+            .expect("status query should work")
+            .expect("status query should return a result");
+        assert_eq!(status, status, "invalid status");
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/state/mod.rs.html b/rust/src/oasis_core_runtime/consensus/state/mod.rs.html new file mode 100644 index 0000000000..d21fc6c485 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/state/mod.rs.html @@ -0,0 +1,219 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+
//! Consensus state wrappers.
+use std::sync::Arc;
+
+use anyhow::{Error, Result};
+use thiserror::Error;
+
+use crate::{
+    protocol::Protocol,
+    storage::mkvs::{sync::HostReadSyncer, ImmutableMKVS, Root, Tree},
+    types::{self, HostStorageEndpoint},
+};
+
+pub mod beacon;
+pub mod keymanager;
+pub mod registry;
+pub mod roothash;
+pub mod staking;
+
+#[derive(Error, Debug)]
+pub enum StateError {
+    #[error("consensus state: unavailable/corrupted state: {0}")]
+    Unavailable(#[from] Error),
+}
+
+impl From<StateError> for types::Error {
+    fn from(e: StateError) -> Self {
+        Self {
+            module: "consensus".to_string(),
+            code: 1,
+            message: e.to_string(),
+        }
+    }
+}
+
+/// Provides consensus state tree from the host.
+pub struct ConsensusState {
+    // An explicit height field is needed because the relationship between the underlying consensus
+    // height and the corresponding state root is a consensus backend implementation detail.
+    height: u64,
+    mkvs: Tree,
+}
+
+impl ConsensusState {
+    /// Creates a consensus state wrapping the provided tree.
+    pub fn new(height: u64, tree: Tree) -> Self {
+        Self { height, mkvs: tree }
+    }
+
+    /// Creates consensus state using host protocol.
+    pub fn from_protocol(protocol: Arc<Protocol>, height: u64, root: Root) -> Self {
+        let read_syncer = HostReadSyncer::new(protocol, HostStorageEndpoint::Consensus);
+        Self {
+            height,
+            mkvs: Tree::builder()
+                .with_capacity(100_000, 10_000_000)
+                .with_root(root)
+                .build(Box::new(read_syncer)),
+        }
+    }
+
+    /// Consensus layer height that this data is for.
+    pub fn height(&self) -> u64 {
+        self.height
+    }
+}
+
+impl ImmutableMKVS for ConsensusState {
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        self.mkvs.get(key)
+    }
+
+    fn get_proof(&self, key: &[u8]) -> Result<Option<crate::storage::mkvs::sync::Proof>> {
+        self.mkvs.get_proof(key)
+    }
+
+    fn prefetch_prefixes(
+        &self,
+        prefixes: &[crate::storage::mkvs::Prefix],
+        limit: u16,
+    ) -> Result<()> {
+        self.mkvs.prefetch_prefixes(prefixes, limit)
+    }
+
+    fn iter(&self) -> Box<dyn crate::storage::mkvs::Iterator + '_> {
+        Box::new(self.mkvs.iter())
+    }
+}
+
+impl ImmutableMKVS for &ConsensusState {
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        self.mkvs.get(key)
+    }
+
+    fn get_proof(&self, key: &[u8]) -> Result<Option<crate::storage::mkvs::sync::Proof>> {
+        self.mkvs.get_proof(key)
+    }
+
+    fn prefetch_prefixes(
+        &self,
+        prefixes: &[crate::storage::mkvs::Prefix],
+        limit: u16,
+    ) -> Result<()> {
+        self.mkvs.prefetch_prefixes(prefixes, limit)
+    }
+
+    fn iter(&self) -> Box<dyn crate::storage::mkvs::Iterator + '_> {
+        Box::new(self.mkvs.iter())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/state/registry.rs.html b/rust/src/oasis_core_runtime/consensus/state/registry.rs.html new file mode 100644 index 0000000000..dd8147f523 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/state/registry.rs.html @@ -0,0 +1,629 @@ +registry.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+
//! Registry state in the consensus layer.
+use anyhow::anyhow;
+
+use crate::{
+    common::{
+        crypto::{
+            hash::Hash,
+            signature::{MultiSigned, PublicKey},
+        },
+        key_format::{KeyFormat, KeyFormatAtom},
+        namespace::Namespace,
+    },
+    consensus::{
+        registry::{Node, Runtime},
+        state::StateError,
+    },
+    key_format,
+    storage::mkvs::ImmutableMKVS,
+};
+
+/// Consensus registry state wrapper.
+pub struct ImmutableState<'a, T: ImmutableMKVS> {
+    mkvs: &'a T,
+}
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Constructs a new ImmutableMKVS.
+    pub fn new(mkvs: &'a T) -> ImmutableState<'a, T> {
+        ImmutableState { mkvs }
+    }
+}
+
+key_format!(SignedNodeKeyFmt, 0x11, Hash);
+key_format!(RuntimeKeyFmt, 0x13, Hash);
+key_format!(SuspendedRuntimeKeyFmt, 0x18, Hash);
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    fn decode_node(&self, data: &[u8]) -> Result<Node, StateError> {
+        let signed: MultiSigned =
+            cbor::from_slice(data).map_err(|err| StateError::Unavailable(anyhow!(err)))?;
+        // The signed blob is transported as-is so we need to use non-strict decoding.
+        cbor::from_slice_non_strict(&signed.blob)
+            .map_err(|err| StateError::Unavailable(anyhow!(err)))
+    }
+
+    /// Looks up a specific node by its identifier.
+    pub fn node(&self, id: &PublicKey) -> Result<Option<Node>, StateError> {
+        let h = Hash::digest_bytes(id.as_ref());
+        match self.mkvs.get(&SignedNodeKeyFmt(h).encode()) {
+            Ok(Some(b)) => Ok(Some(self.decode_node(&b)?)),
+            Ok(None) => Ok(None),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    /// Returns the list of all registered nodes.
+    pub fn nodes(&self) -> Result<Vec<Node>, StateError> {
+        let mut it = self.mkvs.iter();
+        it.seek(&SignedNodeKeyFmt::default().encode_partial(0));
+
+        let mut result: Vec<Node> = Vec::new();
+
+        while let Some(value) = it
+            .next()
+            .and_then(|(key, value)| SignedNodeKeyFmt::decode(&key).map(|_| value))
+        {
+            result.push(self.decode_node(&value)?)
+        }
+
+        Ok(result)
+    }
+
+    fn decode_runtime(&self, data: &[u8]) -> Result<Runtime, StateError> {
+        cbor::from_slice(data).map_err(|err| StateError::Unavailable(anyhow!(err)))
+    }
+
+    /// Looks up a specific runtime by its identifier.
+    ///
+    /// # Note
+    ///
+    /// This includes both non-suspended and suspended runtimes.
+    pub fn runtime(&self, id: &Namespace) -> Result<Option<Runtime>, StateError> {
+        let h = Hash::digest_bytes(id.as_ref());
+
+        // Try non-suspended first.
+        match self.mkvs.get(&RuntimeKeyFmt(h).encode()) {
+            Ok(Some(b)) => Ok(Some(self.decode_runtime(&b)?)),
+            Ok(None) => {
+                // Also try suspended.
+                match self.mkvs.get(&SuspendedRuntimeKeyFmt(h).encode()) {
+                    Ok(Some(b)) => Ok(Some(self.decode_runtime(&b)?)),
+                    Ok(None) => Ok(None),
+                    Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+                }
+            }
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use std::collections::BTreeMap;
+
+    use crate::{
+        common::crypto::signature,
+        consensus::registry::{
+            AnyNodeRuntimeAdmissionPolicy, Capabilities, CapabilityTEE, ConsensusInfo,
+            EntityWhitelistRoleAdmissionPolicy, NodeRuntime, P2PInfo, PerRoleAdmissionPolicy,
+            RolesMask, RuntimeAdmissionPolicy, RuntimeKind, TEEHardware, TLSInfo, VRFInfo,
+            VersionInfo,
+        },
+        storage::mkvs::{
+            interop::{Fixture, ProtocolServer},
+            Root, RootType, Tree,
+        },
+        Version,
+    };
+
+    use super::*;
+
+    #[test]
+    fn test_registry_state_interop() {
+        // Keep in sync with go/consensus/cometbft/apps/registry/state/interop/interop.go.
+        // If mock consensus state changes, update the root hash bellow.
+        // See protocol server stdout for hash.
+        // To make the hash show up during tests, run "cargo test" as
+        // "cargo test -- --nocapture".
+
+        // Setup protocol server with initialized mock consensus state.
+        let server = ProtocolServer::new(Fixture::ConsensusMock.into());
+        let mock_consensus_root = Root {
+            version: 1,
+            root_type: RootType::State,
+            hash: Hash::from("8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3"),
+            ..Default::default()
+        };
+        let mkvs = Tree::builder()
+            .with_capacity(100_000, 10_000_000)
+            .with_root(mock_consensus_root)
+            .build(server.read_sync());
+        let registry_state = ImmutableState::new(&mkvs);
+
+        // Test get nodes.
+        let nodes = registry_state.nodes().expect("nodes query should work");
+        assert_eq!(
+            nodes.len(),
+            2,
+            "expected number of nodes should be returned"
+        );
+
+        let expected_nodes = vec![
+                Node{
+                    v: 3,
+                    id: signature::PublicKey::from("43e5aaee54c768867718837ef4f6a6161e0615da0fcf8da394e5c8b7a0d54c18"),
+                    entity_id: signature::PublicKey::from("761950dfe65936f6e9d06a0124bc930f7d5b1812ceefdfb2cae0ef5841291531"),
+                    expiration: 32,
+                    ..Default::default()
+                },
+                Node{
+                    v: 3,
+                    id: signature::PublicKey::from("f43c3559658f76b85d0630f56dc75d603807ac60be0ca3aada66799289066758"),
+                    entity_id: signature::PublicKey::from("761950dfe65936f6e9d06a0124bc930f7d5b1812ceefdfb2cae0ef5841291531"),
+                    expiration: 32,
+                    tls: TLSInfo{
+                        pub_key: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"),
+                        ..Default::default()
+                    },
+                    p2p: P2PInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3"),
+                        addresses: Some(Vec::new()),
+                    },
+                    consensus: ConsensusInfo{
+                        id: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4"),
+                        addresses: Some(Vec::new()),
+                    },
+                    vrf: VRFInfo{
+                        id: PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5"),
+                    },
+                    runtimes: Some(vec![
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000010"),
+                            version: Version::from(321),
+                            ..Default::default()
+                        },
+                        NodeRuntime{
+                            id: Namespace::from("8000000000000000000000000000000000000000000000000000000000000011"),
+                            version: Version::from(123),
+                            capabilities: Capabilities{
+                               tee: Some(CapabilityTEE{
+                                   hardware: TEEHardware::TEEHardwareIntelSGX,
+                                    rak: signature::PublicKey::from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8"),
+                                    attestation: vec![0, 1,2,3,4,5],
+                                    ..Default::default()
+                               }),
+                            },
+                            extra_info: Some(vec![5,3,2,1]),
+                        },
+                    ]),
+                    ..Default::default()
+                },
+            ];
+        assert_eq!(nodes, expected_nodes,);
+
+        let node = registry_state
+            .node(&expected_nodes.get(1).unwrap().id)
+            .expect("node query should work");
+        assert_eq!(node, Some(expected_nodes.get(1).unwrap().clone()));
+
+        let node = registry_state
+            .node(&signature::PublicKey::from(
+                "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+            ))
+            .expect("node query should work");
+        assert_eq!(node, None);
+
+        let expected_runtimes = vec![
+            Runtime {
+                v: 3,
+                id: Namespace::from(
+                    "8000000000000000000000000000000000000000000000000000000000000010",
+                ),
+                entity_id: signature::PublicKey::from(
+                    "761950dfe65936f6e9d06a0124bc930f7d5b1812ceefdfb2cae0ef5841291531",
+                ),
+                kind: RuntimeKind::KindCompute,
+                tee_hardware: TEEHardware::TEEHardwareInvalid,
+                admission_policy: RuntimeAdmissionPolicy {
+                    any_node: Some(AnyNodeRuntimeAdmissionPolicy {}),
+                    ..Default::default()
+                },
+                deployments: vec![
+                    VersionInfo {
+                        version: Version::from(321),
+                        valid_from: 42,
+                        ..Default::default()
+                    },
+                    VersionInfo {
+                        version: Version::from(320),
+                        valid_from: 10,
+                        ..Default::default()
+                    },
+                ],
+                ..Default::default()
+            },
+            Runtime {
+                v: 3,
+                id: Namespace::from(
+                    "8000000000000000000000000000000000000000000000000000000000000011",
+                ),
+                entity_id: signature::PublicKey::from(
+                    "761950dfe65936f6e9d06a0124bc930f7d5b1812ceefdfb2cae0ef5841291531",
+                ),
+                kind: RuntimeKind::KindCompute,
+                tee_hardware: TEEHardware::TEEHardwareIntelSGX,
+                admission_policy: RuntimeAdmissionPolicy {
+                    any_node: Some(AnyNodeRuntimeAdmissionPolicy {}),
+                    ..Default::default()
+                },
+                deployments: vec![
+                    VersionInfo {
+                        version: Version::from(123),
+                        valid_from: 42,
+                        tee: vec![1, 2, 3, 4, 5],
+                        bundle_checksum: vec![0x5; 32],
+                    },
+                    VersionInfo {
+                        version: Version::from(120),
+                        valid_from: 10,
+                        tee: vec![5, 4, 3, 2, 1],
+                        ..Default::default()
+                    },
+                ],
+                ..Default::default()
+            },
+            Runtime {
+                v: 3,
+                id: Namespace::from(
+                    "8000000000000000000000000000000000000000000000000000000000000012",
+                ),
+                entity_id: signature::PublicKey::from(
+                    "761950dfe65936f6e9d06a0124bc930f7d5b1812ceefdfb2cae0ef5841291531",
+                ),
+                kind: RuntimeKind::KindCompute,
+                tee_hardware: TEEHardware::TEEHardwareIntelSGX,
+                admission_policy: RuntimeAdmissionPolicy {
+                    per_role: BTreeMap::from([(
+                        RolesMask::ROLE_OBSERVER,
+                        PerRoleAdmissionPolicy {
+                            entity_whitelist: Some(EntityWhitelistRoleAdmissionPolicy {
+                                entities: BTreeMap::new(),
+                            }),
+                        },
+                    )]),
+                    ..Default::default()
+                },
+                deployments: vec![VersionInfo {
+                    version: Version::from(123),
+                    valid_from: 42,
+                    tee: vec![1, 2, 3, 4, 5],
+                    bundle_checksum: vec![0x5; 32],
+                }],
+                ..Default::default()
+            },
+        ];
+
+        for rt in expected_runtimes {
+            let ext_rt = registry_state
+                .runtime(&rt.id)
+                .expect("runtime query should work");
+            assert_eq!(ext_rt, Some(rt));
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/state/roothash.rs.html b/rust/src/oasis_core_runtime/consensus/state/roothash.rs.html new file mode 100644 index 0000000000..0899e23b0d --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/state/roothash.rs.html @@ -0,0 +1,385 @@ +roothash.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+
//! Roothash state in the consensus layer.
+use std::{collections::BTreeMap, convert::TryInto};
+
+use anyhow::anyhow;
+
+use crate::{
+    common::{
+        crypto::hash::Hash,
+        key_format::{KeyFormat, KeyFormatAtom},
+        namespace::Namespace,
+    },
+    consensus::{
+        roothash::{Error, RoundResults, RoundRoots},
+        state::StateError,
+    },
+    key_format,
+    storage::mkvs::ImmutableMKVS,
+};
+
+/// Consensus roothash state wrapper.
+pub struct ImmutableState<'a, T: ImmutableMKVS> {
+    mkvs: &'a T,
+}
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Constructs a new ImmutableMKVS.
+    pub fn new(mkvs: &'a T) -> ImmutableState<'a, T> {
+        ImmutableState { mkvs }
+    }
+}
+
+key_format!(StateRootKeyFmt, 0x25, Hash);
+key_format!(LastRoundResultsKeyFmt, 0x27, Hash);
+key_format!(PastRootsKeyFmt, 0x2a, (Hash, u64));
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Returns the state root for a specific runtime.
+    pub fn state_root(&self, id: Namespace) -> Result<Hash, Error> {
+        match self
+            .mkvs
+            .get(&StateRootKeyFmt(Hash::digest_bytes(id.as_ref())).encode())
+        {
+            Ok(Some(b)) => Ok(Hash(b.try_into().map_err(|_| -> Error {
+                StateError::Unavailable(anyhow!("corrupted hash value")).into()
+            })?)),
+            Ok(None) => Err(Error::InvalidRuntime(id)),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err)).into()),
+        }
+    }
+
+    /// Returns the last round results for a specific runtime.
+    pub fn last_round_results(&self, id: Namespace) -> Result<RoundResults, Error> {
+        match self
+            .mkvs
+            .get(&LastRoundResultsKeyFmt(Hash::digest_bytes(id.as_ref())).encode())
+        {
+            Ok(Some(b)) => {
+                cbor::from_slice(&b).map_err(|err| StateError::Unavailable(anyhow!(err)).into())
+            }
+            Ok(None) => Err(Error::InvalidRuntime(id)),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err)).into()),
+        }
+    }
+
+    // Returns the state and I/O roots for the given runtime and round.
+    pub fn round_roots(&self, id: Namespace, round: u64) -> Result<Option<RoundRoots>, StateError> {
+        match self
+            .mkvs
+            .get(&PastRootsKeyFmt((Hash::digest_bytes(id.as_ref()), round)).encode())
+        {
+            Ok(Some(b)) => {
+                cbor::from_slice(&b).map_err(|err| StateError::Unavailable(anyhow!(err)))
+            }
+            Ok(None) => Ok(None),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    // Returns all past round roots for the given runtime.
+    pub fn past_round_roots(&self, id: Namespace) -> Result<BTreeMap<u64, RoundRoots>, StateError> {
+        let h = Hash::digest_bytes(id.as_ref());
+        let mut it = self.mkvs.iter();
+        it.seek(&PastRootsKeyFmt((h, Default::default())).encode_partial(1));
+
+        let mut result: BTreeMap<u64, RoundRoots> = BTreeMap::new();
+
+        for (round, value) in it.map_while(|(key, value)| {
+            PastRootsKeyFmt::decode(&key)
+                .filter(|PastRootsKeyFmt((ns, _))| ns == &h)
+                .map(|PastRootsKeyFmt((_, round))| (round, value))
+        }) {
+            result.insert(
+                round,
+                cbor::from_slice(&value).map_err(|err| StateError::Unavailable(anyhow!(err)))?,
+            );
+        }
+
+        Ok(result)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::storage::mkvs::{
+        interop::{Fixture, ProtocolServer},
+        Root, RootType, Tree,
+    };
+
+    use super::*;
+    #[test]
+    fn test_roothash_state_interop() {
+        // Keep in sync with go/consensus/cometbft/apps/roothash/state/interop/interop.go.
+        // If mock consensus state changes, update the root hash bellow.
+        // See protocol server stdout for hash.
+        // To make the hash show up during tests, run "cargo test" as
+        // "cargo test -- --nocapture".
+
+        // Setup protocol server with initialized mock consensus state.
+        let server = ProtocolServer::new(Fixture::ConsensusMock.into());
+        let mock_consensus_root = Root {
+            version: 1,
+            root_type: RootType::State,
+            hash: Hash::from("8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3"),
+            ..Default::default()
+        };
+        let mkvs = Tree::builder()
+            .with_capacity(100_000, 10_000_000)
+            .with_root(mock_consensus_root)
+            .build(server.read_sync());
+        let state = ImmutableState::new(&mkvs);
+
+        let runtime_id =
+            Namespace::from("8000000000000000000000000000000000000000000000000000000000000010");
+
+        // Test fetching past round roots.
+        let past_round_roots = state
+            .past_round_roots(runtime_id)
+            .expect("past round roots query should work");
+        assert_eq!(
+            10,
+            past_round_roots.len(),
+            "expected number of roots should match"
+        );
+        past_round_roots.iter().for_each(|(round, roots)| {
+            assert_eq!(
+                RoundRoots {
+                    state_root: Hash::digest_bytes(format!("state {}", round).as_bytes()),
+                    io_root: Hash::digest_bytes(format!("io {}", round).as_bytes())
+                },
+                *roots,
+                "expected roots should match"
+            );
+        });
+
+        // Test fetching latest round roots.
+        let round_roots = state
+            .round_roots(runtime_id, 100)
+            .expect("round roots query should work");
+        assert_eq!(None, round_roots, "round root should be missing");
+
+        let round_roots = state
+            .round_roots(runtime_id, 10)
+            .expect("round roots query should work");
+        assert_eq!(
+            Some(RoundRoots {
+                state_root: Hash::digest_bytes(format!("state {}", 10).as_bytes()),
+                io_root: Hash::digest_bytes(format!("io {}", 10).as_bytes())
+            }),
+            round_roots,
+            "round root should be missing"
+        );
+
+        // Test non-existing runtime.
+        let runtime_id =
+            Namespace::from("8000000000000000000000000000000000000000000000000000000000000000");
+        let past_round_roots = state
+            .past_round_roots(runtime_id)
+            .expect("past round roots query should work");
+        assert_eq!(
+            0,
+            past_round_roots.len(),
+            "there should be no roots for non-existing runtime"
+        );
+        let round_roots = state
+            .round_roots(runtime_id, 10)
+            .expect("round roots query should work");
+        assert_eq!(
+            None, round_roots,
+            "round root should be missing for non-existing runtime"
+        )
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/state/staking.rs.html b/rust/src/oasis_core_runtime/consensus/state/staking.rs.html new file mode 100644 index 0000000000..24895b919b --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/state/staking.rs.html @@ -0,0 +1,983 @@ +staking.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+
//! Staking state in the consensus layer.
+use std::collections::BTreeMap;
+
+use anyhow::anyhow;
+
+use crate::{
+    common::{
+        key_format::{KeyFormat, KeyFormatAtom},
+        quantity::Quantity,
+    },
+    consensus::{
+        address::Address,
+        beacon::EpochTime,
+        staking::{Account, DebondingDelegation, Delegation},
+        state::StateError,
+    },
+    key_format,
+    storage::mkvs::ImmutableMKVS,
+};
+
+/// Consensus staking state wrapper.
+pub struct ImmutableState<'a, T: ImmutableMKVS> {
+    mkvs: &'a T,
+}
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Constructs a new ImmutableMKVS.
+    pub fn new(mkvs: &'a T) -> ImmutableState<'a, T> {
+        ImmutableState { mkvs }
+    }
+}
+
+key_format!(AccountsKeyFmt, 0x50, Address);
+key_format!(TotalSupplyKeyFmt, 0x51, ());
+key_format!(CommonPoolKeyFmt, 0x52, ());
+key_format!(DelegationKeyFmt, 0x53, (Address, Address));
+key_format!(
+    DebondingDelegationKeyFmt,
+    0x54,
+    (Address, Address, EpochTime)
+);
+key_format!(LastBlockFees, 0x57, ());
+key_format!(GovernanceDepositsKeyFmt, 0x59, ());
+
+impl<'a, T: ImmutableMKVS> ImmutableState<'a, T> {
+    /// Returns the staking account for the given account address.
+    pub fn account(&self, address: Address) -> Result<Account, StateError> {
+        match self.mkvs.get(&AccountsKeyFmt(address).encode()) {
+            Ok(Some(b)) => {
+                cbor::from_slice(&b).map_err(|err| StateError::Unavailable(anyhow!(err)))
+            }
+            Ok(None) => Ok(Account::default()),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    fn load_stored_balance<K: KeyFormat>(&self, key_format: K) -> Result<Quantity, StateError> {
+        match self.mkvs.get(&key_format.encode()) {
+            Ok(Some(b)) => {
+                cbor::from_slice(&b).map_err(|err| StateError::Unavailable(anyhow!(err)))
+            }
+            Ok(None) => Ok(Quantity::default()),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    /// Returns the total supply.
+    pub fn total_supply(&self) -> Result<Quantity, StateError> {
+        self.load_stored_balance(TotalSupplyKeyFmt(()))
+    }
+
+    /// Returns the balance of the global common pool.
+    pub fn common_pool(&self) -> Result<Quantity, StateError> {
+        self.load_stored_balance(CommonPoolKeyFmt(()))
+    }
+
+    /// Returns the last block fees balance.
+    pub fn last_block_fees(&self) -> Result<Quantity, StateError> {
+        self.load_stored_balance(LastBlockFees(()))
+    }
+
+    /// Returns the governance deposits balance.
+    pub fn governance_deposits(&self) -> Result<Quantity, StateError> {
+        self.load_stored_balance(GovernanceDepositsKeyFmt(()))
+    }
+
+    /// Returns the non-empty addresses from the staking ledger.
+    pub fn addresses(&self) -> Result<Vec<Address>, StateError> {
+        let mut it = self.mkvs.iter();
+        it.seek(&AccountsKeyFmt::default().encode_partial(0));
+
+        Ok(it
+            .map_while(|(key, _)| AccountsKeyFmt::decode(&key))
+            .map(|AccountsKeyFmt(addr)| addr)
+            .collect())
+    }
+
+    /// Returns the delegation.
+    pub fn delegation(
+        &self,
+        delegator_addr: Address,
+        escrow_addr: Address,
+    ) -> Result<Delegation, StateError> {
+        match self
+            .mkvs
+            .get(&DelegationKeyFmt((escrow_addr, delegator_addr)).encode())
+        {
+            Ok(Some(b)) => {
+                cbor::from_slice(&b).map_err(|err| StateError::Unavailable(anyhow!(err)))
+            }
+            Ok(None) => Ok(Delegation::default()),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    /// Returns all active delegations.
+    pub fn delegations(
+        &self,
+    ) -> Result<BTreeMap<Address, BTreeMap<Address, Delegation>>, StateError> {
+        let mut it = self.mkvs.iter();
+        it.seek(&DelegationKeyFmt::default().encode_partial(0));
+
+        let mut result: BTreeMap<Address, BTreeMap<Address, Delegation>> = BTreeMap::new();
+
+        while let Some((DelegationKeyFmt((escrow_addr, delegator_addr)), value)) = it
+            .next()
+            .and_then(|(key, value)| DelegationKeyFmt::decode(&key).zip(value.into()))
+        {
+            if !result.contains_key(&escrow_addr) {
+                result.insert(escrow_addr.clone(), BTreeMap::new());
+            }
+            let inner = result.get_mut(&escrow_addr).expect("inner map must exist");
+
+            inner.insert(
+                delegator_addr,
+                cbor::from_slice(&value).map_err(|err| StateError::Unavailable(anyhow!(err)))?,
+            );
+        }
+
+        Ok(result)
+    }
+
+    /// Returns the debonding delegation.
+    pub fn debonding_delegation(
+        &self,
+        delegator_addr: Address,
+        escrow_addr: Address,
+        epoch: EpochTime,
+    ) -> Result<DebondingDelegation, StateError> {
+        match self
+            .mkvs
+            .get(&DebondingDelegationKeyFmt((delegator_addr, escrow_addr, epoch)).encode())
+        {
+            Ok(Some(b)) => {
+                cbor::from_slice(&b).map_err(|err| StateError::Unavailable(anyhow!(err)))
+            }
+            Ok(None) => Ok(DebondingDelegation::default()),
+            Err(err) => Err(StateError::Unavailable(anyhow!(err))),
+        }
+    }
+
+    /// Returns all debonding delegations.
+    pub fn debonding_delegations(
+        &self,
+    ) -> Result<BTreeMap<Address, BTreeMap<Address, Vec<DebondingDelegation>>>, StateError> {
+        let mut it = self.mkvs.iter();
+        it.seek(&DebondingDelegationKeyFmt::default().encode_partial(0));
+
+        let mut result: BTreeMap<Address, BTreeMap<Address, Vec<DebondingDelegation>>> =
+            BTreeMap::new();
+
+        while let Some((DebondingDelegationKeyFmt((delegator_addr, escrow_addr, _)), value)) = it
+            .next()
+            .and_then(|(key, value)| DebondingDelegationKeyFmt::decode(&key).zip(value.into()))
+        {
+            if !result.contains_key(&escrow_addr) {
+                result.insert(escrow_addr.clone(), BTreeMap::new());
+            }
+            let inner = result.get_mut(&escrow_addr).expect("inner map must exist");
+            if !inner.contains_key(&delegator_addr) {
+                inner.insert(delegator_addr.clone(), Vec::new());
+            }
+            let in_inner = inner
+                .get_mut(&delegator_addr)
+                .expect("inner vec in inner map must exist");
+            in_inner.push(
+                cbor::from_slice(&value).map_err(|err| StateError::Unavailable(anyhow!(err)))?,
+            );
+        }
+
+        Ok(result)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::{
+        common::crypto::{hash::Hash, signature::PublicKey},
+        consensus::staking::{EscrowAccount, GeneralAccount, SharePool},
+        storage::mkvs::{
+            interop::{Fixture, ProtocolServer},
+            Root, RootType, Tree,
+        },
+    };
+
+    use super::*;
+
+    #[test]
+    fn test_staking_state_interop() {
+        // Keep in sync with go/consensus/cometbft/apps/staking/state/interop/interop.go.
+        // If mock consensus state changes, update the root hash bellow.
+        // See protocol server stdout for hash.
+        // To make the hash show up during tests, run "cargo test" as
+        // "cargo test -- --nocapture".
+
+        // Setup protocol server with initialized mock consensus state.
+        let server = ProtocolServer::new(Fixture::ConsensusMock.into());
+        let mock_consensus_root = Root {
+            version: 1,
+            root_type: RootType::State,
+            hash: Hash::from("8e39bf193f8a954ab8f8d7cb6388c591fd0785ea060bbd8e3752e266b54499d3"),
+            ..Default::default()
+        };
+        let mkvs = Tree::builder()
+            .with_capacity(100_000, 10_000_000)
+            .with_root(mock_consensus_root)
+            .build(server.read_sync());
+        let staking_state = ImmutableState::new(&mkvs);
+
+        let pk =
+            PublicKey::from("7e57baaad01fffffffffffffffffffffffffffffffffffffffffffffffffffff");
+        let pk2 =
+            PublicKey::from("7e57baaad02fffffffffffffffffffffffffffffffffffffffffffffffffffff");
+        let pk3 =
+            PublicKey::from("7e57baaad03fffffffffffffffffffffffffffffffffffffffffffffffffffff");
+        let expected_addrs = vec![
+            Address::from_pk(&pk),
+            Address::from_pk(&pk2),
+            Address::from_pk(&pk3),
+        ];
+
+        // Test all addresses and accounts.
+        let addrs = staking_state
+            .addresses()
+            .expect("addresses query should work");
+        assert_eq!(expected_addrs, addrs, "expected addresses should match");
+
+        let mut accounts = Vec::new();
+        for addr in &addrs {
+            let acc = staking_state
+                .account(addr.clone())
+                .expect("accounts query should work");
+            accounts.push(acc);
+        }
+
+        let expected_accounts = vec![
+            Account {
+                general: GeneralAccount {
+                    balance: Quantity::from(23u32),
+                    nonce: 13,
+                    ..Default::default()
+                },
+                escrow: EscrowAccount {
+                    active: SharePool {
+                        balance: Quantity::from(100u32),
+                        total_shares: Quantity::from(10u32),
+                    },
+                    debonding: SharePool {
+                        balance: Quantity::from(5u32),
+                        total_shares: Quantity::from(5u32),
+                    },
+                    ..Default::default()
+                },
+                ..Default::default()
+            },
+            Account {
+                general: GeneralAccount {
+                    balance: Quantity::from(23u32),
+                    nonce: 1,
+                    ..Default::default()
+                },
+                escrow: EscrowAccount {
+                    active: SharePool {
+                        balance: Quantity::from(500u32),
+                        total_shares: Quantity::from(5u32),
+                    },
+                    ..Default::default()
+                },
+                ..Default::default()
+            },
+            Account {
+                general: GeneralAccount {
+                    balance: Quantity::from(113u32),
+                    nonce: 17,
+                    ..Default::default()
+                },
+                escrow: EscrowAccount {
+                    active: SharePool {
+                        balance: Quantity::from(400u32),
+                        total_shares: Quantity::from(35u32),
+                    },
+                    ..Default::default()
+                },
+                ..Default::default()
+            },
+        ];
+        assert_eq!(
+            expected_accounts, accounts,
+            "expected addresses should match"
+        );
+
+        // Test all delegations.
+        let delegations = staking_state
+            .delegations()
+            .expect("delegations query should work");
+        for (escrow_addr, dels) in &delegations {
+            for (delegator_addr, del) in dels.clone() {
+                let d = staking_state
+                    .delegation(delegator_addr, escrow_addr.clone())
+                    .expect("delegation query should work");
+                assert_eq!(del, d, "delegation should match")
+            }
+        }
+
+        let mut expected_delegations: BTreeMap<Address, BTreeMap<Address, Delegation>> =
+            BTreeMap::new();
+        // Delegations to address[0].
+        expected_delegations.insert(
+            addrs[0].clone(),
+            [
+                (
+                    addrs[0].clone(),
+                    Delegation {
+                        shares: Quantity::from(5u32),
+                    },
+                ),
+                (
+                    addrs[1].clone(),
+                    Delegation {
+                        shares: Quantity::from(5u32),
+                    },
+                ),
+            ]
+            .iter()
+            .cloned()
+            .collect(),
+        );
+        // Delegations to address[1].
+        expected_delegations.insert(
+            addrs[1].clone(),
+            [(
+                addrs[2].clone(),
+                Delegation {
+                    shares: Quantity::from(5u32),
+                },
+            )]
+            .iter()
+            .cloned()
+            .collect(),
+        );
+        // Delegations to address[2].
+        expected_delegations.insert(
+            addrs[2].clone(),
+            [
+                (
+                    addrs[0].clone(),
+                    Delegation {
+                        shares: Quantity::from(20u32),
+                    },
+                ),
+                (
+                    addrs[1].clone(),
+                    Delegation {
+                        shares: Quantity::from(6u32),
+                    },
+                ),
+                (
+                    addrs[2].clone(),
+                    Delegation {
+                        shares: Quantity::from(10u32),
+                    },
+                ),
+            ]
+            .iter()
+            .cloned()
+            .collect(),
+        );
+        assert_eq!(
+            expected_delegations, delegations,
+            "expected delegations should match"
+        );
+
+        // Test all debonding delegations.
+        let debonding_delegations = staking_state
+            .debonding_delegations()
+            .expect("debonding delegations query should work");
+        for (escrow_addr, debss) in &debonding_delegations {
+            for (delegator_addr, debs) in debss {
+                for deb in debs {
+                    let d = staking_state
+                        .debonding_delegation(
+                            delegator_addr.clone(),
+                            escrow_addr.clone(),
+                            deb.debond_end_time,
+                        )
+                        .expect("debonding delegation query should work");
+                    assert_eq!(deb.clone(), d, "debonding delegation should match")
+                }
+            }
+        }
+        let mut expected_debonding: BTreeMap<Address, BTreeMap<Address, Vec<DebondingDelegation>>> =
+            BTreeMap::new();
+        // Debonding delegations in address[0].
+        expected_debonding.insert(
+            addrs[0].clone(),
+            [
+                (
+                    addrs[0].clone(),
+                    vec![DebondingDelegation {
+                        shares: Quantity::from(1u32),
+                        debond_end_time: 33,
+                    }],
+                ),
+                (
+                    addrs[1].clone(),
+                    vec![
+                        DebondingDelegation {
+                            shares: Quantity::from(1u32),
+                            debond_end_time: 15,
+                        },
+                        DebondingDelegation {
+                            shares: Quantity::from(1u32),
+                            debond_end_time: 21,
+                        },
+                    ],
+                ),
+                (
+                    addrs[2].clone(),
+                    vec![DebondingDelegation {
+                        shares: Quantity::from(2u32),
+                        debond_end_time: 100,
+                    }],
+                ),
+            ]
+            .iter()
+            .cloned()
+            .collect(),
+        );
+        assert_eq!(
+            expected_debonding, debonding_delegations,
+            "expected debonding delegations should match"
+        );
+
+        // Test all stored balances.
+        let total_supply = staking_state
+            .total_supply()
+            .expect("total supply query should work");
+        assert_eq!(
+            Quantity::from(10000u32),
+            total_supply,
+            "total supply should match expected"
+        );
+
+        let common_pool = staking_state
+            .common_pool()
+            .expect("common pool query should work");
+        assert_eq!(
+            Quantity::from(1000u32),
+            common_pool,
+            "common pool should match expected"
+        );
+
+        let last_block_fees = staking_state
+            .last_block_fees()
+            .expect("last block fees query should work");
+        assert_eq!(
+            Quantity::from(33u32),
+            last_block_fees,
+            "last block fees should match expected"
+        );
+
+        let governance_deposits = staking_state
+            .governance_deposits()
+            .expect("governance deposits query should work");
+        assert_eq!(
+            Quantity::from(12u32),
+            governance_deposits,
+            "governance deposits should match expected"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/merkle.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/merkle.rs.html new file mode 100644 index 0000000000..17755b2d09 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/merkle.rs.html @@ -0,0 +1,371 @@ +merkle.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+
//! Merkle proofs used in Tendermint networks
+//!
+//! Rewritten to Rust from:
+//! https://github.com/tendermint/tendermint/blob/main/crypto/merkle/proof.go
+//!
+//! Helper functions copied from:
+//! https://github.com/informalsystems/tendermint-rs/blob/main/tendermint/src/merkle.rs
+
+use std::cmp::Ordering;
+
+use anyhow::{anyhow, Result};
+use rustc_hex::ToHex;
+use sha2::{Digest, Sha256};
+
+use tendermint::merkle::{Hash, HASH_SIZE};
+
+/// Maximum number of aunts that can be included in a Proof.
+/// This corresponds to a tree of size 2^100, which should be sufficient for all conceivable purposes.
+/// This maximum helps prevent Denial-of-Service attacks by limiting the size of the proofs.
+pub const MAX_AUNTS: usize = 100;
+
+/// Proof represents a Merkle proof.
+///
+/// NOTE: The convention for proofs is to include leaf hashes but to
+/// exclude the root hash.
+/// This convention is implemented across IAVL range proofs as well.
+/// Keep this consistent unless there's a very good reason to change
+/// everything.  This also affects the generalized proof system as
+/// well.
+#[derive(Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Proof {
+    pub total: i64,       // Total number of items.
+    pub index: i64,       // Index of item to prove.
+    pub leaf_hash: Hash,  // Hash of item value.
+    pub aunts: Vec<Hash>, // Hashes from leaf's sibling to a root's child.
+}
+
+impl Proof {
+    /// Verify that the Proof proves the root hash.
+    /// Check index/total manually if needed.
+    pub fn verify(&self, root_hash: Hash, leaf: Hash) -> Result<()> {
+        if self.total < 0 {
+            return Err(anyhow!("proof total must be positive"));
+        }
+        if self.index < 0 {
+            return Err(anyhow!("proof index cannot be negative"));
+        }
+        if self.aunts.len() > MAX_AUNTS {
+            return Err(anyhow!(
+                "expected no more than {} aunts, got {}",
+                MAX_AUNTS,
+                self.aunts.len()
+            ));
+        }
+
+        let leaf_hash = leaf_hash(&leaf);
+        match self.leaf_hash.cmp(&leaf_hash) {
+            Ordering::Equal => (),
+            _ => {
+                return Err(anyhow!(
+                    "invalid leaf hash: wanted {} got {}",
+                    leaf_hash.to_hex::<String>(),
+                    self.leaf_hash.to_hex::<String>(),
+                ));
+            }
+        }
+
+        let computed_hash = self.compute_root_hash().ok_or_else(|| {
+            anyhow!(
+                "invalid root hash: wanted {} got None",
+                root_hash.to_hex::<String>()
+            )
+        })?;
+        match computed_hash.cmp(&root_hash) {
+            Ordering::Equal => (),
+            _ => {
+                return Err(anyhow!(
+                    "invalid root hash: wanted {} got {}",
+                    root_hash.to_hex::<String>(),
+                    computed_hash.to_hex::<String>(),
+                ));
+            }
+        }
+
+        Ok(())
+    }
+
+    /// Compute the root hash given a leaf hash. Does not verify the result.
+    pub fn compute_root_hash(&self) -> Option<Hash> {
+        Self::compute_hash_from_aunts(self.index, self.total, self.leaf_hash, &self.aunts)
+    }
+
+    /// Use the leaf_hash and inner_hashes to get the root merkle hash.
+    /// If the length of the inner_hashes slice isn't exactly correct, the result is None.
+    /// Recursive impl.
+    fn compute_hash_from_aunts(
+        index: i64,
+        total: i64,
+        leaf_hash: Hash,
+        inner_hashes: &[Hash],
+    ) -> Option<Hash> {
+        if index >= total || index < 0 || total <= 0 {
+            return None;
+        }
+        match total {
+            0 => unreachable!("cannot call compute_hash_from_aunts() with 0 total"), // Handled above.
+            1 => {
+                if !inner_hashes.is_empty() {
+                    return None;
+                }
+                Some(leaf_hash)
+            }
+            _ => {
+                if inner_hashes.is_empty() {
+                    return None;
+                }
+                let last_idx = inner_hashes.len() - 1;
+                let last_hash = inner_hashes[last_idx];
+                let inner_hashes = &inner_hashes[..last_idx];
+
+                let num_left = get_split_point(total as usize) as i64;
+                if index < num_left {
+                    if let Some(left_hash) =
+                        Self::compute_hash_from_aunts(index, num_left, leaf_hash, inner_hashes)
+                    {
+                        return Some(inner_hash(&left_hash, &last_hash));
+                    }
+                    return None;
+                }
+                if let Some(right_hash) = Self::compute_hash_from_aunts(
+                    index - num_left,
+                    total - num_left,
+                    leaf_hash,
+                    inner_hashes,
+                ) {
+                    return Some(inner_hash(&last_hash, &right_hash));
+                }
+                None
+            }
+        }
+    }
+}
+
+/// returns the largest power of 2 less than length
+fn get_split_point(length: usize) -> usize {
+    match length {
+        0 => panic!("tree is empty!"),
+        1 => panic!("tree has only one element!"),
+        2 => 1,
+        _ => length.next_power_of_two() / 2,
+    }
+}
+
+/// tmhash(0x00 || leaf)
+fn leaf_hash(bytes: &[u8]) -> Hash {
+    // make a new array starting with 0 and copy in the bytes
+    let mut leaf_bytes = Vec::with_capacity(bytes.len() + 1);
+    leaf_bytes.push(0x00);
+    leaf_bytes.extend_from_slice(bytes);
+
+    // hash it !
+    let digest = Sha256::digest(&leaf_bytes);
+
+    // copy the GenericArray out
+    let mut hash_bytes = [0u8; HASH_SIZE];
+    hash_bytes.copy_from_slice(&digest);
+    hash_bytes
+}
+
+/// tmhash(0x01 || left || right)
+fn inner_hash(left: &[u8], right: &[u8]) -> Hash {
+    // make a new array starting with 0x1 and copy in the bytes
+    let mut inner_bytes = Vec::with_capacity(left.len() + right.len() + 1);
+    inner_bytes.push(0x01);
+    inner_bytes.extend_from_slice(left);
+    inner_bytes.extend_from_slice(right);
+
+    // hash it !
+    let digest = Sha256::digest(&inner_bytes);
+
+    // copy the GenericArray out
+    let mut hash_bytes = [0u8; HASH_SIZE];
+    hash_bytes.copy_from_slice(&digest);
+    hash_bytes
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/mod.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/mod.rs.html new file mode 100644 index 0000000000..b685eb1b4f --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/mod.rs.html @@ -0,0 +1,257 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+
//! Tendermint consensus layer backend.
+
+pub mod merkle;
+pub mod verifier;
+
+use std::convert::{TryFrom, TryInto};
+
+use anyhow::{anyhow, Result};
+use tendermint::{
+    block::signed_header::SignedHeader as TMSignedHeader, chain, validator::Set as TMValidatorSet,
+};
+use tendermint_proto::{types::LightBlock as RawLightBlock, Protobuf};
+
+use crate::{
+    common::{crypto::hash::Hash, namespace::Namespace},
+    consensus::LightBlock,
+    storage::mkvs::{Root, RootType},
+};
+
+/// Tendermint consensus backend name.
+/// Keep synced with go/consensus/cometbft/api/api.go.
+pub const BACKEND_NAME: &str = "tendermint";
+
+/// The domain separation context used by Oasis Core for Tendermint cryptography.
+/// Keep synced with go/consensus/cometbft/crypto/signature.go.
+pub const TENDERMINT_CONTEXT: &[u8] = b"oasis-core/tendermint";
+
+/// Convert an Oasis Core chain context into a Tendermint chain ID.
+pub fn chain_id(chain_context: &str) -> chain::Id {
+    chain_context[..chain::id::MAX_LENGTH].try_into().unwrap()
+}
+
+/// Decode the light block metadata as a Tendermint light block.
+pub fn decode_light_block(light_block: LightBlock) -> Result<LightBlockMeta> {
+    LightBlockMeta::decode_vec(&light_block.meta).map_err(|e| anyhow!("{}", e))
+}
+
+/// Encode the light block metadata to a Tendermint light block.
+pub fn encode_light_block(light_block_meta: LightBlockMeta) -> Result<LightBlock> {
+    let height = u64::from(
+        light_block_meta
+            .signed_header
+            .as_ref()
+            .ok_or_else(|| anyhow!("signed header should be present"))?
+            .header
+            .height,
+    );
+    let meta = LightBlockMeta::encode_vec(light_block_meta);
+
+    Ok(LightBlock { height, meta })
+}
+
+/// Extract state root from the given signed block header.
+///
+/// # Panics
+///
+/// The signed header must be present and the application hash must be a valid Oasis Core
+/// application hash (state root hash).
+pub fn state_root_from_header(signed_header: &TMSignedHeader) -> Root {
+    let header = signed_header.header();
+    let height: u64 = header.height.into();
+    let hash: [u8; 32] = header
+        .app_hash
+        .as_bytes()
+        .try_into()
+        .expect("invalid app hash");
+
+    Root {
+        namespace: Namespace::default(),
+        version: height - 1,
+        root_type: RootType::State,
+        hash: Hash(hash),
+    }
+}
+
+/// Tendermint light consensus block metadata.
+#[derive(Debug, Clone)]
+pub struct LightBlockMeta {
+    pub signed_header: Option<TMSignedHeader>,
+    pub validators: TMValidatorSet,
+}
+
+impl LightBlockMeta {
+    /// State root specified by this light block.
+    ///
+    /// # Panics
+    ///
+    /// The signed header must be present and the application hash must be a valid Oasis Core
+    /// application hash (state root hash).
+    pub fn get_state_root(&self) -> Root {
+        let header = self
+            .signed_header
+            .as_ref()
+            .expect("signed header should be present");
+
+        state_root_from_header(header)
+    }
+}
+
+impl Protobuf<RawLightBlock> for LightBlockMeta {}
+
+impl TryFrom<RawLightBlock> for LightBlockMeta {
+    type Error = anyhow::Error;
+
+    fn try_from(value: RawLightBlock) -> Result<Self> {
+        Ok(LightBlockMeta {
+            signed_header: value
+                .signed_header
+                .map(TryInto::try_into)
+                .transpose()
+                .map_err(|error| anyhow!("{}", error))?,
+            validators: value
+                .validator_set
+                .ok_or_else(|| anyhow!("missing validator set"))?
+                .try_into()
+                .map_err(|error| anyhow!("{}", error))?,
+        })
+    }
+}
+
+impl From<LightBlockMeta> for RawLightBlock {
+    fn from(value: LightBlockMeta) -> Self {
+        RawLightBlock {
+            signed_header: value.signed_header.map(Into::into),
+            validator_set: Some(value.validators.into()),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/cache.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/cache.rs.html new file mode 100644 index 0000000000..69d0b326d7 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/cache.rs.html @@ -0,0 +1,101 @@ +cache.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
use std::num::NonZeroUsize;
+
+use tendermint::block::Height;
+use tendermint_light_client::types::LightBlock as TMLightBlock;
+
+use crate::common::crypto::{hash::Hash, signature::PublicKey};
+
+/// Verifier cache.
+pub struct Cache {
+    pub last_verified_height: u64,
+    pub last_verified_round: u64,
+    pub last_verified_epoch: u64,
+    pub last_verified_block: Option<TMLightBlock>,
+    pub verified_state_roots: lru::LruCache<u64, (Hash, u64)>,
+    pub host_node_id: PublicKey,
+}
+
+impl Cache {
+    /// Latest known and verified consensus layer height.
+    pub fn latest_known_height(&self) -> Option<u64> {
+        self.last_verified_block
+            .as_ref()
+            .map(|b| b.signed_header.header.height.value())
+    }
+
+    /// Process a new verified consensus layer block and update the cache if needed.
+    pub fn update_verified_block(&mut self, verified_block: &TMLightBlock) {
+        let h = |b: &TMLightBlock| -> Height { b.signed_header.header.height };
+        if let Some(last_verified_block) = self.last_verified_block.as_ref() {
+            if h(verified_block) <= h(last_verified_block) {
+                return;
+            }
+        }
+        self.last_verified_block = Some(verified_block.clone())
+    }
+}
+
+impl Cache {
+    /// Construct a new verifier cache.
+    pub fn new(host_node_id: PublicKey) -> Self {
+        Self {
+            last_verified_height: 0,
+            last_verified_round: 0,
+            last_verified_epoch: 0,
+            last_verified_block: None,
+            verified_state_roots: lru::LruCache::new(NonZeroUsize::new(128).unwrap()),
+            host_node_id,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/clock.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/clock.rs.html new file mode 100644 index 0000000000..a867f174f2 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/clock.rs.html @@ -0,0 +1,23 @@ +clock.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
use tendermint_light_client::{components, types::Time};
+
+use crate::common::time;
+
+pub struct InsecureClock;
+
+impl components::clock::Clock for InsecureClock {
+    fn now(&self) -> Time {
+        Time::from_unix_timestamp(time::insecure_posix_time(), 0).unwrap()
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/handle.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/handle.rs.html new file mode 100644 index 0000000000..ae2ea7c02c --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/handle.rs.html @@ -0,0 +1,251 @@ +handle.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+
use std::sync::Arc;
+
+use async_trait::async_trait;
+use crossbeam::channel;
+use tokio::sync::oneshot;
+
+use crate::{
+    consensus::{
+        beacon::EpochTime,
+        roothash::Header,
+        state::ConsensusState,
+        tendermint::decode_light_block,
+        verifier::{self, Error},
+        Event, LightBlock,
+    },
+    protocol::Protocol,
+    types::EventKind,
+};
+
+use super::types::Command;
+
+pub struct Handle {
+    pub protocol: Arc<Protocol>,
+    pub command_sender: channel::Sender<Command>,
+}
+
+#[async_trait]
+impl verifier::Verifier for Handle {
+    async fn sync(&self, height: u64) -> Result<(), Error> {
+        let (sender, receiver) = oneshot::channel();
+        self.command_sender
+            .send(Command::Synchronize(height, sender))
+            .map_err(|_| Error::Internal)?;
+
+        receiver.await.map_err(|_| Error::Internal)?
+    }
+
+    async fn verify(
+        &self,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Result<ConsensusState, Error> {
+        let (sender, receiver) = oneshot::channel();
+        self.command_sender
+            .send(Command::Verify(
+                consensus_block,
+                runtime_header,
+                epoch,
+                sender,
+                false,
+            ))
+            .map_err(|_| Error::Internal)?;
+
+        receiver.await.map_err(|_| Error::Internal)?
+    }
+
+    async fn verify_for_query(
+        &self,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Result<ConsensusState, Error> {
+        let (sender, receiver) = oneshot::channel();
+        self.command_sender
+            .send(Command::Verify(
+                consensus_block,
+                runtime_header,
+                epoch,
+                sender,
+                true,
+            ))
+            .map_err(|_| Error::Internal)?;
+
+        receiver.await.map_err(|_| Error::Internal)?
+    }
+
+    async fn unverified_state(&self, consensus_block: LightBlock) -> Result<ConsensusState, Error> {
+        let untrusted_block =
+            decode_light_block(consensus_block).map_err(Error::VerificationFailed)?;
+        // NOTE: No actual verification is performed.
+        let state_root = untrusted_block.get_state_root();
+        Ok(ConsensusState::from_protocol(
+            self.protocol.clone(),
+            state_root.version + 1,
+            state_root,
+        ))
+    }
+
+    async fn latest_state(&self) -> Result<ConsensusState, Error> {
+        let (sender, receiver) = oneshot::channel();
+        self.command_sender
+            .send(Command::LatestState(sender))
+            .map_err(|_| Error::Internal)?;
+
+        receiver.await.map_err(|_| Error::Internal)?
+    }
+
+    async fn state_at(&self, height: u64) -> Result<ConsensusState, Error> {
+        let (sender, receiver) = oneshot::channel();
+        self.command_sender
+            .send(Command::StateAt(height, sender))
+            .map_err(|_| Error::Internal)?;
+
+        receiver.await.map_err(|_| Error::Internal)?
+    }
+
+    async fn events_at(&self, height: u64, kind: EventKind) -> Result<Vec<Event>, Error> {
+        let (sender, receiver) = oneshot::channel();
+        self.command_sender
+            .send(Command::EventsAt(height, kind, sender))
+            .map_err(|_| Error::Internal)?;
+
+        receiver.await.map_err(|_| Error::Internal)?
+    }
+
+    async fn latest_height(&self) -> Result<u64, Error> {
+        let (sender, receiver) = oneshot::channel();
+        self.command_sender
+            .send(Command::LatestHeight(sender))
+            .map_err(|_| Error::Internal)?;
+
+        receiver.await.map_err(|_| Error::Internal)?
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/io.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/io.rs.html new file mode 100644 index 0000000000..83d5fb499e --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/io.rs.html @@ -0,0 +1,265 @@ +io.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+
use std::sync::Arc;
+
+use tendermint_light_client::{
+    components::{
+        self,
+        io::{AtHeight, IoError},
+    },
+    types::{LightBlock as TMLightBlock, PeerId},
+};
+use tendermint_rpc::error::Error as RpcError;
+
+use crate::{
+    consensus::{
+        tendermint::{decode_light_block, LightBlockMeta},
+        transaction::SignedTransactionWithProof,
+        HEIGHT_LATEST,
+    },
+    protocol::Protocol,
+    types::Body,
+};
+
+use super::types::Nonce;
+
+pub struct Io {
+    protocol: Arc<Protocol>,
+}
+
+impl Io {
+    pub fn new(protocol: &Arc<Protocol>) -> Self {
+        Self {
+            protocol: protocol.clone(),
+        }
+    }
+
+    fn fetch_light_block(&self, height: u64) -> Result<LightBlockMeta, IoError> {
+        let result = self
+            .protocol
+            .call_host(Body::HostFetchConsensusBlockRequest { height })
+            .map_err(|err| IoError::rpc(RpcError::server(err.to_string())))?;
+
+        // Extract generic light block from response.
+        let block = match result {
+            Body::HostFetchConsensusBlockResponse { block } => block,
+            _ => return Err(IoError::rpc(RpcError::server("bad response".to_string()))),
+        };
+
+        // Decode block as a Tendermint light block.
+        let block = decode_light_block(block)
+            .map_err(|err| IoError::rpc(RpcError::server(err.to_string())))?;
+
+        Ok(block)
+    }
+
+    pub fn fetch_genesis_height(&self) -> Result<u64, IoError> {
+        let result = self
+            .protocol
+            .call_host(Body::HostFetchGenesisHeightRequest {})
+            .map_err(|err| IoError::rpc(RpcError::server(err.to_string())))?;
+
+        // Extract genesis height from response.
+        let height = match result {
+            Body::HostFetchGenesisHeightResponse { height } => height,
+            _ => return Err(IoError::rpc(RpcError::server("bad response".to_string()))),
+        };
+
+        Ok(height)
+    }
+
+    pub fn fetch_freshness_proof(
+        &self,
+        nonce: &Nonce,
+    ) -> Result<SignedTransactionWithProof, IoError> {
+        let result = self
+            .protocol
+            .call_host(Body::HostProveFreshnessRequest {
+                blob: nonce.to_vec(),
+            })
+            .map_err(|err| IoError::rpc(RpcError::server(err.to_string())))?;
+
+        // Extract proof from response.
+        let (signed_tx, proof) = match result {
+            Body::HostProveFreshnessResponse { signed_tx, proof } => (signed_tx, proof),
+            _ => return Err(IoError::rpc(RpcError::server("bad response".to_string()))),
+        };
+
+        Ok(SignedTransactionWithProof { signed_tx, proof })
+    }
+
+    pub fn fetch_block_metadata(&self, height: u64) -> Result<SignedTransactionWithProof, IoError> {
+        let result = self
+            .protocol
+            .call_host(Body::HostFetchBlockMetadataTxRequest { height })
+            .map_err(|err| IoError::rpc(RpcError::server(err.to_string())))?;
+
+        // Extract proof from response.
+        let (signed_tx, proof) = match result {
+            Body::HostFetchBlockMetadataTxResponse { signed_tx, proof } => (signed_tx, proof),
+            _ => return Err(IoError::rpc(RpcError::server("bad response".to_string()))),
+        };
+
+        Ok(SignedTransactionWithProof { signed_tx, proof })
+    }
+}
+
+impl components::io::Io for Io {
+    fn fetch_light_block(&self, height: AtHeight) -> Result<TMLightBlock, IoError> {
+        let height = match height {
+            AtHeight::At(height) => height.into(),
+            AtHeight::Highest => HEIGHT_LATEST,
+        };
+
+        // Fetch light block at height and height+1.
+        let block = Io::fetch_light_block(self, height)?;
+        let height: u64 = block
+            .signed_header
+            .as_ref()
+            .ok_or_else(|| IoError::rpc(RpcError::server("missing signed header".to_string())))?
+            .header()
+            .height
+            .into();
+        // NOTE: It seems that the requirement to fetch the next validator set is redundant and it
+        //       should be handled at a higher layer of the light client.
+        let next_block = Io::fetch_light_block(self, height + 1)?;
+
+        Ok(TMLightBlock {
+            signed_header: block.signed_header.unwrap(), // Checked above.
+            validators: block.validators,
+            next_validators: next_block.validators,
+            provider: PeerId::new([0; 20]),
+        })
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/mod.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/mod.rs.html new file mode 100644 index 0000000000..f2773ca0e1 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/mod.rs.html @@ -0,0 +1,1851 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+
//! Tendermint consensus layer verification logic.
+use std::{convert::TryInto, str::FromStr, sync::Arc, time::Duration};
+
+use anyhow::anyhow;
+use crossbeam::channel;
+use rand::{rngs::OsRng, Rng};
+use sha2::{Digest, Sha256};
+use slog::{debug, error, info};
+use tendermint::merkle::HASH_SIZE;
+use tendermint_light_client::{
+    builder::LightClientBuilder,
+    components::{self, io::AtHeight, verifier::PredicateVerifier},
+    instance::Instance,
+    light_client,
+    operations::{ProdCommitValidator, ProvidedVotingPowerCalculator},
+    store::LightStore,
+    types::{
+        Hash as TMHash, LightBlock as TMLightBlock, PeerId, Status, Time, TrustThreshold,
+        TrustedBlockState,
+    },
+    verifier::{predicates::ProdPredicates, Verdict, Verifier as TMVerifier},
+};
+
+use crate::{
+    common::{logger::get_logger, namespace::Namespace, process, time, version::Version},
+    consensus::{
+        beacon::EpochTime,
+        registry::METHOD_PROVE_FRESHNESS,
+        roothash::Header,
+        state::ConsensusState,
+        tendermint::{
+            chain_id, decode_light_block, merkle, state_root_from_header,
+            verifier::{
+                clock::InsecureClock,
+                io::Io,
+                store::LruStore,
+                types::{Command, Nonce, NONCE_SIZE},
+            },
+            LightBlockMeta,
+        },
+        transaction::{Proof, SignedTransaction, Transaction},
+        verifier::{self, verify_state_freshness, Error, TrustRoot},
+        BlockMetadata, Event, LightBlock, HEIGHT_LATEST, METHOD_META,
+    },
+    future::block_on,
+    host::Host,
+    protocol::Protocol,
+    storage::mkvs::{Root, RootType},
+    types::{Body, EventKind, HostFetchConsensusEventsRequest, HostFetchConsensusEventsResponse},
+};
+
+use self::{
+    cache::Cache,
+    handle::Handle,
+    store::{TrustedState, TrustedStateStore},
+};
+
+// Modules.
+mod cache;
+mod clock;
+mod handle;
+mod io;
+mod noop;
+mod predicates;
+mod signature;
+mod store;
+mod types;
+
+// Re-exports.
+pub use noop::NopVerifier;
+
+/// Maximum number of times to retry initialization.
+const MAX_INITIALIZATION_RETRIES: usize = 3;
+
+/// Trusted state save interval (in consensus blocks).
+const TRUSTED_STATE_SAVE_INTERVAL: u64 = 128;
+
+/// Tendermint consensus layer verifier.
+pub struct Verifier {
+    logger: slog::Logger,
+    protocol: Arc<Protocol>,
+    tokio_runtime: tokio::runtime::Handle,
+    runtime_version: Version,
+    runtime_id: Namespace,
+    chain_context: String,
+    trust_root: TrustRoot,
+    command_sender: channel::Sender<Command>,
+    command_receiver: channel::Receiver<Command>,
+    trusted_state_store: TrustedStateStore,
+}
+
+impl Verifier {
+    /// Create a new Tendermint consensus layer verifier.
+    pub fn new(
+        protocol: Arc<Protocol>,
+        tokio_runtime: tokio::runtime::Handle,
+        trust_root: TrustRoot,
+        runtime_id: Namespace,
+        chain_context: String,
+    ) -> Self {
+        let logger = get_logger("consensus/cometbft/verifier");
+        let (command_sender, command_receiver) = channel::unbounded();
+        let runtime_version = protocol.get_config().version;
+        let trusted_state_store =
+            TrustedStateStore::new(runtime_id, chain_context.clone(), protocol.clone());
+
+        assert_eq!(
+            trust_root.runtime_id, runtime_id,
+            "trust root must have the same runtime id"
+        );
+
+        Self {
+            logger,
+            protocol,
+            tokio_runtime,
+            runtime_version,
+            runtime_id,
+            chain_context,
+            trust_root,
+            command_sender,
+            command_receiver,
+            trusted_state_store,
+        }
+    }
+
+    /// Return a handle to interact with the verifier.
+    pub fn handle(&self) -> impl verifier::Verifier {
+        Handle {
+            protocol: self.protocol.clone(),
+            command_sender: self.command_sender.clone(),
+        }
+    }
+
+    fn verify_to_target(
+        &self,
+        height: u64,
+        cache: &mut Cache,
+        instance: &mut Instance,
+    ) -> Result<TMLightBlock, Error> {
+        let verified_block = match height {
+            HEIGHT_LATEST => instance.light_client.verify_to_highest(&mut instance.state),
+            _ => instance
+                .light_client
+                .verify_to_target(height.try_into().unwrap(), &mut instance.state),
+        }
+        .map_err(|err| Error::VerificationFailed(err.into()))?;
+
+        // Clear verification trace as it could otherwise lead to infinite memory growth.
+        instance.state.verification_trace.clear();
+
+        cache.update_verified_block(&verified_block);
+        self.update_insecure_posix_time(&verified_block);
+
+        Ok(verified_block)
+    }
+
+    fn sync(&self, cache: &mut Cache, instance: &mut Instance, height: u64) -> Result<(), Error> {
+        if height < cache.last_verified_height || height < cache.latest_known_height().unwrap_or(0)
+        {
+            // Ignore requests for earlier heights.
+            return Ok(());
+        }
+        self.verify_to_target(height, cache, instance)?;
+        Ok(())
+    }
+
+    fn latest_consensus_state(
+        &self,
+        cache: &mut Cache,
+        instance: &mut Instance,
+    ) -> Result<ConsensusState, Error> {
+        // When latest state is requested we always perform same-block execution verification.
+        let height = self.latest_consensus_height(cache)?;
+        let state_root = self.state_root_from_metadata(cache, instance, height)?;
+
+        Ok(ConsensusState::from_protocol(
+            self.protocol.clone(),
+            state_root.version,
+            state_root,
+        ))
+    }
+
+    fn latest_consensus_height(&self, cache: &Cache) -> Result<u64, Error> {
+        let height = cache.latest_known_height().ok_or(Error::Internal)?;
+        Ok(height)
+    }
+
+    fn consensus_state_at(
+        &self,
+        cache: &mut Cache,
+        instance: &mut Instance,
+        height: u64,
+    ) -> Result<ConsensusState, Error> {
+        // Obtain an authoritative state root, either from the current block if it is already
+        // finalized or from the metadata transaction of the previous block.
+        let state_root = match self.verify_to_target(height, cache, instance) {
+            Ok(verified_block) => state_root_from_header(&verified_block.signed_header),
+            Err(_) => self.state_root_from_metadata(cache, instance, height - 1)?,
+        };
+
+        Ok(ConsensusState::from_protocol(
+            self.protocol.clone(),
+            state_root.version + 1,
+            state_root,
+        ))
+    }
+
+    fn verify_consensus_block(
+        &self,
+        cache: &mut Cache,
+        instance: &mut Instance,
+        consensus_block: LightBlock,
+    ) -> Result<LightBlockMeta, Error> {
+        // Decode passed block as a Tendermint block.
+        let lb_height = consensus_block.height;
+        let untrusted_block =
+            decode_light_block(consensus_block).map_err(Error::VerificationFailed)?;
+        let untrusted_header = untrusted_block
+            .signed_header
+            .as_ref()
+            .ok_or_else(|| Error::VerificationFailed(anyhow!("missing signed header")))?;
+
+        // Verify up to the block at current height.
+        // Only does forward verification and fails if height is lower than the last trust height.
+        let height = untrusted_header.header().height.value();
+        if height != lb_height {
+            return Err(Error::VerificationFailed(anyhow!(
+                "inconsistent light block/header height"
+            )));
+        }
+        let verified_block = self.verify_to_target(height, cache, instance)?;
+
+        // Validate passed consensus block.
+        if untrusted_header.header() != verified_block.signed_header.header() {
+            return Err(Error::VerificationFailed(anyhow!("header mismatch")));
+        }
+
+        Ok(untrusted_block)
+    }
+
+    /// Verify state freshness using RAK and nonces.
+    fn verify_freshness_with_rak(
+        &self,
+        state: &ConsensusState,
+        cache: &Cache,
+    ) -> Result<(), Error> {
+        let identity = if let Some(identity) = self.protocol.get_identity() {
+            identity
+        } else {
+            return Ok(());
+        };
+
+        verify_state_freshness(
+            state,
+            identity,
+            &self.runtime_id,
+            &self.runtime_version,
+            &cache.host_node_id,
+        )
+    }
+
+    /// Verify state freshness using prove freshness transaction.
+    ///
+    /// Verification is done in three steps. In the first one, the verifier selects a unique nonce
+    /// and sends it to the host. The second step is done by the host, who prepares, signs and
+    /// submits a prove freshness transaction using the received nonce. Once transaction is included
+    /// in a block, the host replies with block's height, transaction details and a Merkle proof
+    /// that the transaction was included in the block. In the final step, the verifier verifies
+    /// the proof and accepts state as fresh iff verification succeeds.
+    fn verify_freshness_with_proof(
+        &self,
+        instance: &mut Instance,
+        cache: &mut Cache,
+    ) -> Result<(), Error> {
+        info!(
+            self.logger,
+            "Verifying state freshness using prove freshness transaction"
+        );
+
+        // Generate a random nonce for prove freshness transaction.
+        let mut rng = OsRng {};
+        let mut nonce = [0u8; NONCE_SIZE];
+        rng.fill(&mut nonce);
+
+        // Ask host for freshness proof.
+        let io = Io::new(&self.protocol);
+        let stwp = io.fetch_freshness_proof(&nonce).map_err(|err| {
+            Error::FreshnessVerificationFailed(anyhow!("failed to fetch freshness proof: {}", err))
+        })?;
+
+        // Verify the transaction and the proof.
+        let tx = self.verify_transaction(cache, instance, &stwp.signed_tx, &stwp.proof)?;
+
+        // Verify the method name and the nonce.
+        if tx.method != METHOD_PROVE_FRESHNESS {
+            return Err(Error::FreshnessVerificationFailed(anyhow!(
+                "invalid method name"
+            )));
+        }
+
+        let tx_nonce: Nonce = cbor::from_value(tx.body).map_err(|err| {
+            Error::FreshnessVerificationFailed(anyhow!("failed to decode nonce: {}", err))
+        })?;
+        match nonce.cmp(&tx_nonce) {
+            std::cmp::Ordering::Equal => (),
+            _ => return Err(Error::FreshnessVerificationFailed(anyhow!("invalid nonce"))),
+        }
+
+        info!(self.logger, "State freshness successfully verified");
+
+        Ok(())
+    }
+
+    fn verify_transaction(
+        &self,
+        cache: &mut Cache,
+        instance: &mut Instance,
+        signed_tx: &SignedTransaction,
+        proof: &Proof,
+    ) -> Result<Transaction, Error> {
+        // Verify the signature.
+        if !signed_tx.verify(&self.chain_context) {
+            return Err(Error::TransactionVerificationFailed(anyhow!(
+                "failed to verify the signature"
+            )));
+        }
+
+        // Fetch the root hash of a block in which the transaction was published.
+        let verified_block = self
+            .verify_to_target(proof.height, cache, instance)
+            .map_err(|err| {
+                Error::TransactionVerificationFailed(anyhow!("failed to fetch the block: {}", err))
+            })?;
+
+        let header = verified_block.signed_header.header;
+        if header.height.value() != proof.height {
+            return Err(Error::TransactionVerificationFailed(anyhow!(
+                "invalid block"
+            )));
+        }
+
+        let root_hash = header
+            .data_hash
+            .ok_or_else(|| Error::TransactionVerificationFailed(anyhow!("root hash not found")))?;
+        let root_hash = match root_hash {
+            TMHash::Sha256(hash) => hash,
+            TMHash::None => {
+                return Err(Error::TransactionVerificationFailed(anyhow!(
+                    "root hash not found"
+                )));
+            }
+        };
+
+        // Compute hash of the transaction.
+        let digest = Sha256::digest(cbor::to_vec(signed_tx.clone()));
+        let mut tx_hash = [0u8; HASH_SIZE];
+        tx_hash.copy_from_slice(&digest);
+
+        // Decode raw proof as a CometBFT Merkle proof of inclusion.
+        let merkle_proof: merkle::Proof = cbor::from_slice(&proof.raw_proof).map_err(|err| {
+            Error::TransactionVerificationFailed(anyhow!("failed to decode Merkle proof: {}", err))
+        })?;
+
+        merkle_proof.verify(root_hash, tx_hash).map_err(|err| {
+            Error::TransactionVerificationFailed(anyhow!("failed to verify Merkle proof: {}", err))
+        })?;
+
+        // Decode transaction.
+        let tx: Transaction = cbor::from_slice(signed_tx.blob.as_slice()).map_err(|err| {
+            Error::TransactionVerificationFailed(anyhow!("failed to decode transaction: {}", err))
+        })?;
+
+        Ok(tx)
+    }
+
+    /// Fetch state root from block metadata transaction.
+    fn state_root_from_metadata(
+        &self,
+        cache: &mut Cache,
+        instance: &mut Instance,
+        height: u64,
+    ) -> Result<Root, Error> {
+        debug!(
+            self.logger,
+            "Fetching state root from block metadata transaction"
+        );
+
+        // Ask the host for block metadata transaction.
+        let io = Io::new(&self.protocol);
+        let stwp = io.fetch_block_metadata(height).map_err(|err| {
+            Error::StateRoot(anyhow!(
+                "failed to fetch block metadata transaction: {}",
+                err
+            ))
+        })?;
+
+        // Verify the transaction and the proof.
+        let tx = self.verify_transaction(cache, instance, &stwp.signed_tx, &stwp.proof)?;
+
+        if tx.method != METHOD_META {
+            return Err(Error::StateRoot(anyhow!("invalid method name")));
+        }
+
+        let meta: BlockMetadata = cbor::from_value(tx.body).map_err(|err| {
+            Error::StateRoot(anyhow!(
+                "failed to decode block metadata transaction: {}",
+                err
+            ))
+        })?;
+
+        Ok(Root {
+            namespace: Namespace::default(),
+            version: height,
+            root_type: RootType::State,
+            hash: meta.state_root,
+        })
+    }
+
+    fn verify(
+        &self,
+        cache: &mut Cache,
+        instance: &mut Instance,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Result<ConsensusState, Error> {
+        // Perform basic verifications.
+        predicates::verify_namespace(self.runtime_id, &runtime_header)?;
+        predicates::verify_round_advance(cache, &runtime_header, &consensus_block, epoch)?;
+        predicates::verify_consensus_advance(cache, &consensus_block)?;
+
+        // Verify the consensus layer block.
+        let height = consensus_block.height;
+        let consensus_block = self.verify_consensus_block(cache, instance, consensus_block)?;
+
+        // Perform basic verifications.
+        predicates::verify_time(&runtime_header, &consensus_block)?;
+
+        // Obtain an authoritative state root.
+        let state = self.consensus_state_at(cache, instance, height)?;
+
+        // Check if we have already verified this runtime header to avoid re-verification.
+        if let Some((state_root, state_epoch)) =
+            cache.verified_state_roots.get(&runtime_header.round)
+        {
+            if state_root == &runtime_header.state_root
+                && state_epoch == &epoch
+                && epoch == cache.last_verified_epoch
+            {
+                // Header and epoch matches, no need to perform re-verification.
+
+                // Cache last verified fields.
+                cache.last_verified_height = height;
+                cache.last_verified_round = runtime_header.round;
+
+                return Ok(state);
+            }
+
+            // Force full verification in case of cache mismatch.
+        }
+
+        // Obtain an authoritative state root for full verification.
+        // Note that we cannot return the state at height+1 as the block might not have been
+        // finalized yet, and we won't be able to query block results such as events.
+        let next_state = self.consensus_state_at(cache, instance, height + 1)?;
+
+        // Perform full verification.
+        predicates::verify_state_root(&next_state, &runtime_header)?;
+        predicates::verify_epoch(&next_state, epoch)?;
+
+        // Verify our own RAK is published in registry once per epoch.
+        // This ensures consensus state is recent enough.
+        if cache.last_verified_epoch != epoch {
+            let latest_state = self.latest_consensus_state(cache, instance)?;
+            self.verify_freshness_with_rak(&latest_state, cache)?;
+        }
+
+        // Cache verified state root and epoch.
+        cache
+            .verified_state_roots
+            .put(runtime_header.round, (runtime_header.state_root, epoch));
+
+        // Cache last verified fields.
+        cache.last_verified_height = height;
+        cache.last_verified_round = runtime_header.round;
+        cache.last_verified_epoch = epoch;
+
+        Ok(state)
+    }
+
+    fn verify_for_query(
+        &self,
+        cache: &mut Cache,
+        instance: &mut Instance,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Result<ConsensusState, Error> {
+        // Perform basic verifications.
+        predicates::verify_namespace(self.runtime_id, &runtime_header)?;
+
+        // Verify the consensus layer block.
+        let height = consensus_block.height;
+        let consensus_block = self.verify_consensus_block(cache, instance, consensus_block)?;
+
+        // Perform basic verifications.
+        predicates::verify_time(&runtime_header, &consensus_block)?;
+
+        // Obtain an authoritative state root.
+        let state = self.consensus_state_at(cache, instance, height)?;
+
+        // Check if we have already verified this runtime header to avoid re-verification.
+        if let Some((state_root, state_epoch)) =
+            cache.verified_state_roots.get(&runtime_header.round)
+        {
+            if state_root == &runtime_header.state_root && state_epoch == &epoch {
+                // Header and epoch matches, no need to perform re-verification.
+                return Ok(state);
+            }
+
+            // Force full verification in case of cache mismatch.
+        }
+
+        // Obtain an authoritative state root for full verification.
+        // Note that we cannot return the state at height+1 as the block might not have been
+        // finalized yet, and we won't be able to query block results such as events.
+        let next_state = self.consensus_state_at(cache, instance, height + 1)?;
+
+        // Perform full verification.
+        predicates::verify_state_root(&next_state, &runtime_header)?;
+        predicates::verify_epoch(&next_state, epoch)?;
+
+        // Cache verified state root and epoch.
+        cache
+            .verified_state_roots
+            .put(runtime_header.round, (runtime_header.state_root, epoch));
+
+        Ok(state)
+    }
+
+    fn events_at(&self, height: u64, kind: EventKind) -> Result<Vec<Event>, Error> {
+        let result = self
+            .protocol
+            .call_host(Body::HostFetchConsensusEventsRequest(
+                HostFetchConsensusEventsRequest { height, kind },
+            ))
+            .map_err(|err| Error::VerificationFailed(err.into()))?;
+        // TODO: Perform event verification once this becomes possible.
+
+        match result {
+            Body::HostFetchConsensusEventsResponse(HostFetchConsensusEventsResponse { events }) => {
+                Ok(events)
+            }
+            _ => Err(Error::VerificationFailed(anyhow!("bad response from host"))),
+        }
+    }
+
+    fn update_insecure_posix_time(&self, verified_block: &TMLightBlock) {
+        // Update untrusted time if ahead. This makes sure that the enclave's sense of time is
+        // synced with consensus sense of time based on the fact that consensus time is harder to
+        // fake than host operating system time.
+        time::update_insecure_posix_time(
+            verified_block
+                .signed_header
+                .header
+                .time
+                .duration_since(Time::unix_epoch())
+                .unwrap()
+                .as_secs()
+                .try_into()
+                .unwrap(),
+        );
+    }
+
+    /// Start the verifier in a separate thread.
+    pub fn start(self) {
+        std::thread::spawn(move || {
+            let _guard = self.tokio_runtime.enter(); // Ensure Tokio runtime is available.
+
+            let logger = get_logger("consensus/cometbft/verifier");
+            info!(logger, "Starting consensus verifier");
+
+            // Try to initialize a couple of times as initially it may be the case that we have
+            // started while the Runtime Host Protocol has not been fully initialized so the host
+            // is still rejecting requests. This is the case because `start()` is called as part
+            // of the RHP initialization itself (when handling a `RuntimeInfoRequest`).
+            for retry in 1..=MAX_INITIALIZATION_RETRIES {
+                // Handle panics by logging and aborting the runtime.
+                let result =
+                    match std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| self.run())) {
+                        Ok(result) => result,
+                        Err(_) => {
+                            error!(logger, "Consensus verifier aborted");
+                            process::abort();
+                        }
+                    };
+
+                // Handle failures.
+                match result {
+                    Ok(_) => {}
+                    Err(err @ Error::Builder(_))
+                    | Err(err @ Error::TrustedStateLoadingFailed)
+                    | Err(err @ Error::ChainContextTransitionFailed(_)) => {
+                        error!(logger, "Consensus verifier failed to initialize, retrying";
+                            "err" => %err,
+                            "retry" => retry,
+                        );
+                    }
+                    Err(err) => {
+                        // All other errors are fatal.
+                        error!(logger, "Consensus verifier terminated, aborting";
+                            "err" => %err,
+                        );
+                        process::abort();
+                    }
+                }
+
+                // Retry to initialize the verifier.
+                std::thread::sleep(Duration::from_secs(1));
+            }
+
+            error!(logger, "Failed to start consensus verifier, aborting");
+            process::abort();
+        });
+    }
+
+    fn run(&self) -> Result<(), Error> {
+        // Create a new light client instance.
+        let options = light_client::Options {
+            trust_threshold: Default::default(),
+            // XXX: Until we have a way to retrieve trusted light client headers from other nodes
+            //      (e.g., via EnclaveRPC) there is little sense in specifying a trusting period.
+            trusting_period: Duration::from_secs(3600 * 24 * 365 * 10), // 10 years
+            clock_drift: Duration::from_secs(60),
+        };
+
+        // NOTE: Peer identifier is irrelevant as the enclave is totally eclipsed.
+        let peer_id = PeerId::new([0; 20]);
+        let clock = Box::new(InsecureClock);
+        let verifier = Box::new(PredicateVerifier::new(
+            ProdPredicates,
+            ProvidedVotingPowerCalculator::<signature::DomSepVerifier>::default(),
+            ProdCommitValidator,
+        ));
+        let io = Box::new(Io::new(&self.protocol));
+
+        // Build a light client using the embedded trust root or trust root
+        // stored in the local store.
+        info!(self.logger, "Loading trusted state");
+        let trusted_state = self
+            .trusted_state_store
+            .load(self.runtime_version, &self.trust_root);
+
+        let trusted_state: TrustedState = match trusted_state {
+            Ok(state) => state,
+            Err(err) => {
+                error!(self.logger, "failed to load trusted state (if running in SGX mode, check if the CPU had changed; if yes, wipe 'worker-local-storage.badger.db' and restart the node)");
+                return Err(err);
+            }
+        };
+
+        // Verify if we can trust light blocks from a new chain if the consensus
+        // chain context changes.
+        info!(self.logger, "Checking chain context change");
+        let trusted_state = self.handle_chain_context_change(
+            trusted_state,
+            verifier.as_ref(),
+            clock.as_ref(),
+            io.as_ref(),
+        )?;
+
+        // Insert all of the trusted blocks into the light store as trusted.
+        let mut store = Box::new(LruStore::new(
+            512,
+            trusted_state.trust_root.height.try_into().unwrap(),
+        ));
+        for lb in trusted_state.trusted_blocks {
+            store.insert(lb.into(), Status::Trusted);
+        }
+        let trust_root = trusted_state.trust_root;
+
+        let builder = LightClientBuilder::custom(
+            peer_id,
+            options,
+            store,
+            io,
+            clock,
+            verifier,
+            Box::new(components::scheduler::basic_bisecting_schedule),
+            Box::new(ProdPredicates),
+        );
+
+        let mut instance = builder
+            .trust_primary_at(
+                trust_root.height.try_into().unwrap(),
+                TMHash::from_str(&trust_root.hash.to_uppercase()).unwrap(),
+            )
+            .map_err(|err| Error::Builder(err.into()))?
+            .build();
+
+        info!(self.logger, "Consensus verifier initialized";
+            "trust_root_height" => trust_root.height,
+            "trust_root_hash" => ?trust_root.hash,
+            "trust_root_runtime_id" => ?trust_root.runtime_id,
+            "trust_root_chain_context" => ?trust_root.chain_context,
+        );
+
+        let host_node_id =
+            block_on(self.protocol.identity()).expect("host should provide a node identity");
+
+        let mut cache = Cache::new(host_node_id);
+
+        // Sync the verifier up to the latest block to make sure we are up to date before
+        // processing any requests.
+        let verified_block = self.verify_to_target(HEIGHT_LATEST, &mut cache, &mut instance)?;
+
+        self.trusted_state_store
+            .save(self.runtime_version, &instance.state.light_store);
+
+        let mut last_saved_verified_block_height =
+            verified_block.signed_header.header.height.value();
+
+        info!(self.logger, "Consensus verifier synced";
+            "latest_height" => cache.latest_known_height(),
+        );
+
+        // Verify state freshness with freshness proof. This step is required only for clients
+        // as executors and key managers verify freshness regularly using node registration
+        // (RAK with random nonces).
+        self.verify_freshness_with_proof(&mut instance, &mut cache)?;
+
+        // Start the command processing loop.
+        loop {
+            let command = self.command_receiver.recv().map_err(|_| Error::Internal)?;
+
+            match command {
+                Command::Synchronize(height, sender) => {
+                    sender
+                        .send(self.sync(&mut cache, &mut instance, height))
+                        .map_err(|_| Error::Internal)?;
+                }
+                Command::Verify(consensus_block, runtime_header, epoch, sender, false) => {
+                    sender
+                        .send(self.verify(
+                            &mut cache,
+                            &mut instance,
+                            consensus_block,
+                            runtime_header,
+                            epoch,
+                        ))
+                        .map_err(|_| Error::Internal)?;
+                }
+                Command::Verify(consensus_block, runtime_header, epoch, sender, true) => {
+                    sender
+                        .send(self.verify_for_query(
+                            &mut cache,
+                            &mut instance,
+                            consensus_block,
+                            runtime_header,
+                            epoch,
+                        ))
+                        .map_err(|_| Error::Internal)?;
+                }
+                Command::LatestState(sender) => {
+                    sender
+                        .send(self.latest_consensus_state(&mut cache, &mut instance))
+                        .map_err(|_| Error::Internal)?;
+                }
+                Command::StateAt(height, sender) => {
+                    sender
+                        .send(self.consensus_state_at(&mut cache, &mut instance, height))
+                        .map_err(|_| Error::Internal)?;
+                }
+                Command::LatestHeight(sender) => {
+                    sender
+                        .send(self.latest_consensus_height(&cache))
+                        .map_err(|_| Error::Internal)?;
+                }
+                Command::EventsAt(height, kind, sender) => {
+                    sender
+                        .send(self.events_at(height, kind))
+                        .map_err(|_| Error::Internal)?;
+                }
+            }
+
+            // Persist last verified block once in a while.
+            if let Some(last_verified_block) = cache.last_verified_block.as_ref() {
+                let last_height = last_verified_block.signed_header.header.height.into();
+                if last_height - last_saved_verified_block_height > TRUSTED_STATE_SAVE_INTERVAL {
+                    self.trusted_state_store
+                        .save(self.runtime_version, &instance.state.light_store);
+                    last_saved_verified_block_height = last_height;
+                }
+            }
+        }
+    }
+
+    fn handle_chain_context_change(
+        &self,
+        mut trusted_state: TrustedState,
+        verifier: &impl TMVerifier,
+        clock: &impl components::clock::Clock,
+        io: &Io,
+    ) -> Result<TrustedState, Error> {
+        let host_info = self.protocol.get_host_info();
+
+        // Nothing to handle.
+        if trusted_state.trust_root.chain_context == host_info.consensus_chain_context {
+            info!(self.logger, "Consensus chain context hasn't changed");
+            return Ok(trusted_state);
+        }
+        info!(self.logger, "Consensus chain context has changed");
+
+        // Chain context transition cannot be done directly from the embedded
+        // trust root as we don't have access to the matching trusted light
+        // block which validator set we need to verify blocks from the new chain.
+        let trusted_block: TMLightBlock = trusted_state
+            .trusted_blocks
+            .pop()
+            .ok_or_else(|| {
+                Error::ChainContextTransitionFailed(anyhow!(
+                    "cannot transition from embedded trust root"
+                ))
+            })?
+            .into();
+
+        // Fetch genesis block from the host and prepare untrusted state for
+        // verification. Since host cannot be trusted we need to verify if
+        // fetched height and block belong to the genesis.
+        let height = io
+            .fetch_genesis_height()
+            .map_err(|err| Error::ChainContextTransitionFailed(err.into()))?;
+        let height = AtHeight::At(height.try_into().unwrap());
+        let untrusted_block = components::io::Io::fetch_light_block(io, height)
+            .map_err(|err| Error::ChainContextTransitionFailed(err.into()))?;
+
+        if untrusted_block.signed_header.header.last_block_id.is_some() {
+            return Err(Error::ChainContextTransitionFailed(anyhow!(
+                "invalid genesis block"
+            )));
+        }
+
+        let untrusted = untrusted_block.as_untrusted_state();
+
+        // Prepare trusted state for verification. As we are using the verifier
+        // to verify the untrusted block and state transition, we must make
+        // sure that trusted and untrusted states don't belong to consecutive
+        // blocks as otherwise validator set hash will get verified also.
+        // Keeping heights at minimum distance of 2 will make sure that the
+        // verifier will check if there is enough overlap between the validator
+        // sets.
+        let header = trusted_block.signed_header.header;
+        let height = header.height;
+        let height = if height.increment() != untrusted.height() {
+            height
+        } else {
+            height
+                .value()
+                .checked_sub(1)
+                .ok_or_else(|| Error::ChainContextTransitionFailed(anyhow!("height underflow")))?
+                .try_into()
+                .unwrap()
+        };
+
+        let trusted = TrustedBlockState {
+            header_time: header.time,
+            height,
+            next_validators: &trusted_block.validators,
+            next_validators_hash: header.validators_hash,
+            // We need to use the target chain ID as we know it has changed.
+            chain_id: &chain_id(&host_info.consensus_chain_context),
+        };
+
+        // Verify the new block using +2/3 trust threshold rule.
+        let options = light_client::Options {
+            trust_threshold: TrustThreshold::TWO_THIRDS,
+            trusting_period: Duration::from_secs(3600 * 24 * 365 * 10), // 10 years
+            clock_drift: Duration::from_secs(60),
+        };
+        let now = clock.now();
+
+        let verdict = verifier.verify_update_header(untrusted, trusted, &options, now);
+
+        match verdict {
+            Verdict::Success => (),
+            Verdict::NotEnoughTrust(tally) => {
+                info!(
+                    self.logger,
+                    "Not enough trust to accept new chain context";
+                    "log_event" => "consensus/cometbft/verifier/chain_context/no_trust",
+                    "tally" => ?tally,
+                );
+                return Err(Error::ChainContextTransitionFailed(anyhow!(
+                    "not enough trust"
+                )));
+            }
+            Verdict::Invalid(e) => {
+                info!(
+                    self.logger,
+                    "Failed to accept new chain context";
+                    "log_event" => "consensus/cometbft/verifier/chain_context/failed",
+                    "error" => ?e,
+                );
+                return Err(Error::ChainContextTransitionFailed(anyhow!(
+                    "invalid genesis block"
+                )));
+            }
+        }
+
+        info!(self.logger, "Consensus chain context transition done");
+
+        let header = &untrusted_block.signed_header.header;
+        let trust_root = TrustRoot {
+            height: header.height.into(),
+            hash: header.hash().to_string(),
+            runtime_id: self.runtime_id,
+            chain_context: host_info.consensus_chain_context,
+        };
+
+        Ok(TrustedState {
+            trust_root,
+            trusted_blocks: vec![untrusted_block.into()],
+        })
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/noop.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/noop.rs.html new file mode 100644 index 0000000000..9d51fd6eef --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/noop.rs.html @@ -0,0 +1,377 @@ +noop.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
use std::sync::{Arc, Mutex};
+
+use anyhow::anyhow;
+use async_trait::async_trait;
+use slog::info;
+
+use crate::{
+    common::{logger::get_logger, namespace::Namespace},
+    consensus::{
+        beacon::EpochTime,
+        roothash::Header,
+        state::ConsensusState,
+        tendermint::decode_light_block,
+        transaction::Transaction,
+        verifier::{self, Error},
+        BlockMetadata, Event, LightBlock, HEIGHT_LATEST, METHOD_META,
+    },
+    protocol::Protocol,
+    storage::mkvs::{Root, RootType},
+    types::{Body, EventKind, HostFetchConsensusEventsRequest, HostFetchConsensusEventsResponse},
+};
+
+struct Inner {
+    latest_height: Option<u64>,
+}
+
+/// A verifier which performs no verification.
+pub struct NopVerifier {
+    protocol: Arc<Protocol>,
+    inner: Arc<Mutex<Inner>>,
+}
+
+impl NopVerifier {
+    /// Create a new non-verifying verifier.
+    pub fn new(protocol: Arc<Protocol>) -> Self {
+        Self {
+            protocol,
+            inner: Arc::new(Mutex::new(Inner {
+                latest_height: None,
+            })),
+        }
+    }
+
+    /// Start the non-verifying verifier.
+    pub fn start(&self) {
+        let logger = get_logger("consensus/cometbft/verifier");
+        info!(logger, "Starting consensus noop verifier");
+    }
+
+    async fn fetch_light_block(&self, height: u64) -> Result<LightBlock, Error> {
+        let result = self
+            .protocol
+            .call_host_async(Body::HostFetchConsensusBlockRequest { height })
+            .await
+            .map_err(|err| Error::VerificationFailed(err.into()))?;
+
+        match result {
+            Body::HostFetchConsensusBlockResponse { block } => Ok(block),
+            _ => Err(Error::VerificationFailed(anyhow!("bad response from host"))),
+        }
+    }
+}
+
+#[async_trait]
+impl verifier::Verifier for NopVerifier {
+    async fn sync(&self, height: u64) -> Result<(), Error> {
+        let mut inner = self.inner.lock().unwrap();
+        inner.latest_height = Some(height);
+
+        Ok(())
+    }
+
+    async fn verify(
+        &self,
+        consensus_block: LightBlock,
+        _runtime_header: Header,
+        _epoch: EpochTime,
+    ) -> Result<ConsensusState, Error> {
+        self.unverified_state(consensus_block).await
+    }
+
+    async fn verify_for_query(
+        &self,
+        consensus_block: LightBlock,
+        _runtime_header: Header,
+        _epoch: EpochTime,
+    ) -> Result<ConsensusState, Error> {
+        self.unverified_state(consensus_block).await
+    }
+
+    async fn unverified_state(&self, consensus_block: LightBlock) -> Result<ConsensusState, Error> {
+        let untrusted_block =
+            decode_light_block(consensus_block).map_err(Error::VerificationFailed)?;
+        // NOTE: No actual verification is performed.
+        let state_root = untrusted_block.get_state_root();
+
+        let mut inner = self.inner.lock().unwrap();
+        if state_root.version + 1 > inner.latest_height.unwrap_or_default() {
+            inner.latest_height = Some(state_root.version + 1);
+        }
+
+        Ok(ConsensusState::from_protocol(
+            self.protocol.clone(),
+            state_root.version + 1,
+            state_root,
+        ))
+    }
+
+    async fn latest_state(&self) -> Result<ConsensusState, Error> {
+        let height = self.latest_height().await?;
+
+        // When latest state is requested we always perform same-block execution verification.
+        let result = self
+            .protocol
+            .call_host_async(Body::HostFetchBlockMetadataTxRequest { height })
+            .await
+            .map_err(|err| Error::StateRoot(err.into()))?;
+
+        // NOTE: This is a noop verifier so we do not verify the Merkle proof.
+        let signed_tx = match result {
+            Body::HostFetchBlockMetadataTxResponse { signed_tx, .. } => signed_tx,
+            _ => return Err(Error::StateRoot(anyhow!("bad response from host"))),
+        };
+
+        let tx: Transaction = cbor::from_slice(signed_tx.blob.as_slice()).map_err(|err| {
+            Error::TransactionVerificationFailed(anyhow!("failed to decode transaction: {}", err))
+        })?;
+
+        if tx.method != METHOD_META {
+            return Err(Error::StateRoot(anyhow!("invalid method name")));
+        }
+
+        let meta: BlockMetadata = cbor::from_value(tx.body).map_err(|err| {
+            Error::StateRoot(anyhow!(
+                "failed to decode block metadata transaction: {}",
+                err
+            ))
+        })?;
+
+        let state_root = Root {
+            namespace: Namespace::default(),
+            version: height,
+            root_type: RootType::State,
+            hash: meta.state_root,
+        };
+
+        Ok(ConsensusState::from_protocol(
+            self.protocol.clone(),
+            state_root.version,
+            state_root,
+        ))
+    }
+
+    async fn state_at(&self, height: u64) -> Result<ConsensusState, Error> {
+        let block = self.fetch_light_block(height).await?;
+        self.unverified_state(block).await
+    }
+
+    async fn events_at(&self, height: u64, kind: EventKind) -> Result<Vec<Event>, Error> {
+        let result = self
+            .protocol
+            .call_host_async(Body::HostFetchConsensusEventsRequest(
+                HostFetchConsensusEventsRequest { height, kind },
+            ))
+            .await
+            .map_err(|err| Error::VerificationFailed(err.into()))?;
+
+        match result {
+            Body::HostFetchConsensusEventsResponse(HostFetchConsensusEventsResponse { events }) => {
+                Ok(events)
+            }
+            _ => Err(Error::VerificationFailed(anyhow!("bad response from host"))),
+        }
+    }
+
+    async fn latest_height(&self) -> Result<u64, Error> {
+        {
+            let inner = self.inner.lock().unwrap();
+            if let Some(latest_height) = inner.latest_height {
+                return Ok(latest_height);
+            }
+        }
+
+        let latest_height = self.fetch_light_block(HEIGHT_LATEST).await?.height;
+        self.sync(latest_height).await?;
+        Ok(latest_height)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/predicates.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/predicates.rs.html new file mode 100644 index 0000000000..482c905620 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/predicates.rs.html @@ -0,0 +1,259 @@ +predicates.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+
use anyhow::anyhow;
+
+use crate::{
+    common::namespace::Namespace,
+    consensus::{
+        beacon::EpochTime,
+        roothash::Header,
+        state::{
+            beacon::ImmutableState as BeaconState, roothash::ImmutableState as RoothashState,
+            ConsensusState,
+        },
+        tendermint::{verifier::Cache, LightBlockMeta},
+        verifier::Error,
+        LightBlock,
+    },
+};
+
+/// Verifies that the namespace in the runtime header matches the trusted namespace.
+pub fn verify_namespace(trusted: Namespace, runtime_header: &Header) -> Result<(), Error> {
+    if trusted != runtime_header.namespace {
+        return Err(Error::VerificationFailed(anyhow!(
+            "header namespace does not match trusted runtime id"
+        )));
+    }
+
+    Ok(())
+}
+
+/// Verifies that consensus height has correctly advanced since the last update.
+pub fn verify_consensus_advance(cache: &Cache, consensus_block: &LightBlock) -> Result<(), Error> {
+    if consensus_block.height < cache.last_verified_height {
+        // Reject requests for earlier heights.
+        return Err(Error::VerificationFailed(anyhow!(
+            "height seems to have moved backwards"
+        )));
+    }
+
+    Ok(())
+}
+
+/// Verifies that the round has correctly advanced since the last update.
+pub fn verify_round_advance(
+    cache: &Cache,
+    runtime_header: &Header,
+    consensus_block: &LightBlock,
+    epoch: EpochTime,
+) -> Result<(), Error> {
+    if runtime_header.round < cache.last_verified_round {
+        // Reject requests for earlier rounds.
+        return Err(Error::VerificationFailed(anyhow!(
+            "round seems to have moved backwards"
+        )));
+    }
+    if epoch < cache.last_verified_epoch {
+        // Reject requests for earlier epochs.
+        return Err(Error::VerificationFailed(anyhow!(
+            "epoch seems to have moved backwards"
+        )));
+    }
+
+    // If round has advanced make sure that consensus height has also advanced as a round can
+    // only be finalized in a subsequent consensus block. This is to avoid a situation where
+    // one would keep feeding the same consensus block for subsequent rounds.
+    if runtime_header.round > cache.last_verified_round
+        && consensus_block.height <= cache.last_verified_height
+    {
+        return Err(Error::VerificationFailed(anyhow!(
+            "consensus height did not advance but runtime round did"
+        )));
+    }
+
+    Ok(())
+}
+
+/// Verifies that the runtime header has time consistent with the consensus header.
+pub fn verify_time(runtime_header: &Header, consensus_block: &LightBlockMeta) -> Result<(), Error> {
+    let consensus_header = &consensus_block
+        .signed_header
+        .as_ref()
+        .ok_or_else(|| Error::VerificationFailed(anyhow!("missing signed header")))?
+        .header;
+    if runtime_header.timestamp != consensus_header.time.unix_timestamp() as u64 {
+        return Err(Error::VerificationFailed(anyhow!(
+            "runtime block timestamp inconsistent with consensus time"
+        )));
+    }
+
+    Ok(())
+}
+
+/// Verifies that the runtime header has state root consistent with consensus state.
+///
+/// Assumes the namespace in the runtime header has already been verified via `verify_namespace`.
+pub fn verify_state_root(state: &ConsensusState, runtime_header: &Header) -> Result<(), Error> {
+    let roothash_state = RoothashState::new(&state);
+    let state_root = roothash_state
+        .state_root(runtime_header.namespace)
+        .map_err(|err| {
+            Error::VerificationFailed(anyhow!("failed to retrieve trusted state root: {}", err))
+        })?;
+
+    if runtime_header.state_root != state_root {
+        return Err(Error::VerificationFailed(anyhow!(
+            "state root mismatch (expected: {} got: {})",
+            state_root,
+            runtime_header.state_root
+        )));
+    }
+
+    Ok(())
+}
+
+/// Verifies that the epoch is consistent with consensus state.
+pub fn verify_epoch(state: &ConsensusState, epoch: EpochTime) -> Result<(), Error> {
+    let beacon_state = BeaconState::new(&state);
+    let current_epoch = beacon_state
+        .epoch()
+        .map_err(|err| Error::VerificationFailed(anyhow!("failed to retrieve epoch: {}", err)))?;
+
+    if current_epoch != epoch {
+        return Err(Error::VerificationFailed(anyhow!(
+            "epoch number mismatch (expected: {} got: {})",
+            current_epoch,
+            epoch,
+        )));
+    }
+
+    Ok(())
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/signature.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/signature.rs.html new file mode 100644 index 0000000000..15a2cef731 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/signature.rs.html @@ -0,0 +1,43 @@ +signature.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+
use tendermint::{crypto::signature, PublicKey, Signature};
+
+use crate::{common::crypto::hash::Hash, consensus::tendermint::TENDERMINT_CONTEXT};
+
+/// A signature verifier that uses the Oasis Core domain separation scheme.
+#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
+pub struct DomSepVerifier;
+
+impl signature::Verifier for DomSepVerifier {
+    fn verify(
+        pubkey: PublicKey,
+        msg: &[u8],
+        signature: &Signature,
+    ) -> Result<(), signature::Error> {
+        // Use Oasis Core domain separation scheme.
+        let msg = Hash::digest_bytes_list(&[TENDERMINT_CONTEXT, msg]);
+
+        // Forward the actual verification to the Tendermint's default verifier.
+        tendermint::crypto::default::signature::Verifier::verify(pubkey, msg.as_ref(), signature)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/lru.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/lru.rs.html new file mode 100644 index 0000000000..e347f96e57 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/lru.rs.html @@ -0,0 +1,455 @@ +lru.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+
//! An in-memory LRU store for the light client.
+use std::{
+    num::NonZeroUsize,
+    sync::{Mutex, MutexGuard},
+};
+
+use tendermint_light_client::{
+    store::LightStore,
+    types::{Height, LightBlock, Status},
+};
+
+/// In-memory LRU store.
+pub struct LruStore {
+    inner: Mutex<Inner>,
+}
+
+impl std::fmt::Debug for LruStore {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
+        write!(f, "LruStore")
+    }
+}
+
+#[derive(Clone, Debug, PartialEq)]
+struct StoreEntry {
+    light_block: LightBlock,
+    status: Status,
+}
+
+impl StoreEntry {
+    fn new(light_block: LightBlock, status: Status) -> Self {
+        Self {
+            light_block,
+            status,
+        }
+    }
+}
+
+struct Inner {
+    trust_root_height: Height,
+    blocks: lru::LruCache<Height, StoreEntry>,
+}
+
+impl LruStore {
+    /// Create a new, empty, in-memory LRU store of the given capacity and trust root height.
+    pub fn new(capacity: usize, trust_root_height: Height) -> Self {
+        Self {
+            inner: Mutex::new(Inner {
+                trust_root_height,
+                blocks: lru::LruCache::new(NonZeroUsize::new(capacity).unwrap()),
+            }),
+        }
+    }
+
+    fn inner(&self) -> MutexGuard<'_, Inner> {
+        self.inner.lock().unwrap()
+    }
+
+    fn inner_mut(&mut self) -> &mut Inner {
+        self.inner.get_mut().unwrap()
+    }
+}
+
+impl LightStore for LruStore {
+    fn get(&self, height: Height, status: Status) -> Option<LightBlock> {
+        self.inner()
+            .blocks
+            .get(&height)
+            .filter(|e| e.status == status)
+            .map(|e| e.light_block.clone())
+    }
+
+    fn insert(&mut self, light_block: LightBlock, status: Status) {
+        let store = self.inner_mut();
+
+        // Promote trust root to prevent it from being evicted.
+        store.blocks.promote(&store.trust_root_height);
+
+        store
+            .blocks
+            .put(light_block.height(), StoreEntry::new(light_block, status));
+    }
+
+    fn remove(&mut self, height: Height, status: Status) {
+        let store = self.inner_mut();
+
+        // Prevent removal of trust root.
+        if height == store.trust_root_height {
+            return;
+        }
+
+        if store
+            .blocks
+            .get(&height)
+            .map(|e| e.status != status)
+            .unwrap_or(true)
+        {
+            return;
+        }
+        store.blocks.pop(&height);
+    }
+
+    fn update(&mut self, light_block: &LightBlock, status: Status) {
+        self.insert(light_block.clone(), status)
+    }
+
+    fn highest(&self, status: Status) -> Option<LightBlock> {
+        self.inner()
+            .blocks
+            .iter()
+            .filter(|(_, e)| e.status == status)
+            .max_by_key(|(&height, _)| height)
+            .map(|(_, e)| e.light_block.clone())
+    }
+
+    fn highest_before(&self, height: Height, status: Status) -> Option<LightBlock> {
+        self.inner()
+            .blocks
+            .iter()
+            .filter(|(_, e)| e.status == status)
+            .filter(|(h, _)| h <= &&height)
+            .max_by_key(|(&height, _)| height)
+            .map(|(_, e)| e.light_block.clone())
+    }
+
+    fn lowest(&self, status: Status) -> Option<LightBlock> {
+        self.inner()
+            .blocks
+            .iter()
+            .filter(|(_, e)| e.status == status)
+            .min_by_key(|(&height, _)| height)
+            .map(|(_, e)| e.light_block.clone())
+    }
+
+    #[allow(clippy::needless_collect)]
+    fn all(&self, status: Status) -> Box<dyn Iterator<Item = LightBlock>> {
+        let light_blocks: Vec<_> = self
+            .inner()
+            .blocks
+            .iter()
+            .filter(|(_, e)| e.status == status)
+            .map(|(_, e)| e.light_block.clone())
+            .collect();
+
+        Box::new(light_blocks.into_iter())
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use tendermint_light_client::{
+        store::LightStore,
+        types::{LightBlock, Status},
+    };
+    use tendermint_testgen::{Generator, LightChain};
+
+    use super::LruStore;
+
+    fn generate_blocks(count: u64) -> Vec<LightBlock> {
+        LightChain::default_with_length(count)
+            .light_blocks
+            .into_iter()
+            .map(|lb| lb.generate().unwrap())
+            .map(|lb| LightBlock {
+                signed_header: lb.signed_header,
+                validators: lb.validators,
+                next_validators: lb.next_validators,
+                provider: lb.provider,
+            })
+            .collect()
+    }
+
+    #[test]
+    fn test_trust_root_height_retained() {
+        let blocks = generate_blocks(10);
+        let mut store = LruStore::new(2, blocks[0].height()); // Only storing two blocks.
+        store.insert(blocks[0].clone(), Status::Trusted);
+        store.insert(blocks[1].clone(), Status::Trusted);
+        store.insert(blocks[2].clone(), Status::Trusted);
+        store.insert(blocks[3].clone(), Status::Trusted);
+
+        let lowest = store
+            .lowest(Status::Trusted)
+            .expect("there should be a lowest block");
+        assert_eq!(lowest, blocks[0]);
+    }
+
+    #[test]
+    fn test_basic() {
+        let blocks = generate_blocks(10);
+        let mut store = LruStore::new(10, blocks[0].height());
+        for block in &blocks {
+            store.insert(block.clone(), Status::Trusted);
+
+            // Block should be stored.
+            let stored_block = store.get(block.height(), Status::Trusted);
+            assert_eq!(stored_block.as_ref(), Some(block));
+
+            // Highest and lowest blocks should be correct.
+            let highest = store
+                .highest(Status::Trusted)
+                .expect("there should be a highest block");
+            let lowest = store
+                .lowest(Status::Trusted)
+                .expect("there should be a lowest block");
+            assert_eq!(&highest, block);
+            assert_eq!(lowest, blocks[0]);
+
+            // Highest before should work.
+            let highest_before = store.highest_before(block.height(), Status::Trusted);
+            assert_eq!(highest_before.as_ref(), Some(block));
+
+            let highest_before = store.highest_before(block.height().increment(), Status::Trusted);
+            assert_eq!(highest_before.as_ref(), Some(block));
+        }
+
+        // Test removal of trust root block.
+        store.remove(blocks[0].height(), Status::Trusted);
+
+        let block_zero = store.get(blocks[0].height(), Status::Trusted);
+        assert_eq!(block_zero.as_ref(), Some(&blocks[0]));
+
+        let lowest = store
+            .lowest(Status::Trusted)
+            .expect("there should be a lowest block");
+        assert_eq!(lowest, blocks[0]);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/mod.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/mod.rs.html new file mode 100644 index 0000000000..39b80d7554 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/mod.rs.html @@ -0,0 +1,19 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+
// Modules.
+mod lru;
+mod state;
+
+// Re-exports.
+pub use self::{
+    lru::LruStore,
+    state::{TrustedState, TrustedStateStore},
+};
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/state.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/state.rs.html new file mode 100644 index 0000000000..97ebe6683f --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/store/state.rs.html @@ -0,0 +1,377 @@ +state.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+
use std::sync::Arc;
+
+use sgx_isa::Keypolicy;
+use tendermint_light_client::{
+    store::LightStore,
+    types::{LightBlock as TMLightBlock, Status},
+};
+
+use crate::{
+    common::{
+        namespace::Namespace,
+        sgx::{seal, EnclaveIdentity},
+        version::Version,
+    },
+    consensus::verifier::{Error, TrustRoot},
+    protocol::ProtocolUntrustedLocalStorage,
+    storage::KeyValue,
+    Protocol, TeeType, BUILD_INFO,
+};
+
+/// Storage key prefix under which the sealed trusted state is stored in
+/// the untrusted local storage.
+///
+/// The actual key includes the MRENCLAVE to support upgrades.
+const TRUSTED_STATE_STORAGE_KEY_PREFIX: &str = "tendermint.verifier.trusted_state";
+
+/// Domain separation context for the trusted state.
+const TRUSTED_STATE_CONTEXT: &[u8] = b"oasis-core/verifier: trusted state";
+
+/// An encoded Tendermint light block.
+#[derive(Debug, Clone)]
+pub struct EncodedLightBlock(TMLightBlock);
+
+impl From<TMLightBlock> for EncodedLightBlock {
+    fn from(value: TMLightBlock) -> Self {
+        Self(value)
+    }
+}
+
+impl From<EncodedLightBlock> for TMLightBlock {
+    fn from(value: EncodedLightBlock) -> Self {
+        value.0
+    }
+}
+
+impl cbor::Encode for EncodedLightBlock {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::serde::to_value(&self.0).unwrap()
+    }
+}
+
+impl cbor::Decode for EncodedLightBlock {
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        cbor::serde::from_value(value)
+            .map_err(|_| cbor::DecodeError::ParsingFailed)
+            .map(Self)
+    }
+}
+
+/// Trusted state containing trust root and trusted light block.
+#[derive(Debug, Clone, Default, cbor::Encode, cbor::Decode)]
+pub struct TrustedState {
+    /// Trust root.
+    pub trust_root: TrustRoot,
+    /// Trusted light blocks, ordered by height from lowest to highest.
+    ///
+    /// Optional as we don't want to force trusted state for embedded trust
+    /// root to have a matching trusted light block.
+    pub trusted_blocks: Vec<EncodedLightBlock>,
+}
+
+/// Untrusted local storage for storing the sealed latest trusted root.
+pub struct TrustedStateStore {
+    runtime_id: Namespace,
+    chain_context: String,
+    untrusted_local_store: ProtocolUntrustedLocalStorage,
+}
+
+impl TrustedStateStore {
+    /// Create a new trusted state local store.
+    pub fn new(runtime_id: Namespace, chain_context: String, protocol: Arc<Protocol>) -> Self {
+        let untrusted_local_store = ProtocolUntrustedLocalStorage::new(protocol);
+
+        Self {
+            runtime_id,
+            chain_context,
+            untrusted_local_store,
+        }
+    }
+
+    /// Persist latest trusted state from the in-memory light store.
+    ///
+    /// # Panics
+    ///
+    /// Panics in case the light store does not have any blocks or if insertion to the underlying
+    /// runtime's untrusted local store fails.
+    pub fn save(&self, runtime_version: Version, store: &Box<dyn LightStore>) {
+        if BUILD_INFO.tee_type == TeeType::Tdx {
+            // TODO: Currently TDX does not have sealing capabilities, so we just do not persist
+            //       anything as we can't seal secrets until we have CPU-bound key derivation.
+            return;
+        }
+
+        let lowest_block = store.lowest(Status::Trusted).unwrap();
+        let highest_block = store.highest(Status::Trusted).unwrap();
+
+        // Generate a new trust root from the highest trusted block.
+        let trust_root = TrustRoot {
+            height: highest_block.height().into(),
+            hash: highest_block.signed_header.header.hash().to_string(),
+            runtime_id: self.runtime_id,
+            chain_context: self.chain_context.clone(),
+        };
+
+        let trusted_state = TrustedState {
+            trust_root,
+            trusted_blocks: vec![lowest_block.into(), highest_block.into()],
+        };
+
+        // Serialize and seal the trusted state.
+        let raw = cbor::to_vec(trusted_state);
+        let sealed = seal::seal(Keypolicy::MRENCLAVE, TRUSTED_STATE_CONTEXT, &raw);
+
+        // Store the trusted state.
+        self.untrusted_local_store
+            .insert(Self::derive_storage_key(runtime_version), sealed)
+            .unwrap();
+    }
+
+    /// Attempts to load previously sealed trusted state.
+    ///
+    /// If no sealed trusted state is available, it returns state based on the passed trust root.
+    pub fn load(
+        &self,
+        runtime_version: Version,
+        trust_root: &TrustRoot,
+    ) -> Result<TrustedState, Error> {
+        if BUILD_INFO.tee_type == TeeType::Tdx {
+            // TODO: Currently TDX does not have sealing capabilities, so we just do not persist
+            //       anything as we can't seal secrets until we have CPU-bound key derivation.
+            return Ok(TrustedState {
+                trust_root: trust_root.clone(),
+                trusted_blocks: vec![],
+            });
+        }
+
+        // Attempt to load the previously sealed trusted state.
+        let untrusted_value = self
+            .untrusted_local_store
+            .get(Self::derive_storage_key(runtime_version))
+            .map_err(|_| Error::TrustedStateLoadingFailed)?;
+        if untrusted_value.is_empty() {
+            return Ok(TrustedState {
+                trust_root: trust_root.clone(),
+                trusted_blocks: vec![],
+            });
+        }
+
+        // Unseal the sealed trusted state.
+        let raw = seal::unseal(
+            Keypolicy::MRENCLAVE,
+            TRUSTED_STATE_CONTEXT,
+            &untrusted_value,
+        )
+        .map_err(|_| Error::TrustedStateLoadingFailed)?
+        .unwrap();
+
+        let trusted_state: TrustedState =
+            cbor::from_slice(&raw).expect("corrupted sealed trusted state");
+
+        Ok(trusted_state)
+    }
+
+    fn derive_storage_key(runtime_version: Version) -> Vec<u8> {
+        // Namespace storage key by MRENCLAVE as we can only unseal our own sealed data and we need
+        // to support upgrades. We assume that an upgrade will include an up-to-date trusted state
+        // anyway.
+        format!(
+            "{}.{}.{:x}",
+            TRUSTED_STATE_STORAGE_KEY_PREFIX,
+            u64::from(runtime_version),
+            EnclaveIdentity::current()
+                .map(|eid| eid.mr_enclave)
+                .unwrap_or_default()
+        )
+        .into_bytes()
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/tendermint/verifier/types.rs.html b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/types.rs.html new file mode 100644 index 0000000000..685f500755 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/tendermint/verifier/types.rs.html @@ -0,0 +1,63 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
use tokio::sync::oneshot;
+
+use crate::{
+    consensus::{
+        beacon::EpochTime, roothash::Header, state::ConsensusState, verifier::Error, Event,
+        LightBlock,
+    },
+    types::EventKind,
+};
+
+/// Size of nonce for prove freshness request.
+pub const NONCE_SIZE: usize = 32;
+
+/// Nonce for prove freshness request.
+pub type Nonce = [u8; NONCE_SIZE];
+
+/// Command sent to the verifier thread.
+pub enum Command {
+    Synchronize(u64, oneshot::Sender<Result<(), Error>>),
+    Verify(
+        LightBlock,
+        Header,
+        EpochTime,
+        oneshot::Sender<Result<ConsensusState, Error>>,
+        bool,
+    ),
+    LatestState(oneshot::Sender<Result<ConsensusState, Error>>),
+    LatestHeight(oneshot::Sender<Result<u64, Error>>),
+    StateAt(u64, oneshot::Sender<Result<ConsensusState, Error>>),
+    EventsAt(u64, EventKind, oneshot::Sender<Result<Vec<Event>, Error>>),
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/transaction.rs.html b/rust/src/oasis_core_runtime/consensus/transaction.rs.html new file mode 100644 index 0000000000..77315d5130 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/transaction.rs.html @@ -0,0 +1,143 @@ +transaction.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
use crate::common::{
+    crypto::signature::{signature_context_with_chain_separation, Signed},
+    quantity::Quantity,
+};
+
+pub const SIGNATURE_CONTEXT: &[u8] = b"oasis-core/consensus: tx";
+
+fn signature_context(chain_context: &String) -> Vec<u8> {
+    let context = SIGNATURE_CONTEXT.to_vec();
+    signature_context_with_chain_separation(context, chain_context)
+}
+
+/// Unsigned consensus transaction.
+#[derive(Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Transaction {
+    /// Nonce to prevent replay.
+    pub nonce: u64,
+    /// Optional fee that the sender commits to pay to execute this transaction.
+    pub fee: Option<Fee>,
+
+    /// Method that should be called.
+    pub method: MethodName,
+    /// Method call body.
+    pub body: cbor::Value,
+}
+
+/// Signed consensus transaction.
+pub type SignedTransaction = Signed;
+
+impl SignedTransaction {
+    /// Returns true iff the signature is valid.
+    pub fn verify(&self, chain_context: &String) -> bool {
+        let context = signature_context(chain_context);
+        self.signature.verify(&context, &self.blob)
+    }
+}
+
+/// Consensus transaction fee the sender wishes to pay for operations which
+/// require a fee to be paid to validators.
+#[derive(Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Fee {
+    /// Fee amount to be paid.
+    pub amount: Quantity,
+    /// Maximum gas that a transaction can use.
+    pub gas: Gas,
+}
+
+/// Consensus gas representation.
+pub type Gas = u64;
+
+/// Method name.
+pub type MethodName = String;
+
+/// Proof of transaction inclusion in a block.
+#[derive(Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Proof {
+    /// Block height at which the transaction was published.
+    pub height: u64,
+    /// Actual raw proof.
+    pub raw_proof: Vec<u8>,
+}
+
+/// Signed consensus transaction with a proof of its inclusion in a block.
+#[derive(Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct SignedTransactionWithProof {
+    /// Signed transaction.
+    pub signed_tx: SignedTransaction,
+    /// Proof of transaction inclusion in a block.
+    pub proof: Proof,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/consensus/verifier.rs.html b/rust/src/oasis_core_runtime/consensus/verifier.rs.html new file mode 100644 index 0000000000..7b0d6ae021 --- /dev/null +++ b/rust/src/oasis_core_runtime/consensus/verifier.rs.html @@ -0,0 +1,445 @@ +verifier.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+
//! Trait for consensus layer verification.
+use std::sync::Arc;
+
+use anyhow::anyhow;
+use async_trait::async_trait;
+use thiserror::Error;
+
+use super::{
+    beacon::EpochTime,
+    roothash::Header,
+    state::{registry::ImmutableState as RegistryState, ConsensusState},
+    Event, LightBlock,
+};
+use crate::{
+    common::{crypto::signature::PublicKey, namespace::Namespace, version::Version},
+    identity::Identity,
+    types::{self, EventKind},
+};
+
+#[derive(Debug, Error)]
+pub enum Error {
+    #[error("builder: {0}")]
+    Builder(#[source] anyhow::Error),
+
+    #[error("verification: {0}")]
+    VerificationFailed(#[source] anyhow::Error),
+
+    #[error("trusted state loading failed")]
+    TrustedStateLoadingFailed,
+
+    #[error("consensus chain context transition failed: {0}")]
+    ChainContextTransitionFailed(#[source] anyhow::Error),
+
+    #[error("freshness verification: {0}")]
+    FreshnessVerificationFailed(#[source] anyhow::Error),
+
+    #[error("transaction verification: {0}")]
+    TransactionVerificationFailed(#[source] anyhow::Error),
+
+    #[error("state root: {0}")]
+    StateRoot(#[source] anyhow::Error),
+
+    #[error("internal consensus verifier error")]
+    Internal,
+}
+
+impl Error {
+    fn code(&self) -> u32 {
+        match self {
+            Error::Builder(_) => 1,
+            Error::VerificationFailed(_) => 2,
+            Error::TrustedStateLoadingFailed => 3,
+            Error::ChainContextTransitionFailed(_) => 4,
+            Error::FreshnessVerificationFailed(_) => 5,
+            Error::TransactionVerificationFailed(_) => 6,
+            Error::StateRoot(_) => 7,
+            Error::Internal => 8,
+        }
+    }
+}
+
+impl From<Error> for types::Error {
+    fn from(e: Error) -> Self {
+        Self {
+            module: "verifier".to_string(),
+            code: e.code(),
+            message: e.to_string(),
+        }
+    }
+}
+
+/// Verifier is the consensus layer state verifier trait.
+#[async_trait]
+pub trait Verifier: Send + Sync {
+    /// Synchronize the verifier state up to including the passed consensus height.
+    async fn sync(&self, height: u64) -> Result<(), Error>;
+
+    /// Verify that the given runtime header is valid at the given consensus layer block and return
+    /// the consensus layer state accessor for that block.
+    ///
+    /// This also verifies that the state is fresh.
+    async fn verify(
+        &self,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Result<ConsensusState, Error>;
+
+    /// Verify that the given runtime header is valid at the given consensus layer block and return
+    /// the consensus layer state accessor for that block.
+    ///
+    /// This is a relaxed version of the `verify` function that should be used for verifying state
+    /// in queries.
+    async fn verify_for_query(
+        &self,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Result<ConsensusState, Error>;
+
+    /// Return the consensus layer state accessor for the given consensus layer block WITHOUT
+    /// performing any verification. This method should only be used for operations that do not
+    /// require integrity guarantees.
+    async fn unverified_state(&self, consensus_block: LightBlock) -> Result<ConsensusState, Error>;
+
+    /// Return the latest verified consensus layer state.
+    ///
+    /// # Warning
+    ///
+    /// The state is not verified to be fresh. Use `verify_state_freshness` to perform this
+    /// verification manually if needed.
+    async fn latest_state(&self) -> Result<ConsensusState, Error>;
+
+    /// Return the verified consensus layer state for a given height.
+    ///
+    /// # Warning
+    ///
+    /// The state is not verified to be fresh. Use `verify_state_freshness` to perform this
+    /// verification manually if needed.
+    async fn state_at(&self, height: u64) -> Result<ConsensusState, Error>;
+
+    /// Return the consensus layer events at the given height.
+    ///
+    /// # Warning
+    ///
+    /// Event integrity is currently not verified and it thus relies on replicated computation even
+    /// when using a TEE-enabled runtime.
+    async fn events_at(&self, height: u64, kind: EventKind) -> Result<Vec<Event>, Error>;
+
+    /// Return the latest known consensus layer height.
+    async fn latest_height(&self) -> Result<u64, Error>;
+}
+
+#[async_trait]
+impl<T: ?Sized + Verifier> Verifier for Arc<T> {
+    async fn sync(&self, height: u64) -> Result<(), Error> {
+        Verifier::sync(&**self, height).await
+    }
+
+    async fn verify(
+        &self,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Result<ConsensusState, Error> {
+        Verifier::verify(&**self, consensus_block, runtime_header, epoch).await
+    }
+
+    async fn verify_for_query(
+        &self,
+        consensus_block: LightBlock,
+        runtime_header: Header,
+        epoch: EpochTime,
+    ) -> Result<ConsensusState, Error> {
+        Verifier::verify_for_query(&**self, consensus_block, runtime_header, epoch).await
+    }
+
+    async fn unverified_state(&self, consensus_block: LightBlock) -> Result<ConsensusState, Error> {
+        Verifier::unverified_state(&**self, consensus_block).await
+    }
+
+    async fn latest_state(&self) -> Result<ConsensusState, Error> {
+        Verifier::latest_state(&**self).await
+    }
+
+    async fn state_at(&self, height: u64) -> Result<ConsensusState, Error> {
+        Verifier::state_at(&**self, height).await
+    }
+
+    async fn events_at(&self, height: u64, kind: EventKind) -> Result<Vec<Event>, Error> {
+        Verifier::events_at(&**self, height, kind).await
+    }
+
+    async fn latest_height(&self) -> Result<u64, Error> {
+        Verifier::latest_height(&**self).await
+    }
+}
+
+/// Consensus layer trust root.
+#[derive(Debug, Clone, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct TrustRoot {
+    /// Known trusted height.
+    pub height: u64,
+    /// Known hex-encoded trusted consensus layer header hash.
+    pub hash: String,
+    /// Known runtime identifier.
+    pub runtime_id: Namespace,
+    /// Known consensus chain context.
+    pub chain_context: String,
+}
+
+/// Verify consensus layer state freshness based on our internal state.
+pub fn verify_state_freshness(
+    state: &ConsensusState,
+    identity: &Identity,
+    runtime_id: &Namespace,
+    version: &Version,
+    host_node_id: &PublicKey,
+) -> Result<(), Error> {
+    let registry_state = RegistryState::new(&state);
+
+    let node = registry_state.node(host_node_id).map_err(|err| {
+        Error::VerificationFailed(anyhow!(
+            "failed to retrieve node from the registry: {}",
+            err
+        ))
+    })?;
+    let node = node.ok_or_else(|| {
+        Error::VerificationFailed(anyhow!(
+            "own node ID '{}' not found in registry state",
+            host_node_id,
+        ))
+    })?;
+
+    if !node.has_tee(identity, runtime_id, version) {
+        return Err(Error::VerificationFailed(anyhow!(
+            "own identity not found in registry state"
+        )));
+    }
+
+    Ok(())
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/dispatcher.rs.html b/rust/src/oasis_core_runtime/dispatcher.rs.html new file mode 100644 index 0000000000..28bf9bf77e --- /dev/null +++ b/rust/src/oasis_core_runtime/dispatcher.rs.html @@ -0,0 +1,2015 @@ +dispatcher.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+
//! Runtime call dispatcher.
+use std::{
+    convert::TryInto,
+    sync::{Arc, Condvar, Mutex},
+    thread,
+};
+
+use anyhow::Result as AnyResult;
+use rustc_hex::ToHex;
+use slog::{debug, error, info, warn, Logger};
+use tokio::sync::mpsc;
+
+use crate::{
+    app, attestation, cache,
+    common::{
+        crypto::{hash::Hash, signature::Signer},
+        logger::get_logger,
+        panic::AbortOnPanic,
+        sgx::QuotePolicy,
+    },
+    consensus::{
+        beacon::EpochTime,
+        roothash::{self, ComputeResultsHeader, Header, COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT},
+        state::keymanager::Status as KeyManagerStatus,
+        verifier::Verifier,
+        LightBlock,
+    },
+    enclave_rpc::{
+        demux::Demux as RpcDemux,
+        dispatcher::Dispatcher as RpcDispatcher,
+        session::{self, SessionInfo},
+        types::{
+            Kind as RpcKind, Message as RpcMessage, Request as RpcRequest, Response as RpcResponse,
+        },
+        Context as RpcContext,
+    },
+    future::block_on,
+    identity::Identity,
+    policy::PolicyVerifier,
+    protocol::Protocol,
+    storage::mkvs::{sync::NoopReadSyncer, OverlayTree, Root, RootType},
+    transaction::{
+        dispatcher::{Dispatcher as TxnDispatcher, NoopDispatcher as TxnNoopDispatcher},
+        tree::Tree as TxnTree,
+        types::TxnBatch,
+        Context as TxnContext,
+    },
+    types::{Body, ComputedBatch, Error, ExecutionMode},
+};
+
+/// Maximum amount of requests that can be in the dispatcher queue.
+const BACKLOG_SIZE: usize = 1000;
+
+/// Maximum total number of EnclaveRPC sessions.
+const RPC_MAX_SESSIONS: usize = 1024;
+/// Maximum concurrent EnclaveRPC sessions per peer. In case more sessions are open, old sessions
+/// will be closed to make room for new sessions.
+const RPC_MAX_SESSIONS_PER_PEER: usize = 8;
+/// EnclaveRPC sessions without any processed frame for more than RPC_STALE_SESSION_TIMEOUT_SECS
+/// seconds can be closed to make room for new sessions.
+const RPC_STALE_SESSION_TIMEOUT_SECS: i64 = 10;
+
+/// Interface for dispatcher initializers.
+pub trait Initializer: Send + Sync {
+    /// Initializes the dispatcher(s).
+    fn init(self: Box<Self>, state: PreInitState<'_>) -> PostInitState;
+}
+
+impl<F> Initializer for F
+where
+    F: FnOnce(PreInitState<'_>) -> PostInitState + Send + Sync,
+{
+    fn init(self: Box<Self>, state: PreInitState<'_>) -> PostInitState {
+        self(state)
+    }
+}
+
+/// State available before initialization.
+pub struct PreInitState<'a> {
+    /// Protocol instance.
+    pub protocol: &'a Arc<Protocol>,
+    /// Runtime Attestation Key instance.
+    pub identity: &'a Arc<Identity>,
+    /// RPC demultiplexer instance.
+    pub rpc_demux: &'a mut RpcDemux,
+    /// RPC dispatcher instance.
+    pub rpc_dispatcher: &'a mut RpcDispatcher,
+    /// Consensus verifier instance.
+    pub consensus_verifier: &'a Arc<dyn Verifier>,
+}
+
+/// State returned by the initializer.
+#[derive(Default)]
+pub struct PostInitState {
+    /// Optional transaction dispatcher that should be used.
+    pub txn_dispatcher: Option<Box<dyn TxnDispatcher>>,
+    /// Optional ROFL application.
+    pub app: Option<Box<dyn app::App>>,
+}
+
+impl From<tokio::task::JoinError> for Error {
+    fn from(e: tokio::task::JoinError) -> Self {
+        Error::new(
+            "dispatcher",
+            1,
+            &format!("error while processing request: {e}"),
+        )
+    }
+}
+
+/// State related to dispatching a runtime transaction.
+struct TxDispatchState {
+    mode: ExecutionMode,
+    consensus_block: LightBlock,
+    consensus_verifier: Arc<dyn Verifier>,
+    header: Header,
+    epoch: EpochTime,
+    round_results: roothash::RoundResults,
+    max_messages: u32,
+    check_only: bool,
+}
+
+/// State provided by the protocol upon successful initialization.
+struct ProtocolState {
+    protocol: Arc<Protocol>,
+    consensus_verifier: Arc<dyn Verifier>,
+}
+
+/// State held by the dispatcher, shared between all async tasks.
+#[derive(Clone)]
+struct State {
+    protocol: Arc<Protocol>,
+    consensus_verifier: Arc<dyn Verifier>,
+    dispatcher: Arc<Dispatcher>,
+    app: Arc<dyn app::App>,
+    rpc_demux: Arc<RpcDemux>,
+    rpc_dispatcher: Arc<RpcDispatcher>,
+    txn_dispatcher: Arc<dyn TxnDispatcher>,
+    attestation_handler: attestation::Handler,
+    policy_verifier: Arc<PolicyVerifier>,
+    cache_set: cache::CacheSet,
+}
+
+#[derive(Debug)]
+enum Command {
+    Request(u64, Body),
+}
+
+/// Runtime call dispatcher.
+pub struct Dispatcher {
+    logger: Logger,
+    queue_tx: mpsc::Sender<Command>,
+    identity: Arc<Identity>,
+
+    state: Mutex<Option<ProtocolState>>,
+    state_cond: Condvar,
+
+    tokio_runtime: tokio::runtime::Handle,
+}
+
+impl Dispatcher {
+    /// Create a new runtime call dispatcher.
+    pub fn new(
+        tokio_runtime: tokio::runtime::Handle,
+        initializer: Box<dyn Initializer>,
+        identity: Arc<Identity>,
+    ) -> Arc<Self> {
+        let (tx, rx) = mpsc::channel(BACKLOG_SIZE);
+
+        let dispatcher = Arc::new(Dispatcher {
+            logger: get_logger("runtime/dispatcher"),
+            queue_tx: tx,
+            identity,
+            state: Mutex::new(None),
+            state_cond: Condvar::new(),
+            tokio_runtime,
+        });
+
+        // Spawn the dispatcher processing thread.
+        let d = dispatcher.clone();
+        thread::spawn(move || {
+            let _guard = AbortOnPanic;
+            d.run(initializer, rx);
+        });
+
+        dispatcher
+    }
+
+    /// Start the dispatcher.
+    pub fn start(&self, protocol: Arc<Protocol>, consensus_verifier: Box<dyn Verifier>) {
+        let consensus_verifier = Arc::from(consensus_verifier);
+        let mut s = self.state.lock().unwrap();
+        *s = Some(ProtocolState {
+            protocol,
+            consensus_verifier,
+        });
+        self.state_cond.notify_one();
+    }
+
+    /// Queue a new request to be dispatched.
+    pub fn queue_request(&self, id: u64, body: Body) -> AnyResult<()> {
+        self.queue_tx.blocking_send(Command::Request(id, body))?;
+        Ok(())
+    }
+
+    fn run(self: &Arc<Self>, initializer: Box<dyn Initializer>, mut rx: mpsc::Receiver<Command>) {
+        // Wait for the state to be available.
+        let ProtocolState {
+            protocol,
+            consensus_verifier,
+        } = {
+            let mut guard = self.state.lock().unwrap();
+            while guard.is_none() {
+                guard = self.state_cond.wait(guard).unwrap();
+            }
+
+            guard.take().unwrap()
+        };
+
+        // Ensure Tokio runtime is available during dispatcher initialization.
+        let _guard = self.tokio_runtime.enter();
+
+        // Create actual dispatchers for RPCs and transactions.
+        info!(self.logger, "Starting the runtime dispatcher");
+        let mut rpc_demux = RpcDemux::new(
+            session::Builder::default().local_identity(self.identity.clone()),
+            RPC_MAX_SESSIONS,
+            RPC_MAX_SESSIONS_PER_PEER,
+            RPC_STALE_SESSION_TIMEOUT_SECS,
+        );
+        let mut rpc_dispatcher = RpcDispatcher::default();
+        let pre_init_state = PreInitState {
+            protocol: &protocol,
+            identity: &self.identity,
+            rpc_demux: &mut rpc_demux,
+            rpc_dispatcher: &mut rpc_dispatcher,
+            consensus_verifier: &consensus_verifier,
+        };
+        let post_init_state = initializer.init(pre_init_state);
+        let txn_dispatcher = post_init_state
+            .txn_dispatcher
+            .unwrap_or_else(|| Box::<TxnNoopDispatcher>::default());
+        let mut app = post_init_state
+            .app
+            .unwrap_or_else(|| Box::new(app::NoopApp));
+
+        // Initialize the application.
+        if let Err(err) = app.on_init(protocol.clone()) {
+            error!(self.logger, "ROFL application initialization failed"; "err" => ?err);
+        }
+
+        let app: Arc<dyn app::App> = Arc::from(app);
+        let state = State {
+            protocol: protocol.clone(),
+            consensus_verifier: consensus_verifier.clone(),
+            dispatcher: self.clone(),
+            app: app.clone(),
+            rpc_demux: Arc::new(rpc_demux),
+            rpc_dispatcher: Arc::new(rpc_dispatcher),
+            txn_dispatcher: Arc::from(txn_dispatcher),
+            attestation_handler: attestation::Handler::new(
+                self.identity.clone(),
+                protocol.clone(),
+                consensus_verifier.clone(),
+                protocol.get_runtime_id(),
+                protocol.get_config().version,
+                app,
+            ),
+            policy_verifier: Arc::new(PolicyVerifier::new(consensus_verifier)),
+            cache_set: cache::CacheSet::new(protocol.clone()),
+        };
+
+        // Start the async message processing task.
+        self.tokio_runtime.block_on(async move {
+            while let Some(cmd) = rx.recv().await {
+                // Process received command.
+                match cmd {
+                    Command::Request(id, request) => {
+                        // Process request in its own task.
+                        let state = state.clone();
+
+                        tokio::spawn(async move {
+                            let protocol = state.protocol.clone();
+                            let dispatcher = state.dispatcher.clone();
+                            let result = dispatcher.handle_request(state, request).await;
+
+                            // Send response.
+                            let response = match result {
+                                Ok(body) => body,
+                                Err(error) => Body::Error(error),
+                            };
+                            protocol.send_response(id, response).unwrap();
+                        });
+                    }
+                }
+            }
+        });
+
+        info!(self.logger, "Runtime call dispatcher is terminating");
+    }
+
+    async fn handle_request(self: &Arc<Self>, state: State, request: Body) -> Result<Body, Error> {
+        match request {
+            // Attestation-related requests.
+            Body::RuntimeCapabilityTEERakInitRequest { .. }
+            | Body::RuntimeCapabilityTEERakReportRequest {}
+            | Body::RuntimeCapabilityTEERakAvrRequest { .. }
+            | Body::RuntimeCapabilityTEERakQuoteRequest { .. }
+            | Body::RuntimeCapabilityTEEUpdateEndorsementRequest { .. } => {
+                Ok(state.attestation_handler.handle(request).await?)
+            }
+
+            // RPC requests.
+            Body::RuntimeRPCCallRequest {
+                request,
+                kind,
+                peer_id,
+            } => {
+                debug!(self.logger, "Received RPC call request";
+                    "kind" => ?kind,
+                    "peer_id" => peer_id.to_hex::<String>(),
+                );
+
+                match kind {
+                    RpcKind::NoiseSession => {
+                        self.dispatch_secure_rpc(state, request, peer_id).await
+                    }
+                    RpcKind::InsecureQuery => self.dispatch_insecure_rpc(state, request).await,
+                    RpcKind::LocalQuery => self.dispatch_local_rpc(state, request).await,
+                }
+            }
+            Body::RuntimeLocalRPCCallRequest { request } => {
+                debug!(self.logger, "Received RPC call request";
+                    "kind" => ?RpcKind::LocalQuery,
+                );
+
+                self.dispatch_local_rpc(state, request).await
+            }
+
+            // RONL.
+            // TODO: Refactor this so it can be part of an "app".
+            Body::RuntimeExecuteTxBatchRequest {
+                mode,
+                consensus_block,
+                round_results,
+                io_root,
+                inputs,
+                in_msgs,
+                block,
+                epoch,
+                max_messages,
+            } => {
+                // Transaction execution.
+                self.dispatch_txn(
+                    state.cache_set,
+                    &state.txn_dispatcher,
+                    &state.protocol,
+                    io_root,
+                    inputs.unwrap_or_default(),
+                    in_msgs,
+                    TxDispatchState {
+                        mode,
+                        consensus_block,
+                        consensus_verifier: state.consensus_verifier,
+                        header: block.header,
+                        epoch,
+                        round_results,
+                        max_messages,
+                        check_only: false,
+                    },
+                )
+                .await
+            }
+            Body::RuntimeCheckTxBatchRequest {
+                consensus_block,
+                inputs,
+                block,
+                epoch,
+                max_messages,
+            } => {
+                // Transaction check.
+                self.dispatch_txn(
+                    state.cache_set,
+                    &state.txn_dispatcher,
+                    &state.protocol,
+                    Hash::default(),
+                    inputs,
+                    vec![],
+                    TxDispatchState {
+                        mode: ExecutionMode::Execute,
+                        consensus_block,
+                        consensus_verifier: state.consensus_verifier,
+                        header: block.header,
+                        epoch,
+                        round_results: Default::default(),
+                        max_messages,
+                        check_only: true,
+                    },
+                )
+                .await
+            }
+            Body::RuntimeQueryRequest {
+                consensus_block,
+                header,
+                epoch,
+                max_messages,
+                method,
+                args,
+            } if state.txn_dispatcher.is_supported() => {
+                // Query.
+                self.dispatch_query(
+                    state.cache_set,
+                    &state.txn_dispatcher,
+                    &state.protocol,
+                    method,
+                    args,
+                    TxDispatchState {
+                        mode: ExecutionMode::Execute,
+                        consensus_block,
+                        consensus_verifier: state.consensus_verifier,
+                        header,
+                        epoch,
+                        round_results: Default::default(),
+                        max_messages,
+                        check_only: true,
+                    },
+                )
+                .await
+            }
+
+            // ROFL.
+            Body::RuntimeQueryRequest { method, args, .. } if state.app.is_rofl() => state
+                .app
+                .query(&method, args)
+                .await
+                .map(|data| Body::RuntimeQueryResponse { data })
+                .map_err(Into::into),
+            Body::RuntimeNotifyRequest {
+                runtime_block,
+                runtime_event,
+            } => {
+                if let Some(runtime_block) = runtime_block {
+                    if let Err(err) = state.app.on_runtime_block(&runtime_block).await {
+                        error!(self.logger, "Application block notification failed"; "err" => ?err);
+                    }
+                }
+                if let Some(runtime_event) = runtime_event {
+                    if let Err(err) = state
+                        .app
+                        .on_runtime_event(&runtime_event.block, &runtime_event.tags)
+                        .await
+                    {
+                        error!(self.logger, "Application event notification failed"; "err" => ?err);
+                    }
+                }
+
+                Ok(Body::Empty {})
+            }
+
+            // Other requests.
+            Body::RuntimeKeyManagerStatusUpdateRequest { status } => {
+                // Key manager status update local RPC call.
+                self.handle_km_status_update(state, status).await
+            }
+            Body::RuntimeKeyManagerQuotePolicyUpdateRequest {
+                policy: quote_policy,
+            } => {
+                // Key manager quote policy update local RPC call.
+                self.handle_km_quote_policy_update(state, quote_policy)
+                    .await
+            }
+            Body::RuntimeConsensusSyncRequest { height } => state
+                .consensus_verifier
+                .sync(height)
+                .await
+                .map_err(Into::into)
+                .map(|_| Body::RuntimeConsensusSyncResponse {}),
+
+            _ => {
+                error!(self.logger, "Unsupported request type");
+                Err(Error::new("dispatcher", 1, "Unsupported request type"))
+            }
+        }
+    }
+
+    #[allow(clippy::too_many_arguments)]
+    async fn dispatch_query(
+        &self,
+        cache_set: cache::CacheSet,
+        txn_dispatcher: &Arc<dyn TxnDispatcher>,
+        protocol: &Arc<Protocol>,
+        method: String,
+        args: Vec<u8>,
+        state: TxDispatchState,
+    ) -> Result<Body, Error> {
+        debug!(self.logger, "Received query request";
+            "method" => &method,
+            "state_root" => ?state.header.state_root,
+            "round" => ?state.header.round,
+        );
+
+        // Verify that the runtime ID matches the block's namespace. This is a protocol violation
+        // as the compute node should never change the runtime ID.
+        if state.header.namespace != protocol.get_runtime_id() {
+            return Err(Error::new(
+                "dispatcher",
+                1,
+                &format!(
+                    "block namespace does not match runtime id (namespace: {:?} runtime ID: {:?})",
+                    state.header.namespace,
+                    protocol.get_runtime_id(),
+                ),
+            ));
+        }
+
+        let protocol = protocol.clone();
+        let txn_dispatcher = txn_dispatcher.clone();
+
+        // For queries we don't do any consensus layer integrity verification by default and it
+        // is up to the runtime to decide whether this is critical on a query-by-query basis.
+        let consensus_state = state
+            .consensus_verifier
+            .unverified_state(state.consensus_block.clone())
+            .await?;
+
+        tokio::task::spawn_blocking(move || {
+            let cache = cache_set.query(Root {
+                namespace: state.header.namespace,
+                version: state.header.round,
+                root_type: RootType::State,
+                hash: state.header.state_root,
+            });
+            let mut cache = cache.borrow_mut();
+            let mut overlay = OverlayTree::new(cache.tree_mut());
+
+            let txn_ctx = TxnContext::new(
+                protocol,
+                &state.consensus_block,
+                consensus_state,
+                &mut overlay,
+                &state.header,
+                state.epoch,
+                &state.round_results,
+                state.max_messages,
+                state.check_only,
+            );
+
+            txn_dispatcher
+                .query(txn_ctx, &method, args)
+                .map(|data| Body::RuntimeQueryResponse { data })
+        })
+        .await?
+    }
+
+    fn txn_check_batch(
+        &self,
+        protocol: Arc<Protocol>,
+        cache_set: cache::CacheSet,
+        txn_dispatcher: &dyn TxnDispatcher,
+        inputs: TxnBatch,
+        state: TxDispatchState,
+    ) -> Result<Body, Error> {
+        // For check-only we don't do any consensus layer integrity verification.
+        // TODO: Make this async.
+        let consensus_state = block_on(
+            state
+                .consensus_verifier
+                .unverified_state(state.consensus_block.clone()),
+        )?;
+
+        let mut cache = cache_set.check(Root {
+            namespace: state.header.namespace,
+            version: state.header.round,
+            root_type: RootType::State,
+            hash: state.header.state_root,
+        });
+        let mut overlay = OverlayTree::new(cache.tree_mut());
+
+        let txn_ctx = TxnContext::new(
+            protocol.clone(),
+            &state.consensus_block,
+            consensus_state,
+            &mut overlay,
+            &state.header,
+            state.epoch,
+            &state.round_results,
+            state.max_messages,
+            state.check_only,
+        );
+        let results = txn_dispatcher.check_batch(txn_ctx, &inputs);
+
+        if protocol.get_config().persist_check_tx_state {
+            // Commit results to in-memory tree so they persist for subsequent batches that are
+            // based on the same block.
+            let _ = overlay.commit().unwrap();
+        }
+
+        debug!(self.logger, "Transaction batch check complete");
+
+        results.map(|results| Body::RuntimeCheckTxBatchResponse { results })
+    }
+
+    #[allow(clippy::too_many_arguments)]
+    fn txn_execute_batch(
+        &self,
+        protocol: Arc<Protocol>,
+        cache_set: cache::CacheSet,
+        txn_dispatcher: &dyn TxnDispatcher,
+        mut inputs: TxnBatch,
+        in_msgs: Vec<roothash::IncomingMessage>,
+        io_root: Hash,
+        state: TxDispatchState,
+    ) -> Result<Body, Error> {
+        // Verify consensus state and runtime state root integrity before execution.
+        // TODO: Make this async.
+        let consensus_state = block_on(state.consensus_verifier.verify(
+            state.consensus_block.clone(),
+            state.header.clone(),
+            state.epoch,
+        ))?;
+        // Ensure the runtime is still ready to process requests.
+        protocol.ensure_initialized()?;
+
+        let header = &state.header;
+
+        let mut cache = cache_set.execute(Root {
+            namespace: state.header.namespace,
+            version: state.header.round,
+            root_type: RootType::State,
+            hash: state.header.state_root,
+        });
+        let mut overlay = OverlayTree::new(cache.tree_mut());
+
+        let txn_ctx = TxnContext::new(
+            protocol,
+            &state.consensus_block,
+            consensus_state,
+            &mut overlay,
+            header,
+            state.epoch,
+            &state.round_results,
+            state.max_messages,
+            state.check_only,
+        );
+
+        // Perform execution based on the passed mode.
+        let mut results = match state.mode {
+            ExecutionMode::Execute => {
+                // Just execute the batch.
+                txn_dispatcher.execute_batch(txn_ctx, &inputs, &in_msgs)?
+            }
+            ExecutionMode::Schedule => {
+                // Allow the runtime to arbitrarily update the batch.
+                txn_dispatcher.schedule_and_execute_batch(txn_ctx, &mut inputs, &in_msgs)?
+            }
+        };
+
+        // Finalize state.
+        let (state_write_log, new_state_root) = overlay
+            .commit_both(header.namespace, header.round + 1)
+            .expect("state commit must succeed");
+
+        txn_dispatcher.finalize(new_state_root);
+        cache.commit(header.round + 1, new_state_root);
+
+        // Generate I/O root. Since we already fetched the inputs we avoid the need
+        // to fetch them again by generating the previous I/O tree (generated by the
+        // transaction scheduler) from the inputs.
+        let mut txn_tree = TxnTree::new(
+            Box::new(NoopReadSyncer),
+            Root {
+                namespace: header.namespace,
+                version: header.round + 1,
+                root_type: RootType::IO,
+                hash: Hash::empty_hash(),
+            },
+        );
+        let mut hashes = Vec::new();
+        for (batch_order, input) in inputs.drain(..).enumerate() {
+            hashes.push(Hash::digest_bytes(&input));
+            txn_tree
+                .add_input(input, batch_order.try_into().unwrap())
+                .expect("add transaction must succeed");
+        }
+
+        let (input_write_log, input_io_root) = txn_tree.commit().expect("io commit must succeed");
+
+        assert!(
+            state.mode != ExecutionMode::Execute || input_io_root == io_root,
+            "dispatcher: I/O root inconsistent with inputs (expected: {:?} got: {:?})",
+            io_root,
+            input_io_root
+        );
+
+        for (tx_hash, result) in hashes.iter().zip(results.results.drain(..)) {
+            txn_tree
+                .add_output(*tx_hash, result.output, result.tags)
+                .expect("add transaction must succeed");
+        }
+
+        txn_tree
+            .add_block_tags(results.block_tags)
+            .expect("adding block tags must succeed");
+
+        let (io_write_log, io_root) = txn_tree.commit().expect("io commit must succeed");
+
+        let header = ComputeResultsHeader {
+            round: header.round + 1,
+            previous_hash: header.encoded_hash(),
+            io_root: Some(io_root),
+            state_root: Some(new_state_root),
+            messages_hash: Some(roothash::Message::messages_hash(&results.messages)),
+            in_msgs_hash: Some(roothash::IncomingMessage::in_messages_hash(
+                &in_msgs[..results.in_msgs_count],
+            )),
+            in_msgs_count: results.in_msgs_count.try_into().unwrap(),
+        };
+
+        debug!(self.logger, "Transaction batch execution complete";
+            "previous_hash" => ?header.previous_hash,
+            "io_root" => ?header.io_root,
+            "state_root" => ?header.state_root,
+            "messages_hash" => ?header.messages_hash,
+            "in_msgs_hash" => ?header.in_msgs_hash,
+        );
+
+        let rak_sig = self
+            .identity
+            .sign(
+                COMPUTE_RESULTS_HEADER_SIGNATURE_CONTEXT,
+                &cbor::to_vec(header.clone()),
+            )
+            .unwrap();
+
+        Ok(Body::RuntimeExecuteTxBatchResponse {
+            batch: ComputedBatch {
+                header,
+                io_write_log,
+                state_write_log,
+                rak_sig,
+                messages: results.messages,
+            },
+            tx_hashes: hashes,
+            tx_reject_hashes: results.tx_reject_hashes,
+            tx_input_root: input_io_root,
+            tx_input_write_log: input_write_log,
+        })
+    }
+
+    #[allow(clippy::too_many_arguments)]
+    async fn dispatch_txn(
+        self: &Arc<Self>,
+        cache_set: cache::CacheSet,
+        txn_dispatcher: &Arc<dyn TxnDispatcher>,
+        protocol: &Arc<Protocol>,
+        io_root: Hash,
+        inputs: TxnBatch,
+        in_msgs: Vec<roothash::IncomingMessage>,
+        state: TxDispatchState,
+    ) -> Result<Body, Error> {
+        // Make sure to abort the process on panic during transaction processing as that indicates
+        // a serious problem and should make sure to clean up the process.
+        let _guard = AbortOnPanic;
+
+        debug!(self.logger, "Received transaction batch request";
+            "state_root" => ?state.header.state_root,
+            "round" => state.header.round + 1,
+            "round_results" => ?state.round_results,
+            "tx_count" => inputs.len(),
+            "in_msg_count" => in_msgs.len(),
+            "check_only" => state.check_only,
+        );
+
+        // Verify that the runtime ID matches the block's namespace. This is a protocol violation
+        // as the compute node should never change the runtime ID.
+        assert!(
+            state.header.namespace == protocol.get_runtime_id(),
+            "block namespace does not match runtime id (namespace: {:?} runtime ID: {:?})",
+            state.header.namespace,
+            protocol.get_runtime_id(),
+        );
+
+        let protocol = protocol.clone();
+        let dispatcher = self.clone();
+        let txn_dispatcher = txn_dispatcher.clone();
+
+        tokio::task::spawn_blocking(move || {
+            if state.check_only {
+                dispatcher.txn_check_batch(protocol, cache_set, &txn_dispatcher, inputs, state)
+            } else {
+                dispatcher.txn_execute_batch(
+                    protocol,
+                    cache_set,
+                    &txn_dispatcher,
+                    inputs,
+                    in_msgs,
+                    io_root,
+                    state,
+                )
+            }
+        })
+        .await
+        .unwrap() // Propagate panics during transaction dispatch.
+    }
+
+    async fn dispatch_secure_rpc(
+        &self,
+        state: State,
+        request: Vec<u8>,
+        peer_id: Vec<u8>,
+    ) -> Result<Body, Error> {
+        // Make sure to abort the process on panic during RPC processing as that indicates a
+        // serious problem and should make sure to clean up the process.
+        let _guard = AbortOnPanic;
+
+        // Process frame.
+        let mut buffer = vec![];
+        let (mut session, message) = state
+            .rpc_demux
+            .process_frame(peer_id, request, &mut buffer)
+            .await?;
+
+        if let Some(message) = message {
+            // Dispatch request.
+            assert!(
+                buffer.is_empty(),
+                "must have no handshake data in transport mode"
+            );
+
+            match message {
+                RpcMessage::Request(req) => {
+                    // Request, dispatch.
+                    let response = self
+                        .dispatch_rpc(req, RpcKind::NoiseSession, session.info(), &state)
+                        .await?;
+                    let response = RpcMessage::Response(response);
+
+                    // Note: MKVS commit is omitted, this MUST be global side-effect free.
+
+                    debug!(self.logger, "RPC call dispatch complete";
+                        "kind" => ?RpcKind::NoiseSession,
+                    );
+
+                    let mut buffer = vec![];
+                    session
+                        .write_message(response, &mut buffer)
+                        .map_err(|err| {
+                            error!(self.logger, "Error while writing response"; "err" => %err);
+                            Error::new("rhp/dispatcher", 1, &format!("{err}"))
+                        })
+                        .map(|_| Body::RuntimeRPCCallResponse { response: buffer })
+                }
+                RpcMessage::Close => {
+                    // Session close.
+                    let mut buffer = vec![];
+                    state
+                        .rpc_demux
+                        .close(session, &mut buffer)
+                        .map_err(|err| {
+                            error!(self.logger, "Error while closing session"; "err" => %err);
+                            Error::new("rhp/dispatcher", 1, &format!("{err}"))
+                        })
+                        .map(|_| Body::RuntimeRPCCallResponse { response: buffer })
+                }
+                msg => {
+                    warn!(self.logger, "Ignoring invalid RPC message type"; "msg" => ?msg);
+                    Err(Error::new("rhp/dispatcher", 1, "invalid RPC message type"))
+                }
+            }
+        } else {
+            // Send back any handshake frames.
+            Ok(Body::RuntimeRPCCallResponse { response: buffer })
+        }
+    }
+
+    async fn dispatch_insecure_rpc(&self, state: State, request: Vec<u8>) -> Result<Body, Error> {
+        // Make sure to abort the process on panic during RPC processing as that indicates a
+        // serious problem and should make sure to clean up the process.
+        let _guard = AbortOnPanic;
+
+        let request: RpcRequest = cbor::from_slice(&request)
+            .map_err(|_| Error::new("rhp/dispatcher", 1, "malformed request"))?;
+
+        // Request, dispatch.
+        let response = self
+            .dispatch_rpc(request, RpcKind::InsecureQuery, None, &state)
+            .await?;
+        let response = cbor::to_vec(response);
+
+        // Note: MKVS commit is omitted, this MUST be global side-effect free.
+
+        debug!(self.logger, "RPC call dispatch complete";
+            "kind" => ?RpcKind::InsecureQuery,
+        );
+
+        Ok(Body::RuntimeRPCCallResponse { response })
+    }
+
+    async fn dispatch_local_rpc(&self, state: State, request: Vec<u8>) -> Result<Body, Error> {
+        // Make sure to abort the process on panic during local RPC processing as that indicates a
+        // serious problem and should make sure to clean up the process.
+        let _guard = AbortOnPanic;
+
+        let request = cbor::from_slice(&request)
+            .map_err(|_| Error::new("rhp/dispatcher", 1, "malformed request"))?;
+
+        // Request, dispatch.
+        let response = self
+            .dispatch_rpc(request, RpcKind::LocalQuery, None, &state)
+            .await?;
+        let response = RpcMessage::Response(response);
+        let response = cbor::to_vec(response);
+
+        debug!(self.logger, "RPC call dispatch complete";
+            "kind" => ?RpcKind::LocalQuery,
+        );
+
+        Ok(Body::RuntimeLocalRPCCallResponse { response })
+    }
+
+    async fn dispatch_rpc(
+        &self,
+        request: RpcRequest,
+        kind: RpcKind,
+        session_info: Option<Arc<SessionInfo>>,
+        state: &State,
+    ) -> Result<RpcResponse, Error> {
+        let rpc_dispatcher = state.rpc_dispatcher.clone();
+
+        let response = tokio::task::spawn_blocking(move || {
+            let rpc_ctx = RpcContext::new(session_info);
+            rpc_dispatcher.dispatch(rpc_ctx, request, kind)
+        })
+        .await?;
+
+        Ok(response)
+    }
+
+    async fn handle_km_status_update(
+        &self,
+        state: State,
+        status: KeyManagerStatus,
+    ) -> Result<Body, Error> {
+        // Make sure to abort the process on panic during policy processing as that indicates a
+        // serious problem and should make sure to clean up the process.
+        let _guard = AbortOnPanic;
+
+        debug!(self.logger, "Received km status update request");
+
+        // Verify and decode the status.
+        let runtime_id = state.protocol.get_host_info().runtime_id;
+
+        tokio::task::spawn_blocking(move || -> Result<(), Error> {
+            let key_manager = state.policy_verifier.key_manager(&runtime_id)?;
+            let published_status = state
+                .policy_verifier
+                .verify_key_manager_status(status, key_manager)?;
+
+            // Dispatch the local RPC call.
+            state
+                .rpc_dispatcher
+                .handle_km_status_update(published_status);
+
+            Ok(())
+        })
+        .await
+        .unwrap()?; // Propagate panics during key manager status update.
+
+        debug!(self.logger, "KM status update request complete");
+
+        Ok(Body::RuntimeKeyManagerStatusUpdateResponse {})
+    }
+
+    async fn handle_km_quote_policy_update(
+        &self,
+        state: State,
+        quote_policy: QuotePolicy,
+    ) -> Result<Body, Error> {
+        // Make sure to abort the process on panic during quote policy processing as that indicates
+        // a serious problem and should make sure to clean up the process.
+        let _guard = AbortOnPanic;
+
+        debug!(self.logger, "Received km quote policy update request");
+
+        // Verify and decode the policy.
+        let runtime_id = state.protocol.get_host_info().runtime_id;
+
+        tokio::task::spawn_blocking(move || -> Result<(), Error> {
+            let key_manager = state.policy_verifier.key_manager(&runtime_id)?;
+            let policy =
+                state
+                    .policy_verifier
+                    .verify_quote_policy(quote_policy, &key_manager, None)?;
+
+            // Dispatch the local RPC call.
+            state.rpc_dispatcher.handle_km_quote_policy_update(policy);
+
+            Ok(())
+        })
+        .await
+        .unwrap()?; // Propagate panics during key manager quote policy update.
+
+        debug!(self.logger, "KM quote policy update request complete");
+
+        Ok(Body::RuntimeKeyManagerQuotePolicyUpdateResponse {})
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/client.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/client.rs.html new file mode 100644 index 0000000000..192c776713 --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/client.rs.html @@ -0,0 +1,1791 @@ +client.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+
//! Enclave RPC client.
+use std::{
+    collections::HashSet,
+    sync::{
+        atomic::{AtomicU32, Ordering},
+        Arc,
+    },
+};
+
+use futures::stream::{FuturesUnordered, StreamExt};
+use lazy_static::lazy_static;
+#[cfg(not(test))]
+use rand::{rngs::OsRng, RngCore};
+
+use thiserror::Error;
+use tokio::sync::OwnedMutexGuard;
+
+use crate::{
+    common::{
+        crypto::signature,
+        namespace::Namespace,
+        sgx::{EnclaveIdentity, QuotePolicy},
+        time::insecure_posix_time,
+    },
+    enclave_rpc::{session::Builder, types},
+    future::block_on,
+    protocol::Protocol,
+};
+
+use super::{
+    sessions::{self, MultiplexedSession, Sessions, SharedSession},
+    transport::{RuntimeTransport, Transport},
+};
+
+/// Maximum number of retries on transport errors.
+const MAX_TRANSPORT_ERROR_RETRIES: usize = 3;
+
+lazy_static! {
+    /// The ID of the next RPC client.
+    static ref NEXT_CLIENT_ID: AtomicU32 = AtomicU32::new(RpcClient::random_client_id());
+}
+
+/// RPC client error.
+#[derive(Error, Debug)]
+pub enum RpcClientError {
+    #[error("call failed: {0}")]
+    CallFailed(String),
+    #[error("expected response message, received: {0:?}")]
+    ExpectedResponseMessage(types::Message),
+    #[error("expected close message, received: {0:?}")]
+    ExpectedCloseMessage(types::Message),
+    #[error("transport error")]
+    Transport,
+    #[error("unsupported RPC kind")]
+    UnsupportedRpcKind,
+    #[error("client dropped")]
+    Dropped,
+    #[error("decode error: {0}")]
+    DecodeError(#[from] cbor::DecodeError),
+    #[error("sessions error: {0}")]
+    SessionsError(#[from] sessions::Error),
+    #[error("unknown error: {0}")]
+    Unknown(#[from] anyhow::Error),
+}
+
+/// An EnclaveRPC response that can be used to provide peer feedback.
+pub struct Response<'a, T> {
+    transport: &'a dyn Transport,
+    request_id: Option<u64>,
+    inner: Result<T, RpcClientError>,
+}
+
+impl<'a, T> Response<'a, T> {
+    /// Report success if result was `Ok(_)` and failure if result was `Err(_)`, then return the
+    /// inner result consuming the response instance.
+    pub async fn into_result_with_feedback(mut self) -> Result<T, RpcClientError> {
+        match self.inner {
+            Ok(_) => self.success().await,
+            Err(_) => self.failure().await,
+        }
+
+        self.inner
+    }
+
+    /// Reference to inner result.
+    pub fn result(&self) -> &Result<T, RpcClientError> {
+        &self.inner
+    }
+
+    /// Consume the response instance returning the inner result.
+    pub fn into_result(self) -> Result<T, RpcClientError> {
+        self.inner
+    }
+
+    /// Report success as peer feedback.
+    pub async fn success(&mut self) {
+        self.send_peer_feedback(types::PeerFeedback::Success).await;
+    }
+
+    /// Report failure as peer feedback.
+    pub async fn failure(&mut self) {
+        self.send_peer_feedback(types::PeerFeedback::Failure).await;
+    }
+
+    /// Report bad peer as peer feedback.
+    pub async fn bad_peer(&mut self) {
+        self.send_peer_feedback(types::PeerFeedback::BadPeer).await;
+    }
+
+    /// Send peer feedback.
+    async fn send_peer_feedback(&mut self, feedback: types::PeerFeedback) {
+        if let Some(request_id) = self.request_id.take() {
+            // Only count feedback once.
+            let _ = self
+                .transport
+                .submit_peer_feedback(request_id, feedback)
+                .await; // Ignore error.
+        }
+    }
+}
+
+/// RPC client.
+pub struct RpcClient {
+    /// Used transport.
+    transport: Box<dyn Transport>,
+    /// Multiplexed sessions.
+    sessions: tokio::sync::Mutex<Sessions<signature::PublicKey>>,
+    /// The ID of the client.
+    client_id: u32,
+    /// The ID of the next transport request.
+    next_request_id: AtomicU32,
+}
+
+impl RpcClient {
+    fn new(
+        transport: Box<dyn Transport>,
+        builder: Builder,
+        max_sessions: usize,
+        max_sessions_per_peer: usize,
+        stale_session_timeout: i64,
+    ) -> Self {
+        // Assign a unique ID to each client to avoid overlapping request IDs.
+        let client_id = NEXT_CLIENT_ID.fetch_add(1, Ordering::SeqCst); // Wraps if overflows.
+        let next_request_id = AtomicU32::new(1);
+
+        let sessions = tokio::sync::Mutex::new(Sessions::new(
+            builder,
+            max_sessions,
+            max_sessions_per_peer,
+            stale_session_timeout,
+        ));
+
+        Self {
+            transport,
+            sessions,
+            client_id,
+            next_request_id,
+        }
+    }
+
+    /// Construct an unconnected RPC client with runtime-internal transport.
+    pub fn new_runtime(
+        protocol: Arc<Protocol>,
+        endpoint: &str,
+        builder: Builder,
+        max_sessions: usize,
+        max_sessions_per_peer: usize,
+        stale_session_timeout: i64,
+    ) -> Self {
+        let transport = Box::new(RuntimeTransport::new(protocol, endpoint));
+
+        Self::new(
+            transport,
+            builder,
+            max_sessions,
+            max_sessions_per_peer,
+            stale_session_timeout,
+        )
+    }
+
+    /// Update allowed remote enclave identities.
+    pub async fn update_enclaves(&self, enclaves: Option<HashSet<EnclaveIdentity>>) {
+        let sessions = {
+            let mut sessions = self.sessions.lock().await;
+            sessions.update_enclaves(enclaves)
+        };
+        self.close_all(sessions).await;
+    }
+
+    /// Update remote end's quote policy.
+    pub async fn update_quote_policy(&self, policy: QuotePolicy) {
+        let sessions = {
+            let mut sessions = self.sessions.lock().await;
+            sessions.update_quote_policy(policy)
+        };
+        self.close_all(sessions).await;
+    }
+
+    /// Update remote runtime id.
+    pub async fn update_runtime_id(&self, id: Option<Namespace>) {
+        let sessions = {
+            let mut sessions = self.sessions.lock().await;
+            sessions.update_runtime_id(id)
+        };
+        self.close_all(sessions).await;
+    }
+
+    /// Call a remote method using an encrypted and authenticated Noise session.
+    pub async fn secure_call<C, O>(
+        &self,
+        method: &'static str,
+        args: C,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Response<O>
+    where
+        C: cbor::Encode,
+        O: cbor::Decode + Send + 'static,
+    {
+        self.call(method, args, types::Kind::NoiseSession, nodes)
+            .await
+    }
+
+    /// Call a remote method over an insecure channel where messages are sent in plain text.
+    pub async fn insecure_call<C, O>(
+        &self,
+        method: &'static str,
+        args: C,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Response<O>
+    where
+        C: cbor::Encode,
+        O: cbor::Decode + Send + 'static,
+    {
+        self.call(method, args, types::Kind::InsecureQuery, nodes)
+            .await
+    }
+
+    async fn call<C, O>(
+        &self,
+        method: &'static str,
+        args: C,
+        kind: types::Kind,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Response<O>
+    where
+        C: cbor::Encode,
+        O: cbor::Decode + Send + 'static,
+    {
+        let request = types::Request {
+            method: method.to_owned(),
+            args: cbor::to_value(args),
+        };
+
+        // In case the `execute_call` method returns an outer error, this means that there was a
+        // problem with the transport itself and we can retry.
+        let retry_strategy = tokio_retry::strategy::ExponentialBackoff::from_millis(2)
+            .factor(25)
+            .max_delay(std::time::Duration::from_millis(250))
+            .take(MAX_TRANSPORT_ERROR_RETRIES);
+
+        let result = tokio_retry::Retry::spawn(retry_strategy, || {
+            self.execute_call(request.clone(), kind, nodes.clone())
+        })
+        .await;
+
+        let (request_id, inner) = match result {
+            Ok((request_id, response)) => match response.body {
+                types::Body::Success(value) => (
+                    Some(request_id),
+                    cbor::from_value(value).map_err(Into::into),
+                ),
+                types::Body::Error(error) => {
+                    (Some(request_id), Err(RpcClientError::CallFailed(error)))
+                }
+            },
+            Err(err) => (None, Err(err)),
+        };
+
+        Response {
+            transport: &*self.transport,
+            request_id,
+            inner,
+        }
+    }
+
+    async fn execute_call(
+        &self,
+        request: types::Request,
+        kind: types::Kind,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Result<(u64, types::Response), RpcClientError> {
+        match kind {
+            types::Kind::NoiseSession => {
+                // Attempt to establish a connection. This will not do anything in case the
+                // session has already been established.
+                let session = self.connect(nodes).await?;
+                let mut session = session.lock_owned().await;
+
+                // Perform the call.
+                let result = self.secure_call_raw(request, &mut session).await;
+
+                // In case there was a transport error we need to remove the session immediately
+                // as no progress is possible. The next call should select another peer or
+                // the same peer but another session.
+                if result.is_err() {
+                    let mut sessions = self.sessions.lock().await;
+                    sessions.remove(&session);
+                }
+
+                result
+            }
+            types::Kind::InsecureQuery => {
+                // Perform the call.
+                self.insecure_call_raw(request, nodes).await
+            }
+            _ => Err(RpcClientError::UnsupportedRpcKind),
+        }
+    }
+
+    async fn connect(
+        &self,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Result<SharedSession<signature::PublicKey>, RpcClientError> {
+        // Create a new session.
+        let mut session = {
+            let mut sessions = self.sessions.lock().await;
+
+            // No need to create a new session if we are connected to one of the nodes.
+            if let Some(session) = sessions.find(&nodes) {
+                return Ok(session);
+            }
+
+            // Since the peer ID is not yet known, use the default value and set it later.
+            let peer_id = Default::default();
+            sessions.create_initiator(peer_id)
+        };
+
+        // Copy session ID to avoid moved value errors.
+        let session_id = *session.get_session_id();
+
+        // Prepare buffers upfront.
+        let mut buffer1 = vec![];
+        let mut buffer2 = vec![];
+
+        // Session Handshake1: prepare initialization request.
+        session
+            .process_data(&[], &mut buffer1)
+            .await
+            .expect("initiation must always succeed");
+
+        let request_id = self.next_request_id();
+        let result: Result<_, RpcClientError> = async {
+            // Transport: send initialization request and receive a response.
+            let rsp = self
+                .transport
+                .write_noise_session(request_id, session_id, buffer1, String::new(), nodes)
+                .await
+                .map_err(|_| RpcClientError::Transport)?;
+
+            // Update the session with unverified identity of the remote node.
+            // The identity will be verified in Handshake2 using the RAK from
+            // the consensus layer.
+            session.set_peer_id(rsp.node);
+            session
+                .set_remote_node(rsp.node)
+                .expect("remote node should not be set");
+
+            // Session Handshake2: process initialization response, verify
+            // remote node, and prepare the next request containing RAK binding.
+            let _ = session
+                .process_data(&rsp.data, &mut buffer2)
+                .await
+                .map_err(|_| RpcClientError::Transport)?;
+
+            Ok(rsp)
+        }
+        .await;
+
+        // Submit peer feedback for the last transport and the received
+        // initialization response.
+        let feedback = match result {
+            Ok(_) => types::PeerFeedback::Success,
+            Err(_) => types::PeerFeedback::Failure,
+        };
+        let _ = self
+            .transport
+            .submit_peer_feedback(request_id, feedback)
+            .await; // Ignore error.
+
+        // Forward error after peer feedback is sent.
+        let rsp = result?;
+
+        let request_id = self.next_request_id();
+        let result = async {
+            // Transport: send RAK binding request.
+            let rsp = self
+                .transport
+                .write_noise_session(
+                    request_id,
+                    session_id,
+                    buffer2,
+                    String::new(),
+                    vec![rsp.node],
+                )
+                .await
+                .map_err(|_| RpcClientError::Transport)?;
+
+            if session.is_unauthenticated() {
+                return Err(RpcClientError::Transport);
+            }
+
+            Ok(rsp)
+        }
+        .await;
+
+        // Submit peer feedback for the last transport and session
+        // authentication.
+        let feedback = match result {
+            Ok(_) => types::PeerFeedback::Success,
+            Err(_) => types::PeerFeedback::Failure,
+        };
+        let _ = self
+            .transport
+            .submit_peer_feedback(request_id, feedback)
+            .await; // Ignore error.
+
+        // Forward error after peer feedback is sent.
+        if let Err(err) = result {
+            // Failed to complete handshake. Gracefully close the session.
+            let session = Arc::new(tokio::sync::Mutex::new(session))
+                .lock_owned()
+                .await;
+            let _ = self.close(session).await; // Ignore error.
+
+            return Err(err);
+        }
+
+        // The connection has been successfully established. The session can
+        // be added to the set of active sessions if there is space available,
+        // or if we can make space by removing a stale session.
+        let now = insecure_posix_time();
+        let mut sessions = self.sessions.lock().await;
+        let maybe_removed_session = match sessions.remove_for(&rsp.node, now) {
+            Ok(maybe_removed_session) => maybe_removed_session,
+            Err(err) => {
+                // Unable to make space. Gracefully close the session.
+                drop(sessions); // Unlock.
+
+                let session = Arc::new(tokio::sync::Mutex::new(session))
+                    .lock_owned()
+                    .await;
+                let _ = self.close(session).await; // Ignore error.
+
+                return Err(err.into());
+            }
+        };
+        let session = sessions
+            .add(session, now)
+            .expect("there should be space for the new session");
+
+        if let Some(removed_session) = maybe_removed_session {
+            // A stale session was removed. Gracefully close the removed session.
+            drop(sessions); // Unlock.
+
+            let _ = self.close(removed_session).await; // Ignore error.
+        }
+
+        Ok(session)
+    }
+
+    async fn secure_call_raw(
+        &self,
+        request: types::Request,
+        session: &mut OwnedMutexGuard<MultiplexedSession<signature::PublicKey>>,
+    ) -> Result<(u64, types::Response), RpcClientError> {
+        let method = request.method.clone();
+        let msg = types::Message::Request(request);
+        let session_id = *session.get_session_id();
+
+        // Session Transport: prepare the request message.
+        let mut buffer = vec![];
+        session
+            .write_message(msg, &mut buffer)
+            .map_err(|_| RpcClientError::Transport)?;
+        let node = session.get_remote_node()?;
+
+        let request_id = self.next_request_id();
+        let result = async {
+            // Transport: send the request and receive a response.
+            let rsp = self
+                .transport
+                .write_noise_session(request_id, session_id, buffer, method, vec![node])
+                .await
+                .map_err(|_| RpcClientError::Transport)?;
+
+            // Session Transport: process the response.
+            session.process_data(&rsp.data, vec![]).await
+        }
+        .await;
+
+        // Submit negative peer feedback for the last transport
+        // and the received response immediately.
+        if result.is_err() {
+            let _ = self
+                .transport
+                .submit_peer_feedback(request_id, types::PeerFeedback::Failure)
+                .await; // Ignore error.
+        }
+
+        // Forward error after peer feedback is sent.
+        let maybe_msg = result?;
+
+        // Unwrap response.
+        let msg = maybe_msg.expect("message must be decoded if there is no error");
+        let rsp = match msg {
+            types::Message::Response(rsp) => rsp,
+            msg => return Err(RpcClientError::ExpectedResponseMessage(msg)),
+        };
+
+        Ok((request_id, rsp))
+    }
+
+    async fn insecure_call_raw(
+        &self,
+        request: types::Request,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Result<(u64, types::Response), RpcClientError> {
+        // Transport: send the request.
+        let request_id = self.next_request_id();
+        let result = self
+            .transport
+            .write_insecure_query(request_id, cbor::to_vec(request), nodes)
+            .await
+            .map_err(|_| RpcClientError::Transport);
+
+        // Submit negative peer feedback for the last transport immediately.
+        if result.is_err() {
+            let _ = self
+                .transport
+                .submit_peer_feedback(request_id, types::PeerFeedback::Failure)
+                .await; // Ignore error.
+        }
+
+        // Forward error after peer feedback is sent.
+        let rsp = result?;
+
+        // Unwrap response.
+        let rsp = cbor::from_slice(&rsp.data).map_err(RpcClientError::DecodeError)?;
+
+        Ok((request_id, rsp))
+    }
+
+    /// Close the session.
+    async fn close(
+        &self,
+        mut session: OwnedMutexGuard<MultiplexedSession<signature::PublicKey>>,
+    ) -> Result<(), RpcClientError> {
+        if !session.is_connected() && !session.is_unauthenticated() {
+            return Ok(());
+        }
+
+        let session_id = *session.get_session_id();
+        let node = session.get_remote_node()?;
+
+        // Session Transport: prepare close request.
+        let mut buffer = vec![];
+        session
+            .write_message(types::Message::Close, &mut buffer)
+            .map_err(|_| RpcClientError::Transport)?;
+
+        // Transport: send close request.
+        let request_id = self.next_request_id();
+        let rsp = self
+            .transport
+            .write_noise_session(request_id, session_id, buffer, String::new(), vec![node])
+            .await
+            .map_err(|_| RpcClientError::Transport)?;
+
+        // Skipping peer feedback, as the request was sent only to inform
+        // the other side of a graceful session close.
+
+        // Session Transport: process the response.
+        let msg = session
+            .process_data(&rsp.data, vec![])
+            .await?
+            .expect("message must be decoded if there is no error");
+
+        // Close the session.
+        session.close();
+
+        match msg {
+            types::Message::Close => Ok(()),
+            msg => Err(RpcClientError::ExpectedCloseMessage(msg)),
+        }
+    }
+
+    /// Close all sessions.
+    async fn close_all(&self, sessions: Vec<SharedSession<signature::PublicKey>>) {
+        let futures = FuturesUnordered::new();
+        for session in sessions {
+            let future = async {
+                let locked_session = session.lock_owned().await;
+                let _ = self.close(locked_session).await; // Ignore errors.
+            };
+            futures.push(future);
+        }
+        futures.collect::<()>().await;
+    }
+
+    /// Return the ID of the next transport request.
+    fn next_request_id(&self) -> u64 {
+        let next_request_id = self.next_request_id.fetch_add(1, Ordering::SeqCst); // Wraps if overflows.
+        ((self.client_id as u64) << 32) + (next_request_id as u64)
+    }
+
+    /// Generate a random client ID.
+    fn random_client_id() -> u32 {
+        #[cfg(test)]
+        return 0;
+
+        #[cfg(not(test))]
+        OsRng.next_u32()
+    }
+}
+
+impl Drop for RpcClient {
+    fn drop(&mut self) {
+        // Close all sessions after the client is dropped.
+        block_on(async {
+            let sessions = {
+                let mut sessions = self.sessions.lock().await;
+                sessions.drain()
+            };
+            self.close_all(sessions).await;
+        });
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use std::sync::{
+        atomic::{AtomicBool, Ordering},
+        Arc, Mutex,
+    };
+
+    use anyhow::anyhow;
+    use async_trait::async_trait;
+
+    use crate::{
+        common::crypto::signature,
+        enclave_rpc::{demux::Demux, session, transport::EnclaveResponse, types},
+    };
+
+    use super::{super::transport::Transport, RpcClient};
+
+    #[derive(Clone)]
+    struct MockTransport {
+        demux: Arc<Demux>,
+        next_error: Arc<AtomicBool>,
+        peer_feedback_history: Arc<Mutex<Vec<(u64, types::PeerFeedback)>>>,
+    }
+
+    impl MockTransport {
+        fn new() -> Self {
+            Self {
+                demux: Arc::new(Demux::new(session::Builder::default(), 4, 4, 60)),
+                next_error: Arc::new(AtomicBool::new(false)),
+                peer_feedback_history: Arc::new(Mutex::new(Vec::new())),
+            }
+        }
+
+        fn reset(&self) {
+            self.demux.reset();
+        }
+
+        fn induce_transport_error(&self) {
+            self.next_error.store(true, Ordering::SeqCst);
+        }
+
+        fn take_peer_feedback_history(&self) -> Vec<(u64, types::PeerFeedback)> {
+            let mut pfh = self.peer_feedback_history.lock().unwrap();
+            pfh.drain(..).collect()
+        }
+    }
+
+    #[async_trait]
+    impl Transport for MockTransport {
+        async fn write_message_impl(
+            &self,
+            _request_id: u64,
+            request: Vec<u8>,
+            kind: types::Kind,
+            _nodes: Vec<signature::PublicKey>,
+        ) -> Result<EnclaveResponse, anyhow::Error> {
+            // Induce error when configured to do so.
+            if self
+                .next_error
+                .compare_exchange(true, false, Ordering::SeqCst, Ordering::SeqCst)
+                .is_ok()
+            {
+                return Err(anyhow!("transport error"));
+            }
+
+            match kind {
+                types::Kind::NoiseSession => {
+                    // Deliver directly to the multiplexer.
+                    let mut buffer = Vec::new();
+                    let (mut session, message) = self
+                        .demux
+                        .process_frame(vec![], request, &mut buffer)
+                        .await?;
+
+                    match message {
+                        Some(message) => {
+                            let mut buffer = Vec::new();
+
+                            // Message, process and write reply.
+                            match message {
+                                types::Message::Request(rq) => {
+                                    // Just echo back what was given.
+                                    let response = types::Message::Response(types::Response {
+                                        body: types::Body::Success(rq.args),
+                                    });
+
+                                    session.write_message(response, &mut buffer)?;
+                                }
+                                types::Message::Close => {
+                                    self.demux.close(session, &mut buffer)?;
+                                }
+                                _ => panic!("unhandled message type"),
+                            };
+
+                            let rsp = EnclaveResponse {
+                                data: buffer,
+                                node: Default::default(),
+                            };
+                            Ok(rsp)
+                        }
+                        None => {
+                            // Handshake.
+                            let rsp = EnclaveResponse {
+                                data: buffer,
+                                node: Default::default(),
+                            };
+                            Ok(rsp)
+                        }
+                    }
+                }
+                types::Kind::InsecureQuery => {
+                    // Just echo back what was given.
+                    let rq: types::Request = cbor::from_slice(&request).unwrap();
+                    let body = types::Body::Success(rq.args);
+                    let response = types::Response { body };
+                    let rsp = EnclaveResponse {
+                        data: cbor::to_vec(response),
+                        node: Default::default(),
+                    };
+                    return Ok(rsp);
+                }
+                types::Kind::LocalQuery => {
+                    panic!("unhandled RPC kind")
+                }
+            }
+        }
+
+        async fn submit_peer_feedback(
+            &self,
+            request_id: u64,
+            peer_feedback: types::PeerFeedback,
+        ) -> Result<(), anyhow::Error> {
+            self.peer_feedback_history
+                .lock()
+                .unwrap()
+                .push((request_id, peer_feedback));
+
+            Ok(())
+        }
+    }
+
+    #[test]
+    fn test_rpc_client() {
+        let rt = tokio::runtime::Runtime::new().unwrap();
+        let _guard = rt.enter(); // Ensure Tokio runtime is available.
+        let transport = MockTransport::new();
+        let builder = session::Builder::default();
+        let client = RpcClient::new(Box::new(transport.clone()), builder, 8, 2, 60);
+
+        // Basic secure call.
+        let result: u64 = rt
+            .block_on(async {
+                client
+                    .secure_call("test", 42, vec![])
+                    .await
+                    .into_result_with_feedback()
+                    .await
+            })
+            .unwrap();
+        assert_eq!(result, 42, "secure call should work");
+        assert_eq!(
+            transport.take_peer_feedback_history(),
+            vec![
+                (1, types::PeerFeedback::Success), // Handshake.
+                (2, types::PeerFeedback::Success), // Handshake.
+                (3, types::PeerFeedback::Success), // Handled call.
+            ]
+        );
+
+        // Reset all sessions on the server and make sure that we can still get a response.
+        transport.reset();
+
+        let result: u64 = rt
+            .block_on(async {
+                client
+                    .secure_call("test", 43, vec![])
+                    .await
+                    .into_result_with_feedback()
+                    .await
+            })
+            .unwrap();
+        assert_eq!(result, 43, "secure call should work");
+        assert_eq!(
+            transport.take_peer_feedback_history(),
+            vec![
+                (4, types::PeerFeedback::Failure), // Failed call due to session reset.
+                (5, types::PeerFeedback::Success), // New handshake.
+                (6, types::PeerFeedback::Success), // New handshake.
+                (7, types::PeerFeedback::Success), // Handled call.
+            ]
+        );
+
+        // Induce a single transport error without resetting the server sessions and make sure we
+        // can still get a response.
+        transport.induce_transport_error();
+
+        let result: u64 = rt
+            .block_on(async {
+                client
+                    .secure_call("test", 44, vec![])
+                    .await
+                    .into_result_with_feedback()
+                    .await
+            })
+            .unwrap();
+        assert_eq!(result, 44, "secure call should work");
+        assert_eq!(
+            transport.take_peer_feedback_history(),
+            vec![
+                (8, types::PeerFeedback::Failure), // Handshake failed due to induced error.
+                // (9, types::PeerFeedback::Failure), // Session close failed due to decrypt error (handshake not completed). [skipped]
+                (9, types::PeerFeedback::Success), // New handshake.
+                (10, types::PeerFeedback::Success), // New handshake.
+                (11, types::PeerFeedback::Success), // Handled call.
+            ]
+        );
+
+        // Basic insecure call.
+        let result: u64 = rt
+            .block_on(async {
+                client
+                    .insecure_call("test", 45, vec![])
+                    .await
+                    .into_result_with_feedback()
+                    .await
+            })
+            .unwrap();
+        assert_eq!(result, 45, "insecure call should work");
+        assert_eq!(
+            transport.take_peer_feedback_history(),
+            vec![
+                (12, types::PeerFeedback::Success), // Handled call.
+            ]
+        );
+
+        // Induce a single transport error and make sure we can still get a response.
+        transport.induce_transport_error();
+
+        let result: u64 = rt
+            .block_on(async {
+                client
+                    .insecure_call("test", 46, vec![])
+                    .await
+                    .into_result_with_feedback()
+                    .await
+            })
+            .unwrap();
+        assert_eq!(result, 46, "insecure call should work");
+        assert_eq!(
+            transport.take_peer_feedback_history(),
+            vec![
+                (13, types::PeerFeedback::Failure), // Failed call due to induced error.
+                (14, types::PeerFeedback::Success), // Handled call.
+            ]
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/context.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/context.rs.html new file mode 100644 index 0000000000..c7be3bcacd --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/context.rs.html @@ -0,0 +1,35 @@ +context.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
//! RPC call context.
+use std::sync::Arc;
+
+use super::session::SessionInfo;
+
+/// RPC call context.
+pub struct Context {
+    /// Information about the session the RPC call was delivered over.
+    pub session_info: Option<Arc<SessionInfo>>,
+}
+
+impl Context {
+    /// Construct new transaction context.
+    pub fn new(session_info: Option<Arc<SessionInfo>>) -> Self {
+        Self { session_info }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/demux.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/demux.rs.html new file mode 100644 index 0000000000..b10f0c0ac5 --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/demux.rs.html @@ -0,0 +1,325 @@ +demux.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+
//! Session demultiplexer.
+use std::{io::Write, sync::Mutex};
+
+use thiserror::Error;
+use tokio::sync::OwnedMutexGuard;
+
+use super::{
+    session::Builder,
+    sessions::{self, MultiplexedSession, Sessions},
+    types::{Frame, Message, SessionID},
+};
+use crate::common::time::insecure_posix_time;
+
+/// Demultiplexer error.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("malformed payload: {0}")]
+    MalformedPayload(#[from] cbor::DecodeError),
+    #[error("malformed request method")]
+    MalformedRequestMethod,
+    #[error("sessions error: {0}")]
+    SessionsError(#[from] sessions::Error),
+    #[error("{0}")]
+    Other(#[from] anyhow::Error),
+}
+
+impl Error {
+    fn code(&self) -> u32 {
+        match self {
+            Error::MalformedPayload(_) => 1,
+            Error::MalformedRequestMethod => 2,
+            Error::SessionsError(_) => 3,
+            Error::Other(_) => 4,
+        }
+    }
+}
+
+impl From<Error> for crate::types::Error {
+    fn from(e: Error) -> Self {
+        Self {
+            module: "demux".to_string(),
+            code: e.code(),
+            message: e.to_string(),
+        }
+    }
+}
+
+/// Session demultiplexer.
+pub struct Demux {
+    sessions: Mutex<Sessions<Vec<u8>>>,
+}
+
+impl Demux {
+    /// Create new session demultiplexer.
+    pub fn new(
+        builder: Builder,
+        max_sessions: usize,
+        max_sessions_per_peer: usize,
+        stale_session_timeout: i64,
+    ) -> Self {
+        Self {
+            sessions: Mutex::new(Sessions::new(
+                builder,
+                max_sessions,
+                max_sessions_per_peer,
+                stale_session_timeout,
+            )),
+        }
+    }
+
+    /// Set the session builder to use.
+    pub fn set_session_builder(&self, builder: Builder) {
+        let mut sessions = self.sessions.lock().unwrap();
+        sessions.set_builder(builder);
+    }
+
+    async fn get_or_create_session(
+        &self,
+        peer_id: Vec<u8>,
+        session_id: SessionID,
+    ) -> Result<OwnedMutexGuard<MultiplexedSession<Vec<u8>>>, Error> {
+        let session = {
+            let mut sessions = self.sessions.lock().unwrap();
+            match sessions.get(&peer_id, &session_id) {
+                Some(session) => session,
+                None => {
+                    let now = insecure_posix_time();
+                    let _ = sessions.remove_for(&peer_id, now)?;
+                    let session = sessions.create_responder(peer_id, session_id);
+                    sessions
+                        .add(session, now)
+                        .expect("there should be space for the new session")
+                }
+            }
+        };
+
+        Ok(session.lock_owned().await)
+    }
+
+    /// Process a frame, returning the locked session guard and decoded message.
+    ///
+    /// Any data that needs to be transmitted back to the peer is written to the passed writer.
+    pub async fn process_frame<W: Write>(
+        &self,
+        peer_id: Vec<u8>,
+        data: Vec<u8>,
+        writer: W,
+    ) -> Result<
+        (
+            OwnedMutexGuard<MultiplexedSession<Vec<u8>>>,
+            Option<Message>,
+        ),
+        Error,
+    > {
+        // Decode frame.
+        let frame: Frame = cbor::from_slice(&data)?;
+        // Get the existing session or create a new one.
+        let mut session = self.get_or_create_session(peer_id, frame.session).await?;
+        // Process session data.
+        match session.process_data(&frame.payload, writer).await {
+            Ok(msg) => {
+                if let Some(Message::Request(ref req)) = msg {
+                    // Make sure that the untrusted_plaintext matches the request's method.
+                    if frame.untrusted_plaintext != req.method {
+                        return Err(Error::MalformedRequestMethod);
+                    }
+                }
+
+                Ok((session, msg))
+            }
+            Err(err) => {
+                // In case the session was closed, remove the session.
+                if session.is_closed() {
+                    let mut sessions = self.sessions.lock().unwrap();
+                    sessions.remove(&session);
+                }
+                Err(Error::Other(err))
+            }
+        }
+    }
+
+    /// Closes the given session.
+    ///
+    /// Any data that needs to be transmitted back to the peer is written to the passed writer.
+    pub fn close<W: Write>(
+        &self,
+        mut session: OwnedMutexGuard<MultiplexedSession<Vec<u8>>>,
+        writer: W,
+    ) -> Result<(), Error> {
+        let mut sessions = self.sessions.lock().unwrap();
+        sessions.remove(&session);
+
+        session.write_message(Message::Close, writer)?;
+        Ok(())
+    }
+
+    /// Resets all open sessions.
+    pub fn reset(&self) {
+        let mut sessions = self.sessions.lock().unwrap();
+        let _ = sessions.drain();
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/dispatcher.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/dispatcher.rs.html new file mode 100644 index 0000000000..750ea8957a --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/dispatcher.rs.html @@ -0,0 +1,439 @@ +dispatcher.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+
//! RPC dispatcher.
+use std::collections::HashMap;
+
+use anyhow::{bail, Result};
+use thiserror::Error;
+
+use crate::{common::sgx::QuotePolicy, consensus::state::keymanager::Status as KeyManagerStatus};
+
+use super::{
+    context::Context,
+    types::{Body, Kind, Request, Response},
+};
+
+/// Dispatch error.
+#[derive(Error, Debug)]
+enum DispatchError {
+    #[error("method not found: {method:?}")]
+    MethodNotFound { method: String },
+    #[error("invalid RPC kind: {method:?} ({kind:?})")]
+    InvalidRpcKind { method: String, kind: Kind },
+}
+
+/// RPC handler.
+pub trait Handler {
+    /// Returns the list of RPC methods supported by this handler.
+    fn methods(&'static self) -> Vec<Method>;
+}
+
+/// Descriptor of a RPC API method.
+#[derive(Clone, Debug)]
+pub struct MethodDescriptor {
+    /// Method name.
+    pub name: String,
+    /// Specifies which kind of RPC is allowed to call the method.
+    pub kind: Kind,
+}
+
+/// Handler for a RPC method.
+pub trait MethodHandler<Rq, Rsp> {
+    /// Invoke the method implementation and return a response.
+    fn handle(&self, ctx: &Context, request: &Rq) -> Result<Rsp>;
+}
+
+impl<Rq, Rsp, F> MethodHandler<Rq, Rsp> for F
+where
+    Rq: 'static,
+    Rsp: 'static,
+    F: Fn(&Context, &Rq) -> Result<Rsp> + 'static,
+{
+    fn handle(&self, ctx: &Context, request: &Rq) -> Result<Rsp> {
+        (*self)(ctx, request)
+    }
+}
+
+/// Dispatcher for a RPC method.
+pub trait MethodHandlerDispatch {
+    /// Get method descriptor.
+    fn get_descriptor(&self) -> &MethodDescriptor;
+
+    /// Dispatch request.
+    fn dispatch(&self, ctx: &Context, request: Request) -> Result<Response>;
+}
+
+struct MethodHandlerDispatchImpl<Rq, Rsp> {
+    /// Method descriptor.
+    descriptor: MethodDescriptor,
+    /// Method handler.
+    handler: Box<dyn MethodHandler<Rq, Rsp> + Send + Sync>,
+}
+
+impl<Rq, Rsp> MethodHandlerDispatch for MethodHandlerDispatchImpl<Rq, Rsp>
+where
+    Rq: cbor::Decode + 'static,
+    Rsp: cbor::Encode + 'static,
+{
+    fn get_descriptor(&self) -> &MethodDescriptor {
+        &self.descriptor
+    }
+
+    fn dispatch(&self, ctx: &Context, request: Request) -> Result<Response> {
+        let request = cbor::from_value(request.args)?;
+        let response = self.handler.handle(ctx, &request)?;
+
+        Ok(Response {
+            body: Body::Success(cbor::to_value(response)),
+        })
+    }
+}
+
+/// RPC method dispatcher implementation.
+pub struct Method {
+    /// Method dispatcher.
+    dispatcher: Box<dyn MethodHandlerDispatch + Send + Sync>,
+}
+
+impl Method {
+    /// Create a new enclave method descriptor.
+    pub fn new<Rq, Rsp, Handler>(method: MethodDescriptor, handler: Handler) -> Self
+    where
+        Rq: cbor::Decode + 'static,
+        Rsp: cbor::Encode + 'static,
+        Handler: MethodHandler<Rq, Rsp> + Send + Sync + 'static,
+    {
+        Method {
+            dispatcher: Box::new(MethodHandlerDispatchImpl {
+                descriptor: method,
+                handler: Box::new(handler),
+            }),
+        }
+    }
+
+    /// Return method name.
+    fn get_name(&self) -> &String {
+        &self.dispatcher.get_descriptor().name
+    }
+
+    /// Return RPC call kind.
+    fn get_kind(&self) -> Kind {
+        self.dispatcher.get_descriptor().kind
+    }
+
+    /// Dispatch a request.
+    fn dispatch(&self, ctx: &mut Context, request: Request) -> Result<Response> {
+        self.dispatcher.dispatch(ctx, request)
+    }
+}
+
+/// Key manager status update handler callback.
+pub type KeyManagerStatusHandler = dyn Fn(KeyManagerStatus) + Send + Sync;
+/// Key manager quote policy update handler callback.
+pub type KeyManagerQuotePolicyHandler = dyn Fn(QuotePolicy) + Send + Sync;
+
+/// RPC call dispatcher.
+#[derive(Default)]
+pub struct Dispatcher {
+    /// Registered RPC methods.
+    methods: HashMap<String, Method>,
+    /// Registered key manager status handler.
+    km_status_handler: Option<Box<KeyManagerStatusHandler>>,
+    /// Registered key manager quote policy handler.
+    km_quote_policy_handler: Option<Box<KeyManagerQuotePolicyHandler>>,
+}
+
+impl Dispatcher {
+    /// Register a new method in the dispatcher.
+    pub fn add_method(&mut self, method: Method) {
+        self.methods.insert(method.get_name().clone(), method);
+    }
+
+    /// Register new methods in the dispatcher.
+    pub fn add_methods(&mut self, methods: Vec<Method>) {
+        for method in methods {
+            self.add_method(method);
+        }
+    }
+
+    /// Dispatch request.
+    pub fn dispatch(&self, mut ctx: Context, request: Request, kind: Kind) -> Response {
+        match self.dispatch_fallible(&mut ctx, request, kind) {
+            Ok(response) => response,
+            Err(error) => Response {
+                body: Body::Error(format!("{error}")),
+            },
+        }
+    }
+
+    fn dispatch_fallible(
+        &self,
+        ctx: &mut Context,
+        request: Request,
+        kind: Kind,
+    ) -> Result<Response> {
+        let method = match self.methods.get(&request.method) {
+            Some(method) => method,
+            None => bail!(DispatchError::MethodNotFound {
+                method: request.method,
+            }),
+        };
+
+        if method.get_kind() != kind {
+            bail!(DispatchError::InvalidRpcKind {
+                method: request.method,
+                kind,
+            });
+        };
+
+        method.dispatch(ctx, request)
+    }
+
+    /// Handle key manager status update.
+    pub fn handle_km_status_update(&self, status: KeyManagerStatus) {
+        if let Some(handler) = self.km_status_handler.as_ref() {
+            handler(status)
+        }
+    }
+
+    /// Handle key manager quote policy update.
+    pub fn handle_km_quote_policy_update(&self, policy: QuotePolicy) {
+        if let Some(handler) = self.km_quote_policy_handler.as_ref() {
+            handler(policy)
+        }
+    }
+
+    /// Update key manager status update handler.
+    pub fn set_keymanager_status_update_handler(
+        &mut self,
+        f: Option<Box<KeyManagerStatusHandler>>,
+    ) {
+        self.km_status_handler = f;
+    }
+
+    /// Update key manager quote policy update handler.
+    pub fn set_keymanager_quote_policy_update_handler(
+        &mut self,
+        f: Option<Box<KeyManagerQuotePolicyHandler>>,
+    ) {
+        self.km_quote_policy_handler = f;
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/mod.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/mod.rs.html new file mode 100644 index 0000000000..5655d08944 --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/mod.rs.html @@ -0,0 +1,27 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+
//! Secure inter-enclave RPC.
+
+pub mod client;
+pub mod context;
+pub mod demux;
+pub mod dispatcher;
+pub mod session;
+pub mod sessions;
+mod transport;
+pub mod types;
+
+// Re-exports.
+pub use self::context::Context;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/session.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/session.rs.html new file mode 100644 index 0000000000..1bad9fd46b --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/session.rs.html @@ -0,0 +1,1089 @@ +session.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+
//! Secure channel session.
+use std::{collections::HashSet, io::Write, mem, sync::Arc};
+
+use anyhow::Result;
+use thiserror::Error;
+
+use super::types::Message;
+use crate::{
+    common::{
+        crypto::signature::{self, PublicKey, Signature, Signer},
+        namespace::Namespace,
+        sgx::{ias, EnclaveIdentity, Quote, QuotePolicy},
+    },
+    consensus::{
+        registry::{EndorsedCapabilityTEE, VerifiedAttestation, VerifiedEndorsedCapabilityTEE},
+        state::registry::ImmutableState as RegistryState,
+        verifier::Verifier,
+    },
+    identity::Identity,
+};
+
+/// Noise protocol pattern.
+const NOISE_PATTERN: &str = "Noise_XX_25519_ChaChaPoly_SHA256";
+/// RAK signature session binding context.
+const RAK_SESSION_BINDING_CONTEXT: [u8; 8] = *b"EkRakRpc";
+
+/// Session-related error.
+#[derive(Error, Debug)]
+enum SessionError {
+    #[error("invalid input")]
+    InvalidInput,
+    #[error("invalid state")]
+    InvalidState,
+    #[error("session closed")]
+    Closed,
+    #[error("mismatched enclave identity")]
+    MismatchedEnclaveIdentity,
+    #[error("missing quote policy")]
+    MissingQuotePolicy,
+    #[error("remote node not set")]
+    NodeNotSet,
+    #[error("remote node already set")]
+    NodeAlreadySet,
+    #[error("remote node not registered")]
+    NodeNotRegistered,
+    #[error("RAK not published in the consensus layer")]
+    RAKNotFound,
+    #[error("runtime id not set")]
+    RuntimeNotSet,
+}
+
+/// Information about a session.
+pub struct SessionInfo {
+    /// RAK binding.
+    pub rak_binding: RAKBinding,
+    /// Verified TEE remote attestation.
+    pub verified_attestation: VerifiedAttestation,
+    /// Identifier of the node that endorsed the TEE.
+    pub endorsed_by: Option<PublicKey>,
+}
+
+enum State {
+    Handshake1(snow::HandshakeState),
+    Handshake2(snow::HandshakeState),
+    Transport(snow::TransportState),
+    UnauthenticatedTransport(snow::TransportState),
+    Closed,
+}
+
+/// An encrypted and authenticated RPC session.
+pub struct Session {
+    cfg: Config,
+    local_static_pub: Vec<u8>,
+    remote_node: Option<signature::PublicKey>,
+    info: Option<Arc<SessionInfo>>,
+    state: State,
+    buf: Vec<u8>,
+}
+
+impl Session {
+    fn new(handshake_state: snow::HandshakeState, local_static_pub: Vec<u8>, cfg: Config) -> Self {
+        Self {
+            cfg,
+            local_static_pub,
+            remote_node: None,
+            info: None,
+            state: State::Handshake1(handshake_state),
+            buf: vec![0u8; 65535],
+        }
+    }
+
+    /// Process incoming data.
+    ///
+    /// In case the session is in transport mode the returned result will
+    /// contained a parsed message. The `writer` will be used in case any
+    /// protocol replies need to be generated.
+    pub async fn process_data<W: Write>(
+        &mut self,
+        data: &[u8],
+        mut writer: W,
+    ) -> Result<Option<Message>> {
+        // Replace the state with a closed state. In case processing fails for whatever
+        // reason, this will cause the session to be torn down.
+        match mem::replace(&mut self.state, State::Closed) {
+            State::Handshake1(mut state) => {
+                if state.is_initiator() {
+                    // Initiator only sends in this state.
+                    if !data.is_empty() {
+                        return Err(SessionError::InvalidInput.into());
+                    }
+
+                    // -> e
+                    let len = state.write_message(&[], &mut self.buf)?;
+                    writer.write_all(&self.buf[..len])?;
+                } else {
+                    // <- e
+                    state.read_message(data, &mut self.buf)?;
+
+                    // -> e, ee, s, es
+                    let len = state.write_message(&self.get_rak_binding(), &mut self.buf)?;
+                    writer.write_all(&self.buf[..len])?;
+                }
+
+                self.state = State::Handshake2(state);
+            }
+            State::Handshake2(mut state) => {
+                // Process data sent during Handshake1 phase.
+                let len = state.read_message(data, &mut self.buf)?;
+                let remote_static = state
+                    .get_remote_static()
+                    .expect("dh exchange just happened");
+                let auth_info = self
+                    .verify_rak_binding(&self.buf[..len], remote_static)
+                    .await;
+
+                if state.is_initiator() {
+                    // -> s, se
+                    let len = state.write_message(&self.get_rak_binding(), &mut self.buf)?;
+                    writer.write_all(&self.buf[..len])?;
+                }
+
+                match auth_info {
+                    Ok(auth_info) => {
+                        self.info = auth_info;
+                        self.state = State::Transport(state.into_transport_mode()?);
+                    }
+                    Err(_) if state.is_initiator() => {
+                        // There was an error authenticating the session and we are the initiator.
+                        // Transition into unauthenticated transport state so we can notify the
+                        // other side of the close.
+                        self.state = State::UnauthenticatedTransport(state.into_transport_mode()?);
+                    }
+                    Err(err) => {
+                        // There was an authentication error and we are not the initiator, abort.
+                        return Err(err);
+                    }
+                }
+            }
+            State::Transport(mut state) => {
+                // TODO: Restore session in case of errors.
+                let len = state.read_message(data, &mut self.buf)?;
+                let msg = cbor::from_slice(&self.buf[..len])?;
+
+                self.state = State::Transport(state);
+                return Ok(Some(msg));
+            }
+            State::Closed | State::UnauthenticatedTransport(_) => {
+                return Err(SessionError::Closed.into());
+            }
+        }
+
+        Ok(None)
+    }
+
+    /// Write message to session.
+    ///
+    /// The `writer` will be used for protocol message output which should
+    /// be transmitted to the remote session counterpart.
+    pub fn write_message<W: Write>(&mut self, msg: Message, mut writer: W) -> Result<()> {
+        let state = match self.state {
+            State::Transport(ref mut state) => state,
+            State::UnauthenticatedTransport(ref mut state) if matches!(msg, Message::Close) => {
+                state
+            }
+            _ => return Err(SessionError::InvalidState.into()),
+        };
+
+        let len = state.write_message(&cbor::to_vec(msg), &mut self.buf)?;
+        writer.write_all(&self.buf[..len])?;
+
+        Ok(())
+    }
+
+    /// Mark the session as closed.
+    ///
+    /// After the session is closed it can no longer be used to transmit
+    /// or receive messages and any such use will result in an error.
+    pub fn close(&mut self) {
+        self.state = State::Closed;
+    }
+
+    fn get_rak_binding(&self) -> Vec<u8> {
+        match self.cfg.identity {
+            Some(ref identity) => {
+                if identity.quote().is_none() {
+                    return vec![];
+                }
+
+                let binding = identity
+                    .sign(&RAK_SESSION_BINDING_CONTEXT, &self.local_static_pub)
+                    .unwrap();
+
+                if self.cfg.use_endorsement {
+                    // Use endorsed TEE capability when available.
+                    if let Some(ect) = identity.endorsed_capability_tee() {
+                        return cbor::to_vec(RAKBinding::V2 { ect, binding });
+                    }
+                }
+
+                // Use the local RAK and quote.
+                let rak_pub = identity.public_rak();
+                let quote = identity.quote().expect("quote is configured");
+
+                cbor::to_vec(RAKBinding::V1 {
+                    rak_pub,
+                    binding,
+                    quote: (*quote).clone(),
+                })
+            }
+            None => vec![],
+        }
+    }
+
+    async fn verify_rak_binding(
+        &self,
+        rak_binding: &[u8],
+        remote_static: &[u8],
+    ) -> Result<Option<Arc<SessionInfo>>> {
+        if rak_binding.is_empty() {
+            // If enclave identity verification is required and no RAK binding
+            // has been provided, we must abort the session.
+            if self.cfg.remote_enclaves.is_some() {
+                return Err(SessionError::MismatchedEnclaveIdentity.into());
+            }
+            return Ok(None);
+        }
+
+        let policy = self
+            .cfg
+            .policy
+            .as_ref()
+            .ok_or(SessionError::MissingQuotePolicy)?;
+
+        let rak_binding: RAKBinding = cbor::from_slice(rak_binding)?;
+        let vect = rak_binding.verify(remote_static, &self.cfg.remote_enclaves, policy)?;
+
+        // Verify node identity if verification is enabled.
+        if self.cfg.consensus_verifier.is_some() {
+            let rak = rak_binding.rak_pub();
+            self.verify_node_identity(rak).await?;
+        }
+
+        Ok(Some(Arc::new(SessionInfo {
+            rak_binding,
+            verified_attestation: vect.verified_attestation,
+            endorsed_by: vect.node_id,
+        })))
+    }
+
+    /// Session information.
+    pub fn session_info(&self) -> Option<Arc<SessionInfo>> {
+        self.info.clone()
+    }
+
+    /// Whether the session handshake has completed and the session
+    /// is in transport mode.
+    pub fn is_connected(&self) -> bool {
+        matches!(self.state, State::Transport(_))
+    }
+
+    /// Whether the session is connected to one of the given nodes.
+    pub fn is_connected_to(&self, nodes: &Vec<signature::PublicKey>) -> bool {
+        nodes.iter().any(|&node| Some(node) == self.remote_node)
+    }
+
+    /// Whether the session is in closed state.
+    pub fn is_closed(&self) -> bool {
+        matches!(self.state, State::Closed)
+    }
+
+    /// Whether the session is in unauthenticated transport state. In this state the session can
+    /// only be used to transmit a close notification.
+    pub fn is_unauthenticated(&self) -> bool {
+        matches!(self.state, State::UnauthenticatedTransport(_))
+    }
+
+    /// Return remote node identifier.
+    pub fn get_remote_node(&self) -> Result<signature::PublicKey> {
+        self.remote_node.ok_or(SessionError::NodeNotSet.into())
+    }
+
+    /// Set the remote node identifier.
+    pub fn set_remote_node(&mut self, node: signature::PublicKey) -> Result<()> {
+        if self.remote_node.is_some() {
+            return Err(SessionError::NodeAlreadySet.into());
+        }
+        self.remote_node = Some(node);
+        Ok(())
+    }
+
+    /// Verify the identity of the remote node by comparing the given RAK with the trusted RAK
+    /// obtained from the consensus layer registry service.
+    async fn verify_node_identity(&self, rak: signature::PublicKey) -> Result<()> {
+        let consensus_verifier = self
+            .cfg
+            .consensus_verifier
+            .as_ref()
+            .expect("consensus verifier should be set");
+        let runtime_id = self
+            .cfg
+            .remote_runtime_id
+            .ok_or(SessionError::RuntimeNotSet)?;
+        let node = self.remote_node.ok_or(SessionError::NodeNotSet)?;
+
+        let consensus_state = consensus_verifier.latest_state().await?;
+        // TODO: Make this access async.
+        let node = tokio::task::block_in_place(move || -> Result<_> {
+            let registry_state = RegistryState::new(&consensus_state);
+            Ok(registry_state
+                .node(&node)?
+                .ok_or(SessionError::NodeNotRegistered)?)
+        })?;
+
+        let verified = node
+            .runtimes
+            .unwrap_or_default()
+            .iter()
+            .filter(|rt| rt.id == runtime_id)
+            .flat_map(|rt| &rt.capabilities.tee)
+            .any(|tee| tee.rak == rak);
+
+        if !verified {
+            return Err(SessionError::RAKNotFound.into());
+        }
+        Ok(())
+    }
+}
+
+/// Binding of the session's static public key to a remote attestation
+/// verification report through the use of the remote attestation key.
+///
+/// The signature chain is as follows:
+///
+/// * `avr` contains the remote attestation verification report which
+///   binds RAK to the remote attestation.
+/// * `rak_pub` contains the public part of RAK.
+/// * `binding` is signed by `rak_pub` and binds the session's static
+///   public key to RAK.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(tag = "v")]
+pub enum RAKBinding {
+    /// Old V0 format that only supported IAS quotes.
+    #[cbor(rename = 0, missing)]
+    V0 {
+        rak_pub: PublicKey,
+        binding: Signature,
+        avr: ias::AVR,
+    },
+
+    /// New V1 format that supports both IAS and PCS quotes.
+    #[cbor(rename = 1)]
+    V1 {
+        rak_pub: PublicKey,
+        binding: Signature,
+        quote: Quote,
+    },
+
+    /// V2 format which supports endorsed CapabilityTEE structures.
+    #[cbor(rename = 2)]
+    V2 {
+        ect: EndorsedCapabilityTEE,
+        binding: Signature,
+    },
+}
+
+impl RAKBinding {
+    /// Public part of the RAK.
+    pub fn rak_pub(&self) -> PublicKey {
+        match self {
+            Self::V0 { rak_pub, .. } => *rak_pub,
+            Self::V1 { rak_pub, .. } => *rak_pub,
+            Self::V2 { ect, .. } => ect.capability_tee.rak,
+        }
+    }
+
+    /// Signature from RAK, binding the session's static public key to RAK.
+    fn binding(&self) -> Signature {
+        match self {
+            Self::V0 { binding, .. } => *binding,
+            Self::V1 { binding, .. } => *binding,
+            Self::V2 { binding, .. } => *binding,
+        }
+    }
+
+    /// Verify the RAK binding.
+    pub fn verify(
+        &self,
+        remote_static: &[u8],
+        remote_enclaves: &Option<HashSet<EnclaveIdentity>>,
+        policy: &QuotePolicy,
+    ) -> Result<VerifiedEndorsedCapabilityTEE> {
+        let vect = self.verify_inner(policy)?;
+
+        // Ensure that the report data includes the hash of the node's RAK.
+        // NOTE: For V2 this check is part of verify_inner so it is not really needed.
+        Identity::verify_binding(&vect.verified_attestation.quote, &self.rak_pub())?;
+
+        // Verify MRENCLAVE/MRSIGNER.
+        if let Some(ref remote_enclaves) = remote_enclaves {
+            if !remote_enclaves.contains(&vect.verified_attestation.quote.identity) {
+                return Err(SessionError::MismatchedEnclaveIdentity.into());
+            }
+        }
+
+        // Verify remote static key binding.
+        self.binding()
+            .verify(&self.rak_pub(), &RAK_SESSION_BINDING_CONTEXT, remote_static)?;
+
+        Ok(vect)
+    }
+
+    fn verify_inner(&self, policy: &QuotePolicy) -> Result<VerifiedEndorsedCapabilityTEE> {
+        match self {
+            Self::V0 { ref avr, .. } => {
+                ias::verify(avr, &policy.ias.clone().unwrap_or_default()).map(|vq| vq.into())
+            }
+            Self::V1 { ref quote, .. } => quote.verify(policy).map(|vq| vq.into()),
+            Self::V2 { ref ect, .. } => ect.verify(policy),
+        }
+    }
+}
+
+/// Session configuration.
+#[derive(Clone, Default)]
+struct Config {
+    consensus_verifier: Option<Arc<dyn Verifier>>,
+    identity: Option<Arc<Identity>>,
+    remote_enclaves: Option<HashSet<EnclaveIdentity>>,
+    remote_runtime_id: Option<Namespace>,
+    use_endorsement: bool,
+    policy: Option<Arc<QuotePolicy>>,
+}
+
+/// Session builder.
+#[derive(Clone, Default)]
+pub struct Builder {
+    cfg: Config,
+}
+
+impl Builder {
+    /// Return remote enclave identities if configured in the builder.
+    pub fn get_remote_enclaves(&self) -> &Option<HashSet<EnclaveIdentity>> {
+        &self.cfg.remote_enclaves
+    }
+
+    /// Enable remote enclave identity verification.
+    pub fn remote_enclaves(mut self, enclaves: Option<HashSet<EnclaveIdentity>>) -> Self {
+        self.cfg.remote_enclaves = enclaves;
+        self
+    }
+
+    /// Return remote runtime ID if configured in the builder.
+    pub fn get_remote_runtime_id(&self) -> &Option<Namespace> {
+        &self.cfg.remote_runtime_id
+    }
+
+    /// Set remote runtime ID for node identity verification.
+    pub fn remote_runtime_id(mut self, id: Option<Namespace>) -> Self {
+        self.cfg.remote_runtime_id = id;
+        self
+    }
+
+    /// Enable remote node identity verification.
+    pub fn consensus_verifier(mut self, verifier: Option<Arc<dyn Verifier>>) -> Self {
+        self.cfg.consensus_verifier = verifier;
+        self
+    }
+
+    /// Return quote policy if configured in the builder.
+    pub fn get_quote_policy(&self) -> &Option<Arc<QuotePolicy>> {
+        &self.cfg.policy
+    }
+
+    /// Configure quote policy used for remote quote verification.
+    pub fn quote_policy(mut self, policy: Option<Arc<QuotePolicy>>) -> Self {
+        self.cfg.policy = policy;
+        self
+    }
+
+    /// Use endorsement from host node when establishing sessions.
+    pub fn use_endorsement(mut self, use_endorsement: bool) -> Self {
+        self.cfg.use_endorsement = use_endorsement;
+        self
+    }
+
+    /// Return the local identity if configured in the builder.
+    pub fn get_local_identity(&self) -> &Option<Arc<Identity>> {
+        &self.cfg.identity
+    }
+
+    /// Enable RAK binding.
+    pub fn local_identity(mut self, identity: Arc<Identity>) -> Self {
+        self.cfg.identity = Some(identity);
+        self
+    }
+
+    fn build<'a>(self) -> (snow::Builder<'a>, snow::Keypair, Config) {
+        let noise_builder = snow::Builder::new(NOISE_PATTERN.parse().unwrap());
+        let keypair = noise_builder.generate_keypair().unwrap();
+        let cfg = self.cfg;
+
+        (noise_builder, keypair, cfg)
+    }
+
+    /// Build initiator session.
+    pub fn build_initiator(self) -> Session {
+        let (builder, keypair, cfg) = self.build();
+        let session = builder
+            .local_private_key(&keypair.private)
+            .build_initiator()
+            .unwrap();
+        Session::new(session, keypair.public, cfg)
+    }
+
+    /// Build responder session.
+    pub fn build_responder(self) -> Session {
+        let (builder, keypair, cfg) = self.build();
+        let session = builder
+            .local_private_key(&keypair.private)
+            .build_responder()
+            .unwrap();
+        Session::new(session, keypair.public, cfg)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/sessions.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/sessions.rs.html new file mode 100644 index 0000000000..dc02243aa0 --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/sessions.rs.html @@ -0,0 +1,1901 @@ +sessions.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+
//! Session demultiplexer.
+use std::{
+    collections::{BTreeSet, HashMap, HashSet},
+    hash::Hash,
+    io::Write,
+    mem,
+    sync::Arc,
+};
+
+use anyhow::Result;
+use rand::{rngs::OsRng, Rng};
+use tokio::sync::OwnedMutexGuard;
+
+use super::{
+    session::{Builder, Session, SessionInfo},
+    types::{Message, SessionID},
+};
+use crate::common::{
+    crypto::signature,
+    namespace::Namespace,
+    sgx::{EnclaveIdentity, QuotePolicy},
+    time::insecure_posix_time,
+};
+
+/// Shared pointer to a multiplexed session.
+pub type SharedSession<PeerID> = Arc<tokio::sync::Mutex<MultiplexedSession<PeerID>>>;
+
+/// Key for use in the by-idle-time index.
+pub type SessionByTimeKey<PeerID> = (i64, PeerID, SessionID);
+
+/// Sessions error.
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+    #[error("max concurrent sessions reached")]
+    MaxConcurrentSessions,
+}
+
+/// A multiplexed session.
+pub struct MultiplexedSession<PeerID> {
+    /// Peer identifier (needed for resolution when only given the shared pointer).
+    peer_id: PeerID,
+    /// Session identifier (needed for resolution when only given the shared pointer).
+    session_id: SessionID,
+    /// The actual session.
+    inner: Session,
+}
+
+impl<PeerID> MultiplexedSession<PeerID> {
+    /// Return the session's peer ID.
+    pub fn get_peer_id(&self) -> &PeerID {
+        &self.peer_id
+    }
+
+    /// Set the session's peer ID.
+    pub fn set_peer_id(&mut self, peer_id: PeerID) {
+        self.peer_id = peer_id;
+    }
+
+    /// Return the session ID.
+    pub fn get_session_id(&self) -> &SessionID {
+        &self.session_id
+    }
+
+    /// Session information.
+    pub fn info(&self) -> Option<Arc<SessionInfo>> {
+        self.inner.session_info()
+    }
+
+    /// Whether the session is in closed state.
+    pub fn is_closed(&self) -> bool {
+        self.inner.is_closed()
+    }
+
+    /// Process incoming session data.
+    pub async fn process_data<W: Write>(
+        &mut self,
+        data: &[u8],
+        writer: W,
+    ) -> Result<Option<Message>> {
+        self.inner.process_data(data, writer).await
+    }
+
+    /// Write message to session and generate a response.
+    pub fn write_message<W: Write>(&mut self, msg: Message, mut writer: W) -> Result<()> {
+        self.inner.write_message(msg, &mut writer)
+    }
+
+    /// Return remote node identifier.
+    pub fn get_remote_node(&self) -> Result<signature::PublicKey> {
+        self.inner.get_remote_node()
+    }
+
+    /// Set the remote node identifier.
+    pub fn set_remote_node(&mut self, node: signature::PublicKey) -> Result<()> {
+        self.inner.set_remote_node(node)
+    }
+
+    /// Whether the session handshake has completed and the session
+    /// is in transport mode.
+    pub fn is_connected(&self) -> bool {
+        self.inner.is_connected()
+    }
+
+    /// Whether the session is in unauthenticated transport state. In this state the session can
+    /// only be used to transmit a close notification.
+    pub fn is_unauthenticated(&self) -> bool {
+        self.inner.is_unauthenticated()
+    }
+
+    /// Mark the session as closed.
+    ///
+    /// After the session is closed it can no longer be used to transmit
+    /// or receive messages and any such use will result in an error.
+    pub fn close(&mut self) {
+        self.inner.close()
+    }
+}
+
+/// Structure used for session accounting.
+pub struct SessionMeta<PeerID: Clone + Ord + Hash> {
+    /// Peer identifier.
+    peer_id: PeerID,
+    /// Session identifier.
+    session_id: SessionID,
+    /// Timestamp when the session was last accessed.
+    last_access_time: i64,
+    /// The shared session pointer that needs to be locked for access.
+    inner: SharedSession<PeerID>,
+}
+
+impl<PeerID> SessionMeta<PeerID>
+where
+    PeerID: Clone + Ord + Hash,
+{
+    /// Key for ordering in the by-idle-time index.
+    fn by_time_key(&self) -> SessionByTimeKey<PeerID> {
+        (self.last_access_time, self.peer_id.clone(), self.session_id)
+    }
+}
+
+/// Session indices and management operations.
+pub struct Sessions<PeerID: Clone + Ord + Hash> {
+    /// Session builder.
+    builder: Builder,
+    /// Maximum number of sessions.
+    max_sessions: usize,
+    /// Maximum number of sessions per peer.
+    max_sessions_per_peer: usize,
+    /// Stale session timeout (in seconds).
+    stale_session_timeout: i64,
+
+    /// A map of sessions for each peer.
+    by_peer: HashMap<PeerID, HashMap<SessionID, SessionMeta<PeerID>>>,
+    /// A set of all sessions, ordered by idle time.
+    by_idle_time: BTreeSet<SessionByTimeKey<PeerID>>,
+}
+
+impl<PeerID> Sessions<PeerID>
+where
+    PeerID: Clone + Ord + Hash,
+{
+    /// Create a new session management instance.
+    pub fn new(
+        builder: Builder,
+        max_sessions: usize,
+        max_sessions_per_peer: usize,
+        stale_session_timeout: i64,
+    ) -> Self {
+        Self {
+            builder,
+            max_sessions,
+            max_sessions_per_peer,
+            stale_session_timeout,
+            by_peer: HashMap::new(),
+            by_idle_time: BTreeSet::new(),
+        }
+    }
+
+    /// Set the session builder to use.
+    pub fn set_builder(&mut self, builder: Builder) {
+        self.builder = builder;
+    }
+
+    /// Update remote enclave identity verification in the session builder
+    /// and clear all sessions if the identity has changed.
+    pub fn update_enclaves(
+        &mut self,
+        enclaves: Option<HashSet<EnclaveIdentity>>,
+    ) -> Vec<SharedSession<PeerID>> {
+        if self.builder.get_remote_enclaves() == &enclaves {
+            return vec![];
+        }
+
+        self.builder = mem::take(&mut self.builder).remote_enclaves(enclaves);
+        self.drain()
+    }
+
+    /// Update quote policy used for remote quote verification in the session builder
+    /// and clear all sessions if the policy has changed.
+    pub fn update_quote_policy(&mut self, policy: QuotePolicy) -> Vec<SharedSession<PeerID>> {
+        let policy = Some(Arc::new(policy));
+        if self.builder.get_quote_policy() == &policy {
+            return vec![];
+        }
+
+        self.builder = mem::take(&mut self.builder).quote_policy(policy);
+        self.drain()
+    }
+
+    /// Update remote runtime ID for node identity verification in the session builder
+    /// and clear all sessions if the runtime ID has changed.
+    pub fn update_runtime_id(&mut self, id: Option<Namespace>) -> Vec<SharedSession<PeerID>> {
+        if self.builder.get_remote_runtime_id() == &id {
+            return vec![];
+        }
+
+        self.builder = mem::take(&mut self.builder).remote_runtime_id(id);
+        self.drain()
+    }
+
+    /// Create a new multiplexed responder session.
+    pub fn create_responder(
+        &mut self,
+        peer_id: PeerID,
+        session_id: SessionID,
+    ) -> MultiplexedSession<PeerID> {
+        // If no quote policy is set, use the local one.
+        if self.builder.get_quote_policy().is_none() {
+            let policy = self
+                .builder
+                .get_local_identity()
+                .as_ref()
+                .and_then(|id| id.quote_policy());
+
+            self.builder = mem::take(&mut self.builder).quote_policy(policy);
+        }
+
+        MultiplexedSession {
+            peer_id: peer_id.clone(),
+            session_id,
+            inner: self.builder.clone().build_responder(),
+        }
+    }
+
+    /// Create a new multiplexed initiator session.
+    pub fn create_initiator(&self, peer_id: PeerID) -> MultiplexedSession<PeerID> {
+        let session_id = SessionID::random();
+
+        MultiplexedSession {
+            peer_id: peer_id.clone(),
+            session_id,
+            inner: self.builder.clone().build_initiator(),
+        }
+    }
+
+    /// Fetch an existing session given its identifier.
+    pub fn get(
+        &mut self,
+        peer_id: &PeerID,
+        session_id: &SessionID,
+    ) -> Option<SharedSession<PeerID>> {
+        // Check if peer exists.
+        let sessions = match self.by_peer.get_mut(peer_id) {
+            Some(sessions) => sessions,
+            None => return None,
+        };
+
+        // Check if the session exists. If so, return it.
+        let session = match sessions.get_mut(session_id) {
+            Some(session) => session,
+            None => return None,
+        };
+
+        Self::update_access_time(session, &mut self.by_idle_time);
+
+        Some(session.inner.clone())
+    }
+
+    /// Fetch an existing session from one of the given peers. If no peers
+    /// are provided, a session from any peer will be returned.
+    pub fn find(&mut self, peer_ids: &[PeerID]) -> Option<SharedSession<PeerID>> {
+        match peer_ids.is_empty() {
+            true => self.find_any(),
+            false => self.find_one(peer_ids),
+        }
+    }
+
+    /// Fetch an existing session from any peer.
+    pub fn find_any(&mut self) -> Option<SharedSession<PeerID>> {
+        if self.by_idle_time.is_empty() {
+            return None;
+        }
+
+        // Check if there is a session that is not currently in use.
+        for (_, peer_id, session_id) in self.by_idle_time.iter() {
+            let session = self
+                .by_peer
+                .get_mut(peer_id)
+                .unwrap()
+                .get_mut(session_id)
+                .unwrap();
+
+            if session.inner.clone().try_lock_owned().is_ok() {
+                Self::update_access_time(session, &mut self.by_idle_time);
+                return Some(session.inner.clone());
+            }
+        }
+
+        // If all sessions are in use, return a random one.
+        let n = OsRng.gen_range(0..self.by_idle_time.len());
+        let (_, peer_id, session_id) = self.by_idle_time.iter().nth(n).unwrap();
+        let session = self
+            .by_peer
+            .get_mut(peer_id)
+            .unwrap()
+            .get_mut(session_id)
+            .unwrap();
+
+        Self::update_access_time(session, &mut self.by_idle_time);
+
+        Some(session.inner.clone())
+    }
+
+    /// Fetch an existing session from one of the given peers.
+    pub fn find_one(&mut self, peer_ids: &[PeerID]) -> Option<SharedSession<PeerID>> {
+        let mut all_sessions = vec![];
+
+        for peer_id in peer_ids.iter() {
+            let sessions = match self.by_peer.get_mut(peer_id) {
+                Some(sessions) => sessions,
+                None => return None,
+            };
+
+            // Check if peer has a session that is not currently in use.
+            let session = sessions
+                .values_mut()
+                .filter(|s| s.inner.clone().try_lock_owned().is_ok())
+                .min_by_key(|s| s.last_access_time);
+
+            if let Some(session) = session {
+                Self::update_access_time(session, &mut self.by_idle_time);
+                return Some(session.inner.clone());
+            }
+
+            for session in sessions.values() {
+                all_sessions.push((session.peer_id.clone(), session.session_id));
+            }
+        }
+
+        if all_sessions.is_empty() {
+            return None;
+        }
+
+        // If all sessions are in use, return a random one.
+        let n = OsRng.gen_range(0..all_sessions.len());
+        let (peer_id, session_id) = all_sessions.get(n).unwrap();
+        let session = self
+            .by_peer
+            .get_mut(peer_id)
+            .unwrap()
+            .get_mut(session_id)
+            .unwrap();
+
+        Self::update_access_time(session, &mut self.by_idle_time);
+
+        Some(session.inner.clone())
+    }
+
+    /// Remove one session to free up a slot for the given peer.
+    pub fn remove_for(
+        &mut self,
+        peer_id: &PeerID,
+        now: i64,
+    ) -> Result<Option<OwnedMutexGuard<MultiplexedSession<PeerID>>>, Error> {
+        if let Some(session) = self.remove_from(peer_id)? {
+            return Ok(Some(session));
+        }
+        self.remove_one(now)
+    }
+
+    /// Remove one existing session from the given peer if the peer has reached
+    /// the maximum number of sessions or if the total number of sessions exceeds
+    /// the global session limit.
+    pub fn remove_from(
+        &mut self,
+        peer_id: &PeerID,
+    ) -> Result<Option<OwnedMutexGuard<MultiplexedSession<PeerID>>>, Error> {
+        // Check if peer exists.
+        let sessions = match self.by_peer.get_mut(peer_id) {
+            Some(sessions) => sessions,
+            None => return Ok(None),
+        };
+
+        // Check if the peer has max sessions or if no more sessions are available globally.
+        // If so, remove the oldest or return an error.
+        if sessions.len() < self.max_sessions_per_peer
+            && self.by_idle_time.len() < self.max_sessions
+        {
+            return Ok(None);
+        }
+
+        // Force close the oldest idle session.
+        let remove_session = sessions
+            .iter()
+            .min_by_key(|(_, s)| {
+                if let Ok(_inner) = s.inner.try_lock() {
+                    s.last_access_time
+                } else {
+                    i64::MAX // Session is currently in use.
+                }
+            })
+            .map(|(_, s)| s.inner.clone())
+            .ok_or(Error::MaxConcurrentSessions)?;
+
+        let session = match remove_session.try_lock_owned() {
+            Ok(inner) => inner,
+            Err(_) => return Err(Error::MaxConcurrentSessions), // All sessions are in use.
+        };
+
+        self.remove(&session);
+
+        Ok(Some(session))
+    }
+
+    /// Remove one stale session if the total number of sessions exceeds
+    /// the global session limit.
+    pub fn remove_one(
+        &mut self,
+        now: i64,
+    ) -> Result<Option<OwnedMutexGuard<MultiplexedSession<PeerID>>>, Error> {
+        // Check if there are too many sessions. If so, remove one or return an error.
+        if self.by_idle_time.len() < self.max_sessions {
+            return Ok(None);
+        }
+
+        // Attempt to prune stale sessions, starting with the oldest ones.
+        let mut remove_session: Option<OwnedMutexGuard<MultiplexedSession<PeerID>>> = None;
+
+        for (last_process_frame_time, peer_id, session_id) in self.by_idle_time.iter() {
+            if now.saturating_sub(*last_process_frame_time) < self.stale_session_timeout {
+                // This is the oldest session, all next ones will be more fresh.
+                return Err(Error::MaxConcurrentSessions);
+            }
+
+            // Fetch session and attempt to lock it.
+            if let Some(sessions) = self.by_peer.get(peer_id) {
+                if let Some(session) = sessions.get(session_id) {
+                    if let Ok(session) = session.inner.clone().try_lock_owned() {
+                        remove_session = Some(session);
+                        break;
+                    }
+                }
+            }
+        }
+
+        // Check if we found a session that can be removed.
+        let session = match remove_session {
+            Some(session) => session,
+            None => return Err(Error::MaxConcurrentSessions), // All stale sessions are in use.
+        };
+
+        self.remove(&session);
+
+        Ok(Some(session))
+    }
+
+    /// Add a session if there is an available spot.
+    pub fn add(
+        &mut self,
+        session: MultiplexedSession<PeerID>,
+        now: i64,
+    ) -> Result<SharedSession<PeerID>, Error> {
+        if self.by_idle_time.len() >= self.max_sessions {
+            return Err(Error::MaxConcurrentSessions);
+        }
+
+        let sessions = self.by_peer.entry(session.peer_id.clone()).or_default();
+        if sessions.len() >= self.max_sessions_per_peer {
+            return Err(Error::MaxConcurrentSessions);
+        }
+
+        let peer_id = session.peer_id.clone();
+        let session_id = session.session_id;
+
+        let session = SessionMeta {
+            inner: Arc::new(tokio::sync::Mutex::new(session)),
+            peer_id,
+            session_id,
+            last_access_time: now,
+        };
+        let inner = session.inner.clone();
+
+        self.by_idle_time.insert(session.by_time_key());
+        sessions.insert(session.session_id, session);
+
+        Ok(inner)
+    }
+
+    /// Remove a session that must be currently owned by the caller.
+    pub fn remove(&mut self, session: &OwnedMutexGuard<MultiplexedSession<PeerID>>) {
+        let sessions = self.by_peer.get_mut(&session.peer_id).unwrap();
+        let session_meta = sessions.get(&session.session_id).unwrap();
+        let key = session_meta.by_time_key();
+        sessions.remove(&session.session_id);
+        self.by_idle_time.remove(&key);
+
+        // If peer doesn't have any more sessions, remove the peer.
+        if sessions.is_empty() {
+            self.by_peer.remove(&session.peer_id);
+        }
+    }
+
+    /// Removes and returns all sessions.
+    pub fn drain(&mut self) -> Vec<SharedSession<PeerID>> {
+        self.by_idle_time.clear();
+
+        let mut all_sessions = vec![];
+        for (_, mut sessions) in self.by_peer.drain() {
+            for (_, session) in sessions.drain() {
+                all_sessions.push(session.inner);
+            }
+        }
+
+        all_sessions
+    }
+
+    fn update_access_time(
+        session: &mut SessionMeta<PeerID>,
+        by_idle_time: &mut BTreeSet<SessionByTimeKey<PeerID>>,
+    ) {
+        // Remove old idle time.
+        by_idle_time.remove(&session.by_time_key());
+
+        // Update idle time.
+        session.last_access_time = insecure_posix_time();
+        by_idle_time.insert(session.by_time_key());
+    }
+
+    /// Number of all sessions.
+    #[cfg(test)]
+    fn session_count(&self) -> usize {
+        self.by_idle_time.len()
+    }
+
+    /// Number of all peers.
+    #[cfg(test)]
+    fn peer_count(&self) -> usize {
+        self.by_peer.len()
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::enclave_rpc::{session::Builder, types::SessionID};
+
+    use super::{Error, Sessions};
+
+    fn ids() -> (Vec<Vec<u8>>, Vec<SessionID>) {
+        let peer_ids: Vec<Vec<u8>> = (1..8).map(|x| vec![x]).collect();
+        let session_ids: Vec<SessionID> = (1..8).map(|_| SessionID::random()).collect();
+
+        (peer_ids, session_ids)
+    }
+
+    #[test]
+    fn test_add() {
+        let (peer_ids, session_ids) = ids();
+        let mut sessions = Sessions::new(Builder::default(), 4, 2, 60);
+
+        let test_vector = vec![
+            (&peer_ids[0], &session_ids[0], 1, 1, true),
+            (&peer_ids[0], &session_ids[1], 2, 1, true), // Different session ID.
+            (&peer_ids[0], &session_ids[2], 2, 1, false), // Too many sessions per peer.
+            (&peer_ids[1], &session_ids[0], 3, 2, true), // Different peer ID.
+            (&peer_ids[2], &session_ids[2], 4, 3, true), // Different peer ID and session ID.
+            (&peer_ids[3], &session_ids[3], 4, 3, false), // Too many sessions.
+        ];
+
+        let now = 0;
+        for (peer_id, session_id, num_sessions, num_peers, created) in test_vector {
+            let session = sessions.create_responder(peer_id.clone(), session_id.clone());
+            let res = sessions.add(session, now);
+            match created {
+                true => {
+                    assert!(res.is_ok(), "session should be created");
+                    let s = res.unwrap();
+                    let s_owned = s.try_lock().unwrap();
+                    assert_eq!(&s_owned.peer_id, peer_id);
+                    assert_eq!(&s_owned.session_id, session_id);
+                }
+                false => {
+                    assert!(res.is_err(), "session should not be created");
+                    assert!(matches!(res, Err(Error::MaxConcurrentSessions)));
+                }
+            };
+            assert_eq!(sessions.session_count(), num_sessions);
+            assert_eq!(sessions.peer_count(), num_peers);
+        }
+    }
+
+    #[test]
+    fn test_get() {
+        let (peer_ids, session_ids) = ids();
+        let mut sessions = Sessions::new(Builder::default(), 8, 2, 60);
+
+        let test_vector = vec![
+            (&peer_ids[0], &session_ids[0], true),
+            (&peer_ids[0], &session_ids[1], false), // Different peer ID.
+            (&peer_ids[1], &session_ids[0], false), // Different session ID.
+            (&peer_ids[1], &session_ids[1], false), // Different peer ID and session ID.
+        ];
+
+        let now = 0;
+        for (peer_id, session_id, create) in test_vector {
+            if create {
+                let session = sessions.create_responder(peer_id.clone(), session_id.clone());
+                let _ = sessions.add(session, now);
+            }
+
+            let maybe_s = sessions.get(peer_id, session_id);
+            match create {
+                true => {
+                    assert!(maybe_s.is_some(), "session should exist");
+                    let s = maybe_s.unwrap();
+                    let s_owned = s.try_lock_owned().unwrap();
+                    assert_eq!(&s_owned.peer_id, peer_id);
+                    assert_eq!(&s_owned.session_id, session_id);
+                }
+                false => assert!(maybe_s.is_none(), "session should not exist"),
+            }
+        }
+    }
+
+    #[test]
+    fn test_find_any() {
+        let (peer_ids, session_ids) = ids();
+        let mut sessions = Sessions::new(Builder::default(), 8, 2, 60);
+
+        let test_vector = vec![
+            (&peer_ids[0], &session_ids[0]),
+            (&peer_ids[0], &session_ids[1]),
+            (&peer_ids[1], &session_ids[2]),
+        ];
+
+        // No sessions.
+        let maybe_s = sessions.find_any();
+        assert!(maybe_s.is_none(), "session should not be found");
+
+        let mut now = 0;
+        for (peer_id, session_id) in test_vector {
+            let session = sessions.create_responder(peer_id.clone(), session_id.clone());
+            let _ = sessions.add(session, now);
+            now += 1
+        }
+
+        // No sessions in use.
+        let maybe_s = sessions.find_any();
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let s1_owned = s.try_lock_owned().unwrap(); // Session now in use.
+        assert_eq!(&s1_owned.peer_id, &peer_ids[0]);
+        assert_eq!(&s1_owned.session_id, &session_ids[0]);
+
+        // One session in use.
+        let maybe_s = sessions.find_any();
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let s2_owned = s.try_lock_owned().unwrap(); // Session now in use.
+        assert_eq!(&s2_owned.peer_id, &peer_ids[0]);
+        assert_eq!(&s2_owned.session_id, &session_ids[1]); // Different session found.
+
+        // Two sessions in use.
+        let maybe_s = sessions.find_any();
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let s3_owned = s.try_lock_owned().unwrap(); // Session now in use.
+        assert_eq!(&s3_owned.peer_id, &peer_ids[1]);
+        assert_eq!(&s3_owned.session_id, &session_ids[2]); // Different session found.
+
+        // All sessions in use.
+        let maybe_s = sessions.find_any();
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let res = s.try_lock_owned(); // Session now in use.
+        assert!(res.is_err(), "session should be in use");
+
+        // Free one session.
+        drop(s2_owned);
+
+        // Two sessions in use.
+        let maybe_s = sessions.find_any();
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let s_owned = s.try_lock_owned().unwrap(); // Session now in use.
+        assert_eq!(&s_owned.peer_id, &peer_ids[0]);
+        assert_eq!(&s_owned.session_id, &session_ids[1]);
+    }
+
+    #[test]
+    fn test_find_one() {
+        let (peer_ids, session_ids) = ids();
+        let mut sessions = Sessions::new(Builder::default(), 8, 2, 60);
+
+        let test_vector = vec![
+            (&peer_ids[2], &session_ids[0]), // Incorrect peer.
+            (&peer_ids[0], &session_ids[0]),
+            (&peer_ids[3], &session_ids[1]), // Incorrect peer.
+            (&peer_ids[0], &session_ids[1]),
+            (&peer_ids[3], &session_ids[2]), // Incorrect peer.
+            (&peer_ids[1], &session_ids[2]),
+            (&peer_ids[2], &session_ids[2]), // Incorrect peer.
+        ];
+
+        // No sessions.
+        let maybe_s = sessions.find_one(&peer_ids[0..2]);
+        assert!(maybe_s.is_none(), "session should not be found");
+
+        let mut now = 0;
+        for (peer_id, session_id) in test_vector {
+            let session = sessions.create_responder(peer_id.clone(), session_id.clone());
+            let _ = sessions.add(session, now);
+            now += 1
+        }
+
+        // Peers without sessions.
+        let maybe_s = sessions.find_one(&peer_ids[4..]);
+        assert!(maybe_s.is_none(), "session should not be found");
+
+        // No sessions in use.
+        let maybe_s = sessions.find_one(&peer_ids[0..2]);
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let s1_owned = s.try_lock_owned().unwrap(); // Session now in use.
+        assert_eq!(&s1_owned.peer_id, &peer_ids[0]);
+        assert_eq!(&s1_owned.session_id, &session_ids[0]);
+
+        // One session in use.
+        let maybe_s = sessions.find_one(&peer_ids[0..2]);
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let s2_owned = s.try_lock_owned().unwrap(); // Session now in use.
+        assert_eq!(&s2_owned.peer_id, &peer_ids[0]);
+        assert_eq!(&s2_owned.session_id, &session_ids[1]); // Different session found.
+
+        // Two sessions in use.
+        let maybe_s = sessions.find_one(&peer_ids[0..2]);
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let s3_owned = s.try_lock_owned().unwrap(); // Session now in use.
+        assert_eq!(&s3_owned.peer_id, &peer_ids[1]);
+        assert_eq!(&s3_owned.session_id, &session_ids[2]); // Different session found.
+
+        // All sessions in use.
+        let maybe_s = sessions.find_one(&peer_ids[0..2]);
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let res = s.try_lock_owned(); // Session now in use.
+        assert!(res.is_err(), "session should be in use");
+
+        // Free one session.
+        drop(s2_owned);
+
+        // Two sessions in use.
+        let maybe_s = sessions.find_one(&peer_ids[0..2]);
+        assert!(maybe_s.is_some(), "session should be found");
+        let s = maybe_s.unwrap();
+        let s_owned = s.try_lock_owned().unwrap(); // Session now in use.
+        assert_eq!(&s_owned.peer_id, &peer_ids[0]);
+        assert_eq!(&s_owned.session_id, &session_ids[1]);
+    }
+
+    #[test]
+    fn test_remove_from() {
+        let (peer_ids, session_ids) = ids();
+        let mut sessions = Sessions::new(Builder::default(), 4, 2, 60);
+
+        let test_vector = vec![
+            (&peer_ids[0], &session_ids[0]),
+            (&peer_ids[1], &session_ids[1]),
+            (&peer_ids[2], &session_ids[2]),
+            (&peer_ids[2], &session_ids[3]), // Max sessions per peer reached.
+                                             // Max sessions reached.
+        ];
+
+        let mut now = 0;
+        for (peer_id, session_id) in test_vector.clone() {
+            let session = sessions.create_responder(peer_id.clone(), session_id.clone());
+            let _ = sessions.add(session, now);
+            now += 1;
+        }
+
+        // Removing one session from an unknown peer should have no effect,
+        // even if all global session slots are occupied.
+        let res = sessions.remove_from(&peer_ids[3]);
+        assert!(res.is_ok(), "remove_from should succeed");
+        let maybe_s_owned = res.unwrap();
+        assert!(maybe_s_owned.is_none(), "no sessions should be removed");
+        assert_eq!(sessions.session_count(), 4);
+        assert_eq!(sessions.peer_count(), 3);
+
+        // Removing one session for one of the existing peers should work
+        // as it should force evict an old session.
+        // Note that each peer has 2 available slots, but globally there are
+        // only 4 slots so if global slots are full this should trigger peer
+        // session eviction.
+        let res = sessions.remove_from(&peer_ids[0]);
+        assert!(res.is_ok(), "remove_from should succeed");
+        let maybe_s_owned = res.unwrap();
+        assert!(maybe_s_owned.is_some(), "one session should be removed");
+        let s_owned = maybe_s_owned.unwrap();
+        assert_eq!(&s_owned.peer_id, &peer_ids[0]);
+        assert_eq!(&s_owned.session_id, &session_ids[0]);
+        assert_eq!(sessions.session_count(), 3);
+        assert_eq!(sessions.peer_count(), 2);
+
+        // Removing another session should fail as one global session slot
+        // is available.
+        for peer_id in vec![&peer_ids[0], &peer_ids[1]] {
+            let res = sessions.remove_from(peer_id);
+            assert!(res.is_ok(), "remove_from should succeed");
+            let maybe_s_owned = res.unwrap();
+            assert!(maybe_s_owned.is_none(), "no sessions should be removed");
+            assert_eq!(sessions.session_count(), 3);
+            assert_eq!(sessions.peer_count(), 2);
+        }
+
+        // Removing one session from a peer with max sessions should succeed
+        // even if one global slot is available.
+        let res = sessions.remove_from(&peer_ids[2]);
+        assert!(res.is_ok(), "remove_from should succeed");
+        let maybe_s_owned = res.unwrap();
+        assert!(maybe_s_owned.is_some(), "one session should be removed");
+        let s_owned = maybe_s_owned.unwrap();
+        assert_eq!(&s_owned.peer_id, &peer_ids[2]);
+        assert_eq!(&s_owned.session_id, &session_ids[2]);
+        assert_eq!(sessions.session_count(), 2);
+        assert_eq!(sessions.peer_count(), 2);
+    }
+
+    #[test]
+    fn test_remove_one() {
+        let (peer_ids, session_ids) = ids();
+        let mut sessions = Sessions::new(Builder::default(), 4, 2, 60);
+
+        let test_vector = vec![
+            (&peer_ids[0], &session_ids[0]),
+            (&peer_ids[1], &session_ids[1]),
+            (&peer_ids[2], &session_ids[2]),
+            (&peer_ids[2], &session_ids[3]), // Max sessions reached.
+        ];
+
+        let mut now = 0;
+        for (peer_id, session_id) in test_vector.clone() {
+            let session = sessions.create_responder(peer_id.clone(), session_id.clone());
+            let _ = sessions.add(session, now);
+            now += 1;
+        }
+
+        // Forward time (stale_session_timeout - test_vector.len() - 1).
+        now += 60 - 4 - 1;
+
+        // Removing one session should fail as there are none stale sessions.
+        let res = sessions.remove_one(now);
+        assert!(res.is_err(), "remove_one should fail");
+        assert!(matches!(res, Err(Error::MaxConcurrentSessions)));
+        assert_eq!(sessions.session_count(), 4);
+        assert_eq!(sessions.peer_count(), 3);
+
+        // Forward time.
+        now += 1;
+
+        // Removing one session should succeed as no session slots
+        // are available and there is one stale session.
+        let res = sessions.remove_one(now);
+        assert!(res.is_ok(), "remove_one should succeed");
+        let maybe_s_owned = res.unwrap();
+        assert!(maybe_s_owned.is_some(), "one session should be removed");
+        let s_owned = maybe_s_owned.unwrap();
+        assert_eq!(&s_owned.peer_id, &peer_ids[0]);
+        assert_eq!(&s_owned.session_id, &session_ids[0]);
+        assert_eq!(sessions.session_count(), 3);
+        assert_eq!(sessions.peer_count(), 2);
+
+        // Forward time.
+        now += 100;
+
+        // Removing one session should fail even though there are stale sessions
+        // because there is one session slot available.
+        let res = sessions.remove_one(now);
+        assert!(res.is_ok(), "remove_one should succeed");
+        let maybe_s_owned = res.unwrap();
+        assert!(maybe_s_owned.is_none(), "no sessions should be removed");
+        assert_eq!(sessions.session_count(), 3);
+        assert_eq!(sessions.peer_count(), 2);
+    }
+
+    #[test]
+    fn test_remove() {
+        let (peer_ids, session_ids) = ids();
+        let mut sessions = Sessions::new(Builder::default(), 8, 2, 60);
+
+        let test_vector = vec![
+            (&peer_ids[0], &session_ids[0], 3, 2),
+            (&peer_ids[1], &session_ids[1], 2, 1),
+            (&peer_ids[2], &session_ids[2], 1, 1),
+            (&peer_ids[2], &session_ids[3], 0, 0),
+        ];
+
+        let now = 0;
+        for (peer_id, session_id, _, _) in test_vector.clone() {
+            let session = sessions.create_responder(peer_id.clone(), session_id.clone());
+            let _ = sessions.add(session, now);
+        }
+
+        for (peer_id, session_id, num_sessions, num_peers) in test_vector {
+            let maybe_s = sessions.get(peer_id, session_id);
+            assert!(maybe_s.is_some(), "session should exist");
+            let s = maybe_s.unwrap();
+            let s_owned = s.try_lock_owned().unwrap();
+
+            sessions.remove(&s_owned);
+            assert_eq!(sessions.session_count(), num_sessions);
+            assert_eq!(sessions.peer_count(), num_peers);
+        }
+    }
+
+    #[test]
+    fn test_clear() {
+        let (peer_ids, session_ids) = ids();
+        let mut sessions = Sessions::new(Builder::default(), 8, 2, 60);
+
+        let test_vector = vec![
+            (&peer_ids[0], &session_ids[0]),
+            (&peer_ids[1], &session_ids[1]),
+            (&peer_ids[2], &session_ids[2]),
+            (&peer_ids[2], &session_ids[3]),
+        ];
+
+        let now = 0;
+        for (peer_id, session_id) in test_vector.clone() {
+            let session = sessions.create_responder(peer_id.clone(), session_id.clone());
+            let _ = sessions.add(session, now);
+        }
+
+        let removed_sessions = sessions.drain();
+        assert_eq!(removed_sessions.len(), 4);
+        assert_eq!(sessions.session_count(), 0);
+        assert_eq!(sessions.peer_count(), 0);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/transport.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/transport.rs.html new file mode 100644 index 0000000000..9b39220bfe --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/transport.rs.html @@ -0,0 +1,267 @@ +transport.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+
use std::sync::Arc;
+
+use anyhow::{anyhow, Error as AnyError};
+use async_trait::async_trait;
+
+use crate::{common::crypto::signature, types::Body, Protocol};
+
+use super::types;
+
+// Enclave's response.
+pub struct EnclaveResponse {
+    // Actual response data.
+    pub data: Vec<u8>,
+    // The public key of the node that generated the response.
+    pub node: signature::PublicKey,
+}
+
+/// An EnclaveRPC transport.
+#[async_trait]
+pub trait Transport: Send + Sync {
+    async fn write_noise_session(
+        &self,
+        request_id: u64,
+        session_id: types::SessionID,
+        data: Vec<u8>,
+        untrusted_plaintext: String,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Result<EnclaveResponse, AnyError> {
+        let frame = types::Frame {
+            session: session_id,
+            untrusted_plaintext,
+            payload: data,
+        };
+
+        self.write_message_impl(
+            request_id,
+            cbor::to_vec(frame),
+            types::Kind::NoiseSession,
+            nodes,
+        )
+        .await
+    }
+
+    async fn write_insecure_query(
+        &self,
+        request_id: u64,
+        data: Vec<u8>,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Result<EnclaveResponse, AnyError> {
+        self.write_message_impl(request_id, data, types::Kind::InsecureQuery, nodes)
+            .await
+    }
+
+    async fn write_message_impl(
+        &self,
+        request_id: u64,
+        data: Vec<u8>,
+        kind: types::Kind,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Result<EnclaveResponse, AnyError>;
+
+    async fn submit_peer_feedback(
+        &self,
+        request_id: u64,
+        feedback: types::PeerFeedback,
+    ) -> Result<(), AnyError>;
+}
+
+/// A transport implementation which can be used from inside the runtime and uses the Runtime Host
+/// Protocol to transport EnclaveRPC frames.
+pub struct RuntimeTransport {
+    pub protocol: Arc<Protocol>,
+    pub endpoint: String,
+}
+
+impl RuntimeTransport {
+    pub fn new(protocol: Arc<Protocol>, endpoint: &str) -> Self {
+        Self {
+            protocol,
+            endpoint: endpoint.to_string(),
+        }
+    }
+}
+
+#[async_trait]
+impl Transport for RuntimeTransport {
+    async fn write_message_impl(
+        &self,
+        request_id: u64,
+        data: Vec<u8>,
+        kind: types::Kind,
+        nodes: Vec<signature::PublicKey>,
+    ) -> Result<EnclaveResponse, AnyError> {
+        let rsp = self
+            .protocol
+            .call_host_async(Body::HostRPCCallRequest {
+                endpoint: self.endpoint.clone(),
+                request_id,
+                request: data,
+                kind,
+                nodes,
+            })
+            .await?;
+
+        match rsp {
+            Body::HostRPCCallResponse { response, node } => Ok(EnclaveResponse {
+                data: response,
+                node,
+            }),
+            _ => Err(anyhow!("bad response type")),
+        }
+    }
+
+    async fn submit_peer_feedback(
+        &self,
+        request_id: u64,
+        peer_feedback: types::PeerFeedback,
+    ) -> Result<(), AnyError> {
+        let rsp = self
+            .protocol
+            .call_host_async(Body::HostSubmitPeerFeedbackRequest {
+                endpoint: self.endpoint.clone(),
+                request_id,
+                peer_feedback,
+            })
+            .await?;
+
+        match rsp {
+            Body::HostSubmitPeerFeedbackResponse {} => Ok(()),
+            _ => Err(anyhow!("bad response type")),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/enclave_rpc/types.rs.html b/rust/src/oasis_core_runtime/enclave_rpc/types.rs.html new file mode 100644 index 0000000000..2a6bf6a117 --- /dev/null +++ b/rust/src/oasis_core_runtime/enclave_rpc/types.rs.html @@ -0,0 +1,183 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+
//! RPC protocol types.
+use rand::{rngs::OsRng, Rng};
+
+impl_bytes!(
+    SessionID,
+    32,
+    "Session identifier for multiplexing multiple sessions over the \
+     same transport"
+);
+
+impl SessionID {
+    /// Generate a random session identifier.
+    pub fn random() -> Self {
+        let mut session_id = [0u8; 32];
+        OsRng.fill(&mut session_id);
+
+        SessionID(session_id)
+    }
+}
+
+/// RPC call kind.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[cbor(with_default)]
+#[repr(u8)]
+pub enum Kind {
+    /// A secure RPC call using an encrypted and authenticated Noise session.
+    NoiseSession = 0,
+    /// An insecure RPC call where messages are sent in plain text.
+    InsecureQuery = 1,
+    /// A local RPC call.
+    LocalQuery = 2,
+}
+
+impl Default for Kind {
+    fn default() -> Self {
+        Self::NoiseSession
+    }
+}
+
+/// Frame.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Frame {
+    pub session: SessionID,
+    // The `untrusted_plaintext` field is only a temporary workaround until
+    // the snow library supports encrypting the payload with authenticated
+    // data.
+    // This field contains a plaintext copy of the Request's `method` field
+    // and is verified inside the enclave.  It is unused in other cases.
+    pub untrusted_plaintext: String,
+    pub payload: Vec<u8>,
+}
+
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Request {
+    pub method: String,
+    pub args: cbor::Value,
+}
+
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Error {
+    pub message: String,
+}
+
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum Body {
+    Success(cbor::Value),
+    Error(String),
+}
+
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Response {
+    pub body: Body,
+}
+
+/// Protocol message.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum Message {
+    Request(Request),
+    Response(Response),
+    Close,
+}
+
+/// Feedback on the peer that handled the last EnclaveRPC call.
+#[derive(Copy, Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub enum PeerFeedback {
+    Success = 0,
+    Failure = 1,
+    BadPeer = 2,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/future.rs.html b/rust/src/oasis_core_runtime/future.rs.html new file mode 100644 index 0000000000..a689c1b7d0 --- /dev/null +++ b/rust/src/oasis_core_runtime/future.rs.html @@ -0,0 +1,59 @@ +future.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+
//! Helper functions to use with the asynchronous Tokio runtime.
+use std::future::Future;
+
+/// Create a new asynchronous Tokio runtime.
+#[cfg(any(target_env = "sgx", feature = "debug-mock-sgx"))]
+pub fn new_tokio_runtime() -> tokio::runtime::Runtime {
+    // In SGX use a trimmed-down version of the Tokio runtime.
+    //
+    // Make sure to update THREADS.md if you change any of the thread-related settings.
+    tokio::runtime::Builder::new_multi_thread()
+        .worker_threads(6)
+        .max_blocking_threads(16)
+        .thread_keep_alive(std::time::Duration::MAX)
+        .enable_all()
+        .build()
+        .unwrap()
+}
+
+/// Create a new asynchronous Tokio runtime.
+#[cfg(not(any(target_env = "sgx", feature = "debug-mock-sgx")))]
+pub fn new_tokio_runtime() -> tokio::runtime::Runtime {
+    // In non-SGX we use a fully-fledged Tokio runtime.
+    tokio::runtime::Runtime::new().unwrap()
+}
+
+/// Runs a future to completion on the current Tokio handle's associated Runtime.
+pub fn block_on<F: Future>(future: F) -> F::Output {
+    tokio::runtime::Handle::current().block_on(future)
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/host.rs.html b/rust/src/oasis_core_runtime/host.rs.html new file mode 100644 index 0000000000..cdd5bf81f1 --- /dev/null +++ b/rust/src/oasis_core_runtime/host.rs.html @@ -0,0 +1,257 @@ +host.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+
//! Host interface.
+use async_trait::async_trait;
+use thiserror::Error;
+
+use crate::{
+    common::{crypto::signature::PublicKey, namespace::Namespace},
+    protocol::Protocol,
+    storage::mkvs::sync,
+    types::{self, Body},
+};
+
+/// Errors.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("bad response from host")]
+    BadResponse,
+    #[error("{0}")]
+    Other(#[from] types::Error),
+}
+
+/// Transaction submission options.
+#[derive(Clone, Default, Debug)]
+pub struct SubmitTxOpts {
+    /// Target runtime identifier. If not specified, own runtime identifier is used.
+    pub runtime_id: Option<Namespace>,
+    /// Whether the call should wait until the transaction is included in a block.
+    pub wait: bool,
+    /// Whether the response should include a proof of transaction being included in a block.
+    pub prove: bool,
+}
+
+/// Transaction submission result.
+#[derive(Clone, Default, Debug)]
+pub struct TxResult {
+    /// Transaction output.
+    pub output: Vec<u8>,
+    /// Round in which the transaction was executed.
+    pub round: u64,
+    /// Order of the transaction in the execution batch.
+    pub batch_order: u32,
+    /// Optional inclusion proof.
+    pub proof: Option<sync::Proof>,
+}
+
+/// Notification registration options.
+#[derive(Clone, Default, Debug)]
+pub struct RegisterNotifyOpts {
+    /// Subscribe to runtime block notifications.
+    pub runtime_block: bool,
+    /// Subscribe to runtime event notifications.
+    pub runtime_event: Vec<Vec<u8>>,
+}
+
+/// Interface to the (untrusted) host node.
+#[async_trait]
+pub trait Host: Send + Sync {
+    /// Returns the identity of the host node.
+    async fn identity(&self) -> Result<PublicKey, Error>;
+
+    /// Submit a transaction.
+    async fn submit_tx(&self, data: Vec<u8>, opts: SubmitTxOpts)
+        -> Result<Option<TxResult>, Error>;
+
+    /// Register for receiving notifications.
+    async fn register_notify(&self, opts: RegisterNotifyOpts) -> Result<(), Error>;
+}
+
+#[async_trait]
+impl Host for Protocol {
+    async fn identity(&self) -> Result<PublicKey, Error> {
+        match self.call_host_async(Body::HostIdentityRequest {}).await? {
+            Body::HostIdentityResponse { node_id } => Ok(node_id),
+            _ => Err(Error::BadResponse),
+        }
+    }
+
+    async fn submit_tx(
+        &self,
+        data: Vec<u8>,
+        opts: SubmitTxOpts,
+    ) -> Result<Option<TxResult>, Error> {
+        match self
+            .call_host_async(Body::HostSubmitTxRequest {
+                runtime_id: opts.runtime_id.unwrap_or_else(|| self.get_runtime_id()),
+                data,
+                wait: opts.wait,
+                prove: opts.prove,
+            })
+            .await?
+        {
+            Body::HostSubmitTxResponse {
+                output,
+                round,
+                batch_order,
+                proof,
+            } => {
+                if opts.wait {
+                    Ok(Some(TxResult {
+                        output,
+                        round,
+                        batch_order,
+                        proof,
+                    }))
+                } else {
+                    // If we didn't wait for inclusion then there is no result.
+                    Ok(None)
+                }
+            }
+            _ => Err(Error::BadResponse),
+        }
+    }
+
+    async fn register_notify(&self, opts: RegisterNotifyOpts) -> Result<(), Error> {
+        match self
+            .call_host_async(Body::HostRegisterNotifyRequest {
+                runtime_block: opts.runtime_block,
+                runtime_event: match opts.runtime_event {
+                    tags if tags.is_empty() => None,
+                    tags => Some(types::RegisterNotifyRuntimeEvent { tags }),
+                },
+            })
+            .await?
+        {
+            Body::Empty {} => Ok(()),
+            _ => Err(Error::BadResponse),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/identity.rs.html b/rust/src/oasis_core_runtime/identity.rs.html new file mode 100644 index 0000000000..9a27163b36 --- /dev/null +++ b/rust/src/oasis_core_runtime/identity.rs.html @@ -0,0 +1,963 @@ +identity.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+
//! Runtime attestation key handling.
+use std::{
+    collections::VecDeque,
+    sync::{Arc, RwLock},
+};
+
+use anyhow::Result;
+use base64::prelude::*;
+use rand::{rngs::OsRng, Rng};
+use sgx_isa::Targetinfo;
+use thiserror::Error;
+use tiny_keccak::{Hasher, TupleHash};
+
+use crate::{
+    common::{
+        crypto::{
+            hash::Hash,
+            mrae::deoxysii::{self, Opener},
+            signature::{self, Signature, Signer},
+            x25519,
+        },
+        sgx::{self, EnclaveIdentity, Quote, QuotePolicy, VerifiedQuote},
+        time::insecure_posix_time,
+    },
+    consensus::registry::EndorsedCapabilityTEE,
+    TeeType, BUILD_INFO,
+};
+
+/// Context used for computing the RAK digest.
+const RAK_HASH_CONTEXT: &[u8] = b"oasis-core/node: TEE RAK binding";
+/// Context used for deriving the nonce used in quotes.
+const QUOTE_NONCE_CONTEXT: &[u8] = b"oasis-core/node: TEE quote nonce";
+
+/// A dummy RAK seed for use in non-SGX tests where integrity is not needed.
+const INSECURE_RAK_SEED: &str = "ekiden test key manager RAK seed";
+/// A dummy REK seed for use in non-SGX tests where confidentiality is not needed.
+const INSECURE_REK_SEED: &str = "ekiden test key manager REK seed";
+
+/// Identity-related error.
+#[derive(Error, Debug)]
+enum IdentityError {
+    #[error("RAK binding mismatch")]
+    BindingMismatch,
+    #[error("malformed report data")]
+    MalformedReportData,
+}
+
+/// Quote-related errors.
+#[derive(Error, Debug)]
+enum QuoteError {
+    #[error("target info not set")]
+    TargetInfoNotSet,
+    #[error("malformed target_info")]
+    MalformedTargetInfo,
+    #[error("MRENCLAVE mismatch")]
+    MrEnclaveMismatch,
+    #[error("MRSIGNER mismatch")]
+    MrSignerMismatch,
+    #[error("quote nonce mismatch")]
+    NonceMismatch,
+    #[error("quote policy not set")]
+    QuotePolicyNotSet,
+    #[error("node identity not set")]
+    NodeIdentityNotSet,
+    #[error("endorsed quote mismatch")]
+    EndorsedQuoteMismatch,
+}
+
+struct Inner {
+    rak: signature::PrivateKey,
+    rek: x25519::PrivateKey,
+    quote: Option<Arc<Quote>>,
+    quote_timestamp: Option<i64>,
+    quote_policy: Option<Arc<QuotePolicy>>,
+    known_quotes: VecDeque<Arc<Quote>>,
+    enclave_identity: Option<EnclaveIdentity>,
+    node_identity: Option<signature::PublicKey>,
+    endorsed_capability_tee: Option<EndorsedCapabilityTEE>,
+    target_info: Option<Targetinfo>,
+    nonce: Option<[u8; 32]>,
+}
+
+/// Runtime identity.
+///
+/// The identity can be used to sign remote attestations with runtime
+/// attestation key (RAK) or to decrypt ciphertexts sent to the enclave
+/// with runtime encryption key (REK). RAK avoids round trips to IAS/PCS
+/// for each verification as the verifier can instead verify the RAK signature
+/// and the signature on the provided quote which binds RAK to the enclave.
+/// REK allows enclaves to publish encrypted data on-chain to an enclave
+/// instance.
+pub struct Identity {
+    inner: RwLock<Inner>,
+}
+
+impl Default for Identity {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl Identity {
+    /// Create an uninitialized runtime identity.
+    pub fn new() -> Self {
+        let (rak, rek) = match BUILD_INFO.tee_type {
+            TeeType::None => {
+                // Use insecure mock keys for insecure non-TEE builds.
+                assert!(!BUILD_INFO.is_secure);
+
+                (
+                    signature::PrivateKey::from_test_seed(INSECURE_RAK_SEED.to_string()),
+                    x25519::PrivateKey::from_test_seed(INSECURE_REK_SEED.to_string()),
+                )
+            }
+            _ => {
+                // Generate ephemeral RAK and REK.
+                (
+                    signature::PrivateKey::generate(),
+                    x25519::PrivateKey::generate(),
+                )
+            }
+        };
+
+        Self {
+            inner: RwLock::new(Inner {
+                rak,
+                rek,
+                quote: None,
+                quote_timestamp: None,
+                quote_policy: None,
+                known_quotes: Default::default(),
+                enclave_identity: EnclaveIdentity::current(),
+                node_identity: None,
+                endorsed_capability_tee: None,
+                target_info: None,
+                nonce: None,
+            }),
+        }
+    }
+
+    /// Generate report body = H(RAK_HASH_CONTEXT || RAK_pub).
+    fn report_body_for_rak(rak: &signature::PublicKey) -> Hash {
+        let mut message = [0; 64];
+        message[0..32].copy_from_slice(RAK_HASH_CONTEXT);
+        message[32..64].copy_from_slice(rak.as_ref());
+        Hash::digest_bytes(&message)
+    }
+
+    /// Generate a random 256-bit nonce, for anti-replay.
+    fn generate_nonce() -> [u8; 32] {
+        let mut nonce_bytes = [0u8; 32];
+        OsRng.fill(&mut nonce_bytes);
+
+        let mut h = TupleHash::v256(QUOTE_NONCE_CONTEXT);
+        h.update(&nonce_bytes);
+        h.finalize(&mut nonce_bytes);
+
+        nonce_bytes
+    }
+
+    /// Get the SGX target info.
+    fn get_sgx_target_info(&self) -> Option<Targetinfo> {
+        let inner = self.inner.read().unwrap();
+        inner.target_info.clone()
+    }
+
+    /// Initialize the SGX target info.
+    pub(crate) fn init_target_info(&self, target_info: Vec<u8>) -> Result<()> {
+        match BUILD_INFO.tee_type {
+            TeeType::Sgx => {
+                let mut inner = self.inner.write().unwrap();
+
+                // Set the Quoting Enclave target_info first, as unlike key generation
+                // it can fail.
+                let target_info = match Targetinfo::try_copy_from(&target_info) {
+                    Some(target_info) => target_info,
+                    None => return Err(QuoteError::MalformedTargetInfo.into()),
+                };
+                inner.target_info = Some(target_info);
+
+                Ok(())
+            }
+            TeeType::Tdx => {
+                // Target info configuration is not needed on TDX and MUST be empty.
+                if !target_info.is_empty() {
+                    return Err(QuoteError::MalformedTargetInfo.into());
+                }
+
+                Ok(())
+            }
+            TeeType::None => Ok(()),
+        }
+    }
+
+    /// Initialize the attestation report.
+    pub(crate) fn init_report(
+        &self,
+    ) -> Result<(signature::PublicKey, x25519::PublicKey, Vec<u8>, String)> {
+        let rak_pub = self.public_rak();
+        let rek_pub = self.public_rek();
+
+        // Generate a new anti-replay nonce.
+        let nonce = Self::generate_nonce();
+        // Generate report body.
+        let report_body = Self::report_body_for_rak(&rak_pub);
+        let mut report_data = [0; 64];
+        report_data[0..32].copy_from_slice(report_body.as_ref());
+        report_data[32..64].copy_from_slice(nonce.as_ref());
+
+        let result = match BUILD_INFO.tee_type {
+            TeeType::Sgx => {
+                let target_info = self
+                    .get_sgx_target_info()
+                    .ok_or(QuoteError::TargetInfoNotSet)?;
+
+                // The derived nonce is only used in case IAS-based attestation is used
+                // as it is included in the outer AVR envelope. But given that the body
+                // also includes the nonce in our specific case, this is not relevant.
+                let quote_nonce = BASE64_STANDARD.encode(&nonce[..24]);
+
+                let report = sgx::report_for(&target_info, &report_data);
+                let report: &[u8] = report.as_ref();
+                let report = report.to_vec();
+
+                // This used to reset the quote, but that is now done in the external
+                // accessor combined with a freshness check.
+
+                (rak_pub, rek_pub, report, quote_nonce)
+            }
+            #[cfg(feature = "tdx")]
+            TeeType::Tdx => {
+                // In TDX we can immediately generate a quote. Do it and return it as a "report".
+                let quote = crate::common::tdx::report::get_quote(&report_data)?;
+
+                (rak_pub, rek_pub, quote, String::new())
+            }
+            _ => panic!("init_report called outside TEE environment"),
+        };
+
+        // Cache the nonce, the report was generated.
+        let mut inner = self.inner.write().unwrap();
+        inner.nonce = Some(nonce);
+
+        Ok(result)
+    }
+
+    /// Configure the remote attestation quote for RAK.
+    pub(crate) fn set_quote(
+        &self,
+        node_id: signature::PublicKey,
+        quote: Quote,
+    ) -> Result<VerifiedQuote> {
+        let rak_pub = self.public_rak();
+
+        let mut inner = self.inner.write().unwrap();
+
+        // If there is no anti-replay nonce set, we aren't in the process of attesting.
+        let expected_nonce = match &inner.nonce {
+            Some(nonce) => *nonce,
+            None => return Err(QuoteError::NonceMismatch.into()),
+        };
+
+        // Verify that the quote's nonce matches one that we generated,
+        // and remove it.  If the validation fails for any reason, we
+        // should not accept a new quote with the same nonce as a quote
+        // that failed.
+        inner.nonce = None;
+
+        let policy = inner
+            .quote_policy
+            .as_ref()
+            .ok_or(QuoteError::QuotePolicyNotSet)?;
+        let verified_quote = quote.verify(policy)?;
+        let nonce = &verified_quote.report_data[32..];
+        if expected_nonce.as_ref() != nonce {
+            return Err(QuoteError::NonceMismatch.into());
+        }
+
+        // Verify that the quote's enclave identity matches our own.
+        let enclave_identity = inner
+            .enclave_identity
+            .as_ref()
+            .expect("Enclave identity must be configured");
+        if verified_quote.identity.mr_enclave != enclave_identity.mr_enclave {
+            return Err(QuoteError::MrEnclaveMismatch.into());
+        }
+        if verified_quote.identity.mr_signer != enclave_identity.mr_signer {
+            return Err(QuoteError::MrSignerMismatch.into());
+        }
+
+        // Verify that the quote has H(RAK) in report body.
+        Self::verify_binding(&verified_quote, &rak_pub)?;
+
+        // If there is an existing quote that is dated more recently than
+        // the one being set, silently ignore the update.
+        if inner.quote.is_some() {
+            let existing_timestamp = inner.quote_timestamp.unwrap();
+            if existing_timestamp > verified_quote.timestamp {
+                return Ok(verified_quote);
+            }
+        }
+
+        // Ensure host identity cannot change.
+        match inner.node_identity {
+            Some(existing_node_id) if node_id != existing_node_id => {
+                panic!("host node identity may never change");
+            }
+            Some(_) => {} // Host identity already set and is the same.
+            None => inner.node_identity = Some(node_id),
+        }
+
+        let quote = Arc::new(quote);
+        inner.quote = Some(quote.clone());
+        inner.quote_timestamp = Some(verified_quote.timestamp);
+
+        // Keep around last two valid quotes to allow for transition as node registration does not
+        // happen immediately after a quote has been verified by the runtime.
+        inner.known_quotes.push_back(quote);
+        if inner.known_quotes.len() > 2 {
+            inner.known_quotes.pop_front();
+        }
+
+        Ok(verified_quote)
+    }
+
+    /// Configure the runtime quote policy.
+    pub(crate) fn set_quote_policy(&self, policy: QuotePolicy) -> Result<()> {
+        let mut inner = self.inner.write().unwrap();
+        inner.quote_policy = Some(Arc::new(policy));
+
+        Ok(())
+    }
+
+    /// Configure the endorsed TEE capability.
+    pub(crate) fn set_endorsed_capability_tee(&self, ect: EndorsedCapabilityTEE) -> Result<()> {
+        // Make sure the endorsed quote is actually ours.
+        if !ect.capability_tee.matches(self) {
+            return Err(QuoteError::EndorsedQuoteMismatch.into());
+        }
+
+        let mut inner = self.inner.write().unwrap();
+        let policy = inner
+            .quote_policy
+            .as_ref()
+            .ok_or(QuoteError::QuotePolicyNotSet)?;
+        let node_id = inner.node_identity.ok_or(QuoteError::NodeIdentityNotSet)?;
+
+        // Verify the endorsed capability TEE to make sure it matches our state.
+        if ect.node_endorsement.public_key != node_id {
+            return Err(QuoteError::EndorsedQuoteMismatch.into());
+        }
+        ect.verify(policy)?;
+
+        inner.endorsed_capability_tee = Some(ect);
+
+        Ok(())
+    }
+
+    /// Endorsed TEE capability.
+    pub fn endorsed_capability_tee(&self) -> Option<EndorsedCapabilityTEE> {
+        let inner = self.inner.read().unwrap();
+        inner.endorsed_capability_tee.clone()
+    }
+
+    /// Host node identity public key.
+    pub fn node_identity(&self) -> Option<signature::PublicKey> {
+        let inner = self.inner.read().unwrap();
+        inner.node_identity
+    }
+
+    /// Public part of RAK.
+    ///
+    /// This method will return an insecure test key in the case where
+    /// the enclave is not running on SGX hardware.
+    pub fn public_rak(&self) -> signature::PublicKey {
+        let inner = self.inner.read().unwrap();
+        inner.rak.public_key()
+    }
+
+    /// Public part of REK.
+    ///
+    /// This method will return an insecure test key in the case where
+    /// the enclave is not running on SGX hardware.
+    pub fn public_rek(&self) -> x25519::PublicKey {
+        let inner = self.inner.read().unwrap();
+        inner.rek.public_key()
+    }
+
+    /// Quote for RAK.
+    ///
+    /// This method may return `None` in case quote has not yet been set from
+    /// the outside, or if the quote has expired.
+    pub fn quote(&self) -> Option<Arc<Quote>> {
+        let now = insecure_posix_time();
+
+        // Enforce quote expiration.
+        let mut inner = self.inner.write().unwrap();
+        if inner.quote.is_some() {
+            let quote = inner.quote.as_ref().unwrap();
+            let timestamp = inner.quote_timestamp.unwrap();
+            let quote_policy = inner.quote_policy.as_ref().unwrap();
+
+            if !quote.is_fresh(now, timestamp, quote_policy) {
+                // Reset the quote.
+                inner.quote = None;
+                inner.quote_timestamp = None;
+                inner.quote_policy = None;
+
+                return None;
+            }
+        }
+
+        inner.quote.clone()
+    }
+
+    /// Runtime quote policy.
+    ///
+    /// This method may return `None` in the case where the enclave is not
+    /// running on SGX hardware or if the quote policy has not yet been
+    /// fetched from the consensus layer.
+    pub fn quote_policy(&self) -> Option<Arc<QuotePolicy>> {
+        let inner = self.inner.read().unwrap();
+        inner.quote_policy.clone()
+    }
+
+    /// Verify a provided RAK binding.
+    pub fn verify_binding(quote: &VerifiedQuote, rak: &signature::PublicKey) -> Result<()> {
+        if quote.report_data.len() < 32 {
+            return Err(IdentityError::MalformedReportData.into());
+        }
+        if Self::report_body_for_rak(rak).as_ref() != &quote.report_data[..32] {
+            return Err(IdentityError::BindingMismatch.into());
+        }
+
+        Ok(())
+    }
+
+    /// Checks whether the RAK matches another specified (RAK_pub, quote) pair.
+    pub fn rak_matches(&self, rak: &signature::PublicKey, quote: &Quote) -> bool {
+        // Check if public key matches.
+        if &self.public_rak() != rak {
+            return false;
+        }
+
+        let inner = self.inner.read().unwrap();
+        inner.known_quotes.iter().any(|q| &**q == quote)
+    }
+}
+
+impl Signer for Identity {
+    fn public(&self) -> signature::PublicKey {
+        let inner = self.inner.read().unwrap();
+        inner.rak.public_key()
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature> {
+        let inner = self.inner.read().unwrap();
+        inner.rak.sign(context, message)
+    }
+}
+
+impl Opener for Identity {
+    fn box_open(
+        &self,
+        nonce: &[u8; deoxysii::NONCE_SIZE],
+        ciphertext: Vec<u8>,
+        additional_data: Vec<u8>,
+        peers_public_key: &x25519_dalek::PublicKey,
+    ) -> Result<Vec<u8>> {
+        let inner = self.inner.read().unwrap();
+        let private_key = &inner.rek.0;
+
+        deoxysii::box_open(
+            nonce,
+            ciphertext,
+            additional_data,
+            peers_public_key,
+            private_key,
+        )
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/init.rs.html b/rust/src/oasis_core_runtime/init.rs.html new file mode 100644 index 0000000000..29d76c99c5 --- /dev/null +++ b/rust/src/oasis_core_runtime/init.rs.html @@ -0,0 +1,209 @@ +init.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+
//! Runtime initialization.
+use std::sync::Arc;
+
+use anyhow::Result;
+use slog::{error, info};
+
+use crate::{
+    common::logger::{get_logger, init_logger},
+    config::Config,
+    dispatcher::{Dispatcher, Initializer},
+    future::new_tokio_runtime,
+    identity::Identity,
+    protocol::{Protocol, Stream},
+    TeeType, BUILD_INFO,
+};
+
+/// Starts the runtime.
+pub fn start_runtime(initializer: Box<dyn Initializer>, config: Config) {
+    // Initialize logging.
+    init_logger(log::Level::Info);
+    let logger = get_logger("runtime");
+    info!(logger, "Runtime is starting");
+
+    // Perform TDX-specific early initialization.
+    #[cfg(feature = "tdx")]
+    if BUILD_INFO.tee_type == TeeType::Tdx {
+        crate::common::tdx::init::init();
+    }
+
+    // Initialize runtime identity with runtime attestation key and runtime encryption key.
+    let identity = Arc::new(Identity::new());
+
+    // Initialize the async Tokio runtime.
+    let tokio_runtime = new_tokio_runtime();
+    let tokio_handle = tokio_runtime.handle();
+
+    // Initialize the dispatcher.
+    let dispatcher = Dispatcher::new(tokio_handle.clone(), initializer, identity.clone());
+
+    // Connect to the runtime host.
+    info!(logger, "Establishing connection with the worker host");
+
+    let stream = match connect() {
+        Ok(stream) => stream,
+        Err(err) => {
+            error!(logger, "Failed to connect with the worker host"; "err" => %err);
+            return;
+        }
+    };
+
+    // Initialize the protocol handler loop.
+    let protocol = Arc::new(Protocol::new(
+        tokio_handle.clone(),
+        stream,
+        identity,
+        dispatcher,
+        config,
+    ));
+
+    // Start handling protocol messages. This blocks the main thread forever
+    // (or until we get a shutdown request).
+    protocol.start();
+
+    info!(logger, "Protocol handler terminated, shutting down");
+}
+
+/// Establish a connection with the host.
+fn connect() -> Result<Stream> {
+    match BUILD_INFO.tee_type {
+        #[cfg(not(target_env = "sgx"))]
+        TeeType::Sgx | TeeType::None => {
+            let stream = std::os::unix::net::UnixStream::connect(
+                std::env::var("OASIS_WORKER_HOST").unwrap_or_default(),
+            )?;
+            Ok(Stream::Unix(stream))
+        }
+
+        #[cfg(target_env = "sgx")]
+        TeeType::Sgx => {
+            let stream = std::net::TcpStream::connect("worker-host")?;
+            Ok(Stream::Tcp(stream))
+        }
+
+        #[cfg(feature = "tdx")]
+        TeeType::Tdx => {
+            /// VSOCK port used for the Runtime Host Protocol.
+            const VSOCK_PORT_RHP: u32 = 1;
+
+            // Accept first connection.
+            let listener = vsock::VsockListener::bind(&vsock::VsockAddr::new(
+                libc::VMADDR_CID_ANY,
+                VSOCK_PORT_RHP,
+            ))?;
+            let stream = listener
+                .incoming()
+                .next()
+                .ok_or(anyhow::anyhow!("failed to accept connection"))??;
+            Ok(Stream::Vsock(stream))
+        }
+
+        #[allow(unreachable_patterns)]
+        _ => Err(anyhow::anyhow!("unsupported TEE type")),
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/lib.rs.html b/rust/src/oasis_core_runtime/lib.rs.html new file mode 100644 index 0000000000..1395dec40a --- /dev/null +++ b/rust/src/oasis_core_runtime/lib.rs.html @@ -0,0 +1,341 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+
//! Oasis Core runtime SDK.
+//!
+//! # Examples
+//!
+//! To create a minimal runtime that doesn't expose any APIs to the
+//! outside world, you need to call the `start_runtime` function:
+//! ```rust,ignore
+//! oasis_core_runtime::start_runtime(Some(Box::new(reg)), config);
+//! ```
+//!
+//! This will start the required services needed to communicate with
+//! the worker host.
+#![feature(test)]
+#![feature(arbitrary_self_types)]
+#![feature(const_option)]
+
+use lazy_static::lazy_static;
+#[cfg(target_env = "sgx")]
+use sgx_isa::{AttributesFlags, Report};
+
+#[cfg_attr(test, macro_use)]
+extern crate base64_serde;
+
+#[macro_use]
+pub mod common;
+pub mod app;
+mod attestation;
+pub mod cache;
+pub mod config;
+pub mod consensus;
+pub mod dispatcher;
+pub mod enclave_rpc;
+pub mod future;
+pub mod host;
+pub mod identity;
+pub mod init;
+pub mod policy;
+pub mod protocol;
+pub mod storage;
+pub mod transaction;
+pub mod types;
+
+use common::{
+    sgx::{EnclaveIdentity, MrSigner},
+    version::{Version, PROTOCOL_VERSION},
+};
+
+// Validate features.
+#[cfg(all(target_env = "sgx", feature = "debug-mock-sgx"))]
+compile_error!("the debug-mock-sgx feature can only be enabled on non-sgx targets");
+
+#[cfg(all(target_env = "sgx", feature = "tdx"))]
+compile_error!("the tdx feature can only be enabled on non-sgx targets");
+
+#[cfg(all(feature = "tdx", feature = "debug-mock-sgx"))]
+compile_error!("the tdx feature can't be enabled together with debug-mock-sgx");
+
+lazy_static! {
+    pub static ref BUILD_INFO: BuildInfo = {
+        // Determine TEE type.
+        let tee_type = if cfg!(any(target_env = "sgx", feature = "debug-mock-sgx")) {
+            TeeType::Sgx
+        } else if cfg!(feature = "tdx") {
+            TeeType::Tdx
+        } else {
+            TeeType::None
+        };
+
+        // Determine build security.
+        #[allow(clippy::let_and_return)]
+        let is_secure = match tee_type {
+            TeeType::Sgx => {
+                // SGX build security depends on how it was built.
+                //
+                // Optimistically start out as "it could be secure", and any single insecure build time
+                // option will propagate failure.
+                let maybe_secure = true;
+
+                // Quote signature verification MUST be enabled.
+                let maybe_secure = maybe_secure && option_env!("OASIS_UNSAFE_SKIP_AVR_VERIFY").is_none();
+
+                // Disallow debug enclaves MUST be enabled.
+                let maybe_secure = maybe_secure && option_env!("OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES").is_none();
+
+                // Attestation `OutOfDate` and `ConfigurationNeeded` responses MUST count as attestation
+                // failure.
+                //
+                // Rationale: This is how remote attestation signifies that the host environment is
+                // insecure (eg: SMT is enabled when it should not be).
+                let maybe_secure = maybe_secure && option_env!("OASIS_UNSAFE_LAX_AVR_VERIFY").is_none();
+
+                // The enclave MUST NOT be a debug one.
+                #[cfg(target_env = "sgx")]
+                let maybe_secure = maybe_secure && !Report::for_self().attributes.flags.contains(AttributesFlags::DEBUG);
+
+                // The enclave MUST NOT be signed by a test key,
+                let enclave_identity = EnclaveIdentity::current().unwrap();
+                let fortanix_mrsigner = MrSigner::from("9affcfae47b848ec2caf1c49b4b283531e1cc425f93582b36806e52a43d78d1a");
+                let maybe_secure = maybe_secure && (enclave_identity.mr_signer != fortanix_mrsigner);
+
+                maybe_secure
+            }
+            TeeType::Tdx => {
+                // TDX build security depends on how it was built.
+                //
+                // Optimistically start out as "it could be secure", and any single insecure build time
+                // option will propagate failure.
+                let maybe_secure = true;
+
+                // Quote signature verification MUST be enabled.
+                let maybe_secure = maybe_secure && option_env!("OASIS_UNSAFE_SKIP_AVR_VERIFY").is_none();
+
+                // Disallow debug enclaves MUST be enabled.
+                let maybe_secure = maybe_secure && option_env!("OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES").is_none();
+
+                // Attestation `OutOfDate` and `ConfigurationNeeded` responses MUST count as attestation
+                // failure.
+                //
+                // Rationale: This is how remote attestation signifies that the host environment is
+                // insecure (eg: SMT is enabled when it should not be).
+                let maybe_secure = maybe_secure && option_env!("OASIS_UNSAFE_LAX_AVR_VERIFY").is_none();
+
+                // TODO: Debug TD attributes.
+
+                maybe_secure
+            }
+            TeeType::None => {
+                // Non-TEE builds are insecure by definition.
+                false
+            }
+        };
+
+        BuildInfo {
+            tee_type,
+            protocol_version: PROTOCOL_VERSION,
+            is_secure,
+        }
+    };
+}
+
+/// TEE type this build is for.
+#[derive(Debug, Default, PartialEq, Eq)]
+pub enum TeeType {
+    #[default]
+    None,
+    Sgx,
+    Tdx,
+}
+
+/// Runtime build information.
+#[derive(Debug)]
+pub struct BuildInfo {
+    /// TEE type this build is for.
+    pub tee_type: TeeType,
+    /// Supported runtime protocol version.
+    pub protocol_version: Version,
+    /// True iff the build can provide integrity and confidentiality.
+    pub is_secure: bool,
+}
+
+// Re-exports.
+pub use self::{
+    enclave_rpc::{demux::Demux as RpcDemux, dispatcher::Dispatcher as RpcDispatcher},
+    init::start_runtime,
+    protocol::Protocol,
+    transaction::dispatcher::Dispatcher as TxnDispatcher,
+};
+
+// Re-export the cbor crate.
+pub use cbor;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/policy.rs.html b/rust/src/oasis_core_runtime/policy.rs.html new file mode 100644 index 0000000000..a89320b867 --- /dev/null +++ b/rust/src/oasis_core_runtime/policy.rs.html @@ -0,0 +1,403 @@ +policy.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+
//! Consensus SGX and quote policy handling.
+
+use std::sync::Arc;
+
+use anyhow::{bail, Result};
+use slog::{debug, Logger};
+use thiserror::Error;
+
+use crate::{
+    common::{logger::get_logger, namespace::Namespace, sgx::QuotePolicy, version::Version},
+    consensus::{
+        keymanager::SignedPolicySGX,
+        registry::{SGXConstraints, TEEHardware},
+        state::{
+            beacon::ImmutableState as BeaconState,
+            keymanager::{ImmutableState as KeyManagerState, Status},
+            registry::ImmutableState as RegistryState,
+        },
+        verifier::Verifier,
+    },
+    future::block_on,
+};
+
+/// Policy verifier error.
+#[derive(Error, Debug)]
+pub enum PolicyVerifierError {
+    #[error("missing runtime descriptor")]
+    MissingRuntimeDescriptor,
+    #[error("no corresponding runtime deployment")]
+    NoDeployment,
+    #[error("bad TEE constraints")]
+    BadTEEConstraints,
+    #[error("policy mismatch")]
+    PolicyMismatch,
+    #[error("policy hasn't been published")]
+    PolicyNotPublished,
+    #[error("status mismatch")]
+    StatusMismatch,
+    #[error("status hasn't been published")]
+    StatusNotPublished,
+    #[error("configured runtime hardware mismatch")]
+    HardwareMismatch,
+    #[error("runtime doesn't use key manager")]
+    NoKeyManager,
+}
+
+/// Consensus policy verifier.
+pub struct PolicyVerifier {
+    consensus_verifier: Arc<dyn Verifier>,
+    logger: Logger,
+}
+
+impl PolicyVerifier {
+    /// Create a new consensus policy verifier.
+    pub fn new(consensus_verifier: Arc<dyn Verifier>) -> Self {
+        let logger = get_logger("runtime/policy_verifier");
+        Self {
+            consensus_verifier,
+            logger,
+        }
+    }
+
+    /// Fetch runtime's quote policy from the latest verified consensus layer state.
+    ///
+    /// If the runtime version is not provided, the policy for the active deployment is returned.
+    pub fn quote_policy(
+        &self,
+        runtime_id: &Namespace,
+        version: Option<Version>,
+    ) -> Result<QuotePolicy> {
+        // Fetch quote policy from the consensus layer using the given or the active version.
+        // TODO: Make this async.
+        let consensus_state = block_on(self.consensus_verifier.latest_state())?;
+        let registry_state = RegistryState::new(&consensus_state);
+        let runtime = registry_state
+            .runtime(runtime_id)?
+            .ok_or(PolicyVerifierError::MissingRuntimeDescriptor)?;
+
+        let ad = match version {
+            Some(version) => runtime
+                .deployment_for_version(version)
+                .ok_or(PolicyVerifierError::NoDeployment)?,
+            None => {
+                let beacon_state = BeaconState::new(&consensus_state);
+                let epoch = beacon_state.epoch()?;
+
+                runtime
+                    .active_deployment(epoch)
+                    .ok_or(PolicyVerifierError::NoDeployment)?
+            }
+        };
+
+        let policy = match runtime.tee_hardware {
+            TEEHardware::TEEHardwareIntelSGX => {
+                let sc: SGXConstraints = ad
+                    .try_decode_tee()
+                    .map_err(|_| PolicyVerifierError::BadTEEConstraints)?;
+                sc.policy()
+            }
+            _ => bail!(PolicyVerifierError::HardwareMismatch),
+        };
+
+        Ok(policy)
+    }
+
+    /// Verify that runtime's quote policy has been published in the consensus layer.
+    pub fn verify_quote_policy(
+        &self,
+        policy: QuotePolicy,
+        runtime_id: &Namespace,
+        version: Option<Version>,
+    ) -> Result<QuotePolicy> {
+        let published_policy = self.quote_policy(runtime_id, version)?;
+
+        if policy != published_policy {
+            debug!(
+                self.logger,
+                "quote policy mismatch";
+                "untrusted" => ?policy,
+                "published" => ?published_policy,
+            );
+            return Err(PolicyVerifierError::PolicyMismatch.into());
+        }
+
+        Ok(published_policy)
+    }
+
+    /// Fetch key manager's status from the latest verified consensus layer state.
+    pub fn key_manager_status(&self, key_manager: Namespace) -> Result<Status> {
+        // TODO: Make this async.
+        let consensus_state = block_on(self.consensus_verifier.latest_state())?;
+        let km_state = KeyManagerState::new(&consensus_state);
+        km_state
+            .status(key_manager)?
+            .ok_or_else(|| PolicyVerifierError::StatusNotPublished.into())
+    }
+
+    /// Verify that key manager's status has been published in the consensus layer.
+    pub fn verify_key_manager_status(
+        &self,
+        status: Status,
+        key_manager: Namespace,
+    ) -> Result<Status> {
+        let published_status = self.key_manager_status(key_manager)?;
+
+        if status != published_status {
+            debug!(
+                self.logger,
+                "key manager status mismatch";
+                "untrusted" => ?status,
+                "published" => ?published_status,
+            );
+            return Err(PolicyVerifierError::StatusMismatch.into());
+        }
+
+        Ok(published_status)
+    }
+
+    /// Fetch key manager's policy from the latest verified consensus layer state.
+    pub fn key_manager_policy(&self, key_manager: Namespace) -> Result<SignedPolicySGX> {
+        self.key_manager_status(key_manager)?
+            .policy
+            .ok_or_else(|| PolicyVerifierError::PolicyNotPublished.into())
+    }
+
+    /// Verify that key manager's policy has been published in the consensus layer.
+    pub fn verify_key_manager_policy(
+        &self,
+        policy: SignedPolicySGX,
+        key_manager: Namespace,
+    ) -> Result<SignedPolicySGX> {
+        let published_policy = self.key_manager_policy(key_manager)?;
+
+        if policy != published_policy {
+            debug!(
+                self.logger,
+                "key manager policy mismatch";
+                "untrusted" => ?policy,
+                "published" => ?published_policy,
+            );
+            return Err(PolicyVerifierError::PolicyMismatch.into());
+        }
+
+        Ok(published_policy)
+    }
+
+    /// Fetch runtime's key manager.
+    pub fn key_manager(&self, runtime_id: &Namespace) -> Result<Namespace> {
+        // TODO: Make this async.
+        let consensus_state = block_on(self.consensus_verifier.latest_state())?;
+        let registry_state = RegistryState::new(&consensus_state);
+        let runtime = registry_state
+            .runtime(runtime_id)?
+            .ok_or(PolicyVerifierError::MissingRuntimeDescriptor)?;
+        let key_manager = runtime
+            .key_manager
+            .ok_or(PolicyVerifierError::NoKeyManager)?;
+
+        Ok(key_manager)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/protocol.rs.html b/rust/src/oasis_core_runtime/protocol.rs.html new file mode 100644 index 0000000000..f73f20f935 --- /dev/null +++ b/rust/src/oasis_core_runtime/protocol.rs.html @@ -0,0 +1,1157 @@ +protocol.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+
//! Runtime side of the worker-host protocol.
+use std::{
+    collections::{BTreeMap, HashMap},
+    io::{BufReader, BufWriter, Read, Write},
+    sync::{
+        atomic::{AtomicUsize, Ordering},
+        Arc, Mutex,
+    },
+};
+
+use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
+use crossbeam::channel;
+use slog::{debug, error, info, warn, Logger};
+use thiserror::Error;
+use tokio::sync::oneshot;
+
+use crate::{
+    common::{logger::get_logger, namespace::Namespace, version::Version},
+    config::Config,
+    consensus::{tendermint, verifier::Verifier},
+    dispatcher::Dispatcher,
+    future::block_on,
+    identity::Identity,
+    storage::KeyValue,
+    types::{Body, Error, Message, MessageType, RuntimeInfoRequest, RuntimeInfoResponse},
+    TeeType, BUILD_INFO,
+};
+
+/// Stream used to communicate with the host.
+pub enum Stream {
+    #[cfg(not(target_env = "sgx"))]
+    Unix(std::os::unix::net::UnixStream),
+    Tcp(std::net::TcpStream),
+    #[cfg(feature = "tdx")]
+    Vsock(vsock::VsockStream),
+}
+
+impl Read for &Stream {
+    fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
+        #[allow(clippy::borrow_deref_ref)]
+        match self {
+            #[cfg(not(target_env = "sgx"))]
+            Stream::Unix(stream) => (&*stream).read(buf),
+            Stream::Tcp(stream) => (&*stream).read(buf),
+            #[cfg(feature = "tdx")]
+            Stream::Vsock(stream) => (&*stream).read(buf),
+        }
+    }
+}
+
+impl Write for &Stream {
+    fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
+        #[allow(clippy::borrow_deref_ref)]
+        match self {
+            #[cfg(not(target_env = "sgx"))]
+            Stream::Unix(stream) => (&*stream).write(buf),
+            Stream::Tcp(stream) => (&*stream).write(buf),
+            #[cfg(feature = "tdx")]
+            Stream::Vsock(stream) => (&*stream).write(buf),
+        }
+    }
+
+    fn flush(&mut self) -> std::io::Result<()> {
+        #[allow(clippy::borrow_deref_ref)]
+        match self {
+            #[cfg(not(target_env = "sgx"))]
+            Stream::Unix(stream) => (&*stream).flush(),
+            Stream::Tcp(stream) => (&*stream).flush(),
+            #[cfg(feature = "tdx")]
+            Stream::Vsock(stream) => (&*stream).flush(),
+        }
+    }
+}
+
+/// Maximum message size.
+const MAX_MESSAGE_SIZE: usize = 16 * 1024 * 1024; // 16MiB
+
+#[derive(Error, Debug)]
+pub enum ProtocolError {
+    #[error("message too large")]
+    MessageTooLarge,
+    #[error("method not supported")]
+    MethodNotSupported,
+    #[error("invalid response")]
+    InvalidResponse,
+    #[error("attestation required")]
+    #[allow(unused)]
+    AttestationRequired,
+    #[error("host environment information not configured")]
+    HostInfoNotConfigured,
+    #[error("incompatible consensus backend")]
+    IncompatibleConsensusBackend,
+    #[error("invalid runtime id (expected: {0} got: {1})")]
+    InvalidRuntimeId(Namespace, Namespace),
+    #[error("already initialized")]
+    AlreadyInitialized,
+    #[error("channel closed")]
+    ChannelClosed,
+}
+
+impl From<ProtocolError> for Error {
+    fn from(err: ProtocolError) -> Self {
+        Self {
+            module: "protocol".to_string(),
+            code: 1,
+            message: err.to_string(),
+        }
+    }
+}
+
+/// Information about the host environment.
+#[derive(Debug, Clone)]
+pub struct HostInfo {
+    /// Assigned runtime identifier of the loaded runtime.
+    pub runtime_id: Namespace,
+    /// Name of the consensus backend that is in use for the consensus layer.
+    pub consensus_backend: String,
+    /// Consensus protocol version that is in use for the consensus layer.
+    pub consensus_protocol_version: Version,
+    /// Consensus layer chain domain separation context.
+    pub consensus_chain_context: String,
+    /// Node-local runtime configuration.
+    ///
+    /// This configuration must not be used in any context which requires determinism across
+    /// replicated runtime instances.
+    pub local_config: BTreeMap<String, cbor::Value>,
+}
+
+/// Runtime part of the runtime host protocol.
+pub struct Protocol {
+    /// Logger.
+    logger: Logger,
+    /// Runtime identity.
+    #[cfg_attr(
+        not(any(target_env = "sgx", feature = "debug-mock-sgx")),
+        allow(unused)
+    )]
+    identity: Arc<Identity>,
+    /// Incoming request dispatcher.
+    dispatcher: Arc<Dispatcher>,
+    /// Channel for sending outgoing messages.
+    outgoing_tx: channel::Sender<Message>,
+    /// Channel for receiving outgoing messages.
+    outgoing_rx: channel::Receiver<Message>,
+    /// Stream to the runtime host.
+    stream: Stream,
+    /// Outgoing request identifier generator.
+    last_request_id: AtomicUsize,
+    /// Pending outgoing requests.
+    pending_out_requests: Mutex<HashMap<u64, oneshot::Sender<Body>>>,
+    /// Runtime configuration.
+    config: Config,
+    /// Host environment information.
+    host_info: Mutex<Option<HostInfo>>,
+    /// Tokio runtime handle.
+    tokio_runtime: tokio::runtime::Handle,
+}
+
+impl Protocol {
+    /// Create a new protocol handler instance.
+    pub(crate) fn new(
+        tokio_runtime: tokio::runtime::Handle,
+        stream: Stream,
+        identity: Arc<Identity>,
+        dispatcher: Arc<Dispatcher>,
+        config: Config,
+    ) -> Self {
+        let logger = get_logger("runtime/protocol");
+
+        let (outgoing_tx, outgoing_rx) = channel::unbounded();
+
+        Self {
+            logger,
+            identity,
+            dispatcher,
+            outgoing_tx,
+            outgoing_rx,
+            stream,
+            last_request_id: AtomicUsize::new(0),
+            pending_out_requests: Mutex::new(HashMap::new()),
+            config,
+            host_info: Mutex::new(None),
+            tokio_runtime,
+        }
+    }
+
+    /// The supplied runtime configuration.
+    pub fn get_config(&self) -> &Config {
+        &self.config
+    }
+
+    /// The runtime identity.
+    pub fn get_identity(&self) -> Option<&Arc<Identity>> {
+        self.identity.quote()?;
+        Some(&self.identity)
+    }
+
+    /// The runtime identifier for this instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics, if the host environment information is not set.
+    pub fn get_runtime_id(&self) -> Namespace {
+        self.host_info
+            .lock()
+            .unwrap()
+            .as_ref()
+            .expect("host environment information should be set")
+            .runtime_id
+    }
+
+    /// The host environment information for this instance.
+    ///
+    /// # Panics
+    ///
+    /// Panics, if the host environment information is not set.
+    pub fn get_host_info(&self) -> HostInfo {
+        self.host_info
+            .lock()
+            .unwrap()
+            .as_ref()
+            .expect("host environment information should be set")
+            .clone()
+    }
+
+    /// Start the protocol handler loop.
+    pub(crate) fn start(self: &Arc<Protocol>) {
+        // Spawn write end in a separate thread.
+        let protocol = self.clone();
+        std::thread::spawn(move || protocol.io_write());
+
+        // Run read end in the current thread.
+        self.io_read();
+    }
+
+    fn io_read(self: &Arc<Protocol>) {
+        info!(self.logger, "Starting protocol reader thread");
+        let mut reader = BufReader::new(&self.stream);
+
+        loop {
+            if let Err(error) = self.handle_message(&mut reader) {
+                error!(self.logger, "Failed to handle message"; "err" => %error);
+                break;
+            }
+        }
+
+        info!(self.logger, "Protocol reader thread is terminating");
+    }
+
+    fn io_write(self: &Arc<Protocol>) {
+        info!(self.logger, "Starting protocol writer thread");
+
+        while let Ok(message) = self.outgoing_rx.recv() {
+            if let Err(error) = self.write_message(message) {
+                warn!(self.logger, "Failed to write message"; "err" => %error);
+            }
+        }
+
+        info!(self.logger, "Protocol writer thread is terminating");
+    }
+
+    /// Make a new request to the runtime host and wait for the response.
+    ///
+    /// This is a blocking variant of `call_host_async`.
+    ///
+    /// # Panics
+    ///
+    /// This function panics if called within an asynchronous execution context.
+    pub fn call_host(&self, body: Body) -> Result<Body, Error> {
+        block_on(self.call_host_async(body))
+    }
+
+    /// Make a new request to the runtime host and wait for the response.
+    pub async fn call_host_async(&self, body: Body) -> Result<Body, Error> {
+        let id = self.last_request_id.fetch_add(1, Ordering::SeqCst) as u64;
+        let message = Message {
+            id,
+            body,
+            message_type: MessageType::Request,
+        };
+
+        // Create a response channel and register an outstanding pending request.
+        let (tx, rx) = oneshot::channel();
+        {
+            let mut pending_requests = self.pending_out_requests.lock().unwrap();
+            pending_requests.insert(id, tx);
+        }
+
+        // Write message to stream and wait for the response.
+        self.send_message(message).map_err(Error::from)?;
+
+        let result = rx
+            .await
+            .map_err(|_| Error::from(ProtocolError::ChannelClosed))?;
+        match result {
+            Body::Error(err) => Err(err),
+            body => Ok(body),
+        }
+    }
+
+    /// Send an async response to a previous request back to the host.
+    pub fn send_response(&self, id: u64, body: Body) -> anyhow::Result<()> {
+        self.send_message(Message {
+            id,
+            body,
+            message_type: MessageType::Response,
+        })
+    }
+
+    fn send_message(&self, message: Message) -> anyhow::Result<()> {
+        self.outgoing_tx.send(message).map_err(|err| err.into())
+    }
+
+    fn decode_message<R: Read>(&self, mut reader: R) -> anyhow::Result<Message> {
+        let length = reader.read_u32::<BigEndian>()? as usize;
+        if length > MAX_MESSAGE_SIZE {
+            return Err(ProtocolError::MessageTooLarge.into());
+        }
+
+        // TODO: Avoid allocations.
+        let mut buffer = vec![0; length];
+        reader.read_exact(&mut buffer)?;
+
+        let message = cbor::from_slice(&buffer)
+            .map_err(|error| {
+                warn!(self.logger, "Failed to decode message"; "err" => %error);
+                debug!(self.logger, "Malformed message"; "bytes" => ?buffer);
+                error
+            })
+            .unwrap_or_default();
+
+        Ok(message)
+    }
+
+    fn write_message(&self, message: Message) -> anyhow::Result<()> {
+        let buffer = cbor::to_vec(message);
+        if buffer.len() > MAX_MESSAGE_SIZE {
+            return Err(ProtocolError::MessageTooLarge.into());
+        }
+
+        let mut writer = BufWriter::new(&self.stream);
+        writer.write_u32::<BigEndian>(buffer.len() as u32)?;
+        writer.write_all(&buffer)?;
+
+        Ok(())
+    }
+
+    fn handle_message<R: Read>(self: &Arc<Protocol>, reader: R) -> anyhow::Result<()> {
+        let message = self.decode_message(reader)?;
+
+        match message.message_type {
+            MessageType::Request => {
+                // Incoming request.
+                let id = message.id;
+
+                let body = match self.handle_request(id, message.body) {
+                    Ok(Some(result)) => result,
+                    Ok(None) => {
+                        // A message will be sent later by another thread so there
+                        // is no need to do anything more.
+                        return Ok(());
+                    }
+                    Err(error) => Body::Error(Error::new("rhp/dispatcher", 1, &format!("{error}"))),
+                };
+
+                // Send response back.
+                self.send_message(Message {
+                    id,
+                    message_type: MessageType::Response,
+                    body,
+                })?;
+            }
+            MessageType::Response => {
+                // Response to our request.
+                let response_sender = {
+                    let mut pending_requests = self.pending_out_requests.lock().unwrap();
+                    pending_requests.remove(&message.id)
+                };
+
+                match response_sender {
+                    Some(response_sender) => {
+                        if response_sender.send(message.body).is_err() {
+                            warn!(self.logger, "Unable to deliver response to local handler");
+                        }
+                    }
+                    None => {
+                        warn!(self.logger, "Received response message for unknown request"; "msg_id" => message.id);
+                    }
+                }
+            }
+            _ => warn!(self.logger, "Received a malformed message"),
+        }
+
+        Ok(())
+    }
+
+    fn handle_request(
+        self: &Arc<Protocol>,
+        id: u64,
+        request: Body,
+    ) -> anyhow::Result<Option<Body>> {
+        match request {
+            // Connection setup and various requests.
+            Body::RuntimeInfoRequest(request) => Ok(Some(Body::RuntimeInfoResponse(
+                self.initialize_guest(request)?,
+            ))),
+            Body::RuntimePingRequest {} => Ok(Some(Body::Empty {})),
+            Body::RuntimeShutdownRequest {} => {
+                info!(self.logger, "Received worker shutdown request");
+                Err(ProtocolError::MethodNotSupported.into())
+            }
+            Body::RuntimeAbortRequest {} => {
+                info!(self.logger, "Received worker abort request");
+                Err(ProtocolError::MethodNotSupported.into())
+            }
+
+            // Attestation-related requests.
+            Body::RuntimeCapabilityTEERakInitRequest { .. }
+            | Body::RuntimeCapabilityTEERakReportRequest {}
+            | Body::RuntimeCapabilityTEERakAvrRequest { .. }
+            | Body::RuntimeCapabilityTEERakQuoteRequest { .. }
+            | Body::RuntimeCapabilityTEEUpdateEndorsementRequest { .. } => {
+                self.dispatcher.queue_request(id, request)?;
+                Ok(None)
+            }
+
+            // Other requests.
+            Body::RuntimeRPCCallRequest { .. }
+            | Body::RuntimeLocalRPCCallRequest { .. }
+            | Body::RuntimeCheckTxBatchRequest { .. }
+            | Body::RuntimeExecuteTxBatchRequest { .. }
+            | Body::RuntimeNotifyRequest { .. }
+            | Body::RuntimeKeyManagerStatusUpdateRequest { .. }
+            | Body::RuntimeKeyManagerQuotePolicyUpdateRequest { .. }
+            | Body::RuntimeQueryRequest { .. }
+            | Body::RuntimeConsensusSyncRequest { .. } => {
+                self.ensure_initialized()?;
+                self.dispatcher.queue_request(id, request)?;
+                Ok(None)
+            }
+
+            _ => {
+                warn!(self.logger, "Received unsupported request"; "req" => format!("{request:?}"));
+                Err(ProtocolError::MethodNotSupported.into())
+            }
+        }
+    }
+
+    fn initialize_guest(
+        self: &Arc<Protocol>,
+        host_info: RuntimeInfoRequest,
+    ) -> anyhow::Result<RuntimeInfoResponse> {
+        info!(self.logger, "Received host environment information";
+            "runtime_id" => ?host_info.runtime_id,
+            "consensus_backend" => &host_info.consensus_backend,
+            "consensus_protocol_version" => ?host_info.consensus_protocol_version,
+            "consensus_chain_context" => &host_info.consensus_chain_context,
+            "local_config" => ?host_info.local_config,
+        );
+
+        if tendermint::BACKEND_NAME != host_info.consensus_backend {
+            return Err(ProtocolError::IncompatibleConsensusBackend.into());
+        }
+        let mut local_host_info = self.host_info.lock().unwrap();
+        if local_host_info.is_some() {
+            return Err(ProtocolError::AlreadyInitialized.into());
+        }
+
+        // Create and start the consensus verifier.
+        let consensus_verifier: Box<dyn Verifier> =
+            if let Some(ref trust_root) = self.config.trust_root {
+                // Make sure that the host environment matches the trust root.
+                if host_info.runtime_id != trust_root.runtime_id {
+                    return Err(ProtocolError::InvalidRuntimeId(
+                        trust_root.runtime_id,
+                        host_info.runtime_id,
+                    )
+                    .into());
+                }
+
+                // Create the Tendermint consensus layer verifier and spawn it in a separate thread.
+                let verifier = tendermint::verifier::Verifier::new(
+                    self.clone(),
+                    self.tokio_runtime.clone(),
+                    trust_root.clone(),
+                    host_info.runtime_id,
+                    host_info.consensus_chain_context.clone(),
+                );
+                let handle = verifier.handle();
+                verifier.start();
+
+                Box::new(handle)
+            } else {
+                // Create a no-op verifier.
+                let verifier = tendermint::verifier::NopVerifier::new(self.clone());
+                verifier.start();
+
+                Box::new(verifier)
+            };
+
+        // Configure the host environment info.
+        *local_host_info = Some(HostInfo {
+            runtime_id: host_info.runtime_id,
+            consensus_backend: host_info.consensus_backend,
+            consensus_protocol_version: host_info.consensus_protocol_version,
+            consensus_chain_context: host_info.consensus_chain_context,
+            local_config: host_info.local_config,
+        });
+
+        // Start the dispatcher.
+        self.dispatcher.start(self.clone(), consensus_verifier);
+
+        Ok(RuntimeInfoResponse {
+            protocol_version: BUILD_INFO.protocol_version,
+            runtime_version: self.config.version,
+            features: self.config.features.clone(),
+        })
+    }
+
+    /// Ensure that the runtime is ready to process requests and fail otherwise.
+    pub fn ensure_initialized(&self) -> anyhow::Result<()> {
+        self.host_info
+            .lock()
+            .unwrap()
+            .as_ref()
+            .ok_or(ProtocolError::HostInfoNotConfigured)?;
+
+        match BUILD_INFO.tee_type {
+            TeeType::Sgx | TeeType::Tdx => {
+                self.identity
+                    .quote()
+                    .ok_or(ProtocolError::AttestationRequired)?;
+            }
+            TeeType::None => {}
+        }
+
+        Ok(())
+    }
+}
+
+/// Untrusted key/value store which stores arbitrary binary key/value pairs
+/// on the worker host.
+///
+/// Care MUST be taken to not trust this interface at all.  The worker host
+/// is capable of doing whatever it wants including but not limited to,
+/// hiding data, tampering with keys/values, ignoring writes, replaying
+/// past values, etc.
+pub struct ProtocolUntrustedLocalStorage {
+    protocol: Arc<Protocol>,
+}
+
+impl ProtocolUntrustedLocalStorage {
+    pub fn new(protocol: Arc<Protocol>) -> Self {
+        Self { protocol }
+    }
+}
+
+impl KeyValue for ProtocolUntrustedLocalStorage {
+    fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error> {
+        match self
+            .protocol
+            .call_host(Body::HostLocalStorageGetRequest { key })?
+        {
+            Body::HostLocalStorageGetResponse { value } => Ok(value),
+            _ => Err(ProtocolError::InvalidResponse.into()),
+        }
+    }
+
+    fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error> {
+        match self
+            .protocol
+            .call_host(Body::HostLocalStorageSetRequest { key, value })?
+        {
+            Body::HostLocalStorageSetResponse {} => Ok(()),
+            _ => Err(ProtocolError::InvalidResponse.into()),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/cache/lru_cache.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/cache/lru_cache.rs.html new file mode 100644 index 0000000000..c2e86d36a6 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/cache/lru_cache.rs.html @@ -0,0 +1,1049 @@ +lru_cache.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+
use std::{cell::RefCell, pin::Pin, ptr::NonNull, rc::Rc};
+
+use anyhow::{anyhow, Result};
+use intrusive_collections::{intrusive_adapter, LinkedList, LinkedListLink};
+use thiserror::Error;
+
+#[cfg(test)]
+use crate::storage::mkvs::cache::CacheStats;
+use crate::storage::mkvs::{
+    cache::{Cache, CacheExtra, CacheItem, ReadSyncFetcher},
+    sync::{merge_verified_subtree, ProofVerifier, ReadSync},
+    tree::{
+        Depth, InternalNode, Key, LeafNode, NodeBox, NodeKind, NodePointer, NodePtrRef, NodeRef,
+        Root, RootType, Value,
+    },
+};
+
+#[derive(Error, Debug)]
+#[error("mkvs: tried to remove locked node")]
+struct RemoveLockedError;
+
+#[derive(Clone, Default)]
+pub struct CacheItemBox<Item: CacheItem + Default> {
+    item: Rc<RefCell<Item>>,
+    link: LinkedListLink,
+}
+
+intrusive_adapter!(
+    CacheItemAdapter<Item> = Pin<Box<CacheItemBox<Item>>>:
+        CacheItemBox<Item> { link: LinkedListLink }
+        where Item: CacheItem + Default
+);
+
+struct LRUList<V>
+where
+    V: CacheItem + Default,
+{
+    pub list: LinkedList<CacheItemAdapter<V>>,
+    pub size: usize,
+    pub capacity: usize,
+    pub mark: CacheExtra<V>,
+}
+
+impl<V> LRUList<V>
+where
+    V: CacheItem + Default,
+{
+    pub fn new(capacity: usize) -> LRUList<V> {
+        LRUList {
+            list: LinkedList::new(CacheItemAdapter::new()),
+            size: 0,
+            capacity,
+            mark: None,
+        }
+    }
+
+    fn mark(&mut self) {
+        self.mark = self.list.front().get().map(|front| {
+            front
+                .item
+                .borrow()
+                .get_cache_extra()
+                .expect("item was just retrieved from list, cache extra must exist")
+        });
+    }
+
+    fn add(&mut self, val: Rc<RefCell<V>>) {
+        let mut val_ref = val.borrow_mut();
+        if val_ref.get_cache_extra().is_none() {
+            self.size += val_ref.get_cached_size();
+            let mut item_box = Box::pin(CacheItemBox {
+                item: val.clone(),
+                link: LinkedListLink::new(),
+            });
+            val_ref.set_cache_extra(NonNull::new(&mut *item_box));
+            if let Some(non_null_pos) = &self.mark {
+                let mut pos_cursor =
+                    unsafe { self.list.cursor_mut_from_ptr(non_null_pos.as_ptr()) };
+                pos_cursor.insert_after(item_box);
+            } else {
+                self.list.push_front(item_box);
+            }
+        } else {
+            self.use_val(val.clone());
+        }
+    }
+
+    fn use_val(&mut self, val: Rc<RefCell<V>>) -> bool {
+        let val_ref = val.borrow();
+        match val_ref.get_cache_extra() {
+            None => false,
+            Some(non_null) => {
+                let mut item_cursor = unsafe { self.list.cursor_mut_from_ptr(non_null.as_ptr()) };
+                let removed_box = item_cursor.remove().unwrap();
+                self.list.push_front(removed_box);
+                true
+            }
+        }
+    }
+
+    fn remove(&mut self, val: Rc<RefCell<V>>) -> bool {
+        let extra = val.borrow().get_cache_extra();
+        match extra {
+            None => false,
+            Some(non_null) => {
+                if let Some(non_null_mark) = self.mark {
+                    if non_null.as_ptr() == non_null_mark.as_ptr() {
+                        self.mark = None;
+                    }
+                }
+
+                let mut item_cursor = unsafe { self.list.cursor_mut_from_ptr(non_null.as_ptr()) };
+                match item_cursor.remove() {
+                    None => false,
+                    Some(item_box) => {
+                        let mut val = item_box.item.borrow_mut();
+                        val.set_cache_extra(None);
+                        self.size -= val.get_cached_size();
+                        true
+                    }
+                }
+            }
+        }
+    }
+
+    fn evict_for_val(
+        &mut self,
+        val: Rc<RefCell<V>>,
+        locked_val: Option<&Rc<RefCell<V>>>,
+    ) -> Result<Vec<Rc<RefCell<V>>>, RemoveLockedError> {
+        let mut evicted: Vec<Rc<RefCell<V>>> = Vec::new();
+        if self.capacity > 0 {
+            let target_size = val.borrow().get_cached_size();
+            while !self.list.is_empty() && self.size + target_size > self.capacity {
+                let back = self.list.back().get().unwrap().item.clone();
+                if let Some(locked_val) = locked_val {
+                    if back.as_ptr() == locked_val.as_ptr() {
+                        return Err(RemoveLockedError);
+                    }
+                }
+                if self.remove(back.clone()) {
+                    evicted.push(back);
+                }
+            }
+        }
+        Ok(evicted)
+    }
+}
+
+/// Cache implementation with a simple LRU eviction strategy.
+pub struct LRUCache {
+    read_syncer: Box<dyn ReadSync>,
+
+    pending_root: NodePtrRef,
+    sync_root: Root,
+
+    lru_leaf: LRUList<NodePointer>,
+    lru_internal: LRUList<NodePointer>,
+}
+
+impl LRUCache {
+    /// Construct a new cache instance.
+    ///
+    /// * `node_capacity` is the maximum number of internal nodes held by the
+    ///   cache before eviction.
+    /// * `value_capacity` is the total size, in bytes, of values held
+    ///   by the cache before eviction.
+    /// * `read_syncer` is the read syncer used as backing for the cache.
+    pub fn new(
+        node_capacity: usize,
+        value_capacity: usize,
+        read_syncer: Box<dyn ReadSync>,
+        root_type: RootType,
+    ) -> Box<LRUCache> {
+        Box::new(LRUCache {
+            read_syncer,
+
+            pending_root: Rc::new(RefCell::new(NodePointer {
+                node: None,
+                ..Default::default()
+            })),
+            sync_root: Root {
+                root_type,
+                ..Default::default()
+            },
+
+            lru_leaf: LRUList::new(value_capacity),
+            lru_internal: LRUList::new(node_capacity),
+        })
+    }
+
+    fn new_internal_node_ptr(&mut self, node: Option<NodeRef>) -> NodePtrRef {
+        Rc::new(RefCell::new(NodePointer {
+            node,
+            ..Default::default()
+        }))
+    }
+
+    fn new_leaf_node_ptr(&mut self, node: Option<NodeRef>) -> NodePtrRef {
+        Rc::new(RefCell::new(NodePointer {
+            node,
+            ..Default::default()
+        }))
+    }
+
+    fn try_commit_node(
+        &mut self,
+        ptr: NodePtrRef,
+        locked_ptr: Option<&NodePtrRef>,
+    ) -> Result<(), RemoveLockedError> {
+        assert!(ptr.borrow().clean, "mkvs: commit_node called on dirty node");
+        if ptr.borrow().node.is_none() {
+            return Ok(());
+        }
+        if self.use_node(ptr.clone()) {
+            return Ok(());
+        }
+
+        match classify_noderef!(? ptr.borrow().node) {
+            NodeKind::Internal => {
+                let evicted = self.lru_internal.evict_for_val(ptr.clone(), locked_ptr)?;
+                for node in evicted {
+                    self.try_remove_node(node.clone(), locked_ptr)?;
+                }
+                self.lru_internal.add(ptr);
+            }
+            NodeKind::Leaf => {
+                let evicted = self.lru_leaf.evict_for_val(ptr.clone(), locked_ptr)?;
+                for node in evicted {
+                    self.try_remove_node(node.clone(), locked_ptr)?;
+                }
+                self.lru_leaf.add(ptr);
+            }
+            NodeKind::None => return Ok(()),
+        };
+
+        Ok(())
+    }
+
+    fn try_remove_node(
+        &mut self,
+        ptr: NodePtrRef,
+        locked_ptr: Option<&NodePtrRef>,
+    ) -> Result<(), RemoveLockedError> {
+        #[derive(Clone, Copy)]
+        enum VisitState {
+            Unvisited,
+            VisitedLeaf,
+            VisitedLeft,
+            VisitedRight,
+        }
+        #[derive(Clone)]
+        struct PendingNode(NodePtrRef, VisitState);
+
+        let mut stack: Vec<PendingNode> = vec![PendingNode(ptr, VisitState::Unvisited)];
+        'stack: while !stack.is_empty() {
+            let top_idx = stack.len() - 1;
+            let top = stack[top_idx].clone();
+
+            if let Some(locked_ptr) = locked_ptr {
+                if locked_ptr.as_ptr() == top.0.as_ptr() {
+                    return Err(RemoveLockedError);
+                }
+            }
+
+            // Perform removal in depth-first order. We do not remove the node from
+            // the stack until all of its subtrees have been fully removed.
+            if let Some(ref node_ref) = top.0.borrow().node {
+                if let NodeBox::Internal(ref n) = *node_ref.borrow() {
+                    match top.1 {
+                        VisitState::Unvisited => {
+                            stack[top_idx].1 = VisitState::VisitedLeaf;
+                            stack.push(PendingNode(n.leaf_node.clone(), VisitState::Unvisited));
+                            continue 'stack;
+                        }
+                        VisitState::VisitedLeaf => {
+                            stack[top_idx].1 = VisitState::VisitedLeft;
+                            stack.push(PendingNode(n.left.clone(), VisitState::Unvisited));
+                            continue 'stack;
+                        }
+                        VisitState::VisitedLeft => {
+                            stack[top_idx].1 = VisitState::VisitedRight;
+                            stack.push(PendingNode(n.right.clone(), VisitState::Unvisited));
+                            continue 'stack;
+                        }
+                        VisitState::VisitedRight => {
+                            // Now it can finally be removed.
+                        }
+                    }
+                }
+            }
+
+            stack.pop();
+
+            match classify_noderef!(? top.0.borrow().node) {
+                NodeKind::Internal => {
+                    self.lru_internal.remove(top.0.clone());
+                    top.0.borrow_mut().node = None;
+                }
+                NodeKind::Leaf => {
+                    self.lru_leaf.remove(top.0.clone());
+                    top.0.borrow_mut().node = None;
+                }
+                NodeKind::None => {}
+            }
+        }
+
+        Ok(())
+    }
+
+    fn commit_merged_node(
+        &mut self,
+        ptr: NodePtrRef,
+        locked_ptr: &NodePtrRef,
+    ) -> Result<(), RemoveLockedError> {
+        // Try to commit the node. If we fail this means that there is not enough
+        // space in the cache to keep the node that we are trying to dereference.
+        if let Err(error) = self.try_commit_node(ptr.clone(), Some(locked_ptr)) {
+            // Failed to commit, make sure to not keep the subtree in memory.
+            ptr.borrow_mut().node = None;
+            return Err(error);
+        }
+
+        // Commit all children.
+        match classify_noderef!(? ptr.borrow().node) {
+            NodeKind::Internal => {
+                let node_ref = ptr.borrow().get_node();
+                self.commit_merged_node(noderef_as!(node_ref, Internal).left.clone(), locked_ptr)?;
+                self.commit_merged_node(noderef_as!(node_ref, Internal).right.clone(), locked_ptr)?;
+            }
+            NodeKind::Leaf => {}
+            NodeKind::None => {}
+        }
+
+        Ok(())
+    }
+}
+
+impl Cache for LRUCache {
+    #[cfg(test)]
+    fn stats(&self) -> CacheStats {
+        CacheStats {
+            internal_node_count: self.lru_internal.size,
+            leaf_value_size: self.lru_leaf.size,
+        }
+    }
+
+    fn get_pending_root(&self) -> NodePtrRef {
+        self.pending_root.clone()
+    }
+
+    fn set_pending_root(&mut self, new_root: NodePtrRef) {
+        self.pending_root = new_root;
+    }
+
+    fn set_sync_root(&mut self, root: Root) {
+        self.sync_root = root;
+    }
+
+    #[cfg(test)]
+    fn get_read_syncer(&self) -> &Box<dyn ReadSync> {
+        &self.read_syncer
+    }
+
+    fn new_internal_node(
+        &mut self,
+        label: &Key,
+        label_bit_length: Depth,
+        leaf_node: NodePtrRef,
+        left: NodePtrRef,
+        right: NodePtrRef,
+    ) -> NodePtrRef {
+        let node = Rc::new(RefCell::new(NodeBox::Internal(InternalNode {
+            label: label.clone(),
+            label_bit_length,
+            leaf_node,
+            left,
+            right,
+            ..Default::default()
+        })));
+        self.new_internal_node_ptr(Some(node))
+    }
+
+    fn new_leaf_node(&mut self, key: &Key, value: Value) -> NodePtrRef {
+        let node = Rc::new(RefCell::new(NodeBox::Leaf(LeafNode {
+            key: key.clone(),
+            value,
+            ..Default::default()
+        })));
+        self.new_leaf_node_ptr(Some(node))
+    }
+
+    fn remove_node(&mut self, ptr: NodePtrRef) {
+        self.try_remove_node(ptr, None)
+            .expect("no locked pointer passed, cannot fail");
+    }
+
+    fn deref_node_ptr<F: ReadSyncFetcher>(
+        &mut self,
+        ptr: NodePtrRef,
+        fetcher: Option<F>,
+    ) -> Result<Option<NodeRef>> {
+        let ptr_ref = ptr;
+        let ptr = ptr_ref.borrow();
+
+        self.use_node(ptr_ref.clone());
+
+        if let Some(ref node) = &ptr.node {
+            let refetch = match *node.borrow() {
+                NodeBox::Internal(ref n) => {
+                    // If this is an internal node, check if the leaf node  has been evicted.
+                    // In this case treat it as if we need to re-fetch the node.
+                    let leaf_ptr = n.leaf_node.borrow();
+                    !leaf_ptr.is_null() && leaf_ptr.node.is_none()
+                }
+                NodeBox::Leaf(..) => false,
+            };
+
+            if refetch {
+                drop(ptr);
+                self.remove_node(ptr_ref.clone());
+            } else {
+                return Ok(Some(node.clone()));
+            }
+        } else {
+            if !ptr.clean || ptr.is_null() {
+                return Ok(None);
+            }
+            drop(ptr);
+        }
+
+        // Node not available locally, fetch from read syncer.
+        if let Some(fetcher) = fetcher {
+            self.remote_sync(ptr_ref.clone(), fetcher)?;
+        } else {
+            return Err(anyhow!(
+                "mkvs: node to dereference not available locally and no fetcher provided"
+            ));
+        }
+
+        let ptr = ptr_ref.borrow();
+        if ptr.node.is_none() {
+            return Err(anyhow!(
+                "mkvs: received result did not contain node (or cache too small)"
+            ));
+        }
+        Ok(ptr.node.clone())
+    }
+
+    fn remote_sync<F: ReadSyncFetcher>(&mut self, ptr: NodePtrRef, fetcher: F) -> Result<()> {
+        let proof = fetcher.fetch(self.sync_root, ptr.clone(), &mut self.read_syncer)?;
+
+        // The proof can be for one of two hashes: i) it is either for ptr.Hash in case
+        // all the nodes are only contained in the subtree below ptr, or ii) it is for
+        // the c.syncRoot.Hash in case it contains nodes outside the subtree.
+        let ptr_hash = ptr.borrow().hash;
+        let (dst_ptr, expected_root) = if proof.untrusted_root == ptr_hash {
+            (ptr.clone(), ptr_hash)
+        } else if proof.untrusted_root == self.sync_root.hash {
+            (self.pending_root.clone(), self.sync_root.hash)
+        } else {
+            return Err(anyhow!(
+                "mkvs: got proof for unexpected root ({:?})",
+                proof.untrusted_root
+            ));
+        };
+
+        // Verify proof.
+        let pv = ProofVerifier;
+        let subtree = pv.verify_proof(expected_root, &proof)?;
+
+        // Merge resulting nodes.
+        let mut merged_nodes: Vec<NodePtrRef> = Vec::new();
+        merge_verified_subtree(dst_ptr, subtree, &mut merged_nodes)?;
+        let mut remove = false;
+        for node_ref in merged_nodes {
+            if remove {
+                // Do not keep subtrees that we failed to commit in memory.
+                node_ref.borrow_mut().node = None;
+            }
+
+            if let Err(RemoveLockedError) = self.commit_merged_node(node_ref, &ptr) {
+                // Cache is too small, ignore.
+                remove = true;
+            }
+        }
+
+        Ok(())
+    }
+
+    fn use_node(&mut self, ptr: NodePtrRef) -> bool {
+        match classify_noderef!(? ptr.borrow().node) {
+            NodeKind::Internal => self.lru_internal.use_val(ptr),
+            NodeKind::Leaf => self.lru_leaf.use_val(ptr),
+            NodeKind::None => false,
+        }
+    }
+
+    fn commit_node(&mut self, ptr: NodePtrRef) {
+        self.try_commit_node(ptr, None)
+            .expect("no locked pointer passed, cannot fail");
+    }
+
+    fn rollback_node(&mut self, ptr: NodePtrRef, kind: NodeKind) {
+        if ptr.borrow().get_cache_extra().is_none() {
+            // Node has not yet been committed to cache.
+            return;
+        }
+
+        let lru = match kind {
+            NodeKind::Internal => &mut self.lru_internal,
+            NodeKind::Leaf => &mut self.lru_leaf,
+            NodeKind::None => panic!("lru_cache: rollback works only for Internal and Leaf nodes!"),
+        };
+        lru.remove(ptr.clone());
+
+        ptr.borrow_mut().set_cache_extra(None);
+    }
+
+    fn mark_position(&mut self) {
+        self.lru_internal.mark();
+        self.lru_leaf.mark();
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/cache/mod.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/cache/mod.rs.html new file mode 100644 index 0000000000..77b5953e77 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/cache/mod.rs.html @@ -0,0 +1,307 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+
mod lru_cache;
+
+pub use lru_cache::LRUCache;
+
+use std::ptr::NonNull;
+
+use anyhow::Result;
+
+use crate::storage::mkvs::{
+    cache::lru_cache::CacheItemBox,
+    sync::{Proof, ReadSync},
+    tree::{Depth, Key, NodeKind, NodePtrRef, NodeRef, Root, Value},
+};
+
+/// Statistics about the contents of the cache.
+#[derive(Debug, Default)]
+#[cfg(test)]
+pub struct CacheStats {
+    /// Count of internal nodes held by the cache.
+    pub internal_node_count: usize,
+    /// Total size of values held by the cache.
+    pub leaf_value_size: usize,
+}
+
+/// Used to fetch proofs from a remote tree via the ReadSyncer interface.
+pub trait ReadSyncFetcher {
+    /// Fetch proof.
+    fn fetch(&self, root: Root, ptr: NodePtrRef, rs: &mut Box<dyn ReadSync>) -> Result<Proof>;
+}
+
+impl<F> ReadSyncFetcher for F
+where
+    F: Fn(Root, NodePtrRef, &mut Box<dyn ReadSync>) -> Result<Proof>,
+{
+    fn fetch(&self, root: Root, ptr: NodePtrRef, rs: &mut Box<dyn ReadSync>) -> Result<Proof> {
+        (*self)(root, ptr, rs)
+    }
+}
+
+/// Cache interface for the in-mmory tree cache.
+pub trait Cache {
+    /// Return statistics about the contents of the cache.
+    #[cfg(test)]
+    fn stats(&self) -> CacheStats;
+
+    /// Get a pointer to the current uncommitted root node.
+    fn get_pending_root(&self) -> NodePtrRef;
+    /// Set the root node for the tree to the given pointer.
+    fn set_pending_root(&mut self, new_root: NodePtrRef);
+    /// Set the root of the tree after committing.
+    fn set_sync_root(&mut self, root: Root);
+
+    /// Get the read syncer backing this cache.
+    #[cfg(test)]
+    fn get_read_syncer(&self) -> &Box<dyn ReadSync>;
+
+    /// Create a new internal node and returns a pointer to it.
+    fn new_internal_node(
+        &mut self,
+        label: &Key,
+        label_bit_length: Depth,
+        leaf_node: NodePtrRef,
+        left: NodePtrRef,
+        right: NodePtrRef,
+    ) -> NodePtrRef;
+    /// Create a new leaf node and returns a pointer to it.
+    fn new_leaf_node(&mut self, key: &Key, value: Value) -> NodePtrRef;
+
+    /// Try removing a node from the cache.
+    fn remove_node(&mut self, ptr: NodePtrRef);
+
+    /// Dereference a node pointer into a concrete node object.
+    ///
+    /// Calling this method may invoke the underlying read syncer.
+    /// Giving a None fetcher forces the dereference to be local-only,
+    /// without invoking the read syncer.
+    fn deref_node_ptr<F: ReadSyncFetcher>(
+        &mut self,
+        ptr: NodePtrRef,
+        fetcher: Option<F>,
+    ) -> Result<Option<NodeRef>>;
+    /// Perform a remote sync with the configured remote syncer.
+    fn remote_sync<F: ReadSyncFetcher>(&mut self, ptr: NodePtrRef, fetcher: F) -> Result<()>;
+
+    /// Mark that a tree node was just used.
+    fn use_node(&mut self, ptr: NodePtrRef) -> bool;
+
+    /// Commit a node into the cache.
+    ///
+    /// This method may evict some nodes in order to make space
+    /// for the one being committed.
+    fn commit_node(&mut self, ptr: NodePtrRef);
+
+    // Mark a tree node as no longer being eligible for eviction
+    // due to it becoming dirty.
+    fn rollback_node(&mut self, ptr: NodePtrRef, kind: NodeKind);
+
+    /// Mark the current LRU queue positions as the ones before any nodes are
+    /// visited. Any new nodes committed into the cache after this is called
+    /// will be inserted after the marked position.
+    ///
+    /// This makes it possible to keep the path from the root to the derefed
+    /// node in the cache instead of evicting it.
+    fn mark_position(&mut self);
+}
+
+/// Shorthand for the type that cacheable items must hold to aid caching.
+pub type CacheExtra<T> = Option<NonNull<CacheItemBox<T>>>;
+
+/// Cacheable objects must implement this trait to enable the cache to cache them.
+pub trait CacheItem<Item = Self>
+where
+    Item: CacheItem + Default,
+{
+    /// Get the item's caching hint.
+    ///
+    /// For e.g. the LRU cache, this may be a used timestamp.
+    fn get_cache_extra(&self) -> CacheExtra<Item>;
+    /// Set the item's caching hint.
+    fn set_cache_extra(&mut self, new_val: CacheExtra<Item>);
+    /// Return the size, in bytes, of the item when cached.
+    fn get_cached_size(&self) -> usize;
+}
+
+/// Callback type used for updating cache items after a commit.
+pub type CacheUpdater<C> = Box<dyn Fn(&mut C)>;
+
+/// A list of cache update callbacks.
+pub struct UpdateList<C: Cache> {
+    updates: Vec<CacheUpdater<C>>,
+}
+
+impl<C: Cache> UpdateList<C> {
+    /// Construct a new UpdateList instance.
+    pub fn new() -> UpdateList<C> {
+        UpdateList {
+            updates: Vec::new(),
+        }
+    }
+
+    /// Push a new callback to the end of the list.
+    pub fn push(&mut self, updater: CacheUpdater<C>) {
+        self.updates.push(updater);
+    }
+
+    /// Commit the update list by calling all callbacks in order and destroying the list.
+    pub fn commit(&mut self, cache: &mut C) {
+        for update in &self.updates {
+            (update)(cache);
+        }
+        self.updates.clear();
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/marshal.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/marshal.rs.html new file mode 100644 index 0000000000..d916f84acd --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/marshal.rs.html @@ -0,0 +1,133 @@ +marshal.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
use std::io::Cursor;
+
+use anyhow::{anyhow, Result};
+use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
+
+/// The `Marshal` trait is used for marshaling and unmarshaling MKVS trees.
+pub trait Marshal {
+    /// Marshal the object into a binary form and return it as a new vector.
+    fn marshal_binary(&self) -> Result<Vec<u8>>;
+    /// Unmarshal from the given byte slice reference and modify `self`.
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>;
+}
+
+impl Marshal for u16 {
+    fn marshal_binary(&self) -> Result<Vec<u8>> {
+        let mut result: Vec<u8> = Vec::with_capacity(2);
+        result.write_u16::<LittleEndian>(*self)?;
+        Ok(result)
+    }
+
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize> {
+        if data.len() < 2 {
+            Err(anyhow!("mkvs: malformed 16-bit integer"))
+        } else {
+            let mut reader = Cursor::new(data);
+            *self = reader.read_u16::<LittleEndian>()?;
+            Ok(2)
+        }
+    }
+}
+
+impl Marshal for u32 {
+    fn marshal_binary(&self) -> Result<Vec<u8>> {
+        let mut result: Vec<u8> = Vec::with_capacity(4);
+        result.write_u32::<LittleEndian>(*self)?;
+        Ok(result)
+    }
+
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize> {
+        if data.len() < 4 {
+            Err(anyhow!("mkvs: malformed 32-bit integer"))
+        } else {
+            let mut reader = Cursor::new(data);
+            *self = reader.read_u32::<LittleEndian>()?;
+            Ok(4)
+        }
+    }
+}
+
+impl Marshal for u64 {
+    fn marshal_binary(&self) -> Result<Vec<u8>> {
+        let mut result: Vec<u8> = Vec::with_capacity(8);
+        result.write_u64::<LittleEndian>(*self)?;
+        Ok(result)
+    }
+
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize> {
+        if data.len() < 8 {
+            Err(anyhow!("mkvs: malformed 64-bit integer"))
+        } else {
+            let mut reader = Cursor::new(data);
+            *self = reader.read_u64::<LittleEndian>()?;
+            Ok(8)
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/mod.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/mod.rs.html new file mode 100644 index 0000000000..a5f929be91 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/mod.rs.html @@ -0,0 +1,651 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+
//! Merklized key-value store.
+use std::{
+    iter,
+    ops::{Deref, DerefMut},
+};
+
+use anyhow::{Error, Result};
+
+use crate::common::{crypto::hash::Hash, namespace::Namespace};
+
+use self::sync::Proof;
+
+#[macro_use]
+mod tree;
+mod cache;
+#[cfg(test)]
+pub mod interop;
+pub mod marshal;
+pub mod sync;
+#[cfg(test)]
+mod tests;
+
+pub use tree::{Depth, Key, NodeBox, NodePointer, NodePtrRef, OverlayTree, Root, RootType, Tree};
+
+/// The type of entry in the log.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum LogEntryKind {
+    Insert,
+    Delete,
+}
+
+/// An entry in the write log, describing a single update.
+#[derive(Clone, Debug, Default, Eq, PartialEq, Hash, cbor::Encode, cbor::Decode)]
+#[cbor(as_array)]
+pub struct LogEntry {
+    /// The key that was inserted or deleted.
+    pub key: Vec<u8>,
+    /// The inserted value (empty if the key was deleted).
+    pub value: Option<Vec<u8>>,
+}
+
+impl LogEntry {
+    pub fn new(key: &[u8], value: &[u8]) -> Self {
+        Self {
+            key: key.to_owned(),
+            value: Some(value.to_owned()),
+        }
+    }
+
+    pub fn kind(&self) -> LogEntryKind {
+        match self.value {
+            Some(_) => LogEntryKind::Insert,
+            None => LogEntryKind::Delete,
+        }
+    }
+}
+
+/// The write log.
+///
+/// The keys in the write log must be unique.
+pub type WriteLog = Vec<LogEntry>;
+
+/// A key prefix.
+#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Ord, cbor::Encode, cbor::Decode)]
+#[cbor(transparent)]
+pub struct Prefix(Vec<u8>);
+
+impl AsRef<[u8]> for Prefix {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl Deref for Prefix {
+    type Target = Vec<u8>;
+
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+impl DerefMut for Prefix {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut self.0
+    }
+}
+
+impl From<Prefix> for Vec<u8> {
+    fn from(val: Prefix) -> Self {
+        val.0
+    }
+}
+
+impl From<Vec<u8>> for Prefix {
+    fn from(v: Vec<u8>) -> Prefix {
+        Prefix(v)
+    }
+}
+
+/// Merklized key-value store.
+pub trait MKVS {
+    /// Fetch entry with given key.
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;
+
+    /// Fetch proof for entry with given key.
+    fn get_proof(&self, key: &[u8]) -> Option<Proof>;
+
+    /// Check if the local MKVS cache contains the given key.
+    ///
+    /// While get can be used to check if the MKVS as a whole contains
+    /// a given key, this function specifically guarantees that no remote
+    /// syncing will be invoked, only checking the local cache.
+    fn cache_contains_key(&self, key: &[u8]) -> bool;
+
+    /// Update entry with given key.
+    ///
+    /// If the database did not have this key present, [`None`] is returned.
+    ///
+    /// If the database did have this key present, the value is updated, and the old value is
+    /// returned.
+    ///
+    /// [`None`]: std::option::Option
+    fn insert(&mut self, key: &[u8], value: &[u8]) -> Option<Vec<u8>>;
+
+    /// Remove entry with given key, returning the value at the key if the key was previously
+    /// in the database.
+    fn remove(&mut self, key: &[u8]) -> Option<Vec<u8>>;
+
+    /// Populate the in-memory tree with nodes for keys starting with given prefixes.
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16);
+
+    /// Returns an iterator over the tree.
+    fn iter(&self) -> Box<dyn Iterator + '_>;
+
+    /// Commit all database changes to the underlying store.
+    fn commit(&mut self, namespace: Namespace, version: u64) -> Result<(WriteLog, Hash)>;
+}
+
+/// Merklized key-value store where methods return errors instead of panicking.
+pub trait FallibleMKVS {
+    /// Fetch entry with given key.
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;
+
+    /// Fetch proof for entry with given key.
+    fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>;
+
+    /// Check if the local MKVS cache contains the given key.
+    ///
+    /// While get can be used to check if the MKVS as a whole contains
+    /// a given key, this function specifically guarantees that no remote
+    /// syncing will be invoked, only checking the local cache.
+    fn cache_contains_key(&self, key: &[u8]) -> bool;
+
+    /// Update entry with given key.
+    ///
+    /// If the database did not have this key present, [`None`] is returned.
+    ///
+    /// If the database did have this key present, the value is updated, and the old value is
+    /// returned.
+    ///
+    /// [`None`]: std::option::Option
+    fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>>;
+
+    /// Remove entry with given key, returning the value at the key if the key was previously
+    /// in the database.
+    fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>>;
+
+    /// Populate the in-memory tree with nodes for keys starting with given prefixes.
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>;
+
+    /// Returns an iterator over the tree.
+    fn iter(&self) -> Box<dyn Iterator + '_>;
+
+    /// Commit all database changes to the underlying store.
+    fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash>;
+}
+
+/// Immutable merkalized key value store.
+pub trait ImmutableMKVS {
+    /// Fetch entry with given key.
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;
+
+    /// Fetch proof for entry with given key.
+    fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>>;
+
+    /// Populate the in-memory tree with nodes for keys starting with given prefixes.
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()>;
+
+    /// Returns an iterator over the tree.
+    fn iter(&self) -> Box<dyn Iterator + '_>;
+}
+
+impl<T> ImmutableMKVS for T
+where
+    T: FallibleMKVS,
+{
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        T::get(self, key)
+    }
+
+    fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>> {
+        T::get_proof(self, key)
+    }
+
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()> {
+        T::prefetch_prefixes(self, prefixes, limit)
+    }
+
+    fn iter(&self) -> Box<dyn Iterator + '_> {
+        T::iter(self)
+    }
+}
+
+/// An MKVS iterator.
+pub trait Iterator: iter::Iterator<Item = (Vec<u8>, Vec<u8>)> {
+    /// Sets the number of next elements to prefetch.
+    fn set_prefetch(&mut self, prefetch: usize);
+
+    /// Return whether the iterator is valid.
+    fn is_valid(&self) -> bool;
+
+    /// Return the error that occurred during iteration if any.
+    fn error(&self) -> &Option<Error>;
+
+    /// Moves the iterator to the first key in the tree.
+    fn rewind(&mut self);
+
+    /// Moves the iterator either at the given key or at the next larger key.
+    fn seek(&mut self, key: &[u8]);
+
+    /// The key under the iterator.
+    fn get_key(&self) -> &Option<Key>;
+
+    /// The value under the iterator.
+    fn get_value(&self) -> &Option<Vec<u8>>;
+
+    /// Advance the iterator to the next key.
+    fn next(&mut self);
+}
+
+impl<T: MKVS + ?Sized> MKVS for &mut T {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        T::get(self, key)
+    }
+
+    fn get_proof(&self, key: &[u8]) -> Option<Proof> {
+        T::get_proof(self, key)
+    }
+
+    fn cache_contains_key(&self, key: &[u8]) -> bool {
+        T::cache_contains_key(self, key)
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) -> Option<Vec<u8>> {
+        T::insert(self, key, value)
+    }
+
+    fn remove(&mut self, key: &[u8]) -> Option<Vec<u8>> {
+        T::remove(self, key)
+    }
+
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) {
+        T::prefetch_prefixes(self, prefixes, limit)
+    }
+
+    fn iter(&self) -> Box<dyn Iterator + '_> {
+        T::iter(self)
+    }
+
+    fn commit(&mut self, namespace: Namespace, version: u64) -> Result<(WriteLog, Hash)> {
+        T::commit(self, namespace, version)
+    }
+}
+
+impl<T: FallibleMKVS + ?Sized> FallibleMKVS for &mut T {
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        T::get(self, key)
+    }
+
+    fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>> {
+        T::get_proof(self, key)
+    }
+
+    fn cache_contains_key(&self, key: &[u8]) -> bool {
+        T::cache_contains_key(self, key)
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>> {
+        T::insert(self, key, value)
+    }
+
+    fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        T::remove(self, key)
+    }
+
+    fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()> {
+        T::prefetch_prefixes(self, prefixes, limit)
+    }
+
+    fn iter(&self) -> Box<dyn Iterator + '_> {
+        T::iter(self)
+    }
+
+    fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash> {
+        T::commit(self, namespace, version)
+    }
+}
+
+#[cfg(test)]
+mod _tests {
+    use super::*;
+
+    #[test]
+    fn test_write_log_serialization() {
+        let write_log = vec![LogEntry {
+            key: b"foo".to_vec(),
+            value: Some(b"bar".to_vec()),
+        }];
+
+        let raw = cbor::to_vec(write_log.clone());
+        let deserialized: WriteLog = cbor::from_slice(&raw).unwrap();
+
+        assert_eq!(write_log, deserialized);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/sync/errors.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/sync/errors.rs.html new file mode 100644 index 0000000000..9de44d5960 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/sync/errors.rs.html @@ -0,0 +1,15 @@ +errors.rs - source
1
+2
+3
+4
+5
+6
+7
+
use thiserror::Error;
+
+#[derive(Error, Debug)]
+pub enum SyncerError {
+    #[error("mkvs: method not supported")]
+    Unsupported,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/sync/host.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/sync/host.rs.html new file mode 100644 index 0000000000..15d1702241 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/sync/host.rs.html @@ -0,0 +1,119 @@ +host.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+
use std::{any::Any, sync::Arc};
+
+use anyhow::Result;
+
+use crate::{
+    protocol::{Protocol, ProtocolError},
+    storage::mkvs::sync::{
+        GetPrefixesRequest, GetRequest, IterateRequest, ProofResponse, ReadSync,
+    },
+    types::{
+        Body, HostStorageEndpoint, StorageSyncRequest, StorageSyncRequestWithEndpoint,
+        StorageSyncResponse,
+    },
+};
+
+/// A proxy read syncer which forwards calls to the runtime host.
+pub struct HostReadSyncer {
+    protocol: Arc<Protocol>,
+    endpoint: HostStorageEndpoint,
+}
+
+impl HostReadSyncer {
+    /// Construct a new host proxy instance.
+    pub fn new(protocol: Arc<Protocol>, endpoint: HostStorageEndpoint) -> HostReadSyncer {
+        HostReadSyncer { protocol, endpoint }
+    }
+
+    fn call_host_with_proof(&self, request: StorageSyncRequest) -> Result<ProofResponse> {
+        let request = Body::HostStorageSyncRequest(StorageSyncRequestWithEndpoint {
+            endpoint: self.endpoint,
+            request,
+        });
+        match self.protocol.call_host(request) {
+            Ok(Body::HostStorageSyncResponse(StorageSyncResponse::ProofResponse(response))) => {
+                Ok(response)
+            }
+            Ok(_) => Err(ProtocolError::InvalidResponse.into()),
+            Err(error) => Err(error.into()),
+        }
+    }
+}
+
+impl ReadSync for HostReadSyncer {
+    fn as_any(&self) -> &dyn Any {
+        self
+    }
+
+    fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse> {
+        self.call_host_with_proof(StorageSyncRequest::SyncGet(request))
+    }
+
+    fn sync_get_prefixes(&mut self, request: GetPrefixesRequest) -> Result<ProofResponse> {
+        self.call_host_with_proof(StorageSyncRequest::SyncGetPrefixes(request))
+    }
+
+    fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse> {
+        self.call_host_with_proof(StorageSyncRequest::SyncIterate(request))
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/sync/merge.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/sync/merge.rs.html new file mode 100644 index 0000000000..ade955f7e5 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/sync/merge.rs.html @@ -0,0 +1,123 @@ +merge.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+
use anyhow::{anyhow, Result};
+
+use crate::storage::mkvs::tree::*;
+
+/// Merges a previously verified subtree with an existing tree.
+pub fn merge_verified_subtree(
+    dst: NodePtrRef,
+    subtree: NodePtrRef,
+    updater: &mut Vec<NodePtrRef>,
+) -> Result<()> {
+    let dst_ref = dst;
+    let mut dst = dst_ref.borrow_mut();
+    let subtree = subtree.borrow();
+    if dst.is_null() || subtree.is_null() {
+        return Ok(());
+    }
+
+    if !dst.clean {
+        // TODO: Support merging into non-clean subtrees. If a subtree
+        //       is not clean, this means that the tree structure may
+        //       be changed.
+        return Err(anyhow!(
+            "merger: merging into non-clean subtree not yet supported"
+        ));
+    }
+
+    // If the destination pointer is clean, sanity check that we are
+    // merging correct nodes.
+    if dst.hash != subtree.hash {
+        return Err(anyhow!(
+            "merger: hash mismatch during merge (expected: {:?} got: {:?})",
+            dst.hash,
+            subtree.hash,
+        ));
+    }
+
+    // If the subtree node is nil, there is nothing more to merge.
+    if subtree.node.is_none() {
+        return Ok(());
+    }
+
+    // If destination node is nil, we can simply replace the whole subtree.
+    if dst.node.is_none() {
+        dst.node = subtree.node.clone();
+        drop(dst);
+        updater.push(dst_ref);
+        return Ok(());
+    }
+
+    if let NodeBox::Internal(ref int_dst) = *dst.node.as_ref().unwrap().borrow() {
+        if let NodeBox::Internal(ref int_subtree) = *subtree.node.as_ref().unwrap().borrow() {
+            // Proceed with merging children.
+            merge_verified_subtree(int_dst.left.clone(), int_subtree.left.clone(), updater)?;
+            merge_verified_subtree(int_dst.right.clone(), int_subtree.right.clone(), updater)?;
+        } else {
+            panic!("hash was the same so nodes must be of the same type");
+        }
+    }
+
+    Ok(())
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/sync/mod.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/sync/mod.rs.html new file mode 100644 index 0000000000..e28aabeccc --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/sync/mod.rs.html @@ -0,0 +1,169 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+
//! The read-only tree sync interface.
+mod errors;
+mod host;
+mod merge;
+mod noop;
+mod proof;
+mod stats;
+
+pub use errors::SyncerError;
+pub use host::HostReadSyncer;
+pub use merge::merge_verified_subtree;
+pub use noop::NoopReadSyncer;
+pub use proof::{Proof, ProofBuilder, ProofVerifier, RawProofEntry};
+pub use stats::StatsCollector;
+
+use std::any::Any;
+
+use anyhow::Result;
+
+use crate::{
+    common::crypto::hash::Hash,
+    storage::mkvs::{tree::Root, Prefix},
+};
+
+/// Identifies a specific tree and a position within that tree.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct TreeID {
+    /// The Merkle tree root.
+    pub root: Root,
+    /// The caller's position in the tree structure to allow
+    /// returning partial proofs if possible.
+    pub position: Hash,
+}
+
+/// Request for the SyncGet operation.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct GetRequest {
+    pub tree: TreeID,
+    pub key: Vec<u8>,
+    #[cbor(optional)]
+    pub include_siblings: bool,
+}
+
+/// Request for the SyncGetPrefixes operation.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct GetPrefixesRequest {
+    pub tree: TreeID,
+    pub prefixes: Vec<Prefix>,
+    pub limit: u16,
+}
+
+/// Request for the SyncIterate operation.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct IterateRequest {
+    pub tree: TreeID,
+    pub key: Vec<u8>,
+    pub prefetch: u16,
+}
+
+/// Response for requests that produce proofs.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ProofResponse {
+    pub proof: Proof,
+}
+
+/// ReadSync is the interface for synchronizing the in-memory cache
+/// with another (potentially untrusted) MKVS.
+pub trait ReadSync {
+    /// Return `self` as an `Any` object, useful for downcasting.
+    fn as_any(&self) -> &dyn Any;
+
+    /// Fetch a single key and returns the corresponding proof.
+    fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse>;
+
+    /// Fetch all keys under the given prefixes and returns the corresponding proofs.
+    fn sync_get_prefixes(&mut self, request: GetPrefixesRequest) -> Result<ProofResponse>;
+
+    /// Seek to a given key and then fetch the specified number of following items
+    /// based on key iteration order.
+    fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse>;
+}
+
+#[cfg(test)]
+mod test;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/sync/noop.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/sync/noop.rs.html new file mode 100644 index 0000000000..b3671b8ab9 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/sync/noop.rs.html @@ -0,0 +1,57 @@ +noop.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
use std::any::Any;
+
+use anyhow::Result;
+
+use crate::storage::mkvs::sync::{
+    GetPrefixesRequest, GetRequest, IterateRequest, ProofResponse, ReadSync, SyncerError,
+};
+
+/// A no-op read syncer which doesn't support any of the required operations.
+pub struct NoopReadSyncer;
+
+impl ReadSync for NoopReadSyncer {
+    fn as_any(&self) -> &dyn Any {
+        self
+    }
+
+    fn sync_get(&mut self, _request: GetRequest) -> Result<ProofResponse> {
+        Err(SyncerError::Unsupported.into())
+    }
+
+    fn sync_get_prefixes(&mut self, _request: GetPrefixesRequest) -> Result<ProofResponse> {
+        Err(SyncerError::Unsupported.into())
+    }
+
+    fn sync_iterate(&mut self, _request: IterateRequest) -> Result<ProofResponse> {
+        Err(SyncerError::Unsupported.into())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/sync/proof.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/sync/proof.rs.html new file mode 100644 index 0000000000..bf62e5d079 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/sync/proof.rs.html @@ -0,0 +1,1395 @@ +proof.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+
use std::{
+    cell::RefCell,
+    collections::BTreeMap,
+    ops::{Deref, DerefMut},
+    rc::Rc,
+};
+
+use anyhow::{anyhow, Result};
+use arbitrary::Arbitrary;
+
+use crate::{
+    common::crypto::hash::Hash,
+    storage::mkvs::{marshal::Marshal, tree::*},
+};
+
+/// Proof entry type for full nodes.
+const PROOF_ENTRY_FULL: u8 = 0x01;
+/// Proof entry type for subtree hashes.
+const PROOF_ENTRY_HASH: u8 = 0x02;
+
+// Min and max supported proof versions.
+const MIN_PROOF_VERSION: u16 = 0;
+const MAX_PROOF_VERSION: u16 = 1;
+
+/// A raw proof entry.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode, Arbitrary)]
+#[cbor(transparent)]
+pub struct RawProofEntry(pub Vec<u8>);
+
+impl AsRef<[u8]> for RawProofEntry {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl Deref for RawProofEntry {
+    type Target = Vec<u8>;
+
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+impl DerefMut for RawProofEntry {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut self.0
+    }
+}
+
+impl From<RawProofEntry> for Vec<u8> {
+    fn from(val: RawProofEntry) -> Self {
+        val.0
+    }
+}
+
+impl From<Vec<u8>> for RawProofEntry {
+    fn from(v: Vec<u8>) -> RawProofEntry {
+        RawProofEntry(v)
+    }
+}
+
+/// A Merkle proof for a subtree.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct Proof {
+    // The proof version.
+    //
+    // We don't use `Versioned` since we want version 0 proofs to be
+    // backwards compatible with the old structure which was not versioned.
+    //
+    // Version 0:
+    // Initial format.
+    //
+    // Version 1 change:
+    // Leaf nodes are included separately, as children. In version 0 the leaf node was
+    // serialized within the internal node.  The rationale behind this change is to eliminate
+    // the need to serialize all leaf nodes on the path when proving the existence of a
+    // specific value.
+    #[cbor(optional)]
+    pub v: u16,
+    /// The root hash this proof is for. This should only be used as a quick
+    /// sanity check and proof verification MUST use an independently obtained
+    /// root hash as the prover can provide any root.
+    pub untrusted_root: Hash,
+    /// Proof entries in pre-order traversal.
+    pub entries: Vec<Option<RawProofEntry>>,
+}
+
+struct ProofNode {
+    serialized: Vec<u8>,
+    children: Vec<Hash>,
+}
+
+/// A Merkle proof builder.
+pub struct ProofBuilder {
+    proof_version: u16,
+    root: Hash,
+    included: BTreeMap<Hash, ProofNode>,
+}
+
+impl ProofBuilder {
+    /// Create a new proof builder for the given root hash.
+    pub fn new(root: Hash) -> Self {
+        Self::new_with_version(root, MAX_PROOF_VERSION).unwrap()
+    }
+
+    /// Create a new proof builder for the given root hash and proof version.
+    pub fn new_with_version(root: Hash, proof_version: u16) -> Result<Self> {
+        if !(MIN_PROOF_VERSION..=MAX_PROOF_VERSION).contains(&proof_version) {
+            return Err(anyhow!(
+                "proof builder: unsupported proof version: {}",
+                proof_version
+            ));
+        }
+
+        Ok(Self {
+            proof_version,
+            root,
+            included: BTreeMap::new(),
+        })
+    }
+
+    /// Add a node to the set of included nodes.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the node is not clean.
+    pub fn include(&mut self, node: &NodeBox) {
+        if !node.is_clean() {
+            panic!("proof builder: node is not clean");
+        }
+
+        // If node is already included, skip.
+        let nh = node.get_hash();
+        if self.included.contains_key(&nh) {
+            return;
+        }
+        let mut pn = ProofNode {
+            serialized: node
+                .compact_marshal_binary(self.proof_version)
+                .expect("marshaling node in proof"),
+            children: vec![],
+        };
+
+        // For internal nodes, also include children.
+        if let NodeBox::Internal(nd) = node {
+            fn get_child_hash(nd: &Rc<RefCell<NodePointer>>) -> Hash {
+                nd.borrow()
+                    .node
+                    .as_ref()
+                    .map(|n| n.borrow().get_hash())
+                    .unwrap_or_else(Hash::empty_hash)
+            }
+
+            if self.proof_version == 1 {
+                // In proof version 1, leaf nodes are included separately as children.
+                pn.children.push(get_child_hash(&nd.leaf_node));
+            }
+            pn.children.push(get_child_hash(&nd.left));
+            pn.children.push(get_child_hash(&nd.right));
+        }
+
+        self.included.insert(nh, pn);
+    }
+
+    /// Build the (unverified) proof.
+    pub fn build(&self) -> Proof {
+        let mut proof = Proof {
+            v: self.proof_version,
+            untrusted_root: self.root,
+            entries: vec![],
+        };
+        self._build(&mut proof, &self.root);
+
+        proof
+    }
+
+    fn _build(&self, p: &mut Proof, h: &Hash) {
+        if h.is_empty() {
+            // Append nil for empty nodes.
+            p.entries.push(None);
+            return;
+        }
+
+        match self.included.get(h) {
+            None => {
+                // Node is not included in this proof, just add hash of subtree.
+                let mut data = Vec::with_capacity(h.as_ref().len() + 1);
+                data.push(PROOF_ENTRY_HASH);
+                data.extend_from_slice(h.as_ref());
+
+                p.entries.push(Some(RawProofEntry(data)));
+            }
+            Some(pn) => {
+                // Pre-order traversal, add visited node.
+                let mut data = Vec::with_capacity(pn.serialized.len() + 1);
+                data.push(PROOF_ENTRY_FULL);
+                data.extend_from_slice(&pn.serialized);
+
+                p.entries.push(Some(RawProofEntry(data)));
+
+                // Recurse into children.
+                for ch in pn.children.iter() {
+                    self._build(p, ch);
+                }
+            }
+        }
+    }
+}
+
+/// A proof verifier enables verifying proofs returned by the ReadSyncer API.
+pub struct ProofVerifier;
+
+impl ProofVerifier {
+    /// Verify a proof and generate an in-memory subtree representing the
+    /// nodes which are included in the proof.
+    pub fn verify_proof(&self, root: Hash, proof: &Proof) -> Result<NodePtrRef> {
+        // Check proof version.
+        if !(MIN_PROOF_VERSION..=MAX_PROOF_VERSION).contains(&proof.v) {
+            return Err(anyhow!("verifier: unsupported proof version: {}", proof.v));
+        }
+
+        // Sanity check that the proof is for the correct root (as otherwise it
+        // makes no sense to verify the proof).
+        if proof.untrusted_root != root {
+            return Err(anyhow!(
+                "verifier: got proof for unexpected root (expected: {:?} got {:?})",
+                root,
+                proof.untrusted_root,
+            ));
+        }
+        if proof.entries.is_empty() {
+            return Err(anyhow!("verifier: empty proof"));
+        }
+
+        let (idx, root_node) = Self::_verify_proof(proof, 0)?;
+        // Make sure that all of the entries in the proof have been used. The returned index should
+        // point to just beyond the last element.
+        if idx != proof.entries.len() {
+            return Err(anyhow!("verifier: unused entries in proof"));
+        }
+        let root_hash = root_node.borrow().hash;
+        if root_hash != root {
+            return Err(anyhow!(
+                "verifier: bad root (expected: {:?} got {:?})",
+                root,
+                root_hash,
+            ));
+        }
+
+        Ok(root_node)
+    }
+
+    fn _verify_proof(proof: &Proof, idx: usize) -> Result<(usize, NodePtrRef)> {
+        if idx >= proof.entries.len() {
+            return Err(anyhow!("verifier: malformed proof"));
+        }
+        let entry = match &proof.entries[idx] {
+            Some(entry) => entry.as_ref(),
+            None => return Ok((idx + 1, NodePointer::null_ptr())),
+        };
+        if entry.is_empty() {
+            return Err(anyhow!("verifier: malformed proof"));
+        }
+
+        match entry[0] {
+            PROOF_ENTRY_FULL => {
+                // Full node.
+                let mut node = NodeBox::default();
+                node.unmarshal_binary(&entry[1..])?;
+
+                // For internal nodes, also decode children.
+                let mut pos = idx + 1;
+                if let NodeBox::Internal(ref mut nd) = node {
+                    match proof.v {
+                        0 => {
+                            // In proof version 0, leaf nodes are included within the internal node.
+                        }
+                        1 => {
+                            // In proof version 1, leaf nodes are included separately as children.
+                            (pos, nd.leaf_node) = Self::_verify_proof(proof, pos)?;
+                        }
+                        _ => {
+                            // Should not happen, checked in verify_proof.
+                            panic!("unsupported proof version: {:?}", proof.v)
+                        }
+                    }
+
+                    // Left.
+                    (pos, nd.left) = Self::_verify_proof(proof, pos)?;
+                    // Right.
+                    (pos, nd.right) = Self::_verify_proof(proof, pos)?;
+
+                    // Recompute hash as hashes were not recomputed for compact encoding.
+                    nd.update_hash();
+                }
+
+                Ok((pos, NodePointer::from_node(node)))
+            }
+            PROOF_ENTRY_HASH => {
+                // Hash of a node.
+                let entry = &entry[1..];
+                if entry.len() != Hash::len() {
+                    return Err(anyhow!("verifier: malformed hash entry"));
+                }
+
+                Ok((idx + 1, NodePointer::hash_ptr(entry.into())))
+            }
+            entry_type => Err(anyhow!(
+                "verifier: unexpected entry in proof ({:?})",
+                entry_type
+            )),
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use base64::prelude::*;
+    use rustc_hex::ToHex;
+
+    use crate::storage::mkvs::{cache::Cache, sync::NoopReadSyncer};
+
+    use super::*;
+
+    #[test]
+    fn test_proof() {
+        // Test vectors generated by Go.
+
+        // V0 proof.
+        let test_vector_proof = BASE64_STANDARD.decode(
+            "omdlbnRyaWVzhUoBASQAa2V5IDACRgEBAQAAAlghAsFltYRhD4dAwHOdOmEigY1r02pJH6InhiibKlh9neYlWCECpsJnkjOnIgc4+\
+yfvpsqCcIYHh5eld1hNMWTT7arAfHFYIQLhNTLWRbks1RBf52ulnlOTO+7D5EZNMYFzTx8U46sCnm51bnRydXN0ZWRfcm9vdFggWeZ8L9wIuOEN0Iu2\
+uO/mFPzJZey4liX5fxf4fwcQRhM=",
+        ).unwrap();
+
+        let test_vector_root_hash =
+            "59e67c2fdc08b8e10dd08bb6b8efe614fcc965ecb89625f97f17f87f07104613";
+
+        // Proof should decode.
+        let proof: Proof =
+            cbor::from_slice(&test_vector_proof).expect("V0 proof should deserialize");
+        assert_eq!(proof.v, 0, "proof version should be 0");
+        let root_hash = Hash::from(test_vector_root_hash);
+
+        // Proof should round-trip.
+        assert_eq!(
+            test_vector_proof,
+            cbor::to_vec(proof.clone()),
+            "proof should round-trip"
+        );
+
+        // Proof should verify.
+        let pv = ProofVerifier;
+        pv.verify_proof(root_hash, &proof)
+            .expect("verify proof should not fail with a valid proof");
+
+        // Invalid proofs should not verify.
+
+        // Empty proof.
+        let empty_proof = Proof::default();
+        let result = pv.verify_proof(root_hash, &empty_proof);
+        assert!(
+            result.is_err(),
+            "verify proof should fail with an empty proof"
+        );
+
+        // Different root.
+        let bogus_hash = Hash::digest_bytes(b"i am a bogus hash");
+        let result = pv.verify_proof(bogus_hash, &proof);
+        assert!(
+            result.is_err(),
+            "verify proof should fail with a proof for a different root"
+        );
+
+        // Different hash element.
+        let mut corrupted = proof.clone();
+        corrupted.entries[4].as_mut().unwrap()[10] = 0x00;
+        let result = pv.verify_proof(root_hash, &corrupted);
+        assert!(
+            result.is_err(),
+            "verify proof should fail with invalid proof"
+        );
+
+        // Corrupted full node.
+        let mut corrupted = proof.clone();
+        corrupted.entries[0].as_mut().unwrap().truncate(3);
+        let result = pv.verify_proof(root_hash, &corrupted);
+        assert!(
+            result.is_err(),
+            "verify proof should fail with invalid proof"
+        );
+
+        // Corrupted hash.
+        let mut corrupted = proof.clone();
+        corrupted.entries[2].as_mut().unwrap().truncate(3);
+        let result = pv.verify_proof(root_hash, &corrupted);
+        assert!(
+            result.is_err(),
+            "verify proof should fail with invalid proof"
+        );
+
+        // Corrupted proof element type.
+        let mut corrupted = proof.clone();
+        corrupted.entries[3].as_mut().unwrap()[0] = 0xaa;
+        let result = pv.verify_proof(root_hash, &corrupted);
+        assert!(
+            result.is_err(),
+            "verify proof should fail with invalid proof"
+        );
+
+        // Missing elements.
+        let mut corrupted = proof.clone();
+        corrupted.entries.truncate(3);
+        let result = pv.verify_proof(root_hash, &corrupted);
+        assert!(
+            result.is_err(),
+            "verify proof should fail with invalid proof"
+        );
+
+        // V1 proof.
+        let test_vector_proof = BASE64_STANDARD.decode(
+            "o2F2AWdlbnRyaWVzh0oBASQAa2V5IDAC9kYBAQEAAAL2WCECwWW1hGEPh0DAc506YSKBjWvTakkfoieGKJsqWH2d5iVYIQKmwmeSM6ciBzj7J+\
+            +myoJwhgeHl6V3WE0xZNPtqsB8cVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCBZ5nwv3Ai44Q3Qi7a47+\
+            YU/Mll7LiWJfl/F/h/BxBGEw=="
+        ).unwrap();
+
+        // Proof should decode.
+        let proof: Proof =
+            cbor::from_slice(&test_vector_proof).expect("V1 proof should deserialize");
+        assert_eq!(proof.v, 1, "proof version should be 1");
+        let root_hash = Hash::from(test_vector_root_hash);
+
+        // Proof should round-trip.
+        assert_eq!(
+            test_vector_proof,
+            cbor::to_vec(proof.clone()),
+            "proof should round-trip"
+        );
+
+        // Proof should verify.
+        let pv = ProofVerifier;
+        pv.verify_proof(root_hash, &proof)
+            .expect("verify proof should not fail with a valid proof");
+    }
+
+    #[test]
+    fn test_proof_builder_v1() {
+        // NOTE: Ensure this test matches TestProofV1 in go/storage/mkvs/syncer_test.go.
+
+        // Prepare test tree.
+        let mut tree = Tree::builder()
+            .with_root(Root {
+                hash: Hash::empty_hash(),
+                ..Default::default()
+            })
+            .build(Box::new(NoopReadSyncer));
+        for i in 0..11 {
+            let k = format!("key {}", i).into_bytes();
+            let v = format!("value {}", i).into_bytes();
+            tree.insert(&k, &v).expect("insert");
+        }
+        let roothash = tree.commit(Default::default(), 1).expect("commit");
+
+        let mut pb = ProofBuilder::new(roothash);
+
+        // Ensure proof matches Go side.
+        let proof = pb.build();
+        assert_eq!(
+            BASE64_STANDARD.encode(cbor::to_vec(proof)),
+            "o2F2AWdlbnRyaWVzgVghAqlAud7XYhorEEl8hG9G3Hd4OXl5VR1xvuLAepMZ5qpFbnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ=="
+        );
+
+        // Include root node.
+        let root_ptr = tree.cache.borrow().get_pending_root();
+        let root_node = root_ptr.borrow().get_node();
+        pb.include(&*root_node.borrow());
+        // Ensure proof matches Go side.
+        let proof = pb.build();
+        assert_eq!(
+            BASE64_STANDARD.encode(cbor::to_vec(proof)),
+		    "o2F2AWdlbnRyaWVzhEoBASQAa2V5IDAC9lghAhQ6RgqFtADx+B6VKE0CVRrfDHmwgZwU3ewsj4gswWv+WCEC4TUy1kW5LNUQX+drpZ5Tkzvuw+RGTTGBc08fFOOrAp5udW50cnVzdGVkX3Jvb3RYIKlAud7XYhorEEl8hG9G3Hd4OXl5VR1xvuLAepMZ5qpF",
+        );
+
+        // Include root.left node.
+        let root_left = noderef_as!(root_node, Internal).left.borrow().get_node();
+        pb.include(&*root_left.borrow());
+        // Ensure proof matches Go side.
+        let proof = pb.build();
+        assert_eq!(
+            BASE64_STANDARD.encode(cbor::to_vec(proof)),
+            "o2F2AWdlbnRyaWVzh0oBASQAa2V5IDAC9kYBAQEAAAL2WCEC+OrSSPCCo9/QXQt7IsunAp+eUqMndKBCu0NcGHx4HrhYIQKmwmeSM6ciBzj7J++myoJwhgeHl6V3WE0xZNPtqsB8cVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+        );
+
+        // Include root.left.left node.
+        let root_left2 = noderef_as!(root_left, Internal).left.borrow().get_node();
+        pb.include(&*root_left2.borrow());
+
+        // Include root.left.left.left node.
+        let root_left3: Rc<RefCell<NodeBox>> =
+            noderef_as!(root_left2, Internal).left.borrow().get_node();
+        pb.include(&*root_left3.borrow());
+
+        // Include root.left.left.left.right node.
+        let root_left3_right = noderef_as!(root_left3, Internal).right.borrow().get_node();
+        pb.include(&*root_left3_right.borrow());
+
+        // Include root.left.left.left.right.left leaf node.
+        let bottom = noderef_as!(root_left3_right, Internal)
+            .left
+            .borrow()
+            .get_node();
+        pb.include(&*bottom.borrow());
+        // Ensure proof matches Go side.
+        let proof = pb.build();
+        assert_eq!(
+            BASE64_STANDARD.encode(cbor::to_vec(proof)),
+		    "o2F2AWdlbnRyaWVzkEoBASQAa2V5IDAC9kYBAQEAAAL2RgEBAQAAAvZGAQEBAAAC9lghAlF8/rp9QOAd1qSchhUxDtVkpmnze6sjz5IfFhdOuaypRgEBAQCAAlghAldMzQwgHh/Ecm+rF+i31AnOgFYBipBAlcx5Tf5l4yW+VgEABgBrZXkgMTAIAAAAdmFsdWUgMTD2WCECDnYjQhsAp5fD+gf0W5YYFY6CnGURrEETtJvJp+ijH4xYIQKmwmeSM6ciBzj7J++myoJwhgeHl6V3WE0xZNPtqsB8cVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+        );
+    }
+
+    #[test]
+    fn test_proof_extra_nodes() {
+        // V0 proof.
+        let test_vector_proof = BASE64_STANDARD.decode(
+                "omdlbnRyaWVzhUoBASQAa2V5IDACRgEBAQAAAlghAsFltYRhD4dAwHOdOmEigY1r02pJH6InhiibKlh9neYlWCECpsJnkjOnIgc4+\
+    yfvpsqCcIYHh5eld1hNMWTT7arAfHFYIQLhNTLWRbks1RBf52ulnlOTO+7D5EZNMYFzTx8U46sCnm51bnRydXN0ZWRfcm9vdFggWeZ8L9wIuOEN0Iu2\
+    uO/mFPzJZey4liX5fxf4fwcQRhM=",
+            ).unwrap();
+        let test_vector_root_hash =
+            "59e67c2fdc08b8e10dd08bb6b8efe614fcc965ecb89625f97f17f87f07104613";
+
+        // Proof should decode.
+        let mut proof: Proof =
+            cbor::from_slice(&test_vector_proof).expect("proof should deserialize");
+        let root_hash = Hash::from(test_vector_root_hash);
+
+        // Proof should verify.
+        let pv = ProofVerifier;
+        pv.verify_proof(root_hash, &proof)
+            .expect("verify proof should not fail with a valid proof");
+
+        // Duplicate some nodes and add them to the end.
+        proof.entries.push(proof.entries[0].clone());
+
+        pv.verify_proof(root_hash, &proof)
+            .expect_err("proof with extra data should fail to validate");
+
+        // V1 proof.
+        let test_vector_proof = BASE64_STANDARD.decode(
+                "o2F2AWdlbnRyaWVzh0oBASQAa2V5IDAC9kYBAQEAAAL2WCECwWW1hGEPh0DAc506YSKBjWvTakkfoieGKJsqWH2d5iVYIQKmwmeSM6ciBzj7J+\
+                +myoJwhgeHl6V3WE0xZNPtqsB8cVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCBZ5nwv3Ai44Q3Qi7a47+\
+                YU/Mll7LiWJfl/F/h/BxBGEw=="
+            ).unwrap();
+
+        // Proof should decode.
+        let mut proof: Proof =
+            cbor::from_slice(&test_vector_proof).expect("V1 proof should deserialize");
+        assert_eq!(proof.v, 1, "proof version should be 1");
+        let root_hash = Hash::from(test_vector_root_hash);
+
+        // Proof should verify.
+        let pv = ProofVerifier;
+        pv.verify_proof(root_hash, &proof)
+            .expect("verify proof should not fail with a valid proof");
+
+        // Duplicate some nodes and add them to the end.
+        proof.entries.push(proof.entries[0].clone());
+        pv.verify_proof(root_hash, &proof)
+            .expect_err("verify proof should fail with an invalid proof");
+    }
+
+    #[test]
+    fn test_proof_builder_v0() {
+        // NOTE: Ensure this test matches TestProofV0 in go/storage/mkvs/syncer_test.go.
+
+        // Prepare test tree.
+        let mut tree = Tree::builder()
+            .with_root(Root {
+                hash: Hash::empty_hash(),
+                ..Default::default()
+            })
+            .build(Box::new(NoopReadSyncer));
+        for i in 0..10 {
+            let k = format!("key {}", i).into_bytes();
+            let v = format!("value {}", i).into_bytes();
+            tree.insert(&k, &v).expect("insert");
+        }
+        let roothash = tree.commit(Default::default(), 1).expect("commit");
+
+        // Ensure tree matches Go side.
+        assert_eq!(
+            roothash.0.to_hex::<String>(),
+            "59e67c2fdc08b8e10dd08bb6b8efe614fcc965ecb89625f97f17f87f07104613",
+        );
+
+        // Ensure proof matches Go side.
+        let mut pb = ProofBuilder::new_with_version(roothash, 0).expect("new proof builder v0");
+        let root_only_proof = pb.build();
+        assert_eq!(
+            BASE64_STANDARD.encode(cbor::to_vec(root_only_proof)),
+            "omdlbnRyaWVzgVghAlnmfC/cCLjhDdCLtrjv5hT8yWXsuJYl+X8X+H8HEEYTbnVudHJ1c3RlZF9yb290WCBZ5nwv3Ai44Q3Qi7a47+YU/Mll7LiWJfl/F/h/BxBGEw==",
+        );
+
+        // Include root node.
+        let root_ptr = tree.cache.borrow().get_pending_root();
+        let root_node = root_ptr.borrow().get_node();
+        pb.include(&*root_node.borrow());
+        // Include root.left node.
+        pb.include(
+            &*noderef_as!(root_node, Internal)
+                .left
+                .borrow()
+                .get_node()
+                .borrow(),
+        );
+        // Ensure proofs matches Go side.
+        let test_proof = pb.build();
+        assert_eq!(
+            BASE64_STANDARD.encode(cbor::to_vec(test_proof)),
+            "omdlbnRyaWVzhUoBASQAa2V5IDACRgEBAQAAAlghAsFltYRhD4dAwHOdOmEigY1r02pJH6InhiibKlh9neYlWCECpsJnkjOnIgc4+yfvpsqCcIYHh5eld1hNMWTT7arAfHFYIQLhNTLWRbks1RBf52ulnlOTO+7D5EZNMYFzTx8U46sCnm51bnRydXN0ZWRfcm9vdFggWeZ8L9wIuOEN0Iu2uO/mFPzJZey4liX5fxf4fwcQRhM=",
+        );
+    }
+
+    #[test]
+    fn test_tree_proofs() {
+        // NOTE: Ensure this test matches TestTreeProofs in go/storage/mkvs/syncer_test.go.
+
+        // Prepare test tree.
+        let mut tree = Tree::builder()
+            .with_root(Root {
+                hash: Hash::empty_hash(),
+                ..Default::default()
+            })
+            .build(Box::new(NoopReadSyncer));
+        let mut keys = vec![];
+        for i in 0..11 {
+            let k = format!("key {}", i).into_bytes();
+            let v = format!("value {}", i).into_bytes();
+            tree.insert(&k, &v).expect("insert");
+            keys.push(k);
+        }
+        let roothash = tree.commit(Default::default(), 1).expect("commit");
+        // Ensure tree matches Go side.
+        assert_eq!(
+            roothash.0.to_hex::<String>(),
+            "a940b9ded7621a2b10497c846f46dc7778397979551d71bee2c07a9319e6aa45",
+        );
+
+        for tc in vec![
+            // Note: Tree::get_proof doesn't support version 0 proofs.
+            // We test only version 1 proofs here.
+            (
+                // Proof v.
+                1,
+                vec![
+                    // 0.
+                    "o2F2AWdlbnRyaWVzjUoBASQAa2V5IDAC9kYBAQEAAAL2RgEBAQAAAvZGAQEBAAAC9lQBAAUAa2V5IDAHAAAAdmFsdWUgMFghAlO8PtYkGTEg304b/z/cv4oH6+BRaJ88layf7VgIl3xTWCECDnYjQhsAp5fD+gf0W5YYFY6CnGURrEETtJvJp+ijH4xYIQKmwmeSM6ciBzj7J++myoJwhgeHl6V3WE0xZNPtqsB8cVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+                    // 1.
+                    "o2F2AWdlbnRyaWVzkEoBASQAa2V5IDAC9kYBAQEAAAL2RgEBAQAAAvZGAQEBAAAC9lghAlF8/rp9QOAd1qSchhUxDtVkpmnze6sjz5IfFhdOuaypRgEBAQCAAlQBAAUAa2V5IDEHAAAAdmFsdWUgMVghAm2EG0dH85+yEl5rdT67+D59/gbjHB9qDtnCcv0kkuje9lghAg52I0IbAKeXw/oH9FuWGBWOgpxlEaxBE7Sbyafoox+MWCECpsJnkjOnIgc4+yfvpsqCcIYHh5eld1hNMWTT7arAfHFYIQLhNTLWRbks1RBf52ulnlOTO+7D5EZNMYFzTx8U46sCnm51bnRydXN0ZWRfcm9vdFggqUC53tdiGisQSXyEb0bcd3g5eXlVHXG+4sB6kxnmqkU=",
+                    // 2.
+                    "o2F2AWdlbnRyaWVzjUoBASQAa2V5IDAC9kYBAQEAAAL2RgEBAQAAAvZYIQLnu/nMm00WQo9ZxRbRFM/hVtoTov4Phs3vIQ/6jS/29kYBAQEAgAL2VAEABQBrZXkgMgcAAAB2YWx1ZSAyWCECJtIdvBvSs2Vh4Z1ghY3zvHvK8JsoBmt3+dBpRCNdA/xYIQKmwmeSM6ciBzj7J++myoJwhgeHl6V3WE0xZNPtqsB8cVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+                    // 3.
+                    "o2F2AWdlbnRyaWVzjUoBASQAa2V5IDAC9kYBAQEAAAL2RgEBAQAAAvZYIQLnu/nMm00WQo9ZxRbRFM/hVtoTov4Phs3vIQ/6jS/29kYBAQEAgAL2WCECoYj1TutUHeB1K0anT1hRts8AKOw8AfEtn963XMVxV1xUAQAFAGtleSAzBwAAAHZhbHVlIDNYIQKmwmeSM6ciBzj7J++myoJwhgeHl6V3WE0xZNPtqsB8cVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+                    // 4.
+                    "o2F2AWdlbnRyaWVzjUoBASQAa2V5IDAC9kYBAQEAAAL2WCEC+OrSSPCCo9/QXQt7IsunAp+eUqMndKBCu0NcGHx4HrhGAQEBAIAC9kYBAQEAAAL2VAEABQBrZXkgNAcAAAB2YWx1ZSA0WCEC7uES0HThvwiREsS6OKGDOodNGn7WGC3BTBJSLBIsJf1YIQK31gqPbwp33M7yKb2VSo7eB8p4jZZmYGnJ7njeFBGHtVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+                    // 5.
+                    "o2F2AWdlbnRyaWVzjUoBASQAa2V5IDAC9kYBAQEAAAL2WCEC+OrSSPCCo9/QXQt7IsunAp+eUqMndKBCu0NcGHx4HrhGAQEBAIAC9kYBAQEAAAL2WCECxgplEp2jBopznMqoBJZ1ezCE7IO2Bb5CqLypC+IiEhpUAQAFAGtleSA1BwAAAHZhbHVlIDVYIQK31gqPbwp33M7yKb2VSo7eB8p4jZZmYGnJ7njeFBGHtVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+                    // 6.
+                    "o2F2AWdlbnRyaWVzjUoBASQAa2V5IDAC9kYBAQEAAAL2WCEC+OrSSPCCo9/QXQt7IsunAp+eUqMndKBCu0NcGHx4HrhGAQEBAIAC9lghAivLwJbWkwZ8nROaPHGxpfthiG8vqyPbvzhkEEX793dIRgEBAQCAAvZUAQAFAGtleSA2BwAAAHZhbHVlIDZYIQK96CvAaM4vOReqLe+AoO6KajYFZiUsAyvSi8rEgClU7FghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+                    // 7.
+                    "o2F2AWdlbnRyaWVzjUoBASQAa2V5IDAC9kYBAQEAAAL2WCEC+OrSSPCCo9/QXQt7IsunAp+eUqMndKBCu0NcGHx4HrhGAQEBAIAC9lghAivLwJbWkwZ8nROaPHGxpfthiG8vqyPbvzhkEEX793dIRgEBAQCAAvZYIQICPF9slSfLMzCKpIGUKFWpXWq5dxfVdfe6wfGW6xjer1QBAAUAa2V5IDcHAAAAdmFsdWUgN1ghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+                    // 8.
+                    "o2F2AWdlbnRyaWVzh0oBASQAa2V5IDAC9lghAhQ6RgqFtADx+B6VKE0CVRrfDHmwgZwU3ewsj4gswWv+RgEBAwCAAvZUAQAFAGtleSA4BwAAAHZhbHVlIDhYIQINczJ806eMr+T/iGsJmo8/JQFXZtjy1/k+as0V9FdfVG51bnRydXN0ZWRfcm9vdFggqUC53tdiGisQSXyEb0bcd3g5eXlVHXG+4sB6kxnmqkU=",
+                    // 9.
+                    "o2F2AWdlbnRyaWVzh0oBASQAa2V5IDAC9lghAhQ6RgqFtADx+B6VKE0CVRrfDHmwgZwU3ewsj4gswWv+RgEBAwCAAvZYIQIwwW7eyXCi2yXyFCzFD9U+Ssy1gwSwiskBQfk+9KCUA1QBAAUAa2V5IDkHAAAAdmFsdWUgOW51bnRydXN0ZWRfcm9vdFggqUC53tdiGisQSXyEb0bcd3g5eXlVHXG+4sB6kxnmqkU=",
+                    // 10.
+                    "o2F2AWdlbnRyaWVzkEoBASQAa2V5IDAC9kYBAQEAAAL2RgEBAQAAAvZGAQEBAAAC9lghAlF8/rp9QOAd1qSchhUxDtVkpmnze6sjz5IfFhdOuaypRgEBAQCAAlghAldMzQwgHh/Ecm+rF+i31AnOgFYBipBAlcx5Tf5l4yW+VgEABgBrZXkgMTAIAAAAdmFsdWUgMTD2WCECDnYjQhsAp5fD+gf0W5YYFY6CnGURrEETtJvJp+ijH4xYIQKmwmeSM6ciBzj7J++myoJwhgeHl6V3WE0xZNPtqsB8cVghAuE1MtZFuSzVEF/na6WeU5M77sPkRk0xgXNPHxTjqwKebnVudHJ1c3RlZF9yb290WCCpQLne12IaKxBJfIRvRtx3eDl5eVUdcb7iwHqTGeaqRQ==",
+                ],
+            ),
+            ]{
+                // Ensure tree proofs match Go side.
+                for (i, k) in tc.1.iter().enumerate() {
+                    let proof = tree.get_proof(&keys[i]).expect("get proof works").expect("proof exists");
+                    assert_eq!(
+                        BASE64_STANDARD.encode(cbor::to_vec(proof.clone())),
+                        *k,
+                        "expected proof for keys[{}]",
+                        i
+                    );
+                    // Proof should verify.
+                    let pv = ProofVerifier;
+                    pv.verify_proof(roothash, &proof)
+                        .expect("verify proof should not fail with a valid proof");
+                }
+            };
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/sync/stats.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/sync/stats.rs.html new file mode 100644 index 0000000000..11e00e65f1 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/sync/stats.rs.html @@ -0,0 +1,101 @@ +stats.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
use std::any::Any;
+
+use anyhow::Result;
+
+use super::{GetPrefixesRequest, GetRequest, IterateRequest, ProofResponse, ReadSync};
+
+/// A proxy read syncer which keeps track of call statistics.
+pub struct StatsCollector {
+    /// Count of `sync_get` calls made to the underlying read syncer.
+    pub sync_get_count: usize,
+    /// Count of `sync_get_prefixes` calls made to the underlying read syncer.
+    pub sync_get_prefixes_count: usize,
+    /// Count of `sync_iterate` calls made to the underlying read syncer.
+    pub sync_iterate_count: usize,
+
+    rs: Box<dyn ReadSync>,
+}
+
+impl StatsCollector {
+    /// Construct a new instance, proxying to the given backing read syncer.
+    pub fn new(rs: Box<dyn ReadSync>) -> StatsCollector {
+        StatsCollector {
+            sync_get_count: 0,
+            sync_get_prefixes_count: 0,
+            sync_iterate_count: 0,
+            rs,
+        }
+    }
+}
+
+impl ReadSync for StatsCollector {
+    fn as_any(&self) -> &dyn Any {
+        self
+    }
+
+    fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse> {
+        self.sync_get_count += 1;
+        self.rs.sync_get(request)
+    }
+
+    fn sync_get_prefixes(&mut self, request: GetPrefixesRequest) -> Result<ProofResponse> {
+        self.sync_get_prefixes_count += 1;
+        self.rs.sync_get_prefixes(request)
+    }
+
+    fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse> {
+        self.sync_iterate_count += 1;
+        self.rs.sync_iterate(request)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/commit.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/commit.rs.html new file mode 100644 index 0000000000..0fafdec867 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/commit.rs.html @@ -0,0 +1,171 @@ +commit.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+
use anyhow::Result;
+
+use crate::{
+    common::{crypto::hash::Hash, namespace::Namespace},
+    storage::mkvs::{
+        cache::{Cache, LRUCache, UpdateList},
+        tree::{Node, NodeBox, NodeKind, NodePtrRef, Root, Tree},
+    },
+};
+
+impl Tree {
+    /// Commit tree updates to the underlying database and return
+    /// the write log and new merkle root.
+    pub fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash> {
+        let mut update_list: UpdateList<LRUCache> = UpdateList::new();
+        let pending_root = self.cache.borrow().get_pending_root();
+        let new_hash = _commit(pending_root, &mut update_list)?;
+
+        update_list.commit(&mut self.cache.borrow_mut());
+
+        self.cache.borrow_mut().set_sync_root(Root {
+            namespace,
+            version,
+            root_type: self.root_type,
+            hash: new_hash,
+        });
+
+        Ok(new_hash)
+    }
+}
+
+pub fn _commit<C: Cache>(ptr: NodePtrRef, update_list: &mut UpdateList<C>) -> Result<Hash> {
+    if ptr.borrow().clean {
+        return Ok(ptr.borrow().hash);
+    }
+
+    match classify_noderef!(? ptr.borrow().node) {
+        NodeKind::None => {
+            ptr.borrow_mut().hash = Hash::empty_hash();
+        }
+        NodeKind::Internal => {
+            let some_node_ref = ptr.borrow().get_node();
+            if some_node_ref.borrow().is_clean() {
+                ptr.borrow_mut().hash = some_node_ref.borrow().get_hash();
+            } else {
+                let int_leaf_node = noderef_as!(some_node_ref, Internal).leaf_node.clone();
+                let int_left = noderef_as!(some_node_ref, Internal).left.clone();
+                let int_right = noderef_as!(some_node_ref, Internal).right.clone();
+
+                _commit(int_leaf_node, update_list)?;
+                _commit(int_left, update_list)?;
+                _commit(int_right, update_list)?;
+
+                some_node_ref.borrow_mut().update_hash();
+                ptr.borrow_mut().hash = some_node_ref.borrow().get_hash();
+
+                update_list.push(Box::new(move |_| {
+                    noderef_as_mut!(some_node_ref, Internal).clean = true
+                }));
+            }
+        }
+        NodeKind::Leaf => {
+            let node_ref = ptr.borrow().get_node();
+            if node_ref.borrow().is_clean() {
+                ptr.borrow_mut().hash = node_ref.borrow().get_hash();
+            } else {
+                node_ref.borrow_mut().update_hash();
+                ptr.borrow_mut().hash = node_ref.borrow().get_hash();
+
+                update_list.push(Box::new(move |_| {
+                    noderef_as_mut!(node_ref, Leaf).clean = true
+                }));
+            }
+        }
+    };
+
+    let closure_ptr = ptr.clone();
+    update_list.push(Box::new(move |cache| {
+        closure_ptr.borrow_mut().clean = true;
+        // Make node eligible for eviction.
+        cache.commit_node(closure_ptr.clone());
+    }));
+
+    Ok(ptr.borrow().hash)
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/errors.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/errors.rs.html new file mode 100644 index 0000000000..0abfc7774e --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/errors.rs.html @@ -0,0 +1,19 @@ +errors.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+
use thiserror::Error;
+
+#[derive(Error, Debug)]
+pub enum TreeError {
+    #[error("mkvs: malformed node")]
+    MalformedNode,
+    #[error("mkvs: malformed key")]
+    MalformedKey,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/insert.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/insert.rs.html new file mode 100644 index 0000000000..5b60d188a3 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/insert.rs.html @@ -0,0 +1,477 @@ +insert.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+
use std::mem;
+
+use anyhow::{anyhow, Result};
+
+use crate::storage::mkvs::{
+    cache::Cache,
+    tree::{Depth, Key, KeyTrait, NodeBox, NodeKind, NodePointer, NodePtrRef, Tree, Value},
+};
+
+use super::lookup::FetcherSyncGet;
+
+impl Tree {
+    /// Insert a key/value pair into the tree.
+    pub fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>> {
+        let pending_root = self.cache.borrow().get_pending_root();
+        let boxed_key = key.to_vec();
+        let boxed_val = value.to_vec();
+
+        // Remember where the path from root to target node ends (will end).
+        self.cache.borrow_mut().mark_position();
+
+        let (new_root, old_val) = self._insert(pending_root, 0, &boxed_key, boxed_val)?;
+        self.cache.borrow_mut().set_pending_root(new_root);
+
+        Ok(old_val)
+    }
+
+    fn _insert(
+        &mut self,
+        ptr: NodePtrRef,
+        bit_depth: Depth,
+        key: &Key,
+        val: Value,
+    ) -> Result<(NodePtrRef, Option<Value>)> {
+        let node_ref = self
+            .cache
+            .borrow_mut()
+            .deref_node_ptr(ptr.clone(), Some(FetcherSyncGet::new(key, false)))?;
+
+        let (_, key_remainder) = key.split(bit_depth, key.bit_length());
+
+        match classify_noderef!(?node_ref) {
+            NodeKind::None => {
+                return Ok((self.cache.borrow_mut().new_leaf_node(key, val), None));
+            }
+            NodeKind::Internal => {
+                let node_ref = node_ref.unwrap();
+                let (leaf_node, left, right): (NodePtrRef, NodePtrRef, NodePtrRef);
+                let cp_len: Depth;
+                let label_prefix: Key;
+                if let NodeBox::Internal(ref mut n) = *node_ref.borrow_mut() {
+                    cp_len = n.label.common_prefix_len(
+                        n.label_bit_length,
+                        &key_remainder,
+                        key.bit_length() - bit_depth,
+                    );
+
+                    if cp_len == n.label_bit_length {
+                        // The current part of key matched the node's Label. Do recursion.
+                        let r: (NodePtrRef, Option<Value>);
+                        if key.bit_length() == bit_depth + n.label_bit_length {
+                            // Key to insert ends exactly at this node. Add it to the
+                            // existing internal node as LeafNode.
+                            r = self._insert(
+                                n.leaf_node.clone(),
+                                bit_depth + n.label_bit_length,
+                                key,
+                                val,
+                            )?;
+                            n.leaf_node = r.0;
+                        } else if key.get_bit(bit_depth + n.label_bit_length) {
+                            // Insert recursively based on the bit value.
+                            r = self._insert(
+                                n.right.clone(),
+                                bit_depth + n.label_bit_length,
+                                key,
+                                val,
+                            )?;
+                            n.right = r.0;
+                        } else {
+                            r = self._insert(
+                                n.left.clone(),
+                                bit_depth + n.label_bit_length,
+                                key,
+                                val,
+                            )?;
+                            n.left = r.0;
+                        }
+
+                        if !n.leaf_node.borrow().clean
+                            || !n.left.borrow().clean
+                            || !n.right.borrow().clean
+                        {
+                            n.clean = false;
+                            ptr.borrow_mut().clean = false;
+                            // No longer eligible for eviction as it is dirty.
+                            self.cache
+                                .borrow_mut()
+                                .rollback_node(ptr.clone(), NodeKind::Internal);
+                        }
+
+                        return Ok((ptr, r.1));
+                    }
+
+                    // Key mismatches the label at position cp_len. Split the edge and
+                    // insert new leaf.
+                    let label_split = n.label.split(cp_len, n.label_bit_length);
+                    label_prefix = label_split.0;
+                    n.label = label_split.1;
+                    n.label_bit_length -= cp_len;
+                    n.clean = false;
+                    ptr.borrow_mut().clean = false;
+                    // No longer eligible for eviction as it is dirty.
+                    self.cache
+                        .borrow_mut()
+                        .rollback_node(ptr.clone(), NodeKind::Internal);
+
+                    let new_leaf = self.cache.borrow_mut().new_leaf_node(key, val);
+                    if key.bit_length() - bit_depth == cp_len {
+                        // The key is a prefix of existing path.
+                        leaf_node = new_leaf;
+                        if n.label.get_bit(0) {
+                            left = NodePointer::null_ptr();
+                            right = ptr;
+                        } else {
+                            left = ptr;
+                            right = NodePointer::null_ptr();
+                        }
+                    } else {
+                        leaf_node = NodePointer::null_ptr();
+                        if key_remainder.get_bit(cp_len) {
+                            left = ptr;
+                            right = new_leaf;
+                        } else {
+                            left = new_leaf;
+                            right = ptr;
+                        }
+                    }
+                } else {
+                    return Err(anyhow!(
+                        "insert.rs: unknown internal node_ref {:?}",
+                        node_ref
+                    ));
+                }
+
+                return Ok((
+                    self.cache.borrow_mut().new_internal_node(
+                        &label_prefix,
+                        cp_len,
+                        leaf_node,
+                        left,
+                        right,
+                    ),
+                    None,
+                ));
+            }
+            NodeKind::Leaf => {
+                // If the key matches, we can just update the value.
+                let node_ref = node_ref.unwrap();
+                let (leaf_node, left, right): (NodePtrRef, NodePtrRef, NodePtrRef);
+                let cp_len: Depth;
+                let label_prefix: Key;
+                if let NodeBox::Leaf(ref mut n) = *node_ref.borrow_mut() {
+                    // Should always succeed.
+                    if n.key == *key {
+                        // If the key matches, we can just update the value.
+                        if n.value == val {
+                            return Ok((ptr, Some(val)));
+                        }
+                        let old_val = mem::replace(&mut n.value, val);
+                        n.clean = false;
+                        ptr.borrow_mut().clean = false;
+                        // No longer eligible for eviction as it is dirty.
+                        self.cache
+                            .borrow_mut()
+                            .rollback_node(ptr.clone(), NodeKind::Leaf);
+                        return Ok((ptr, Some(old_val)));
+                    }
+
+                    let (_, leaf_key_remainder) = n.key.split(bit_depth, n.key.bit_length());
+                    cp_len = leaf_key_remainder.common_prefix_len(
+                        n.key.bit_length() - bit_depth,
+                        &key_remainder,
+                        key.bit_length() - bit_depth,
+                    );
+
+                    // Key mismatches the label at position cp_len. Split the edge.
+                    label_prefix = leaf_key_remainder
+                        .split(cp_len, leaf_key_remainder.bit_length())
+                        .0;
+                    let new_leaf = self.cache.borrow_mut().new_leaf_node(key, val);
+
+                    if key.bit_length() - bit_depth == cp_len {
+                        // Inserted key is a prefix of the label.
+                        leaf_node = new_leaf;
+                        if leaf_key_remainder.get_bit(cp_len) {
+                            left = NodePointer::null_ptr();
+                            right = ptr;
+                        } else {
+                            left = ptr;
+                            right = NodePointer::null_ptr();
+                        }
+                    } else if n.key.bit_length() - bit_depth == cp_len {
+                        // Label is a prefix of the inserted key.
+                        leaf_node = ptr;
+                        if key_remainder.get_bit(cp_len) {
+                            left = NodePointer::null_ptr();
+                            right = new_leaf;
+                        } else {
+                            left = new_leaf;
+                            right = NodePointer::null_ptr();
+                        }
+                    } else {
+                        leaf_node = NodePointer::null_ptr();
+                        if key_remainder.get_bit(cp_len) {
+                            left = ptr;
+                            right = new_leaf;
+                        } else {
+                            left = new_leaf;
+                            right = ptr;
+                        }
+                    }
+                } else {
+                    return Err(anyhow!("insert.rs: invalid leaf node_ref {:?}", node_ref));
+                }
+
+                let new_internal = self.cache.borrow_mut().new_internal_node(
+                    &label_prefix,
+                    cp_len,
+                    leaf_node,
+                    left,
+                    right,
+                );
+                Ok((new_internal, None))
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/iterator.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/iterator.rs.html new file mode 100644 index 0000000000..7bef25b702 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/iterator.rs.html @@ -0,0 +1,1275 @@ +iterator.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+
//! Tree iterator.
+use std::{collections::VecDeque, fmt};
+
+use anyhow::{Error, Result};
+
+use crate::storage::mkvs::{
+    self,
+    cache::{Cache, ReadSyncFetcher},
+    sync::{IterateRequest, Proof, ReadSync, TreeID},
+    tree::{Depth, Key, KeyTrait, NodeBox, NodeKind, NodePtrRef, Root, Tree},
+};
+
+pub(super) struct FetcherSyncIterate<'a> {
+    key: &'a Key,
+    prefetch: usize,
+}
+
+impl<'a> FetcherSyncIterate<'a> {
+    pub(super) fn new(key: &'a Key, prefetch: usize) -> Self {
+        Self { key, prefetch }
+    }
+}
+
+impl<'a> ReadSyncFetcher for FetcherSyncIterate<'a> {
+    fn fetch(&self, root: Root, ptr: NodePtrRef, rs: &mut Box<dyn ReadSync>) -> Result<Proof> {
+        let rsp = rs.sync_iterate(IterateRequest {
+            tree: TreeID {
+                root,
+                position: ptr.borrow().hash,
+            },
+            key: self.key.clone(),
+            prefetch: self.prefetch as u16,
+        })?;
+        Ok(rsp.proof)
+    }
+}
+
+/// Visit state of a node.
+#[derive(Debug, PartialEq)]
+enum VisitState {
+    Before,
+    At,
+    AtLeft,
+    After,
+}
+
+/// Atom in the current iterator path. Can be used to resume iteration
+/// from a given position.
+struct PathAtom {
+    ptr: NodePtrRef,
+    bit_depth: Depth,
+    path: Key,
+    state: VisitState,
+}
+
+impl fmt::Debug for PathAtom {
+    fn fmt(&self, f: &mut fmt::Formatter) -> std::result::Result<(), fmt::Error> {
+        f.debug_struct("PathAtom")
+            .field("bit_depth", &self.bit_depth)
+            .field("path", &self.path)
+            .field("state", &self.state)
+            .finish()
+    }
+}
+
+/// Tree iterator.
+pub struct TreeIterator<'tree> {
+    tree: &'tree Tree,
+    prefetch: usize,
+    pos: VecDeque<PathAtom>,
+    key: Option<Key>,
+    value: Option<Vec<u8>>,
+    error: Option<Error>,
+}
+
+impl<'tree> TreeIterator<'tree> {
+    /// Create a new tree iterator.
+    fn new(tree: &'tree Tree) -> Self {
+        Self {
+            tree,
+            prefetch: 0,
+            pos: VecDeque::new(),
+            key: None,
+            value: None,
+            error: None,
+        }
+    }
+
+    fn reset(&mut self) {
+        self.pos.clear();
+        self.key = None;
+        self.value = None;
+    }
+
+    fn next(&mut self) {
+        if self.error.is_some() {
+            return;
+        }
+
+        while !self.pos.is_empty() {
+            // Start where we left off.
+            let atom = self.pos.pop_front().expect("not empty");
+            let mut remainder = std::mem::take(&mut self.pos);
+
+            // Remember where the path from root to target node ends (will end).
+            let mut cache = self.tree.cache.borrow_mut();
+            cache.mark_position();
+            for atom in &remainder {
+                cache.use_node(atom.ptr.clone());
+            }
+            drop(cache);
+
+            // Try to proceed with the current node. If we don't succeed, proceed to the
+            // next node.
+            let key = self.key.take().expect("iterator is valid");
+            self.reset();
+            if let Err(error) =
+                self._next(atom.ptr, atom.bit_depth, atom.path, key.clone(), atom.state)
+            {
+                self.error = Some(error);
+                self.reset();
+                return;
+            }
+            if self.key.is_some() {
+                // Key has been found.
+                self.pos.append(&mut remainder);
+                return;
+            }
+
+            self.key = Some(key);
+            self.pos = remainder;
+        }
+
+        // We have reached the end of the tree, make sure everything is reset.
+        self.key = None;
+        self.value = None;
+    }
+
+    fn _next(
+        &mut self,
+        ptr: NodePtrRef,
+        bit_depth: Depth,
+        path: Key,
+        mut key: Key,
+        mut state: VisitState,
+    ) -> Result<()> {
+        let node_ref = self.tree.cache.borrow_mut().deref_node_ptr(
+            ptr.clone(),
+            Some(FetcherSyncIterate::new(&key, self.prefetch)),
+        )?;
+
+        match classify_noderef!(?node_ref) {
+            NodeKind::None => {
+                // Reached a nil node, there is nothing here.
+                Ok(())
+            }
+            NodeKind::Internal => {
+                let node_ref = node_ref.unwrap();
+                if let NodeBox::Internal(ref n) = *node_ref.borrow() {
+                    // Internal node.
+                    let bit_length = bit_depth + n.label_bit_length;
+                    let new_path = path.merge(bit_depth, &n.label, n.label_bit_length);
+
+                    // Check if the key is longer than the current path but lexicographically smaller. In this
+                    // case everything in this subtree will be larger so we need to take the first value.
+                    let take_first =
+                        bit_length > 0 && key.bit_length() >= bit_length && key < new_path;
+
+                    // Does lookup key end here? Look into LeafNode.
+                    if (state == VisitState::Before
+                        && (key.bit_length() <= bit_length || take_first))
+                        || state == VisitState::At
+                    {
+                        if state == VisitState::Before {
+                            self._next(
+                                n.leaf_node.clone(),
+                                bit_length,
+                                path.clone(),
+                                key.clone(),
+                                VisitState::Before,
+                            )?;
+                            if self.key.is_some() {
+                                // Key has been found.
+                                self.pos.push_back(PathAtom {
+                                    ptr,
+                                    bit_depth,
+                                    path,
+                                    state: VisitState::At,
+                                });
+                                return Ok(());
+                            }
+                        }
+                        // Key has not been found, continue with search for next key.
+                        if key.bit_length() <= bit_length {
+                            key = key.append_bit(bit_length, false);
+                        }
+                    }
+
+                    if state == VisitState::Before {
+                        state = VisitState::At;
+                    }
+
+                    // Continue recursively based on a bit value.
+                    if (state == VisitState::At && (!key.get_bit(bit_length) || take_first))
+                        || state == VisitState::AtLeft
+                    {
+                        if state == VisitState::At {
+                            self._next(
+                                n.left.clone(),
+                                bit_length,
+                                new_path.append_bit(bit_length, false),
+                                key.clone(),
+                                VisitState::Before,
+                            )?;
+                            if self.key.is_some() {
+                                // Key has been found.
+                                self.pos.push_back(PathAtom {
+                                    ptr,
+                                    bit_depth,
+                                    path,
+                                    state: VisitState::AtLeft,
+                                });
+                                return Ok(());
+                            }
+                        }
+                        // Key has not been found, continue with search for next key.
+                        key = key.split(bit_length, key.bit_length()).0;
+                        key = key.append_bit(bit_length, true);
+                    }
+
+                    if state == VisitState::At || state == VisitState::AtLeft {
+                        self._next(
+                            n.right.clone(),
+                            bit_length,
+                            new_path.append_bit(bit_length, true),
+                            key,
+                            VisitState::Before,
+                        )?;
+                        if self.key.is_some() {
+                            // Key has been found.
+                            self.pos.push_back(PathAtom {
+                                ptr,
+                                bit_depth,
+                                path,
+                                state: VisitState::After,
+                            });
+                            return Ok(());
+                        }
+                    }
+
+                    return Ok(());
+                }
+
+                unreachable!("node kind is internal node");
+            }
+            NodeKind::Leaf => {
+                // Reached a leaf node.
+                let node_ref = node_ref.unwrap();
+                if let NodeBox::Leaf(ref n) = *node_ref.borrow() {
+                    if n.key >= key {
+                        self.key = Some(n.key.clone());
+                        self.value = Some(n.value.clone());
+                    }
+                } else {
+                    unreachable!("node kind is leaf node");
+                }
+
+                Ok(())
+            }
+        }
+    }
+}
+
+impl<'tree> Iterator for TreeIterator<'tree> {
+    type Item = (Vec<u8>, Vec<u8>);
+
+    fn next(&mut self) -> Option<Self::Item> {
+        use mkvs::Iterator;
+
+        if !self.is_valid() {
+            return None;
+        }
+
+        let key = self.key.as_ref().expect("iterator is valid").clone();
+        let value = self.value.as_ref().expect("iterator is valid").clone();
+        TreeIterator::next(self);
+
+        Some((key, value))
+    }
+}
+
+impl<'tree> mkvs::Iterator for TreeIterator<'tree> {
+    fn set_prefetch(&mut self, prefetch: usize) {
+        self.prefetch = prefetch;
+    }
+
+    fn is_valid(&self) -> bool {
+        self.key.is_some()
+    }
+
+    fn error(&self) -> &Option<Error> {
+        &self.error
+    }
+
+    fn rewind(&mut self) {
+        self.seek(&[])
+    }
+
+    fn seek(&mut self, key: &[u8]) {
+        if self.error.is_some() {
+            return;
+        }
+
+        self.reset();
+        let pending_root = self.tree.cache.borrow().get_pending_root();
+        if let Err(error) = self._next(
+            pending_root,
+            0,
+            Key::new(),
+            key.to_vec(),
+            VisitState::Before,
+        ) {
+            self.error = Some(error);
+            self.reset();
+        }
+    }
+
+    fn get_key(&self) -> &Option<Key> {
+        &self.key
+    }
+
+    fn get_value(&self) -> &Option<Vec<u8>> {
+        &self.value
+    }
+
+    fn next(&mut self) {
+        TreeIterator::next(self)
+    }
+}
+
+impl Tree {
+    /// Return an iterator over the tree.
+    pub fn iter(&self) -> TreeIterator {
+        TreeIterator::new(self)
+    }
+}
+
+#[cfg(test)]
+pub(super) mod test {
+    use std::iter;
+
+    use rustc_hex::FromHex;
+
+    use super::{super::tree_test::generate_key_value_pairs_ex, *};
+    use crate::storage::mkvs::{
+        interop::{Driver, ProtocolServer},
+        sync::{NoopReadSyncer, StatsCollector},
+        Iterator, OverlayTree, RootType,
+    };
+
+    #[test]
+    fn test_iterator() {
+        let server = ProtocolServer::new(None);
+
+        let mut tree = Tree::builder()
+            .with_root_type(RootType::State)
+            .build(Box::new(NoopReadSyncer));
+
+        // Test with an empty tree.
+        let mut it = tree.iter();
+        it.rewind();
+        assert!(
+            !it.is_valid(),
+            "iterator should be invalid on an empty tree"
+        );
+
+        // Test with one item.
+        tree.insert(b"key", b"first").unwrap();
+        let mut it = tree.iter();
+        it.rewind();
+        assert!(
+            it.is_valid(),
+            "iterator should be valid on a non-empty tree"
+        );
+
+        // Insert some items.
+        let items = vec![
+            (b"key".to_vec(), b"first".to_vec()),
+            (b"key 1".to_vec(), b"one".to_vec()),
+            (b"key 2".to_vec(), b"two".to_vec()),
+            (b"key 5".to_vec(), b"five".to_vec()),
+            (b"key 8".to_vec(), b"eight".to_vec()),
+            (b"key 9".to_vec(), b"nine".to_vec()),
+        ];
+        for (key, value) in items.iter() {
+            tree.insert(key, value).unwrap();
+        }
+
+        let tests = vec![
+            (b"k".to_vec(), 0),
+            (b"key 1".to_vec(), 1),
+            (b"key 3".to_vec(), 3),
+            (b"key 4".to_vec(), 3),
+            (b"key 5".to_vec(), 3),
+            (b"key 6".to_vec(), 4),
+            (b"key 7".to_vec(), 4),
+            (b"key 8".to_vec(), 4),
+            (b"key 9".to_vec(), 5),
+            (b"key A".to_vec(), -1),
+        ];
+
+        // Direct.
+        let it = tree.iter();
+        test_iterator_with(&items, it, &tests);
+
+        // Remote.
+        let hash = tree.commit(Default::default(), 0).expect("commit");
+        let write_log = items
+            .iter()
+            .cloned()
+            .map(|(key, value)| mkvs::LogEntry {
+                key,
+                value: Some(value),
+            })
+            .collect();
+        server.apply(&write_log, hash, Default::default(), 0);
+
+        let remote_tree = Tree::builder()
+            .with_capacity(0, 0)
+            .with_root(Root {
+                root_type: RootType::State,
+                hash,
+                ..Default::default()
+            })
+            .build(server.read_sync());
+
+        let it = remote_tree.iter();
+        test_iterator_with(&items, it, &tests);
+
+        // Remote with prefetch (10).
+        let stats = StatsCollector::new(server.read_sync());
+        let remote_tree = Tree::builder()
+            .with_capacity(0, 0)
+            .with_root(Root {
+                root_type: RootType::State,
+                hash,
+                ..Default::default()
+            })
+            .build(Box::new(stats));
+
+        let mut it = remote_tree.iter();
+        it.set_prefetch(10);
+        test_iterator_with(&items, it, &tests);
+
+        let cache = remote_tree.cache.borrow();
+        let stats = cache
+            .get_read_syncer()
+            .as_any()
+            .downcast_ref::<StatsCollector>()
+            .expect("stats");
+        assert_eq!(0, stats.sync_get_count, "sync_get_count");
+        assert_eq!(0, stats.sync_get_prefixes_count, "sync_get_prefixes_count");
+        assert_eq!(1, stats.sync_iterate_count, "sync_iterate_count");
+
+        // Remote with prefetch (3).
+        let stats = StatsCollector::new(server.read_sync());
+        let remote_tree = Tree::builder()
+            .with_capacity(0, 0)
+            .with_root(Root {
+                root_type: RootType::State,
+                hash,
+                ..Default::default()
+            })
+            .build(Box::new(stats));
+
+        let mut it = remote_tree.iter();
+        it.set_prefetch(3);
+        test_iterator_with(&items, it, &tests);
+
+        let cache = remote_tree.cache.borrow();
+        let stats = cache
+            .get_read_syncer()
+            .as_any()
+            .downcast_ref::<StatsCollector>()
+            .expect("stats");
+        assert_eq!(0, stats.sync_get_count, "sync_get_count");
+        assert_eq!(0, stats.sync_get_prefixes_count, "sync_get_prefixes_count");
+        assert_eq!(2, stats.sync_iterate_count, "sync_iterate_count");
+    }
+
+    #[test]
+    fn test_iterator_case1() {
+        let mut tree = Tree::builder()
+            .with_root_type(RootType::State)
+            .build(Box::new(NoopReadSyncer));
+
+        let items = vec![
+            (b"key 5".to_vec(), b"fivey".to_vec()),
+            (b"key 7".to_vec(), b"seven".to_vec()),
+        ];
+        for (key, value) in items.iter() {
+            tree.insert(key, value).unwrap();
+        }
+
+        let tests = vec![(b"key 3".to_vec(), 0)];
+
+        let it = tree.iter();
+        test_iterator_with(&items, it, &tests);
+    }
+
+    #[test]
+    fn test_iterator_case2() {
+        let mut tree = Tree::builder()
+            .with_root_type(RootType::State)
+            .build(Box::new(NoopReadSyncer));
+
+        let items: Vec<(Vec<u8>, Vec<u8>)> = vec![
+            (
+                "54dcb497eb46bc7cb1a1a29d143d5d41f1a684c97e12f2ae536eceb828c15fc34c02"
+                    .from_hex()
+                    .unwrap(),
+                b"value".to_vec(),
+            ),
+            (
+                "54dcb497eb46bc7cb1a1a29d143d5d41f1a684c97e12f2ae536eceb828c15fc34c02"
+                    .from_hex()
+                    .unwrap(),
+                b"value".to_vec(),
+            ),
+        ];
+        for (key, value) in items.iter() {
+            tree.insert(key, value).unwrap();
+        }
+
+        let mut it = tree.iter();
+        let missing_key: Vec<u8> =
+            "54da85be3251772db943cba67341d402117c87ada2a9e8aad7171d40b6b4dc9fbc"
+                .from_hex()
+                .unwrap();
+        it.seek(&missing_key);
+        assert!(it.is_valid(), "iterator should be valid");
+        let item = iter::Iterator::next(&mut it);
+        assert_eq!(
+            Some((items[0].0.clone(), b"value".to_vec())),
+            item,
+            "value should be correct"
+        );
+    }
+
+    #[test]
+    fn test_iterator_eviction() {
+        let server = ProtocolServer::new(None);
+
+        let mut tree = OverlayTree::new(
+            Tree::builder()
+                .with_capacity(0, 0)
+                .with_root_type(RootType::State)
+                .build(Box::new(NoopReadSyncer)),
+        );
+
+        let (keys, values) = generate_key_value_pairs_ex("T".to_owned(), 100);
+        let items: Vec<(Vec<u8>, Vec<u8>)> = keys.into_iter().zip(values.into_iter()).collect();
+        for (key, value) in &items {
+            tree.insert(&key, &value).unwrap();
+        }
+
+        let (write_log, hash) = tree.commit_both(Default::default(), 0).expect("commit");
+        server.apply(&write_log, hash, Default::default(), 0);
+
+        // Create a remote tree with limited cache capacity so that nodes will
+        // be evicted while iterating.
+        let stats = StatsCollector::new(server.read_sync());
+        let remote_tree = Tree::builder()
+            .with_capacity(50, 16 * 1024 * 1024)
+            .with_root(Root {
+                root_type: RootType::State,
+                hash,
+                ..Default::default()
+            })
+            .build(Box::new(stats));
+
+        let mut it = remote_tree.iter();
+        it.set_prefetch(1000);
+        test_iterator_with(&items, it, &vec![]);
+
+        let cache = remote_tree.cache.borrow();
+        let stats = cache
+            .get_read_syncer()
+            .as_any()
+            .downcast_ref::<StatsCollector>()
+            .expect("stats");
+        assert_eq!(0, stats.sync_get_count, "sync_get_count");
+        assert_eq!(0, stats.sync_get_prefixes_count, "sync_get_prefixes_count");
+        // We require multiple fetches as we can only store a limited amount of
+        // results per fetch due to the cache being too small.
+        assert_eq!(2, stats.sync_iterate_count, "sync_iterate_count");
+    }
+
+    pub(in super::super) fn test_iterator_with<I: mkvs::Iterator>(
+        items: &[(Vec<u8>, Vec<u8>)],
+        mut it: I,
+        tests: &[(Vec<u8>, isize)],
+    ) {
+        // Iterate through the whole tree.
+        let mut iterations = 0;
+        it.rewind();
+        for (idx, (key, value)) in it.by_ref().enumerate() {
+            if !tests.is_empty() {
+                assert_eq!(items[idx].0, key, "iterator should have the correct key");
+                assert_eq!(
+                    items[idx].1, value,
+                    "iterator should have the correct value"
+                );
+            }
+            iterations += 1;
+        }
+        assert!(it.error().is_none(), "iterator should not error");
+        assert_eq!(iterations, items.len(), "iterator should go over all items");
+
+        for (seek, pos) in tests {
+            it.seek(&seek);
+            if *pos == -1 {
+                assert!(!it.is_valid(), "iterator should not be valid after seek");
+                continue;
+            }
+
+            for expected in &items[*pos as usize..] {
+                let item = iter::Iterator::next(&mut it);
+                assert_eq!(
+                    Some(expected.clone()),
+                    item,
+                    "iterator should have the correct item"
+                );
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/lookup.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/lookup.rs.html new file mode 100644 index 0000000000..5d066a37a9 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/lookup.rs.html @@ -0,0 +1,317 @@ +lookup.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+
use anyhow::Result;
+
+use crate::storage::mkvs::{
+    cache::{Cache, ReadSyncFetcher},
+    sync::{GetRequest, Proof, ProofBuilder, ReadSync, TreeID},
+    tree::{Depth, Key, KeyTrait, NodeBox, NodeKind, NodePtrRef, Root, Tree, Value},
+};
+
+pub(super) struct FetcherSyncGet<'a> {
+    key: &'a Key,
+    include_siblings: bool,
+}
+
+impl<'a> FetcherSyncGet<'a> {
+    pub(super) fn new(key: &'a Key, include_siblings: bool) -> Self {
+        Self {
+            key,
+            include_siblings,
+        }
+    }
+}
+
+impl<'a> ReadSyncFetcher for FetcherSyncGet<'a> {
+    fn fetch(&self, root: Root, ptr: NodePtrRef, rs: &mut Box<dyn ReadSync>) -> Result<Proof> {
+        let rsp = rs.sync_get(GetRequest {
+            tree: TreeID {
+                root,
+                position: ptr.borrow().hash,
+            },
+            key: self.key.clone(),
+            include_siblings: self.include_siblings,
+        })?;
+        Ok(rsp.proof)
+    }
+}
+
+impl Tree {
+    /// Get an existing key.
+    pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        self._get_top(key, false)
+    }
+
+    pub fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>> {
+        let boxed_key = key.to_vec();
+        let pending_root = self.cache.borrow().get_pending_root();
+
+        // Remember where the path from root to target node ends (will end).
+        self.cache.borrow_mut().mark_position();
+
+        let mut proof_builder = ProofBuilder::new(pending_root.as_ref().borrow().hash);
+
+        let result = self._get(pending_root, 0, &boxed_key, false, Some(&mut proof_builder))?;
+        match result {
+            Some(_) => Ok(Some(proof_builder.build())),
+            None => Ok(None),
+        }
+    }
+
+    /// Check if the key exists in the local cache.
+    pub fn cache_contains_key(&self, key: &[u8]) -> bool {
+        match self._get_top(key, true) {
+            Ok(Some(_)) => true,
+            Ok(None) => false,
+            Err(_) => false,
+        }
+    }
+
+    fn _get_top(&self, key: &[u8], check_only: bool) -> Result<Option<Vec<u8>>> {
+        let boxed_key = key.to_vec();
+        let pending_root = self.cache.borrow().get_pending_root();
+
+        // Remember where the path from root to target node ends (will end).
+        self.cache.borrow_mut().mark_position();
+
+        self._get(pending_root, 0, &boxed_key, check_only, None)
+    }
+
+    fn _get(
+        &self,
+        ptr: NodePtrRef,
+        bit_depth: Depth,
+        key: &Key,
+        check_only: bool,
+        mut proof_builder: Option<&mut ProofBuilder>,
+    ) -> Result<Option<Value>> {
+        let node_ref = self.cache.borrow_mut().deref_node_ptr(
+            ptr,
+            if check_only {
+                None
+            } else {
+                Some(FetcherSyncGet::new(key, false))
+            },
+        )?;
+
+        // Include nodes in proof if we have a proof builder.
+        if let (Some(pb), Some(node_ref)) = (proof_builder.as_mut(), &node_ref) {
+            pb.include(&node_ref.borrow());
+        }
+
+        match classify_noderef!(?node_ref) {
+            NodeKind::None => {
+                // Reached a nil node, there is nothing here.
+                Ok(None)
+            }
+            NodeKind::Internal => {
+                let node_ref = node_ref.unwrap();
+                if let NodeBox::Internal(ref mut n) = *node_ref.borrow_mut() {
+                    // Internal node.
+                    // Does lookup key end here? Look into LeafNode.
+                    if key.bit_length() == bit_depth + n.label_bit_length {
+                        return self._get(
+                            n.leaf_node.clone(),
+                            bit_depth + n.label_bit_length,
+                            key,
+                            check_only,
+                            proof_builder,
+                        );
+                    }
+
+                    // Lookup key is too short for the current n.Label. It's not stored.
+                    if key.bit_length() < bit_depth + n.label_bit_length {
+                        return Ok(None);
+                    }
+
+                    // Continue recursively based on a bit value.
+                    if key.get_bit(bit_depth + n.label_bit_length) {
+                        return self._get(
+                            n.right.clone(),
+                            bit_depth + n.label_bit_length,
+                            key,
+                            check_only,
+                            proof_builder,
+                        );
+                    } else {
+                        return self._get(
+                            n.left.clone(),
+                            bit_depth + n.label_bit_length,
+                            key,
+                            check_only,
+                            proof_builder,
+                        );
+                    }
+                }
+
+                unreachable!("node kind is internal node");
+            }
+            NodeKind::Leaf => {
+                // Reached a leaf node, check if key matches.
+                let node_ref = node_ref.unwrap();
+                if noderef_as!(node_ref, Leaf).key == *key {
+                    Ok(Some(noderef_as!(node_ref, Leaf).value.clone()))
+                } else {
+                    Ok(None)
+                }
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/macros.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/macros.rs.html new file mode 100644 index 0000000000..dd99f1e4b6 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/macros.rs.html @@ -0,0 +1,77 @@ +macros.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+
#[macro_export]
+macro_rules! classify_noderef {
+    (? $e:expr) => {{
+        let kind = match $e {
+            None => NodeKind::None,
+            Some(ref node) => classify_noderef!(node),
+        };
+        kind
+    }};
+    ($e:expr) => {{
+        // Ensure references don't leak outside this macro.
+        let kind = match *$e.borrow() {
+            NodeBox::Internal(_) => NodeKind::Internal,
+            NodeBox::Leaf(_) => NodeKind::Leaf,
+        };
+        kind
+    }};
+}
+
+#[macro_export]
+macro_rules! noderef_as {
+    ($ref:expr, $type:ident) => {
+        match *$ref.borrow() {
+            NodeBox::$type(ref deref) => deref,
+            _ => unreachable!(),
+        }
+    };
+}
+
+#[macro_export]
+macro_rules! noderef_as_mut {
+    ($ref:expr, $type:ident) => {
+        match *$ref.borrow_mut() {
+            NodeBox::$type(ref mut deref) => deref,
+            _ => unreachable!(),
+        }
+    };
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/marshal.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/marshal.rs.html new file mode 100644 index 0000000000..ea25961a95 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/marshal.rs.html @@ -0,0 +1,587 @@ +marshal.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+
use std::{cell::RefCell, mem::size_of, rc::Rc};
+
+use anyhow::Result;
+
+use crate::{
+    common::crypto::hash::Hash,
+    storage::mkvs::{
+        marshal::Marshal,
+        tree::{
+            Depth, DepthTrait, InternalNode, Key, LeafNode, Node, NodeBox, NodeKind, NodePointer,
+            TreeError, Value,
+        },
+    },
+};
+
+/// Size of the encoded value length.
+const VALUE_LENGTH_SIZE: usize = size_of::<u32>();
+
+impl NodeBox {
+    pub fn compact_marshal_binary(&self, v: u16) -> Result<Vec<u8>> {
+        match self {
+            NodeBox::Internal(ref n) => n.compact_marshal_binary(v),
+            NodeBox::Leaf(ref n) => n.compact_marshal_binary(),
+        }
+    }
+}
+
+impl InternalNode {
+    pub fn compact_marshal_binary(&self, v: u16) -> Result<Vec<u8>> {
+        match v {
+            0 => {
+                // In version 0 of compact serialization, leaf node is included in the internal
+                // nodes serialization.
+                let leaf_node_binary = if self.leaf_node.borrow().is_null() {
+                    vec![NodeKind::None as u8]
+                } else {
+                    noderef_as!(self.leaf_node.borrow().get_node(), Leaf).marshal_binary()?
+                };
+
+                let mut result: Vec<u8> = Vec::with_capacity(
+                    1 + size_of::<u16>() + self.label.len() + leaf_node_binary.len(),
+                );
+                result.push(NodeKind::Internal as u8);
+                result.append(&mut self.label_bit_length.marshal_binary()?);
+                result.extend_from_slice(&self.label);
+                result.extend_from_slice(leaf_node_binary.as_ref());
+
+                Ok(result)
+            }
+            1 => {
+                // In version 1 of compact serialization, leaf node is not included.
+                let mut result: Vec<u8> =
+                    Vec::with_capacity(1 + size_of::<u16>() + self.label.len() + 1);
+                result.push(NodeKind::Internal as u8);
+                result.append(&mut self.label_bit_length.marshal_binary()?);
+                result.extend_from_slice(&self.label);
+                result.push(NodeKind::None as u8);
+
+                Ok(result)
+            }
+            _ => panic!("unsupported compact serialization version: {:?}", v),
+        }
+    }
+}
+
+impl Marshal for NodeBox {
+    fn marshal_binary(&self) -> Result<Vec<u8>> {
+        match self {
+            NodeBox::Internal(ref n) => n.marshal_binary(),
+            NodeBox::Leaf(ref n) => n.marshal_binary(),
+        }
+    }
+
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize> {
+        if data.is_empty() {
+            Err(TreeError::MalformedNode.into())
+        } else {
+            let mut kind = NodeKind::None;
+            kind.unmarshal_binary(data)?;
+            match kind {
+                NodeKind::Internal => {
+                    *self = NodeBox::Internal(InternalNode {
+                        ..Default::default()
+                    });
+                }
+                NodeKind::Leaf => {
+                    *self = NodeBox::Leaf(LeafNode {
+                        ..Default::default()
+                    });
+                }
+                _ => {
+                    return Err(TreeError::MalformedNode.into());
+                }
+            };
+            match self {
+                NodeBox::Internal(ref mut n) => n.unmarshal_binary(data),
+                NodeBox::Leaf(ref mut n) => n.unmarshal_binary(data),
+            }
+        }
+    }
+}
+
+impl Marshal for NodeKind {
+    fn marshal_binary(&self) -> Result<Vec<u8>> {
+        Ok(vec![*self as u8])
+    }
+
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize> {
+        if data.is_empty() {
+            Err(TreeError::MalformedNode.into())
+        } else {
+            if data[0] == NodeKind::None as u8 {
+                *self = NodeKind::None;
+            } else if data[0] == NodeKind::Internal as u8 {
+                *self = NodeKind::Internal;
+            } else if data[0] == NodeKind::Leaf as u8 {
+                *self = NodeKind::Leaf;
+            } else {
+                return Err(TreeError::MalformedNode.into());
+            }
+            Ok(1)
+        }
+    }
+}
+
+impl Marshal for InternalNode {
+    fn marshal_binary(&self) -> Result<Vec<u8>> {
+        let leaf_node_binary = if self.leaf_node.borrow().is_null() {
+            vec![NodeKind::None as u8]
+        } else {
+            noderef_as!(self.leaf_node.borrow().get_node(), Leaf).marshal_binary()?
+        };
+
+        let mut result: Vec<u8> = Vec::with_capacity(
+            1 + size_of::<u16>() + self.label.len() + leaf_node_binary.len() + Hash::len() * 2,
+        );
+        result.push(NodeKind::Internal as u8);
+        result.append(&mut self.label_bit_length.marshal_binary()?);
+        result.extend_from_slice(&self.label);
+        result.extend_from_slice(leaf_node_binary.as_ref());
+        result.extend_from_slice(self.left.borrow().hash.as_ref());
+        result.extend_from_slice(self.right.borrow().hash.as_ref());
+
+        Ok(result)
+    }
+
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize> {
+        let mut pos = 0;
+        if data.len() < 1 + size_of::<Depth>() + 1 || data[pos] != NodeKind::Internal as u8 {
+            return Err(TreeError::MalformedNode.into());
+        }
+        pos += 1;
+
+        pos += self.label_bit_length.unmarshal_binary(&data[pos..])?;
+        self.label = vec![0; self.label_bit_length.to_bytes()];
+        if pos + self.label_bit_length.to_bytes() > data.len() {
+            return Err(TreeError::MalformedNode.into());
+        }
+        self.label
+            .clone_from_slice(&data[pos..pos + self.label_bit_length.to_bytes()]);
+        pos += self.label_bit_length.to_bytes();
+        if pos >= data.len() {
+            return Err(TreeError::MalformedNode.into());
+        }
+
+        if data[pos] == NodeKind::None as u8 {
+            self.leaf_node = NodePointer::null_ptr();
+            pos += 1;
+        } else {
+            let mut leaf_node = LeafNode {
+                ..Default::default()
+            };
+            pos += leaf_node.unmarshal_binary(&data[pos..])?;
+            self.leaf_node = Rc::new(RefCell::new(NodePointer {
+                clean: true,
+                hash: leaf_node.get_hash(),
+                node: Some(Rc::new(RefCell::new(NodeBox::Leaf(leaf_node)))),
+                ..Default::default()
+            }));
+        };
+
+        // Hashes are only present in non-compact serialization.
+        if data.len() >= pos + Hash::len() * 2 {
+            let left_hash = Hash::from(&data[pos..pos + Hash::len()]);
+            pos += Hash::len();
+            let right_hash = Hash::from(&data[pos..pos + Hash::len()]);
+            pos += Hash::len();
+
+            if left_hash.is_empty() {
+                self.left = NodePointer::null_ptr();
+            } else {
+                self.left = Rc::new(RefCell::new(NodePointer {
+                    clean: true,
+                    hash: left_hash,
+                    node: None,
+                    ..Default::default()
+                }));
+            }
+            if right_hash.is_empty() {
+                self.right = NodePointer::null_ptr();
+            } else {
+                self.right = Rc::new(RefCell::new(NodePointer {
+                    clean: true,
+                    hash: right_hash,
+                    node: None,
+                    ..Default::default()
+                }));
+            }
+
+            self.update_hash();
+        }
+
+        self.clean = true;
+
+        Ok(pos)
+    }
+}
+
+impl LeafNode {
+    pub fn compact_marshal_binary(&self) -> Result<Vec<u8>> {
+        let mut result: Vec<u8> = Vec::with_capacity(1 + VALUE_LENGTH_SIZE);
+        result.push(NodeKind::Leaf as u8);
+        result.append(&mut self.key.marshal_binary()?);
+        result.append(&mut (self.value.len() as u32).marshal_binary()?);
+        result.extend_from_slice(&self.value);
+
+        Ok(result)
+    }
+}
+
+impl Marshal for LeafNode {
+    fn marshal_binary(&self) -> Result<Vec<u8>> {
+        self.compact_marshal_binary()
+    }
+
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize> {
+        if data.len() < 1 + size_of::<Depth>() + VALUE_LENGTH_SIZE
+            || data[0] != NodeKind::Leaf as u8
+        {
+            return Err(TreeError::MalformedNode.into());
+        }
+
+        self.clean = true;
+
+        let mut pos = 1;
+        self.key = Key::new();
+        let key_len = self.key.unmarshal_binary(&data[pos..])?;
+        pos += key_len;
+        if pos + VALUE_LENGTH_SIZE > data.len() {
+            return Err(TreeError::MalformedNode.into());
+        }
+
+        self.value = Value::new();
+        let mut value_len = 0u32;
+        value_len.unmarshal_binary(&data[pos..(pos + VALUE_LENGTH_SIZE)])?;
+        pos += VALUE_LENGTH_SIZE;
+        if pos + (value_len as usize) > data.len() {
+            return Err(TreeError::MalformedNode.into());
+        }
+
+        self.value
+            .extend_from_slice(&data[pos..(pos + value_len as usize)]);
+        pos += value_len as usize;
+
+        self.update_hash();
+
+        Ok(pos)
+    }
+}
+
+impl Marshal for Key {
+    fn marshal_binary(&self) -> Result<Vec<u8>> {
+        let mut result: Vec<u8> = Vec::new();
+        result.append(&mut (self.len() as Depth).marshal_binary()?);
+        result.extend_from_slice(self);
+        Ok(result)
+    }
+
+    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize> {
+        if data.len() < size_of::<Depth>() {
+            return Err(TreeError::MalformedKey.into());
+        }
+        let mut key_len: Depth = 0;
+        key_len.unmarshal_binary(data)?;
+
+        if data.len() < size_of::<Depth>() + key_len as usize {
+            return Err(TreeError::MalformedKey.into());
+        }
+
+        self.extend_from_slice(&data[size_of::<Depth>()..(size_of::<Depth>() + key_len as usize)]);
+        Ok(size_of::<Depth>() + key_len as usize)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/mod.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/mod.rs.html new file mode 100644 index 0000000000..302aa28f25 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/mod.rs.html @@ -0,0 +1,413 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+
#[macro_use]
+mod macros;
+
+mod commit;
+mod errors;
+mod insert;
+mod iterator;
+mod lookup;
+mod marshal;
+mod node;
+mod overlay;
+mod prefetch;
+mod remove;
+
+pub use errors::*;
+pub use node::*;
+pub use overlay::*;
+
+use std::{cell::RefCell, fmt, rc::Rc};
+
+use anyhow::Result;
+
+use crate::{
+    common::{crypto::hash::Hash, namespace::Namespace},
+    storage::mkvs::{self, cache::*, sync::*},
+};
+
+/// A container for the parameters used to construct a new MKVS tree instance.
+pub struct Options {
+    node_capacity: usize,
+    value_capacity: usize,
+    root: Option<Root>,
+    root_type: Option<RootType>,
+}
+
+impl Default for Options {
+    fn default() -> Self {
+        Self {
+            node_capacity: 50_000,
+            value_capacity: 16 * 1024 * 1024,
+            root: None,
+            root_type: None,
+        }
+    }
+}
+
+/// Tree builder.
+///
+/// This can be used to construct a `Tree` through a builder-like pattern.
+#[derive(Default)]
+pub struct Builder {
+    options: Options,
+}
+
+impl Builder {
+    /// Creates a new builder.
+    pub fn new() -> Self {
+        Builder::default()
+    }
+
+    /// Set the capacity of the underlying in-memory cache.
+    ///
+    /// * `node_capacity` is the maximum number of nodes held by the
+    ///   cache before eviction.
+    /// * `value_capacity` is the total size, in bytes, of values held
+    ///   by the cache before eviction.
+    ///
+    /// If set to 0, the relevant cache will have an unlimited capacity. If left
+    /// unspecified, the cache will default to 50_000 for nodes and 16MB for values.
+    pub fn with_capacity(mut self, node_capacity: usize, value_capacity: usize) -> Self {
+        self.options.node_capacity = node_capacity;
+        self.options.value_capacity = value_capacity;
+        self
+    }
+
+    /// Set an existing root as the root for the new tree.
+    ///
+    /// Either this or a root type must be specified to construct a new
+    /// tree. If neither is specified, or if both are set but don't agree on
+    /// the root type, the constructor will panic.
+    pub fn with_root(mut self, root: Root) -> Self {
+        self.options.root = Some(root);
+        self
+    }
+
+    /// Set the storage root type for this tree.
+    ///
+    /// Either this or an existing root must be specified to construct a new
+    /// tree. If neither is specified, or if both are set but don't agree on
+    /// the root type, the constructor will panic.
+    pub fn with_root_type(mut self, root_type: RootType) -> Self {
+        self.options.root_type = Some(root_type);
+        self
+    }
+
+    /// Commit the options set so far into a newly constructed tree instance.
+    pub fn build(self, read_syncer: Box<dyn ReadSync>) -> Tree {
+        assert!(
+            self.options.root_type.is_some() || self.options.root.is_some(),
+            "mkvs/tree: neither root type nor storage root specified"
+        );
+        if let Some(root) = self.options.root {
+            if let Some(root_type) = self.options.root_type {
+                assert!(
+                    root.root_type == root_type,
+                    "mkvs/tree: specified storage root and incompatible root type"
+                );
+            }
+        }
+        Tree::new(read_syncer, &self.options)
+    }
+}
+
+/// A patricia tree-based MKVS implementation.
+pub struct Tree {
+    pub(crate) cache: RefCell<Box<LRUCache>>,
+    pub(crate) root_type: RootType,
+}
+
+// Tree is Send as long as ownership of internal Rcs cannot leak out via any of its methods.
+unsafe impl Send for Tree {}
+
+impl Tree {
+    /// Construct a new tree instance using the given read syncer and options struct.
+    pub fn new(read_syncer: Box<dyn ReadSync>, opts: &Options) -> Tree {
+        let root_type = if opts.root.is_none() {
+            opts.root_type.unwrap()
+        } else {
+            opts.root.unwrap().root_type
+        };
+        let tree = Tree {
+            cache: RefCell::new(LRUCache::new(
+                opts.node_capacity,
+                opts.value_capacity,
+                read_syncer,
+                root_type,
+            )),
+            root_type,
+        };
+
+        if let Some(root) = opts.root {
+            tree.cache
+                .borrow_mut()
+                .set_pending_root(Rc::new(RefCell::new(NodePointer {
+                    clean: true,
+                    hash: root.hash,
+                    ..Default::default()
+                })));
+            tree.cache.borrow_mut().set_sync_root(root);
+        }
+
+        tree
+    }
+
+    /// Return an builder struct to chain configuration calls on.
+    pub fn builder() -> Builder {
+        Builder::new()
+    }
+}
+
+impl fmt::Debug for Tree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+        self.cache.borrow().get_pending_root().fmt(f)
+    }
+}
+
+impl mkvs::FallibleMKVS for Tree {
+    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        Tree::get(self, key)
+    }
+
+    fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>> {
+        Tree::get_proof(self, key)
+    }
+
+    fn cache_contains_key(&self, key: &[u8]) -> bool {
+        Tree::cache_contains_key(self, key)
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>> {
+        Tree::insert(self, key, value)
+    }
+
+    fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        Tree::remove(self, key)
+    }
+
+    fn prefetch_prefixes(&self, prefixes: &[mkvs::Prefix], limit: u16) -> Result<()> {
+        Tree::prefetch_prefixes(self, prefixes, limit)
+    }
+
+    fn iter(&self) -> Box<dyn mkvs::Iterator + '_> {
+        Box::new(Tree::iter(self))
+    }
+
+    fn commit(&mut self, namespace: Namespace, version: u64) -> Result<Hash> {
+        Tree::commit(self, namespace, version)
+    }
+}
+
+#[cfg(test)]
+mod node_test;
+#[cfg(test)]
+mod tree_bench;
+#[cfg(test)]
+mod tree_test;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/node.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/node.rs.html new file mode 100644 index 0000000000..ef73c9d7f1 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/node.rs.html @@ -0,0 +1,1029 @@ +node.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+
use std::{cell::RefCell, rc::Rc};
+
+use crate::{
+    common::{crypto::hash::Hash, namespace::Namespace},
+    storage::mkvs::{
+        cache::{CacheExtra, CacheItem},
+        marshal::Marshal,
+    },
+};
+
+/// Common interface for node-like objects in the tree.
+pub trait Node {
+    /// Check whether the node is clean or not.
+    fn is_clean(&self) -> bool;
+    /// Get the node's hash.
+    fn get_hash(&self) -> Hash;
+    /// Recompute the node's hash.
+    fn update_hash(&mut self);
+    /// Duplicate the node but include only hash references.
+    fn extract(&self) -> NodeRef;
+}
+
+/// Storage root type.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum RootType {
+    /// Invalid or uninitialized storage root type.
+    #[default]
+    Invalid = 0,
+    /// Storage root for runtime state.
+    State = 1,
+    /// Storage root for transaction IO.
+    IO = 2,
+}
+
+/// Storage root.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct Root {
+    /// Namespace under which the root is stored.
+    #[cbor(rename = "ns")]
+    pub namespace: Namespace,
+    /// Monotonically increasing version number in which the root is stored.
+    pub version: u64,
+    /// The storage type that this root has data for.
+    pub root_type: RootType,
+    /// Merkle root hash.
+    pub hash: Hash,
+}
+
+/// A box type that can contain either internal or leaf nodes.
+#[derive(Debug, Eq, PartialEq)]
+pub enum NodeBox {
+    Internal(InternalNode),
+    Leaf(LeafNode),
+}
+
+impl Default for NodeBox {
+    fn default() -> Self {
+        NodeBox::Internal(Default::default())
+    }
+}
+
+impl Node for NodeBox {
+    fn is_clean(&self) -> bool {
+        match self {
+            NodeBox::Internal(ref n) => n.is_clean(),
+            NodeBox::Leaf(ref n) => n.is_clean(),
+        }
+    }
+
+    fn get_hash(&self) -> Hash {
+        match self {
+            NodeBox::Internal(ref n) => n.get_hash(),
+            NodeBox::Leaf(ref n) => n.get_hash(),
+        }
+    }
+
+    fn update_hash(&mut self) {
+        match self {
+            NodeBox::Internal(ref mut n) => n.update_hash(),
+            NodeBox::Leaf(ref mut n) => n.update_hash(),
+        }
+    }
+
+    fn extract(&self) -> NodeRef {
+        match self {
+            NodeBox::Internal(ref n) => n.extract(),
+            NodeBox::Leaf(ref n) => n.extract(),
+        }
+    }
+}
+
+/// Node types in the tree.
+///
+/// Integer values of the variants here are also used in subtree
+/// serialization and as prefixes in node hash computations.
+#[derive(Copy, Clone, Debug)]
+#[repr(u8)]
+pub enum NodeKind {
+    None = 0x02,
+    Internal = 0x01,
+    Leaf = 0x00,
+}
+
+/// `NodeRef` is a reference-counted pointer to a node box.
+pub type NodeRef = Rc<RefCell<NodeBox>>;
+
+/// A pointer to a node in the tree.
+#[derive(Debug, Default)]
+pub struct NodePointer {
+    pub clean: bool,
+    pub hash: Hash,
+    pub node: Option<NodeRef>,
+
+    pub cache_extra: CacheExtra<NodePointer>,
+}
+
+/// A reference-counted pointer to a pointer.
+pub type NodePtrRef = Rc<RefCell<NodePointer>>;
+
+impl NodePointer {
+    /// Construct a null pointer.
+    pub fn null_ptr() -> NodePtrRef {
+        Rc::new(RefCell::new(NodePointer {
+            node: None,
+            clean: true,
+            hash: Hash::empty_hash(),
+            ..Default::default()
+        }))
+    }
+
+    /// Construct a hash-only pointer.
+    pub fn hash_ptr(hash: Hash) -> NodePtrRef {
+        Rc::new(RefCell::new(NodePointer {
+            node: None,
+            clean: true,
+            hash,
+            ..Default::default()
+        }))
+    }
+
+    /// Construct a node pointer from a full node.
+    pub fn from_node(node: NodeBox) -> NodePtrRef {
+        Rc::new(RefCell::new(NodePointer {
+            hash: node.get_hash(),
+            node: Some(Rc::new(RefCell::new(node))),
+            clean: true,
+            ..Default::default()
+        }))
+    }
+
+    /// Check if the pointer is a null pointer.
+    pub fn is_null(&self) -> bool {
+        self.hash.is_empty()
+    }
+
+    /// Check if the pointer has a resolved reference to a concrete node.
+    pub fn has_node(&self) -> bool {
+        !self.is_null() && self.node.is_some()
+    }
+
+    /// Get a reference to the node the pointer is pointing to.
+    pub fn get_node(&self) -> NodeRef {
+        match &self.node {
+            None => panic!("mkvs: get_node called on pointer without a node"),
+            Some(node) => node.clone(),
+        }
+    }
+
+    /// Return a copy of this pointer containing only hash references.
+    pub fn extract(&self) -> NodePtrRef {
+        assert!(self.clean, "mkvs: extract called on dirty pointer");
+
+        Rc::new(RefCell::new(NodePointer {
+            clean: true,
+            hash: self.hash,
+            ..Default::default()
+        }))
+    }
+
+    // Make deep copy of the Pointer to LeafNode excluding LRU and DBInternal.
+    //
+    // Panics, if it's called on non-leaf node pointer.
+    fn copy_leaf_ptr(&self) -> NodePtrRef {
+        if !self.has_node() {
+            return NodePointer::null_ptr();
+        }
+
+        assert!(self.clean, "mkvs: copy_leaf_ptr called on dirty pointer");
+
+        if let Some(ref some_node) = self.node {
+            let nyoo = noderef_as!(some_node, Leaf).copy();
+            Rc::new(RefCell::new(NodePointer {
+                clean: true,
+                hash: self.hash,
+                node: Some(Rc::new(RefCell::new(NodeBox::Leaf(nyoo)))),
+                ..Default::default()
+            }))
+        } else {
+            panic!("mkvs: copy_leaf_ptr called on a non-leaf pointer");
+        }
+    }
+}
+
+impl CacheItem for NodePointer {
+    fn get_cache_extra(&self) -> CacheExtra<NodePointer> {
+        self.cache_extra
+    }
+
+    fn set_cache_extra(&mut self, new_val: CacheExtra<NodePointer>) {
+        self.cache_extra = new_val;
+    }
+
+    fn get_cached_size(&self) -> usize {
+        1
+    }
+}
+
+impl PartialEq for NodePointer {
+    fn eq(&self, other: &NodePointer) -> bool {
+        if self.clean && other.clean {
+            self.hash == other.hash
+        } else {
+            self.node.is_some() && self.node == other.node
+        }
+    }
+}
+
+impl Eq for NodePointer {}
+
+/// An internal tree node with two children and possibly a leaf.
+#[derive(Debug, Default)]
+pub struct InternalNode {
+    pub clean: bool,
+    pub hash: Hash,
+    pub label: Key,              // label on the incoming edge
+    pub label_bit_length: Depth, // length of the label in bits
+    pub leaf_node: NodePtrRef,   // for the key ending at this depth
+    pub left: NodePtrRef,
+    pub right: NodePtrRef,
+}
+
+impl Node for InternalNode {
+    fn is_clean(&self) -> bool {
+        self.clean
+    }
+
+    fn get_hash(&self) -> Hash {
+        self.hash
+    }
+
+    fn update_hash(&mut self) {
+        let leaf_node_hash = self.leaf_node.borrow().hash;
+        let left_hash = self.left.borrow().hash;
+        let right_hash = self.right.borrow().hash;
+
+        self.hash = Hash::digest_bytes_list(&[
+            &[NodeKind::Internal as u8],
+            &self.label_bit_length.marshal_binary().unwrap(),
+            self.label.as_ref(),
+            leaf_node_hash.as_ref(),
+            left_hash.as_ref(),
+            right_hash.as_ref(),
+        ]);
+    }
+
+    fn extract(&self) -> NodeRef {
+        assert!(self.clean, "mkvs: extract called on dirty node");
+
+        Rc::new(RefCell::new(NodeBox::Internal(InternalNode {
+            clean: true,
+            hash: self.hash,
+            label: self.label.clone(),
+            label_bit_length: self.label_bit_length,
+            leaf_node: self.leaf_node.borrow().copy_leaf_ptr(),
+            left: self.left.borrow().extract(),
+            right: self.right.borrow().extract(),
+        })))
+    }
+}
+
+impl PartialEq for InternalNode {
+    fn eq(&self, other: &InternalNode) -> bool {
+        if self.clean && other.clean {
+            self.hash == other.hash
+        } else {
+            self.leaf_node == other.leaf_node
+                && self.left == other.left
+                && self.right == other.right
+        }
+    }
+}
+
+impl Eq for InternalNode {}
+
+/// A leaf node containing a key/value pair.
+#[derive(Debug, Default)]
+pub struct LeafNode {
+    pub clean: bool,
+    pub hash: Hash,
+    pub key: Key,
+    pub value: Value,
+}
+
+impl LeafNode {
+    pub fn copy(&self) -> LeafNode {
+        LeafNode {
+            clean: self.clean,
+            hash: self.hash,
+            key: self.key.to_owned(),
+            value: self.value.clone(),
+        }
+    }
+}
+
+impl Node for LeafNode {
+    fn is_clean(&self) -> bool {
+        self.clean
+    }
+
+    fn get_hash(&self) -> Hash {
+        self.hash
+    }
+
+    fn update_hash(&mut self) {
+        self.hash = Hash::digest_bytes_list(&[
+            &[NodeKind::Leaf as u8],
+            &(self.key.len() as u32).marshal_binary().unwrap(),
+            self.key.as_ref(),
+            &(self.value.len() as u32).marshal_binary().unwrap(),
+            self.value.as_ref(),
+        ]);
+    }
+
+    fn extract(&self) -> NodeRef {
+        assert!(self.clean, "mkvs: extract called on dirty node");
+        Rc::new(RefCell::new(NodeBox::Leaf(LeafNode {
+            clean: true,
+            hash: self.hash,
+            key: self.key.clone(),
+            value: self.value.clone(),
+        })))
+    }
+}
+
+impl PartialEq for LeafNode {
+    fn eq(&self, other: &LeafNode) -> bool {
+        if self.clean && other.clean {
+            self.hash == other.hash
+        } else {
+            self.key == other.key && self.value == other.value
+        }
+    }
+}
+
+impl Eq for LeafNode {}
+
+// Depth determines the maximum length of the key in bits.
+//
+// max length = 2^size_of(Depth)*8
+pub type Depth = u16;
+
+pub trait DepthTrait {
+    // Returns the number of bytes needed to fit given bits.
+    fn to_bytes(&self) -> usize;
+}
+
+impl DepthTrait for Depth {
+    fn to_bytes(&self) -> usize {
+        let size = self / 8;
+        if self % 8 != 0 {
+            (size + 1) as usize
+        } else {
+            size as usize
+        }
+    }
+}
+
+// Key holds variable-length key.
+pub type Key = Vec<u8>;
+
+pub trait KeyTrait {
+    /// Get a single bit from the given hash.
+    fn get_bit(&self, bit: Depth) -> bool;
+    /// Returns the length of the key in bits.
+    fn bit_length(&self) -> Depth;
+    /// Bit-wise splits of the key.
+    fn split(&self, split_point: Depth, key_len: Depth) -> (Key, Key);
+    /// Bit-wise merges key of given length with another key of given length.
+    fn merge(&self, key_len: Depth, k2: &Key, k2_len: Depth) -> Key;
+    /// Appends the given bit to the key.
+    fn append_bit(&self, key_len: Depth, bit: bool) -> Key;
+    /// Computes length of common prefix of k and k2 with given bit lengths.
+    fn common_prefix_len(&self, key_len: Depth, k2: &Key, k2_len: Depth) -> Depth;
+}
+
+impl KeyTrait for Key {
+    fn get_bit(&self, bit: Depth) -> bool {
+        (self[(bit / 8) as usize] & (1 << (7 - (bit % 8)))) != 0
+    }
+
+    fn bit_length(&self) -> Depth {
+        (self.len() * 8) as Depth
+    }
+
+    fn split(&self, split_point: Depth, key_len: Depth) -> (Key, Key) {
+        assert!(
+            split_point <= key_len,
+            "mkvs: split_point {} greater than key_len {}",
+            split_point,
+            key_len
+        );
+
+        let prefix_len = split_point.to_bytes();
+        let suffix_len = (key_len - split_point).to_bytes();
+        let mut prefix: Key = vec![0; prefix_len];
+        let mut suffix: Key = vec![0; suffix_len];
+
+        prefix.clone_from_slice(&self[0..split_point.to_bytes()]);
+
+        // Clean the remainder of the byte.
+        if split_point % 8 != 0 {
+            prefix[prefix_len - 1] &= 0xff << (8 - split_point % 8)
+        }
+
+        for i in 0..suffix_len {
+            // First set the left chunk of the byte
+            suffix[i] = self[i + split_point as usize / 8] << (split_point % 8);
+            // ...and the right chunk, if we haven't reached the end of k yet.
+            if split_point % 8 != 0 && i + split_point as usize / 8 + 1 != self.len() {
+                suffix[i] |=
+                    self[i + split_point as usize / 8 + 1] >> (8 - split_point as usize % 8);
+            }
+        }
+
+        (prefix, suffix)
+    }
+
+    fn merge(&self, key_len: Depth, k2: &Key, k2_len: Depth) -> Key {
+        let mut key_len_bytes = (key_len as usize) / 8;
+        if key_len % 8 != 0 {
+            key_len_bytes += 1;
+        }
+
+        let mut new_key: Key = vec![0; (key_len + k2_len).to_bytes()];
+        new_key[..key_len_bytes].clone_from_slice(&self[..key_len_bytes]);
+
+        for i in 0..k2.len() {
+            // First set the right chunk of the previous byte
+            if key_len % 8 != 0 && key_len_bytes > 0 {
+                new_key[key_len_bytes + i - 1] |= k2[i] >> (key_len % 8);
+            }
+            // ...and the next left chunk, if we haven't reached the end of newKey
+            // yet.
+            if key_len_bytes + i < new_key.len() {
+                // another mod 8 to prevent bit shifting for 8 bits
+                new_key[key_len_bytes + i] |= k2[i] << ((8 - key_len % 8) % 8);
+            }
+        }
+
+        new_key
+    }
+
+    fn append_bit(&self, key_len: Depth, val: bool) -> Key {
+        let mut new_key: Key = vec![0; (key_len + 1).to_bytes()];
+        new_key[..self.len()].clone_from_slice(self);
+
+        if val {
+            new_key[key_len as usize / 8] |= 0x80 >> (key_len % 8)
+        } else {
+            new_key[key_len as usize / 8] &= !(0x80 >> (key_len % 8))
+        }
+
+        new_key
+    }
+
+    fn common_prefix_len(&self, key_bit_len: Depth, k2: &Key, k2_bit_len: Depth) -> Depth {
+        let min_key_len = if k2.len() < self.len() {
+            k2.len()
+        } else {
+            self.len()
+        };
+
+        // Compute the common prefix byte-wise.
+        let mut i: usize = 0;
+        while i < min_key_len {
+            if self[i] != k2[i] {
+                break;
+            }
+            i += 1;
+        }
+
+        // Prefixes match i bytes and maybe some more bits below.
+        let mut bit_length = (i * 8) as Depth;
+
+        if i != self.len() && i != k2.len() {
+            // We got a mismatch somewhere along the way. We need to compute how
+            // many additional bits in i-th byte match.
+            bit_length += (self[i] ^ k2[i]).leading_zeros() as Depth;
+        }
+
+        // In any case, bit_length should never exceed length of the shorter key.
+        if bit_length > key_bit_len {
+            bit_length = key_bit_len;
+        }
+        if bit_length > k2_bit_len {
+            bit_length = k2_bit_len;
+        };
+        bit_length
+    }
+}
+
+// Value holds the leaf node value.
+pub type Value = Vec<u8>;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/overlay.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/overlay.rs.html new file mode 100644 index 0000000000..9bc2d3d778 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/overlay.rs.html @@ -0,0 +1,881 @@ +overlay.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+
use std::{
+    collections::{btree_map, BTreeMap, HashSet},
+    iter::Peekable,
+};
+
+use anyhow::{Error, Result};
+
+use crate::{
+    common::{crypto::hash::Hash, namespace::Namespace},
+    storage::mkvs::{self, tree::Key, Proof},
+};
+
+/// A key-value tree overlay that holds all updates in memory and only commits them if requested.
+/// This can be used to create snapshots that can be discarded.
+///
+/// While updates (inserts, removes) are stored in the overlay, reads are not cached in the overlay
+/// as the inner tree has its own cache and double caching makes less sense.
+pub struct OverlayTree<T: mkvs::FallibleMKVS> {
+    inner: T,
+    overlay: BTreeMap<Vec<u8>, Vec<u8>>,
+    dirty: HashSet<Vec<u8>>,
+}
+
+impl<T: mkvs::FallibleMKVS> OverlayTree<T> {
+    /// Create a new overlay tree.
+    pub fn new(inner: T) -> Self {
+        Self {
+            inner,
+            overlay: BTreeMap::new(),
+            dirty: HashSet::new(),
+        }
+    }
+
+    /// Get an existing key.
+    pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        // For dirty values, check the overlay.
+        if self.dirty.contains(key) {
+            return Ok(self.overlay.get(key).cloned());
+        }
+
+        // Otherwise fetch from inner tree.
+        self.inner.get(key)
+    }
+
+    pub fn get_proof(&self, key: &[u8]) -> Result<Option<Proof>> {
+        if !self.dirty.is_empty() {
+            Err(Error::msg(
+                "overlay tree proofs are not supported when there are dirty values",
+            ))?;
+        }
+
+        self.inner.get_proof(key)
+    }
+
+    /// Insert a key/value pair into the tree.
+    pub fn insert(&mut self, key: &[u8], value: &[u8]) -> Result<Option<Vec<u8>>> {
+        let previous = self.get(key)?;
+
+        self.overlay.insert(key.to_owned(), value.to_owned());
+        self.dirty.insert(key.to_owned());
+
+        Ok(previous)
+    }
+
+    /// Remove entry with given key, returning the value at the key if the key was previously
+    /// in the database.
+    pub fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        // For dirty values, remove from the overlay.
+        if self.dirty.contains(key) {
+            return Ok(self.overlay.remove(key));
+        }
+
+        let value = self.inner.get(key)?;
+
+        // Do not treat a value as dirty if it was not dirty before and did not exist in the inner tree.
+        if value.is_some() {
+            self.dirty.insert(key.to_owned());
+        }
+        Ok(value)
+    }
+
+    /// Return an iterator over the tree.
+    pub fn iter(&self) -> OverlayTreeIterator<T> {
+        OverlayTreeIterator::new(self)
+    }
+
+    /// Commit any modifications to the underlying tree.
+    pub fn commit(&mut self) -> Result<mkvs::WriteLog> {
+        let mut log: mkvs::WriteLog = Vec::new();
+
+        // Insert all items present in the overlay.
+        for (key, value) in &self.overlay {
+            self.inner.insert(key, value)?;
+            self.dirty.remove(key);
+
+            log.push(mkvs::LogEntry {
+                key: key.clone(),
+                value: Some(value.clone()),
+            });
+        }
+        self.overlay.clear();
+
+        // Any remaining dirty items must have been removed.
+        for key in &self.dirty {
+            self.inner.remove(key)?;
+
+            log.push(mkvs::LogEntry {
+                key: key.clone(),
+                value: None,
+            });
+        }
+        self.dirty.clear();
+
+        Ok(log)
+    }
+
+    /// Commit any modifications to the underlying tree and then immediately commit the underlying
+    /// tree, returning the new root hash.
+    pub fn commit_both(
+        &mut self,
+        namespace: Namespace,
+        version: u64,
+    ) -> Result<(mkvs::WriteLog, Hash)> {
+        // First commit modifications to the underlying tree.
+        let write_log = self.commit()?;
+        // Then commit the underlying tree.
+        let root_hash = self.inner.commit(namespace, version)?;
+
+        Ok((write_log, root_hash))
+    }
+}
+
+/// An iterator over the `OverlayTree`.
+pub struct OverlayTreeIterator<'tree, T: mkvs::FallibleMKVS> {
+    tree: &'tree OverlayTree<T>,
+
+    inner: Box<dyn mkvs::Iterator + 'tree>,
+    overlay: Peekable<btree_map::Range<'tree, Vec<u8>, Vec<u8>>>,
+    overlay_valid: bool,
+
+    key: Option<Vec<u8>>,
+    value: Option<Vec<u8>>,
+}
+
+impl<'tree, T: mkvs::FallibleMKVS> OverlayTreeIterator<'tree, T> {
+    fn new(tree: &'tree OverlayTree<T>) -> Self {
+        Self {
+            tree,
+            inner: tree.inner.iter(),
+            overlay: tree.overlay.range(vec![]..).peekable(),
+            overlay_valid: true,
+            key: None,
+            value: None,
+        }
+    }
+
+    fn update_iterator_position(&mut self) {
+        // Skip over any dirty entries from the inner iterator.
+        loop {
+            if !self.inner.is_valid()
+                || !self
+                    .tree
+                    .dirty
+                    .contains(self.inner.get_key().as_ref().expect("inner.is_valid"))
+            {
+                break;
+            }
+            self.inner.next();
+        }
+
+        let i_key = self.inner.get_key();
+        let o_item = self.overlay.peek();
+        self.overlay_valid = o_item.is_some();
+
+        if self.inner.is_valid()
+            && (!self.overlay_valid
+                || i_key.as_ref().expect("inner.is_valid") < o_item.expect("overlay_valid").0)
+        {
+            // Key of inner iterator is smaller than the key of the overlay iterator.
+            self.key = i_key.clone();
+            self.value = self.inner.get_value().clone();
+        } else if self.overlay_valid {
+            // Key of overlay iterator is smaller than or equal to the key of the inner iterator.
+            let (o_key, o_value) = o_item.expect("overlay_valid");
+            self.key = Some(o_key.to_vec());
+            self.value = Some(o_value.to_vec());
+        } else {
+            // Both iterators are invalid.
+            self.key = None;
+            self.value = None;
+        }
+    }
+
+    fn next(&mut self) {
+        if !self.overlay_valid
+            || (self.inner.is_valid()
+                && self.inner.get_key().as_ref().expect("inner.is_valid")
+                    <= self.overlay.peek().expect("overlay_valid").0)
+        {
+            // Key of inner iterator is smaller or equal than the key of the overlay iterator.
+            self.inner.next();
+        } else {
+            // Key of inner iterator is greater than the key of the overlay iterator.
+            self.overlay.next();
+        }
+
+        self.update_iterator_position();
+    }
+}
+
+impl<'tree, T: mkvs::FallibleMKVS> Iterator for OverlayTreeIterator<'tree, T> {
+    type Item = (Vec<u8>, Vec<u8>);
+
+    fn next(&mut self) -> Option<Self::Item> {
+        use mkvs::Iterator;
+
+        if !self.is_valid() {
+            return None;
+        }
+
+        let key = self.key.as_ref().expect("iterator is valid").clone();
+        let value = self.value.as_ref().expect("iterator is valid").clone();
+        OverlayTreeIterator::next(self);
+
+        Some((key, value))
+    }
+}
+
+impl<'tree, T: mkvs::FallibleMKVS> mkvs::Iterator for OverlayTreeIterator<'tree, T> {
+    fn set_prefetch(&mut self, prefetch: usize) {
+        self.inner.set_prefetch(prefetch)
+    }
+
+    fn is_valid(&self) -> bool {
+        // If either iterator is valid, the merged iterator is valid.
+        self.inner.is_valid() || self.overlay_valid
+    }
+
+    fn error(&self) -> &Option<Error> {
+        self.inner.error()
+    }
+
+    fn rewind(&mut self) {
+        self.seek(&[]);
+    }
+
+    fn seek(&mut self, key: &[u8]) {
+        self.inner.seek(key);
+        self.overlay = self.tree.overlay.range(key.to_vec()..).peekable();
+
+        self.update_iterator_position();
+    }
+
+    fn get_key(&self) -> &Option<Key> {
+        &self.key
+    }
+
+    fn get_value(&self) -> &Option<Vec<u8>> {
+        &self.value
+    }
+
+    fn next(&mut self) {
+        OverlayTreeIterator::next(self)
+    }
+}
+
+impl<T: mkvs::FallibleMKVS> mkvs::MKVS for OverlayTree<T> {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        self.get(key).unwrap()
+    }
+
+    fn get_proof(&self, key: &[u8]) -> Option<Proof> {
+        self.get_proof(key).unwrap()
+    }
+
+    fn cache_contains_key(&self, key: &[u8]) -> bool {
+        // For dirty values, check the overlay.
+        if self.dirty.contains(key) {
+            return self.overlay.contains_key(key);
+        }
+        self.inner.cache_contains_key(key)
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) -> Option<Vec<u8>> {
+        self.insert(key, value).unwrap()
+    }
+
+    fn remove(&mut self, key: &[u8]) -> Option<Vec<u8>> {
+        self.remove(key).unwrap()
+    }
+
+    fn prefetch_prefixes(&self, prefixes: &[mkvs::Prefix], limit: u16) {
+        self.inner.prefetch_prefixes(prefixes, limit).unwrap()
+    }
+
+    fn iter(&self) -> Box<dyn mkvs::Iterator + '_> {
+        Box::new(self.iter())
+    }
+
+    fn commit(&mut self, namespace: Namespace, version: u64) -> Result<(mkvs::WriteLog, Hash)> {
+        self.commit_both(namespace, version)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::storage::mkvs::{
+        sync::NoopReadSyncer, tree::iterator::test::test_iterator_with, RootType, Tree,
+    };
+
+    #[test]
+    fn test_overlay() {
+        let mut tree = Tree::builder()
+            .with_root_type(RootType::State)
+            .build(Box::new(NoopReadSyncer));
+
+        // Generate some items.
+        let items = vec![
+            (b"key".to_vec(), b"first".to_vec()),
+            (b"key 1".to_vec(), b"one".to_vec()),
+            (b"key 2".to_vec(), b"two".to_vec()),
+            (b"key 5".to_vec(), b"five".to_vec()),
+            (b"key 8".to_vec(), b"eight".to_vec()),
+            (b"key 9".to_vec(), b"nine".to_vec()),
+        ];
+
+        let tests = vec![
+            (b"k".to_vec(), 0),
+            (b"key 1".to_vec(), 1),
+            (b"key 3".to_vec(), 3),
+            (b"key 4".to_vec(), 3),
+            (b"key 5".to_vec(), 3),
+            (b"key 6".to_vec(), 4),
+            (b"key 7".to_vec(), 4),
+            (b"key 8".to_vec(), 4),
+            (b"key 9".to_vec(), 5),
+            (b"key A".to_vec(), -1),
+        ];
+
+        // Create an overlay over an empty tree and insert some items into the overlay.
+        let mut overlay = OverlayTree::new(&mut tree);
+        for (key, value) in items.iter() {
+            overlay.insert(key, value).unwrap();
+        }
+
+        // Test that an overlay-only iterator works correctly.
+        let it = overlay.iter();
+        test_iterator_with(&items, it, &tests);
+
+        // Insert some items into the underlying tree.
+        for (key, value) in items.iter() {
+            tree.insert(key, value).unwrap();
+        }
+
+        // Create a tree pointer so we can unsafely peek into the tree later.
+        let tree_ref = &tree as *const Tree;
+
+        // Create an overlay.
+        let mut overlay = OverlayTree::new(&mut tree);
+
+        // Test that all keys can be fetched from an empty overlay.
+        for (k, expected_v) in &items {
+            let v = overlay.get(&k).unwrap();
+            assert_eq!(v.as_ref(), Some(expected_v));
+        }
+
+        // Test that merged iterator works correctly on an empty overlay (it should behave exactly
+        // the same as for the inner tree).
+        let it = overlay.iter();
+        test_iterator_with(&items, it, &tests);
+
+        // Add some updates to the overlay.
+        overlay.remove(b"key 2").unwrap();
+        overlay.insert(b"key 7", b"seven").unwrap();
+        overlay.remove(b"key 5").unwrap();
+        overlay.insert(b"key 5", b"fivey").unwrap();
+
+        // Make sure updates did not propagate to the inner tree.
+        // NOTE: This is unsafe as we are otherwise not allowed to reference the inner tree.
+        unsafe {
+            let tree_ref = &*tree_ref;
+
+            let value = tree_ref.get(b"key 2").unwrap();
+            assert_eq!(
+                value,
+                Some(b"two".to_vec()),
+                "value in inner tree should be unchanged"
+            );
+            let value = tree_ref.get(b"key 7").unwrap();
+            assert_eq!(value, None, "value should not exist in inner tree");
+        }
+
+        // State of overlay after updates.
+        let items = vec![
+            (b"key".to_vec(), b"first".to_vec()),
+            (b"key 1".to_vec(), b"one".to_vec()),
+            (b"key 5".to_vec(), b"fivey".to_vec()),
+            (b"key 7".to_vec(), b"seven".to_vec()),
+            (b"key 8".to_vec(), b"eight".to_vec()),
+            (b"key 9".to_vec(), b"nine".to_vec()),
+        ];
+
+        let tests = vec![
+            (b"k".to_vec(), 0),
+            (b"key 1".to_vec(), 1),
+            (b"key 3".to_vec(), 2),
+            (b"key 4".to_vec(), 2),
+            (b"key 5".to_vec(), 2),
+            (b"key 6".to_vec(), 3),
+            (b"key 7".to_vec(), 3),
+            (b"key 8".to_vec(), 4),
+            (b"key 9".to_vec(), 5),
+            (b"key A".to_vec(), -1),
+        ];
+
+        // Test that all keys can be fetched from an updated overlay.
+        for (k, expected_v) in &items {
+            let v = overlay.get(&k).unwrap();
+            assert_eq!(v.as_ref(), Some(expected_v));
+        }
+
+        // Make sure that merged overlay iterator works.
+        let it = overlay.iter();
+        test_iterator_with(&items, it, &tests);
+
+        // Commit the overlay.
+        overlay.commit().unwrap();
+
+        // Test that all keys can be fetched from an updated tree.
+        for (k, expected_v) in &items {
+            let v = tree.get(&k).unwrap();
+            assert_eq!(v.as_ref(), Some(expected_v));
+        }
+
+        // Make sure that the updated tree is correct.
+        let it = tree.iter();
+        test_iterator_with(&items, it, &tests);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/prefetch.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/prefetch.rs.html new file mode 100644 index 0000000000..3073f79e8a --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/prefetch.rs.html @@ -0,0 +1,87 @@ +prefetch.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
use anyhow::Result;
+
+use crate::storage::mkvs::{
+    cache::{Cache, ReadSyncFetcher},
+    sync::{GetPrefixesRequest, Proof, ReadSync, TreeID},
+    tree::{NodePtrRef, Root, Tree},
+    Prefix,
+};
+
+pub(super) struct FetcherSyncGetPrefixes<'a> {
+    prefixes: &'a [Prefix],
+    limit: u16,
+}
+
+impl<'a> FetcherSyncGetPrefixes<'a> {
+    pub(super) fn new(prefixes: &'a [Prefix], limit: u16) -> Self {
+        Self { prefixes, limit }
+    }
+}
+
+impl<'a> ReadSyncFetcher for FetcherSyncGetPrefixes<'a> {
+    fn fetch(&self, root: Root, ptr: NodePtrRef, rs: &mut Box<dyn ReadSync>) -> Result<Proof> {
+        let rsp = rs.sync_get_prefixes(GetPrefixesRequest {
+            tree: TreeID {
+                root,
+                position: ptr.borrow().hash,
+            },
+            prefixes: self.prefixes.to_vec(),
+            limit: self.limit,
+        })?;
+        Ok(rsp.proof)
+    }
+}
+
+impl Tree {
+    /// Populate the in-memory tree with nodes for keys starting with given prefixes.
+    pub fn prefetch_prefixes(&self, prefixes: &[Prefix], limit: u16) -> Result<()> {
+        let pending_root = self.cache.borrow().get_pending_root();
+        self.cache
+            .borrow_mut()
+            .remote_sync(pending_root, FetcherSyncGetPrefixes::new(prefixes, limit))
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mkvs/tree/remove.rs.html b/rust/src/oasis_core_runtime/storage/mkvs/tree/remove.rs.html new file mode 100644 index 0000000000..d1b4b9fa99 --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mkvs/tree/remove.rs.html @@ -0,0 +1,379 @@ +remove.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+
use anyhow::Result;
+
+use crate::storage::mkvs::{
+    cache::Cache,
+    tree::{
+        Depth, Key, KeyTrait, NodeBox, NodeKind, NodePointer, NodePtrRef, NodeRef, Tree, Value,
+    },
+};
+
+use super::lookup::FetcherSyncGet;
+
+impl Tree {
+    /// Remove entry with given key, returning the value at the key if the key was previously
+    /// in the database.
+    pub fn remove(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>> {
+        let boxed_key = key.to_vec();
+        let pending_root = self.cache.borrow().get_pending_root();
+
+        // Remember where the path from root to target node ends (will end).
+        self.cache.borrow_mut().mark_position();
+
+        let (new_root, _, old_val) = self._remove(pending_root, 0, &boxed_key)?;
+        self.cache.borrow_mut().set_pending_root(new_root);
+
+        Ok(old_val)
+    }
+
+    fn _remove(
+        &mut self,
+        ptr: NodePtrRef,
+        bit_depth: Depth,
+        key: &Key,
+    ) -> Result<(NodePtrRef, bool, Option<Value>)> {
+        let node_ref = self
+            .cache
+            .borrow_mut()
+            .deref_node_ptr(ptr.clone(), Some(FetcherSyncGet::new(key, true)))?;
+
+        match classify_noderef!(?node_ref) {
+            NodeKind::None => {
+                // Remove from nil node.
+                Ok((NodePointer::null_ptr(), false, None))
+            }
+            NodeKind::Internal => {
+                // Remove from internal node and recursively collapse the path, if needed.
+                let node_ref = node_ref.unwrap();
+                let (changed, old_val): (bool, Option<Value>);
+                let (remaining_leaf, remaining_left, remaining_right): (
+                    Option<NodeRef>,
+                    Option<NodeRef>,
+                    Option<NodeRef>,
+                );
+                if let NodeBox::Internal(ref mut n) = *node_ref.borrow_mut() {
+                    // Remove from internal node and recursively collapse the branch, if
+                    // needed.
+                    let bit_length = bit_depth + n.label_bit_length;
+
+                    if key.bit_length() < bit_length {
+                        // Lookup key is too short for the current n.Label, so it doesn't exist.
+                        return Ok((ptr, false, None));
+                    }
+
+                    let (new_child, c, o) = if key.bit_length() == bit_length {
+                        self._remove(n.leaf_node.clone(), bit_depth, key)?
+                    } else if key.get_bit(bit_length) {
+                        self._remove(n.right.clone(), bit_length, key)?
+                    } else {
+                        self._remove(n.left.clone(), bit_length, key)?
+                    };
+
+                    changed = c;
+                    old_val = o;
+
+                    if key.bit_length() == bit_length {
+                        n.leaf_node = new_child;
+                    } else if key.get_bit(bit_length) {
+                        n.right = new_child;
+                    } else {
+                        n.left = new_child;
+                    }
+
+                    // Fetch and check the remaining children.
+                    // NOTE: The leaf node is always included with the internal node.
+                    remaining_leaf = n.leaf_node.borrow().node.clone();
+                    remaining_left = self
+                        .cache
+                        .borrow_mut()
+                        .deref_node_ptr(n.left.clone(), Some(FetcherSyncGet::new(key, true)))?;
+                    remaining_right = self
+                        .cache
+                        .borrow_mut()
+                        .deref_node_ptr(n.right.clone(), Some(FetcherSyncGet::new(key, true)))?;
+                } else {
+                    unreachable!("node kind is Internal");
+                }
+
+                // If exactly one child including LeafNode remains, collapse it.
+                match remaining_leaf {
+                    Some(_) => match remaining_left {
+                        Some(_) => (),
+                        None => match remaining_right {
+                            None => {
+                                let nd_leaf = noderef_as!(node_ref, Internal).leaf_node.clone();
+                                noderef_as_mut!(node_ref, Internal).leaf_node =
+                                    NodePointer::null_ptr();
+                                self.cache.borrow_mut().remove_node(ptr);
+                                return Ok((nd_leaf, true, old_val));
+                            }
+                            Some(_) => (),
+                        },
+                    },
+                    None => {
+                        let mut nd_child: Option<NodeRef> = None;
+                        let mut node_ptr: NodePtrRef = NodePointer::null_ptr();
+                        let mut both_children = true;
+                        match remaining_left {
+                            Some(_) => match remaining_right {
+                                None => {
+                                    node_ptr = noderef_as!(node_ref, Internal).left.clone();
+                                    noderef_as_mut!(node_ref, Internal).left =
+                                        NodePointer::null_ptr();
+                                    nd_child = remaining_left;
+                                    both_children = false;
+                                }
+                                Some(_) => (),
+                            },
+                            None => match remaining_right {
+                                None => (),
+                                Some(_) => {
+                                    node_ptr = noderef_as!(node_ref, Internal).right.clone();
+                                    noderef_as_mut!(node_ref, Internal).right =
+                                        NodePointer::null_ptr();
+                                    nd_child = remaining_right;
+                                    both_children = false;
+                                }
+                            },
+                        }
+
+                        if !both_children {
+                            // If child is an internal node, also fix the label.
+                            if let Some(nd_child) = nd_child {
+                                if let NodeKind::Internal = classify_noderef!(nd_child) {
+                                    if let NodeBox::Internal(ref mut inode) = *nd_child.borrow_mut()
+                                    {
+                                        inode.label = noderef_as!(node_ref, Internal).label.merge(
+                                            noderef_as!(node_ref, Internal).label_bit_length,
+                                            &inode.label,
+                                            inode.label_bit_length,
+                                        );
+                                        inode.label_bit_length +=
+                                            noderef_as!(node_ref, Internal).label_bit_length;
+                                        inode.clean = false;
+                                        node_ptr.borrow_mut().clean = false;
+                                    }
+                                }
+                            }
+
+                            self.cache.borrow_mut().remove_node(ptr);
+                            return Ok((node_ptr, true, old_val));
+                        }
+                    }
+                };
+
+                // Two or more children including leaf_node remain, just mark dirty bit.
+                if changed {
+                    noderef_as_mut!(node_ref, Internal).clean = false;
+                    ptr.borrow_mut().clean = false;
+                    // No longer eligible for eviction as it is dirty.
+                    self.cache
+                        .borrow_mut()
+                        .rollback_node(ptr.clone(), NodeKind::Internal);
+                }
+
+                Ok((ptr, changed, old_val))
+            }
+            NodeKind::Leaf => {
+                // Remove from leaf node.
+                let node_ref = node_ref.unwrap();
+                if noderef_as!(node_ref, Leaf).key == *key {
+                    let old_val = noderef_as!(node_ref, Leaf).value.clone();
+                    self.cache.borrow_mut().remove_node(ptr);
+                    return Ok((NodePointer::null_ptr(), true, Some(old_val)));
+                }
+
+                Ok((ptr, false, None))
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/storage/mod.rs.html b/rust/src/oasis_core_runtime/storage/mod.rs.html new file mode 100644 index 0000000000..48d9b2e47c --- /dev/null +++ b/rust/src/oasis_core_runtime/storage/mod.rs.html @@ -0,0 +1,133 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
//! Runtime storage interfaces and implementations.
+use std::{
+    collections::HashMap,
+    sync::{Arc, Mutex},
+};
+
+use crate::types::Error;
+
+pub mod mkvs;
+
+// Re-exports.
+pub use self::mkvs::MKVS;
+
+/// Trivial key/value storage.
+pub trait KeyValue: Send + Sync {
+    /// Fetch the value for a specific key.
+    fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>;
+
+    /// Store a specific key/value into storage.
+    fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>;
+}
+
+impl<T: ?Sized + KeyValue> KeyValue for Arc<T> {
+    fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error> {
+        KeyValue::get(&**self, key)
+    }
+
+    fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error> {
+        KeyValue::insert(&**self, key, value)
+    }
+}
+
+/// Untrusted key/value storage which stores arbitrary binary key/value pairs
+/// in memory.
+pub struct UntrustedInMemoryStorage {
+    store: Mutex<HashMap<Vec<u8>, Vec<u8>>>,
+}
+
+impl UntrustedInMemoryStorage {
+    pub fn new() -> Self {
+        Self {
+            store: Mutex::new(HashMap::new()),
+        }
+    }
+}
+
+impl KeyValue for UntrustedInMemoryStorage {
+    fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error> {
+        // Return an empty vector if the key is not found.
+        let cache = self.store.lock().unwrap();
+        let value = cache.get(&key).cloned().unwrap_or_default();
+        Ok(value)
+    }
+
+    fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error> {
+        let mut cache = self.store.lock().unwrap();
+        cache.insert(key, value);
+        Ok(())
+    }
+}
+
+impl Default for UntrustedInMemoryStorage {
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/transaction/context.rs.html b/rust/src/oasis_core_runtime/transaction/context.rs.html new file mode 100644 index 0000000000..fb1bf96226 --- /dev/null +++ b/rust/src/oasis_core_runtime/transaction/context.rs.html @@ -0,0 +1,129 @@ +context.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+
//! Runtime call context.
+use std::sync::Arc;
+
+use crate::{
+    consensus::{
+        beacon::EpochTime,
+        roothash::{Header, RoundResults},
+        state::ConsensusState,
+        LightBlock,
+    },
+    protocol::Protocol,
+    storage::MKVS,
+};
+
+/// Transaction context.
+pub struct Context<'a> {
+    /// Low-level access to the underlying Runtime Host Protocol.
+    pub protocol: Arc<Protocol>,
+    /// Consensus light block.
+    pub consensus_block: &'a LightBlock,
+    /// Consensus state tree.
+    pub consensus_state: ConsensusState,
+    /// Runtime state.
+    pub runtime_state: &'a mut dyn MKVS,
+    /// The block header accompanying this transaction.
+    pub header: &'a Header,
+    /// Epoch corresponding to the currently processed block.
+    pub epoch: EpochTime,
+    /// Results of processing the previous successful round.
+    pub round_results: &'a RoundResults,
+    /// The maximum number of messages that can be emitted in this round.
+    pub max_messages: u32,
+    /// Flag indicating whether to only perform transaction check rather than
+    /// running the transaction.
+    pub check_only: bool,
+}
+
+impl<'a> Context<'a> {
+    /// Construct new transaction context.
+    #[allow(clippy::too_many_arguments)]
+    pub fn new(
+        protocol: Arc<Protocol>,
+        consensus_block: &'a LightBlock,
+        consensus_state: ConsensusState,
+        runtime_state: &'a mut dyn MKVS,
+        header: &'a Header,
+        epoch: EpochTime,
+        round_results: &'a RoundResults,
+        max_messages: u32,
+        check_only: bool,
+    ) -> Self {
+        Self {
+            protocol,
+            consensus_block,
+            consensus_state,
+            runtime_state,
+            header,
+            epoch,
+            round_results,
+            max_messages,
+            check_only,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/transaction/dispatcher.rs.html b/rust/src/oasis_core_runtime/transaction/dispatcher.rs.html new file mode 100644 index 0000000000..4bb87462eb --- /dev/null +++ b/rust/src/oasis_core_runtime/transaction/dispatcher.rs.html @@ -0,0 +1,495 @@ +dispatcher.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+
//! Runtime transaction batch dispatcher.
+use std::sync::{atomic::AtomicBool, Arc};
+
+use super::{context::Context, tags::Tags, types::TxnBatch};
+use crate::{
+    common::crypto::hash::Hash,
+    consensus::roothash,
+    types::{CheckTxResult, Error as RuntimeError},
+};
+
+/// Runtime transaction dispatcher trait.
+///
+/// It defines the interface used by the runtime call dispatcher
+/// to process transactions.
+pub trait Dispatcher: Send + Sync {
+    /// Whether dispatch is supported by this dispatcher.
+    fn is_supported(&self) -> bool {
+        true
+    }
+
+    /// Execute the transactions in the given batch.
+    ///
+    /// # Consensus Layer State Integrity
+    ///
+    /// Before this method is invoked, consensus layer state integrity verification is performed.
+    fn execute_batch(
+        &self,
+        ctx: Context,
+        batch: &TxnBatch,
+        in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError>;
+
+    /// Schedule and execute transactions in the given batch.
+    ///
+    /// The passed batch is an initial batch. In case the runtime needs additional items it should
+    /// request them from the host.
+    ///
+    /// # Consensus Layer State Integrity
+    ///
+    /// Before this method is invoked, consensus layer state integrity verification is performed.
+    fn schedule_and_execute_batch(
+        &self,
+        _ctx: Context,
+        _initial_batch: &mut TxnBatch,
+        _in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        Err(RuntimeError::new(
+            "rhp/dispatcher",
+            3,
+            "scheduling not supported",
+        ))
+    }
+
+    /// Check the transactions in the given batch for validity.
+    ///
+    /// # Consensus Layer State Integrity
+    ///
+    /// No consensus layer state integrity verification is performed for queries by default. The
+    /// runtime dispatcher implementation should perform integrity verification if needed on a
+    /// query-by-query basis.
+    fn check_batch(
+        &self,
+        ctx: Context,
+        batch: &TxnBatch,
+    ) -> Result<Vec<CheckTxResult>, RuntimeError>;
+
+    /// Invoke the finalizer (if any).
+    fn finalize(&self, _new_storage_root: Hash) {
+        // Default implementation does nothing.
+    }
+
+    /// Configure abort batch flag.
+    fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>) {
+        // Default implementation does nothing.
+    }
+
+    /// Process a query.
+    ///
+    /// # Consensus Layer State Integrity
+    ///
+    /// No consensus layer state integrity verification is performed for queries by default. The
+    /// runtime dispatcher implementation should perform integrity verification if needed on a
+    /// query-by-query basis.
+    fn query(&self, _ctx: Context, _method: &str, _args: Vec<u8>) -> Result<Vec<u8>, RuntimeError> {
+        // Default implementation returns an error.
+        Err(RuntimeError::new(
+            "rhp/dispatcher",
+            2,
+            "query not supported",
+        ))
+    }
+}
+
+impl<T: Dispatcher + ?Sized> Dispatcher for Box<T> {
+    fn execute_batch(
+        &self,
+        ctx: Context,
+        batch: &TxnBatch,
+        in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        T::execute_batch(&**self, ctx, batch, in_msgs)
+    }
+
+    fn schedule_and_execute_batch(
+        &self,
+        ctx: Context,
+        initial_batch: &mut TxnBatch,
+        in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        T::schedule_and_execute_batch(&**self, ctx, initial_batch, in_msgs)
+    }
+
+    fn check_batch(
+        &self,
+        ctx: Context,
+        batch: &TxnBatch,
+    ) -> Result<Vec<CheckTxResult>, RuntimeError> {
+        T::check_batch(&**self, ctx, batch)
+    }
+
+    fn finalize(&self, new_storage_root: Hash) {
+        T::finalize(&**self, new_storage_root)
+    }
+
+    fn set_abort_batch_flag(&mut self, abort_batch: Arc<AtomicBool>) {
+        T::set_abort_batch_flag(&mut **self, abort_batch)
+    }
+
+    fn query(&self, ctx: Context, method: &str, args: Vec<u8>) -> Result<Vec<u8>, RuntimeError> {
+        T::query(&**self, ctx, method, args)
+    }
+}
+
+impl<T: Dispatcher + ?Sized> Dispatcher for Arc<T> {
+    fn execute_batch(
+        &self,
+        ctx: Context,
+        batch: &TxnBatch,
+        in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        T::execute_batch(&**self, ctx, batch, in_msgs)
+    }
+
+    fn schedule_and_execute_batch(
+        &self,
+        ctx: Context,
+        initial_batch: &mut TxnBatch,
+        in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        T::schedule_and_execute_batch(&**self, ctx, initial_batch, in_msgs)
+    }
+
+    fn check_batch(
+        &self,
+        ctx: Context,
+        batch: &TxnBatch,
+    ) -> Result<Vec<CheckTxResult>, RuntimeError> {
+        T::check_batch(&**self, ctx, batch)
+    }
+
+    fn finalize(&self, new_storage_root: Hash) {
+        T::finalize(&**self, new_storage_root)
+    }
+
+    fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>) {
+        unimplemented!()
+    }
+
+    fn query(&self, ctx: Context, method: &str, args: Vec<u8>) -> Result<Vec<u8>, RuntimeError> {
+        T::query(&**self, ctx, method, args)
+    }
+}
+
+/// Result of processing an ExecuteTx.
+pub struct ExecuteTxResult {
+    /// Transaction output.
+    pub output: Vec<u8>,
+    /// Emitted tags.
+    pub tags: Tags,
+}
+
+/// Result of processing a batch of ExecuteTx.
+pub struct ExecuteBatchResult {
+    /// Per-transaction execution results.
+    pub results: Vec<ExecuteTxResult>,
+    /// Emitted runtime messages.
+    pub messages: Vec<roothash::Message>,
+    /// Number of processed incoming messages.
+    pub in_msgs_count: usize,
+    /// Block emitted tags (not emitted by a specific transaction).
+    pub block_tags: Tags,
+    /// Hashes of transactions to reject.
+    ///
+    /// Note that these are only taken into account in schedule execution mode.
+    pub tx_reject_hashes: Vec<Hash>,
+}
+
+/// No-op dispatcher.
+///
+/// This is mainly used by the runtime dispatcher as a fallback in case
+/// the runtime's initializer doesn't produce its own dispatcher object.
+#[derive(Default)]
+pub struct NoopDispatcher;
+
+impl Dispatcher for NoopDispatcher {
+    fn is_supported(&self) -> bool {
+        false
+    }
+
+    fn execute_batch(
+        &self,
+        _ctx: Context,
+        _batch: &TxnBatch,
+        in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        Ok(ExecuteBatchResult {
+            results: Vec::new(),
+            messages: Vec::new(),
+            block_tags: Tags::new(),
+            in_msgs_count: in_msgs.len(),
+            tx_reject_hashes: Vec::new(),
+        })
+    }
+
+    fn schedule_and_execute_batch(
+        &self,
+        _ctx: Context,
+        _initial_batch: &mut TxnBatch,
+        in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        Ok(ExecuteBatchResult {
+            results: Vec::new(),
+            messages: Vec::new(),
+            block_tags: Tags::new(),
+            in_msgs_count: in_msgs.len(),
+            tx_reject_hashes: Vec::new(),
+        })
+    }
+
+    fn check_batch(
+        &self,
+        _ctx: Context,
+        _batch: &TxnBatch,
+    ) -> Result<Vec<CheckTxResult>, RuntimeError> {
+        Ok(Vec::new())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/transaction/mod.rs.html b/rust/src/oasis_core_runtime/transaction/mod.rs.html new file mode 100644 index 0000000000..62247504e6 --- /dev/null +++ b/rust/src/oasis_core_runtime/transaction/mod.rs.html @@ -0,0 +1,23 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+
//! Runtime transaction processing.
+
+pub mod context;
+pub mod dispatcher;
+pub mod rwset;
+pub mod tags;
+pub mod tree;
+pub mod types;
+
+// Re-exports.
+pub use self::context::Context;
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/transaction/rwset.rs.html b/rust/src/oasis_core_runtime/transaction/rwset.rs.html new file mode 100644 index 0000000000..ef43262a22 --- /dev/null +++ b/rust/src/oasis_core_runtime/transaction/rwset.rs.html @@ -0,0 +1,117 @@ +rwset.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
//! Read/write set.
+
+/// A coarsened key prefix that represents any key that starts with
+/// this prefix.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[cbor(transparent)]
+pub struct CoarsenedKey(pub Vec<u8>);
+
+impl AsRef<[u8]> for CoarsenedKey {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl From<CoarsenedKey> for Vec<u8> {
+    fn from(val: CoarsenedKey) -> Self {
+        val.0
+    }
+}
+
+impl From<Vec<u8>> for CoarsenedKey {
+    fn from(v: Vec<u8>) -> CoarsenedKey {
+        CoarsenedKey(v)
+    }
+}
+
+/// A set of coarsened keys.
+pub type CoarsenedSet = Vec<CoarsenedKey>;
+
+/// A read/write set.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct ReadWriteSet {
+    /// Size of the key prefixes (in bytes) used for coarsening the keys.
+    pub granularity: u16,
+    /// The read set.
+    pub read_set: CoarsenedSet,
+    /// The write set.
+    pub write_set: CoarsenedSet,
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn test_serialization() {
+        let rw_set = ReadWriteSet {
+            granularity: 3,
+            read_set: vec![b"foo".to_vec().into(), b"bar".to_vec().into()],
+            write_set: vec![b"moo".to_vec().into()],
+        };
+
+        let enc = cbor::to_vec(rw_set.clone());
+
+        let dec_rw_set: ReadWriteSet = cbor::from_slice(&enc).unwrap();
+        assert_eq!(rw_set, dec_rw_set, "serialization should round-trip");
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/transaction/tags.rs.html b/rust/src/oasis_core_runtime/transaction/tags.rs.html new file mode 100644 index 0000000000..57102138bb --- /dev/null +++ b/rust/src/oasis_core_runtime/transaction/tags.rs.html @@ -0,0 +1,63 @@ +tags.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+
//! Transaction tags.
+use crate::common::crypto::hash::Hash;
+
+/// Tag is a key/value pair of arbitrary byte blobs with runtime-dependent
+/// semantics which can be indexed to allow easier lookup of blocks and
+/// transactions on runtime clients.
+#[derive(Clone, Debug, Default)]
+pub struct Tag {
+    /// The tag key.
+    pub key: Vec<u8>,
+    /// The tag value.
+    pub value: Vec<u8>,
+    /// The hash of the transaction that emitted the tag.
+    pub tx_hash: Hash,
+}
+
+/// A set of tags.
+pub type Tags = Vec<Tag>;
+
+impl Tag {
+    /// Create a new tag.
+    ///
+    /// The transaction hash is not initialized.
+    pub fn new(key: Vec<u8>, value: Vec<u8>) -> Self {
+        Self {
+            key,
+            value,
+            ..Default::default()
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/transaction/tree.rs.html b/rust/src/oasis_core_runtime/transaction/tree.rs.html new file mode 100644 index 0000000000..6973c43ce8 --- /dev/null +++ b/rust/src/oasis_core_runtime/transaction/tree.rs.html @@ -0,0 +1,525 @@ +tree.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+
//! Transaction I/O tree.
+use anyhow::{anyhow, Result};
+
+use super::tags::Tags;
+use crate::{
+    common::{crypto::hash::Hash, key_format::KeyFormat},
+    storage::mkvs::{self, sync::ReadSync, Root, WriteLog},
+};
+
+// NOTE: This should be kept in sync with go/runtime/transaction/transaction.go.
+
+#[derive(Debug)]
+#[repr(u8)]
+enum ArtifactKind {
+    Input = 1,
+    Output = 2,
+}
+
+// Workaround because rust doesn't support `as u8` inside match arms.
+// See https://github.com/rust-lang/rust/issues/44266
+const ARTIFACT_KIND_INPUT: u8 = ArtifactKind::Input as u8;
+const ARTIFACT_KIND_OUTPUT: u8 = ArtifactKind::Output as u8;
+
+/// Key format used for transaction artifacts.
+#[derive(Debug)]
+struct TxnKeyFormat {
+    /// Transaction hash.
+    tx_hash: Hash,
+    /// Artifact kind.
+    kind: ArtifactKind,
+}
+
+impl KeyFormat for TxnKeyFormat {
+    fn prefix() -> u8 {
+        b'T'
+    }
+
+    fn size() -> usize {
+        32 + 1
+    }
+
+    fn encode_atoms(self, atoms: &mut Vec<Vec<u8>>) {
+        atoms.push(self.tx_hash.as_ref().to_vec());
+        match self.kind {
+            ArtifactKind::Input => atoms.push(vec![ARTIFACT_KIND_INPUT]),
+            ArtifactKind::Output => atoms.push(vec![ARTIFACT_KIND_OUTPUT]),
+        }
+    }
+
+    fn decode_atoms(data: &[u8]) -> Self {
+        Self {
+            tx_hash: data[..32].into(),
+            kind: match data[32] {
+                ARTIFACT_KIND_INPUT => ArtifactKind::Input,
+                ARTIFACT_KIND_OUTPUT => ArtifactKind::Output,
+                other => panic!("transaction: malformed artifact kind ({:?})", other),
+            },
+        }
+    }
+}
+
+/// Key format used for emitted tags.
+///
+/// This is kept separate so that clients can query only tags they are
+/// interested in instead of needing to go through all transactions.
+#[derive(Debug, Default)]
+struct TagKeyFormat {
+    /// Tag key.
+    key: Vec<u8>,
+    /// Transaction hash of the transaction that emitted the tag.
+    tx_hash: Hash,
+}
+
+/// Hash used for block emitted tags not tied to a specific transaction.
+pub const TAG_BLOCK_TX_HASH: Hash = Hash([0u8; 32]);
+
+impl KeyFormat for TagKeyFormat {
+    fn prefix() -> u8 {
+        b'E'
+    }
+
+    fn size() -> usize {
+        32
+    }
+
+    fn encode_atoms(self, atoms: &mut Vec<Vec<u8>>) {
+        atoms.push(self.key);
+        atoms.push(self.tx_hash.as_ref().to_vec());
+    }
+
+    fn decode_atoms(data: &[u8]) -> Self {
+        let offset = data.len() - Self::size();
+        let key = data[0..offset].to_vec();
+        let tx_hash = data[offset..].into();
+
+        Self { key, tx_hash }
+    }
+}
+
+/// The input transaction artifacts.
+///
+/// These are the artifacts that are stored CBOR-serialized in the Merkle tree.
+#[derive(Clone, Debug, Default, PartialEq, cbor::Encode, cbor::Decode)]
+#[cbor(as_array)]
+struct InputArtifacts {
+    /// Transaction input.
+    pub input: Vec<u8>,
+    /// Transaction order within the batch.
+    ///
+    /// This is only relevant within the committee that is processing the batch
+    /// and should be ignored once transactions from multiple committees are
+    /// merged together.
+    pub batch_order: u32,
+}
+
+/// The output transaction artifacts.
+///
+/// These are the artifacts that are stored CBOR-serialized in the Merkle tree.
+#[derive(Clone, Debug, Default, PartialEq, cbor::Encode, cbor::Decode)]
+#[cbor(as_array)]
+struct OutputArtifacts {
+    /// Transaction output.
+    pub output: Vec<u8>,
+}
+
+/// A Merkle tree containing transaction artifacts.
+pub struct Tree {
+    io_root: Root,
+    tree: mkvs::OverlayTree<mkvs::Tree>,
+}
+
+impl Tree {
+    /// Create a new transaction artifacts tree.
+    pub fn new(read_syncer: Box<dyn ReadSync>, io_root: Root) -> Self {
+        Self {
+            io_root,
+            tree: mkvs::OverlayTree::new(
+                mkvs::Tree::builder().with_root(io_root).build(read_syncer),
+            ),
+        }
+    }
+
+    /// Add an input transaction artifact.
+    pub fn add_input(&mut self, input: Vec<u8>, batch_order: u32) -> Result<()> {
+        if input.is_empty() {
+            return Err(anyhow!("transaction: no input given"));
+        }
+
+        let tx_hash = Hash::digest_bytes(&input);
+
+        self.tree.insert(
+            &TxnKeyFormat {
+                tx_hash,
+                kind: ArtifactKind::Input,
+            }
+            .encode(),
+            &cbor::to_vec(InputArtifacts { input, batch_order }),
+        )?;
+
+        Ok(())
+    }
+
+    /// Add an output transaction artifact.
+    pub fn add_output(&mut self, tx_hash: Hash, output: Vec<u8>, tags: Tags) -> Result<()> {
+        self.tree.insert(
+            &TxnKeyFormat {
+                tx_hash,
+                kind: ArtifactKind::Output,
+            }
+            .encode(),
+            &cbor::to_vec(OutputArtifacts { output }),
+        )?;
+
+        // Add tags if specified.
+        for tag in tags {
+            self.tree.insert(
+                &TagKeyFormat {
+                    key: tag.key,
+                    tx_hash,
+                }
+                .encode(),
+                &tag.value,
+            )?;
+        }
+
+        Ok(())
+    }
+
+    /// Add block tags.
+    pub fn add_block_tags(&mut self, tags: Tags) -> Result<()> {
+        for tag in tags {
+            self.tree.insert(
+                &TagKeyFormat {
+                    key: tag.key,
+                    tx_hash: TAG_BLOCK_TX_HASH,
+                }
+                .encode(),
+                &tag.value,
+            )?;
+        }
+
+        Ok(())
+    }
+
+    /// Commit updates to the underlying Merkle tree and return the write
+    /// log and root hash.
+    pub fn commit(&mut self) -> Result<(WriteLog, Hash)> {
+        self.tree
+            .commit_both(self.io_root.namespace, self.io_root.version)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::storage::mkvs::sync::*;
+
+    use super::{super::tags::Tag, *};
+
+    #[test]
+    fn test_transaction() {
+        let mut tree = Tree::new(
+            Box::new(NoopReadSyncer),
+            Root {
+                hash: Hash::empty_hash(),
+                ..Default::default()
+            },
+        );
+
+        let input = b"this goes in".to_vec();
+        let tx_hash = Hash::digest_bytes(&input);
+        tree.add_input(input, 0).unwrap();
+        tree.add_output(
+            tx_hash,
+            b"and this comes out".to_vec(),
+            vec![Tag::new(b"tag1".to_vec(), b"value1".to_vec())],
+        )
+        .unwrap();
+
+        for i in 0..20 {
+            let input = format!("this goes in ({})", i).into_bytes();
+            let tx_hash = Hash::digest_bytes(&input);
+
+            tree.add_input(input, i + 1).unwrap();
+            tree.add_output(
+                tx_hash,
+                b"and this comes out".to_vec(),
+                vec![
+                    Tag::new(b"tagA".to_vec(), b"valueA".to_vec()),
+                    Tag::new(b"tagB".to_vec(), b"valueB".to_vec()),
+                ],
+            )
+            .unwrap();
+        }
+
+        // NOTE: This root is synced with go/runtime/transaction/transaction_test.go.
+        let (_, root_hash) = tree.commit().unwrap();
+        assert_eq!(
+            format!("{:?}", root_hash),
+            "8399ffa753987b00ec6ab251337c6b88e40812662ed345468fcbf1dbdd16321c",
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/transaction/types.rs.html b/rust/src/oasis_core_runtime/transaction/types.rs.html new file mode 100644 index 0000000000..3c6411c5a0 --- /dev/null +++ b/rust/src/oasis_core_runtime/transaction/types.rs.html @@ -0,0 +1,143 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
//! Transaction protocol types.
+use std::{
+    collections::VecDeque,
+    ops::{Deref, DerefMut},
+};
+
+/// Batch of transaction inputs/outputs.
+#[derive(Clone, Debug, Default, Eq, PartialEq, cbor::Encode, cbor::Decode)]
+#[cbor(transparent)]
+pub struct TxnBatch(pub Vec<Vec<u8>>);
+
+impl TxnBatch {
+    pub fn new(txs: Vec<Vec<u8>>) -> TxnBatch {
+        TxnBatch(txs)
+    }
+}
+
+impl Deref for TxnBatch {
+    type Target = Vec<Vec<u8>>;
+
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+impl DerefMut for TxnBatch {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut self.0
+    }
+}
+
+impl From<Vec<Vec<u8>>> for TxnBatch {
+    fn from(other: Vec<Vec<u8>>) -> TxnBatch {
+        TxnBatch(other)
+    }
+}
+
+impl From<VecDeque<Vec<u8>>> for TxnBatch {
+    fn from(other: VecDeque<Vec<u8>>) -> TxnBatch {
+        TxnBatch(other.into())
+    }
+}
+
+impl From<TxnBatch> for Vec<Vec<u8>> {
+    fn from(val: TxnBatch) -> Self {
+        val.0
+    }
+}
+
+impl From<TxnBatch> for VecDeque<Vec<u8>> {
+    fn from(val: TxnBatch) -> Self {
+        val.0.into()
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    use crate::common::crypto::hash::Hash;
+
+    #[test]
+    fn test_consistent_hash() {
+        let batch = TxnBatch(vec![b"foo".to_vec(), b"bar".to_vec(), b"aaa".to_vec()]);
+        let h = Hash::digest_bytes(&cbor::to_vec(batch));
+        assert_eq!(
+            h,
+            Hash::from("c451dd4fd065b815e784aac6b300e479b2167408f0eebbb95a8bd36b9e71e34d")
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_core_runtime/types.rs.html b/rust/src/oasis_core_runtime/types.rs.html new file mode 100644 index 0000000000..4ff28ff85c --- /dev/null +++ b/rust/src/oasis_core_runtime/types.rs.html @@ -0,0 +1,1065 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+
//! Types used by the worker-host protocol.
+use std::collections::BTreeMap;
+
+use thiserror::Error;
+
+use crate::{
+    common::{
+        crypto::{
+            hash::Hash,
+            signature::{self, Signature},
+            x25519,
+        },
+        namespace::Namespace,
+        sgx::{ias::AVR, Quote, QuotePolicy},
+        version::Version,
+    },
+    consensus::{
+        self,
+        beacon::EpochTime,
+        registry::EndorsedCapabilityTEE,
+        roothash::{self, Block, ComputeResultsHeader, Header},
+        state::keymanager::Status as KeyManagerStatus,
+        transaction::{Proof, SignedTransaction},
+        LightBlock,
+    },
+    enclave_rpc,
+    storage::mkvs::{sync, WriteLog},
+    transaction::types::TxnBatch,
+};
+
+/// Computed batch.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ComputedBatch {
+    /// Compute results header.
+    pub header: ComputeResultsHeader,
+    /// Log that generates the I/O tree.
+    pub io_write_log: WriteLog,
+    /// Log of changes to the state tree.
+    pub state_write_log: WriteLog,
+    /// If this runtime uses a TEE, then this is the signature of the batch's
+    /// BatchSigMessage with the node's RAK for this runtime.
+    pub rak_sig: Signature,
+    /// Messages emitted by the runtime.
+    pub messages: Vec<roothash::Message>,
+}
+
+/// Storage sync request.
+#[derive(Debug, cbor::Encode, cbor::Decode)]
+pub enum StorageSyncRequest {
+    SyncGet(sync::GetRequest),
+    SyncGetPrefixes(sync::GetPrefixesRequest),
+    SyncIterate(sync::IterateRequest),
+}
+
+#[derive(Debug)]
+pub struct StorageSyncRequestWithEndpoint {
+    pub endpoint: HostStorageEndpoint,
+    pub request: StorageSyncRequest,
+}
+
+impl cbor::Encode for StorageSyncRequestWithEndpoint {
+    fn into_cbor_value(self) -> cbor::Value {
+        let mut request = cbor::EncodeAsMap::into_cbor_map(self.request);
+        // Add endpoint to the given map.
+        let key = cbor::values::IntoCborValue::into_cbor_value("endpoint");
+        request.push((key, self.endpoint.into_cbor_value()));
+        cbor::Value::Map(request)
+    }
+}
+
+impl cbor::Decode for StorageSyncRequestWithEndpoint {
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::Map(mut items) => {
+                // Take the endpoint field from the map and decode the rest.
+                let key = cbor::values::IntoCborValue::into_cbor_value("endpoint");
+                let (index, _) = items
+                    .iter()
+                    .enumerate()
+                    .find(|(_, v)| v.0 == key)
+                    .ok_or(cbor::DecodeError::MissingField)?;
+                let endpoint = items.remove(index).1;
+
+                Ok(Self {
+                    endpoint: cbor::Decode::try_from_cbor_value(endpoint)?,
+                    request: cbor::Decode::try_from_cbor_value(cbor::Value::Map(items))?,
+                })
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+/// Storage sync response.
+#[derive(Debug, cbor::Encode, cbor::Decode)]
+pub enum StorageSyncResponse {
+    ProofResponse(sync::ProofResponse),
+}
+
+/// Host storage endpoint.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum HostStorageEndpoint {
+    Runtime = 0,
+    Consensus = 1,
+}
+
+/// Runtime host protocol message body.
+#[derive(Debug, cbor::Encode, cbor::Decode)]
+pub enum Body {
+    // An empty body.
+    Empty {},
+
+    // An error response.
+    Error(Error),
+
+    // Runtime interface.
+    RuntimeInfoRequest(RuntimeInfoRequest),
+    RuntimeInfoResponse(RuntimeInfoResponse),
+    RuntimePingRequest {},
+    RuntimeShutdownRequest {},
+    RuntimeAbortRequest {},
+    RuntimeAbortResponse {},
+    RuntimeCapabilityTEERakInitRequest {
+        target_info: Vec<u8>,
+    },
+    RuntimeCapabilityTEERakInitResponse {},
+    RuntimeCapabilityTEERakReportRequest {},
+    RuntimeCapabilityTEERakReportResponse {
+        rak_pub: signature::PublicKey,
+        rek_pub: x25519::PublicKey,
+        report: Vec<u8>,
+        nonce: String,
+    },
+    RuntimeCapabilityTEERakAvrRequest {
+        avr: AVR,
+    },
+    RuntimeCapabilityTEERakAvrResponse {},
+    RuntimeCapabilityTEERakQuoteRequest {
+        quote: Quote,
+    },
+    RuntimeCapabilityTEERakQuoteResponse {
+        height: u64,
+        signature: Signature,
+    },
+    RuntimeCapabilityTEEUpdateEndorsementRequest {
+        ect: EndorsedCapabilityTEE,
+    },
+    RuntimeCapabilityTEEUpdateEndorsementResponse {},
+    RuntimeRPCCallRequest {
+        request: Vec<u8>,
+        kind: enclave_rpc::types::Kind,
+        peer_id: Vec<u8>,
+    },
+    RuntimeRPCCallResponse {
+        response: Vec<u8>,
+    },
+    RuntimeLocalRPCCallRequest {
+        request: Vec<u8>,
+    },
+    RuntimeLocalRPCCallResponse {
+        response: Vec<u8>,
+    },
+    RuntimeCheckTxBatchRequest {
+        consensus_block: LightBlock,
+        inputs: TxnBatch,
+        block: Block,
+        epoch: EpochTime,
+        max_messages: u32,
+    },
+    RuntimeCheckTxBatchResponse {
+        results: Vec<CheckTxResult>,
+    },
+    RuntimeExecuteTxBatchRequest {
+        #[cbor(optional)]
+        mode: ExecutionMode,
+        consensus_block: LightBlock,
+        round_results: roothash::RoundResults,
+        io_root: Hash,
+        #[cbor(optional)]
+        inputs: Option<TxnBatch>,
+        #[cbor(optional)]
+        in_msgs: Vec<roothash::IncomingMessage>,
+        block: Block,
+        epoch: EpochTime,
+        max_messages: u32,
+    },
+    RuntimeExecuteTxBatchResponse {
+        batch: ComputedBatch,
+
+        tx_hashes: Vec<Hash>,
+        tx_reject_hashes: Vec<Hash>,
+        tx_input_root: Hash,
+        tx_input_write_log: WriteLog,
+    },
+    RuntimeKeyManagerStatusUpdateRequest {
+        status: KeyManagerStatus,
+    },
+    RuntimeKeyManagerStatusUpdateResponse {},
+    RuntimeKeyManagerQuotePolicyUpdateRequest {
+        policy: QuotePolicy,
+    },
+    RuntimeKeyManagerQuotePolicyUpdateResponse {},
+    RuntimeQueryRequest {
+        consensus_block: LightBlock,
+        header: Header,
+        epoch: EpochTime,
+        max_messages: u32,
+        method: String,
+        #[cbor(optional)]
+        args: Vec<u8>,
+    },
+    RuntimeQueryResponse {
+        #[cbor(optional)]
+        data: Vec<u8>,
+    },
+    RuntimeConsensusSyncRequest {
+        height: u64,
+    },
+    RuntimeConsensusSyncResponse {},
+    RuntimeNotifyRequest {
+        #[cbor(optional)]
+        runtime_block: Option<roothash::AnnotatedBlock>,
+        #[cbor(optional)]
+        runtime_event: Option<RuntimeNotifyEvent>,
+    },
+    RuntimeNotifyResponse {},
+
+    // Host interface.
+    HostRPCCallRequest {
+        endpoint: String,
+        request_id: u64,
+        request: Vec<u8>,
+        kind: enclave_rpc::types::Kind,
+        nodes: Vec<signature::PublicKey>,
+    },
+    HostRPCCallResponse {
+        response: Vec<u8>,
+        node: signature::PublicKey,
+    },
+    HostSubmitPeerFeedbackRequest {
+        endpoint: String,
+        request_id: u64,
+        peer_feedback: enclave_rpc::types::PeerFeedback,
+    },
+    HostSubmitPeerFeedbackResponse {},
+    HostStorageSyncRequest(StorageSyncRequestWithEndpoint),
+    HostStorageSyncResponse(StorageSyncResponse),
+    HostLocalStorageGetRequest {
+        key: Vec<u8>,
+    },
+    HostLocalStorageGetResponse {
+        value: Vec<u8>,
+    },
+    HostLocalStorageSetRequest {
+        key: Vec<u8>,
+        value: Vec<u8>,
+    },
+    HostLocalStorageSetResponse {},
+    HostFetchConsensusBlockRequest {
+        height: u64,
+    },
+    HostFetchConsensusBlockResponse {
+        block: LightBlock,
+    },
+    HostFetchConsensusEventsRequest(HostFetchConsensusEventsRequest),
+    HostFetchConsensusEventsResponse(HostFetchConsensusEventsResponse),
+    HostFetchTxBatchRequest {
+        #[cbor(optional)]
+        offset: Option<Hash>,
+        limit: u32,
+    },
+    HostFetchTxBatchResponse {
+        #[cbor(optional)]
+        batch: Option<TxnBatch>,
+    },
+    HostFetchBlockMetadataTxRequest {
+        height: u64,
+    },
+    HostFetchBlockMetadataTxResponse {
+        signed_tx: SignedTransaction,
+        proof: Proof,
+    },
+    HostFetchGenesisHeightRequest {},
+    HostFetchGenesisHeightResponse {
+        height: u64,
+    },
+    HostProveFreshnessRequest {
+        blob: Vec<u8>,
+    },
+    HostProveFreshnessResponse {
+        signed_tx: SignedTransaction,
+        proof: Proof,
+    },
+    HostIdentityRequest {},
+    HostIdentityResponse {
+        node_id: signature::PublicKey,
+    },
+    HostSubmitTxRequest {
+        runtime_id: Namespace,
+        data: Vec<u8>,
+        wait: bool,
+        prove: bool,
+    },
+    HostSubmitTxResponse {
+        output: Vec<u8>,
+        round: u64,
+        batch_order: u32,
+        proof: Option<sync::Proof>,
+    },
+    HostRegisterNotifyRequest {
+        #[cbor(optional)]
+        runtime_block: bool,
+        #[cbor(optional)]
+        runtime_event: Option<RegisterNotifyRuntimeEvent>,
+    },
+    HostRegisterNotifyResponse {},
+}
+
+impl Default for Body {
+    fn default() -> Self {
+        Self::Empty {}
+    }
+}
+
+/// A serializable error.
+#[derive(Clone, Debug, Default, Error, cbor::Encode, cbor::Decode)]
+#[error("module: {module} code: {code} message: {message}")]
+pub struct Error {
+    #[cbor(optional)]
+    pub module: String,
+
+    #[cbor(optional)]
+    pub code: u32,
+
+    #[cbor(optional)]
+    pub message: String,
+}
+
+impl Error {
+    /// Create a new error.
+    pub fn new(module: &str, code: u32, msg: &str) -> Self {
+        Self {
+            module: module.to_owned(),
+            code,
+            message: msg.to_owned(),
+        }
+    }
+}
+
+impl From<anyhow::Error> for Error {
+    fn from(err: anyhow::Error) -> Self {
+        Self {
+            module: "unknown".to_string(),
+            code: 1,
+            message: err.to_string(),
+        }
+    }
+}
+
+/// Runtime information request.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct RuntimeInfoRequest {
+    pub runtime_id: Namespace,
+    pub consensus_backend: String,
+    pub consensus_protocol_version: Version,
+    pub consensus_chain_context: String,
+
+    #[cbor(optional)]
+    pub local_config: BTreeMap<String, cbor::Value>,
+}
+
+/// Set of supported runtime features.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub struct Features {
+    /// Schedule control feature.
+    #[cbor(optional)]
+    pub schedule_control: Option<FeatureScheduleControl>,
+    /// A feature specifying that the runtime supports updating key manager's quote policy.
+    #[cbor(optional)]
+    pub key_manager_quote_policy_updates: bool,
+    /// A feature specifying that the runtime supports updating key manager's status.
+    #[cbor(optional)]
+    pub key_manager_status_updates: bool,
+    /// A feature specifying that the runtime supports endorsed TEE capabilities.
+    #[cbor(optional)]
+    pub endorsed_capability_tee: bool,
+}
+
+impl Default for Features {
+    fn default() -> Self {
+        Self {
+            schedule_control: None,
+            key_manager_quote_policy_updates: true,
+            key_manager_status_updates: true,
+            endorsed_capability_tee: true,
+        }
+    }
+}
+
+/// A feature specifying that the runtime supports controlling the scheduling of batches. This means
+/// that the scheduler should only take priority into account and ignore weights, leaving it up to
+/// the runtime to decide which transactions to include.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct FeatureScheduleControl {
+    /// Size of the initial batch of transactions.
+    pub initial_batch_size: u32,
+}
+
+/// Runtime information response.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct RuntimeInfoResponse {
+    /// The runtime protocol version supported by the runtime.
+    pub protocol_version: Version,
+
+    /// The version of the runtime.
+    pub runtime_version: Version,
+
+    /// Describes the features supported by the runtime.
+    pub features: Features,
+}
+
+/// Batch execution mode.
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[cbor(with_default)]
+pub enum ExecutionMode {
+    /// Execution mode where the batch of transactions is executed as-is without the ability to
+    /// perform and modifications to the batch.
+    Execute = 0,
+    /// Execution mode where the runtime is in control of scheduling and may arbitrarily modify the
+    /// batch during execution.
+    ///
+    /// This execution mode will only be used in case the runtime advertises to support the schedule
+    /// control feature. In this case the call will only contain up to InitialBatchSize transactions
+    /// and the runtime will need to request more if it needs more.
+    Schedule = 1,
+}
+
+impl Default for ExecutionMode {
+    fn default() -> Self {
+        Self::Execute
+    }
+}
+
+/// Result of a CheckTx operation.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct CheckTxResult {
+    pub error: Error,
+    pub meta: Option<CheckTxMetadata>,
+}
+
+/// CheckTx transaction metadata.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct CheckTxMetadata {
+    #[cbor(optional)]
+    pub priority: u64,
+
+    #[cbor(optional)]
+    pub sender: Vec<u8>,
+    #[cbor(optional)]
+    pub sender_seq: u64,
+    #[cbor(optional)]
+    pub sender_state_seq: u64,
+}
+
+/// Consensus event kind.
+#[derive(Clone, Copy, Debug, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum EventKind {
+    Staking = 1,
+    Registry = 2,
+    RootHash = 3,
+    Governance = 4,
+}
+
+/// Request to host to fetch the consensus events for the given height.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct HostFetchConsensusEventsRequest {
+    pub height: u64,
+    pub kind: EventKind,
+}
+
+/// Response from host fetching the consensus events for the given height.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct HostFetchConsensusEventsResponse {
+    pub events: Vec<consensus::Event>,
+}
+
+/// Registration for runtime event notifications.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct RegisterNotifyRuntimeEvent {
+    /// Event tags to subscribe to.
+    pub tags: Vec<Vec<u8>>,
+}
+
+/// An event notification.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct RuntimeNotifyEvent {
+    /// Header of the block that emitted the event.
+    pub block: roothash::AnnotatedBlock,
+    /// Matching tags.
+    pub tags: Vec<Vec<u8>>,
+}
+
+#[derive(Clone, Copy, Debug, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum MessageType {
+    /// Invalid message (should never be seen on the wire).
+    Invalid = 0,
+    /// Request.
+    Request = 1,
+    /// Response.
+    Response = 2,
+}
+
+impl Default for MessageType {
+    fn default() -> Self {
+        Self::Invalid
+    }
+}
+
+/// Runtime protocol message.
+#[derive(Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Message {
+    /// Unique request identifier.
+    pub id: u64,
+    /// Message type.
+    pub message_type: MessageType,
+    /// Message body.
+    pub body: Body,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/callformat.rs.html b/rust/src/oasis_runtime_sdk/callformat.rs.html new file mode 100644 index 0000000000..aef016a37d --- /dev/null +++ b/rust/src/oasis_runtime_sdk/callformat.rs.html @@ -0,0 +1,699 @@ +callformat.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+
//! Handling of different call formats.
+use std::convert::TryInto;
+
+use anyhow::anyhow;
+use byteorder::{BigEndian, WriteBytesExt};
+use oasis_core_runtime::consensus::beacon;
+use rand_core::{OsRng, RngCore};
+
+use crate::{
+    context::Context,
+    core::common::crypto::{mrae::deoxysii, x25519},
+    crypto::signature::context::get_chain_context_for,
+    keymanager, module,
+    modules::core::Error,
+    state::CurrentState,
+    types::{
+        self,
+        transaction::{Call, CallFormat, CallResult},
+    },
+};
+
+/// Maximum age of an ephemeral key in the number of epochs.
+///
+/// This is half the current window as enforced by the key manager as negative results are not
+/// cached and randomized queries could open the scheme to a potential DoS attack.
+const MAX_EPHEMERAL_KEY_AGE: beacon::EpochTime = 5;
+
+/// Additional metadata required by the result encoding function.
+pub enum Metadata {
+    Empty,
+    EncryptedX25519DeoxysII {
+        /// Caller's ephemeral public key used for X25519.
+        pk: x25519::PublicKey,
+        /// Secret key.
+        sk: x25519::PrivateKey,
+        /// Transaction index within the batch.
+        index: usize,
+    },
+}
+
+impl std::fmt::Debug for Metadata {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        match self {
+            Self::Empty => f.debug_struct("Metadata::Empty").finish(),
+            Self::EncryptedX25519DeoxysII { pk, index, .. } => f
+                .debug_struct("Metadata::EncryptedX25519DeoxysII")
+                .field("pk", pk)
+                .field("index", index)
+                .finish_non_exhaustive(),
+        }
+    }
+}
+
+/// Derive the key pair ID for the call data encryption key pair.
+pub fn get_key_pair_id(epoch: beacon::EpochTime) -> keymanager::KeyPairId {
+    keymanager::get_key_pair_id([
+        get_chain_context_for(types::callformat::CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE).as_slice(),
+        &epoch.to_be_bytes(),
+    ])
+}
+
+fn verify_epoch<C: Context>(ctx: &C, epoch: beacon::EpochTime) -> Result<(), Error> {
+    if epoch > ctx.epoch() {
+        return Err(Error::InvalidCallFormat(anyhow!("epoch in the future")));
+    }
+    if epoch < ctx.epoch().saturating_sub(MAX_EPHEMERAL_KEY_AGE) {
+        return Err(Error::InvalidCallFormat(anyhow!(
+            "epoch too far in the past"
+        )));
+    }
+    Ok(())
+}
+
+/// Decode call arguments.
+///
+/// Returns `Some((Call, Metadata))` when processing should proceed and `None` in case further
+/// execution needs to be deferred (e.g., because key manager access is required).
+pub fn decode_call<C: Context>(
+    ctx: &C,
+    call: Call,
+    index: usize,
+) -> Result<Option<(Call, Metadata)>, Error> {
+    decode_call_ex(ctx, call, index, false /* assume_km_reachable */)
+}
+
+/// Decode call arguments.
+///
+/// Returns `Some((Call, Metadata))` when processing should proceed and `None` in case further
+/// execution needs to be deferred (e.g., because key manager access is required).
+/// If `assume_km_reachable` is set, then this method will return errors instead of `None`.
+pub fn decode_call_ex<C: Context>(
+    ctx: &C,
+    call: Call,
+    index: usize,
+    assume_km_reachable: bool,
+) -> Result<Option<(Call, Metadata)>, Error> {
+    match call.format {
+        // In case of the plain-text data format, we simply pass on the call unchanged.
+        CallFormat::Plain => Ok(Some((call, Metadata::Empty))),
+
+        // Encrypted data format using X25519 key exchange and Deoxys-II symmetric encryption.
+        CallFormat::EncryptedX25519DeoxysII => {
+            // Method must be empty.
+            if !call.method.is_empty() {
+                return Err(Error::InvalidCallFormat(anyhow!("non-empty method")));
+            }
+            // Body needs to follow the specified envelope.
+            let envelope: types::callformat::CallEnvelopeX25519DeoxysII =
+                cbor::from_value(call.body)
+                    .map_err(|_| Error::InvalidCallFormat(anyhow!("bad call envelope")))?;
+            let pk = envelope.pk;
+
+            // Make sure a key manager is available in this runtime.
+            let key_manager = ctx
+                .key_manager()
+                .ok_or_else(|| Error::InvalidCallFormat(anyhow!("confidential txs unavailable")))?;
+
+            // If we are only doing checks, this is the most that we can do as in this case we may
+            // be unable to access the key manager.
+            if !assume_km_reachable && CurrentState::with_env(|env| !env.is_execute()) {
+                return Ok(None);
+            }
+
+            let decrypt = |epoch: beacon::EpochTime| {
+                let keypair = key_manager
+                    .get_or_create_ephemeral_keys(get_key_pair_id(epoch), epoch)
+                    .map_err(|err| match err {
+                        keymanager::KeyManagerError::InvalidEpoch(..) => {
+                            Error::InvalidCallFormat(anyhow!("invalid epoch"))
+                        }
+                        _ => Error::Abort(err.into()),
+                    })?;
+                let sk = keypair.input_keypair.sk;
+                // Derive shared secret via X25519 and open the sealed box.
+                deoxysii::box_open(
+                    &envelope.nonce,
+                    envelope.data.clone(),
+                    vec![],
+                    &envelope.pk.0,
+                    &sk.0,
+                )
+                .map(|data| (data, sk))
+            };
+
+            // Get transaction key pair from the key manager. Note that only the `input_keypair`
+            // portion is used.
+            let (data, sk) = if envelope.epoch > 0 {
+                verify_epoch(ctx, envelope.epoch)?;
+                decrypt(envelope.epoch)
+            } else {
+                // In case of failure, also try with previous epoch key in case the epoch
+                // transition just occurred.
+                decrypt(ctx.epoch()).or_else(|_| decrypt(ctx.epoch() - 1))
+            }
+            .map_err(Error::InvalidCallFormat)?;
+
+            let read_only = call.read_only;
+            let call: Call = cbor::from_slice(&data)
+                .map_err(|_| Error::InvalidCallFormat(anyhow!("malformed call")))?;
+
+            // Ensure read-only flag is the same as in the outer envelope. This is to prevent
+            // bypassing any authorization based on the read-only flag.
+            if call.read_only != read_only {
+                return Err(Error::InvalidCallFormat(anyhow!("read-only flag mismatch")));
+            }
+
+            Ok(Some((
+                call,
+                Metadata::EncryptedX25519DeoxysII { pk, sk, index },
+            )))
+        }
+    }
+}
+
+#[cfg(any(test, feature = "test"))]
+/// Encodes a call such that it can be decoded by `decode_call[_ex]`.
+pub fn encode_call<C: Context>(
+    ctx: &C,
+    mut call: Call,
+    client_keypair: &(x25519_dalek::PublicKey, x25519_dalek::StaticSecret),
+) -> Result<Call, Error> {
+    match call.format {
+        // In case of the plain-text data format, we simply pass on the call unchanged.
+        CallFormat::Plain => Ok(call),
+
+        // Encrypted data format using X25519 key exchange and Deoxys-II symmetric encryption.
+        CallFormat::EncryptedX25519DeoxysII => {
+            let key_manager = ctx.key_manager().ok_or_else(|| {
+                Error::InvalidCallFormat(anyhow!("confidential transactions not available"))
+            })?;
+            let epoch = ctx.epoch();
+            let runtime_keypair = key_manager
+                .get_or_create_ephemeral_keys(get_key_pair_id(epoch), epoch)
+                .map_err(|err| Error::Abort(err.into()))?;
+            let runtime_pk = runtime_keypair.input_keypair.pk;
+            let nonce = [0u8; deoxysii::NONCE_SIZE];
+
+            Ok(Call {
+                format: call.format,
+                method: std::mem::take(&mut call.method),
+                body: cbor::to_value(types::callformat::CallEnvelopeX25519DeoxysII {
+                    pk: client_keypair.0.into(),
+                    nonce,
+                    epoch,
+                    data: deoxysii::box_seal(
+                        &nonce,
+                        cbor::to_vec(call),
+                        vec![],
+                        &runtime_pk.0,
+                        &client_keypair.1,
+                    )
+                    .unwrap(),
+                }),
+                ..Default::default()
+            })
+        }
+    }
+}
+
+/// Encode call results.
+pub fn encode_result<C: Context>(
+    ctx: &C,
+    result: module::CallResult,
+    metadata: Metadata,
+) -> CallResult {
+    encode_result_ex(ctx, result, metadata, false /* expose_failure */)
+}
+
+/// Encode call results.
+///
+/// If `expose_failure` is set, then this method will not encrypt errors.
+pub fn encode_result_ex<C: Context>(
+    ctx: &C,
+    result: module::CallResult,
+    metadata: Metadata,
+    expose_failure: bool,
+) -> CallResult {
+    match metadata {
+        // In case of the plain-text data format, we simply pass on the data unchanged.
+        Metadata::Empty => result.into(),
+
+        // Encrypted data format using X25519 key exchange and Deoxys-II symmetric encryption.
+        Metadata::EncryptedX25519DeoxysII { pk, sk, index } => {
+            // Serialize result.
+            let result: CallResult = result.into();
+
+            if expose_failure {
+                if result.is_success() {
+                    return CallResult::Ok(encrypt_result_x25519_deoxysii(
+                        ctx, result, pk, sk, index,
+                    ));
+                }
+
+                return result;
+            }
+
+            CallResult::Unknown(encrypt_result_x25519_deoxysii(ctx, result, pk, sk, index))
+        }
+    }
+}
+
+/// Encrypt a call result using the X25519-Deoxys-II encryption scheme.
+pub fn encrypt_result_x25519_deoxysii<C: Context>(
+    ctx: &C,
+    result: types::transaction::CallResult,
+    pk: x25519::PublicKey,
+    sk: x25519::PrivateKey,
+    index: usize,
+) -> cbor::Value {
+    let mut nonce = Vec::with_capacity(deoxysii::NONCE_SIZE);
+    if CurrentState::with_env(|env| env.is_execute()) {
+        // In execution mode generate nonce for the output as Round (8 bytes) || Index (4 bytes) || 00 00 00.
+        nonce
+            .write_u64::<BigEndian>(ctx.runtime_header().round)
+            .unwrap();
+        nonce
+            .write_u32::<BigEndian>(index.try_into().unwrap())
+            .unwrap();
+        nonce.extend(&[0, 0, 0]);
+    } else {
+        // In non-execution mode randomize the nonce to facilitate private queries.
+        nonce.resize(deoxysii::NONCE_SIZE, 0);
+        OsRng.fill_bytes(&mut nonce);
+    }
+    let nonce = nonce.try_into().unwrap();
+    let result = cbor::to_vec(result);
+    let data = deoxysii::box_seal(&nonce, result, vec![], &pk.0, &sk.0).unwrap();
+
+    // Return an envelope.
+    cbor::to_value(types::callformat::ResultEnvelopeX25519DeoxysII { nonce, data })
+}
+
+#[cfg(any(test, feature = "test"))]
+pub fn decode_result<C: Context>(
+    ctx: &C,
+    format: CallFormat,
+    result: CallResult,
+    client_keypair: &(x25519_dalek::PublicKey, x25519_dalek::StaticSecret),
+) -> Result<module::CallResult, Error> {
+    if matches!(format, CallFormat::Plain) {
+        return Ok(result.into_call_result().expect("CallResult was Unknown"));
+    }
+    let envelope_value = match result {
+        CallResult::Ok(v) | CallResult::Unknown(v) => v,
+        CallResult::Failed {
+            module,
+            code,
+            message,
+        } => {
+            return Ok(module::CallResult::Failed {
+                module,
+                code,
+                message,
+            })
+        }
+    };
+    match format {
+        CallFormat::Plain => unreachable!("checked above"),
+        CallFormat::EncryptedX25519DeoxysII => {
+            let envelope: types::callformat::ResultEnvelopeX25519DeoxysII =
+                cbor::from_value(envelope_value)
+                    .map_err(|_| Error::InvalidCallFormat(anyhow!("bad result envelope")))?;
+
+            // Get the runtime pubkey from the KM. A real client would simply use the
+            // session key that has already been derived.
+            let key_manager = ctx
+                .key_manager()
+                .ok_or_else(|| Error::InvalidCallFormat(anyhow!("confidential txs unavailable")))?;
+            let keypair = key_manager
+                .get_or_create_ephemeral_keys(get_key_pair_id(ctx.epoch()), ctx.epoch())
+                .map_err(|err| Error::Abort(err.into()))?;
+            let runtime_pk = keypair.input_keypair.pk;
+
+            let data = deoxysii::box_open(
+                &envelope.nonce,
+                envelope.data,
+                vec![],
+                &runtime_pk.0,
+                &client_keypair.1,
+            )
+            .map_err(Error::InvalidCallFormat)?;
+            let call_result: CallResult = cbor::from_slice(&data)
+                .map_err(|_| Error::InvalidCallFormat(anyhow!("malformed call")))?;
+            Ok(call_result
+                .into_call_result()
+                .expect("CallResult was Unknown"))
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/config.rs.html b/rust/src/oasis_runtime_sdk/config.rs.html new file mode 100644 index 0000000000..941f114abf --- /dev/null +++ b/rust/src/oasis_runtime_sdk/config.rs.html @@ -0,0 +1,57 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
//! Configuration types.
+
+/// Runtime schedule control configuration.
+pub struct ScheduleControl {
+    /// Size of the initial batch that the node should provide to the runtime.
+    pub initial_batch_size: u32,
+    /// Size of each extra batch that the runtime should fetch.
+    pub batch_size: u32,
+    /// Minimum amount of gas that needs to be remaining in a batch in order to still consider
+    /// including new transactions.
+    pub min_remaining_gas: u64,
+    /// Maximum number of transactions that can go in a batch.
+    ///
+    /// This is only used as a last resort to avoid the batch going over the runtime's limit.
+    pub max_tx_count: usize,
+}
+
+impl ScheduleControl {
+    /// Construct a default schedule control configuration.
+    pub const fn default() -> Self {
+        Self {
+            initial_batch_size: 50,
+            batch_size: 50,
+            min_remaining_gas: 1_000,
+            max_tx_count: 1_000,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/context.rs.html b/rust/src/oasis_runtime_sdk/context.rs.html new file mode 100644 index 0000000000..7e5cfd7b6b --- /dev/null +++ b/rust/src/oasis_runtime_sdk/context.rs.html @@ -0,0 +1,549 @@ +context.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+
//! Execution context.
+use std::{collections::btree_map::BTreeMap, marker::PhantomData};
+
+use slog::{self, o};
+
+use oasis_core_runtime::{
+    common::{logger::get_logger, namespace::Namespace},
+    consensus,
+    consensus::roothash,
+    protocol::HostInfo,
+};
+
+use crate::{
+    history,
+    keymanager::KeyManager,
+    module::MethodHandler as _,
+    runtime,
+    state::{self, CurrentState},
+};
+
+/// Local configuration key the value of which determines whether expensive queries should be
+/// allowed or not, and also whether smart contracts should be simulated for `core.EstimateGas`.
+/// DEPRECATED and superseded by LOCAL_CONFIG_ESTIMATE_GAS_BY_SIMULATING_CONTRACTS and LOCAL_CONFIG_ALLOWED_QUERIES.
+const LOCAL_CONFIG_ALLOW_EXPENSIVE_QUERIES: &str = "allow_expensive_queries";
+/// Local configuration key the value of which determines whether smart contracts should
+/// be simulated when estimating gas in `core.EstimateGas`.
+const LOCAL_CONFIG_ESTIMATE_GAS_BY_SIMULATING_CONTRACTS: &str =
+    "estimate_gas_by_simulating_contracts";
+/// Local configuration key the value of which determines the set of allowed queries.
+const LOCAL_CONFIG_ALLOWED_QUERIES: &str = "allowed_queries";
+/// Special key inside the `allowed_queries` list; represents the set of all queries.
+const LOCAL_CONFIG_ALLOWED_QUERIES_ALL: &str = "all";
+/// Special key inside the `allowed_queries` list; represents the set of all queries
+/// that are tagged `expensive`.
+const LOCAL_CONFIG_ALLOWED_QUERIES_ALL_EXPENSIVE: &str = "all_expensive";
+
+/// Runtime SDK context.
+pub trait Context {
+    /// Runtime that the context is being invoked in.
+    type Runtime: runtime::Runtime;
+
+    /// Clone this context.
+    fn clone(&self) -> Self;
+
+    /// Returns a logger.
+    fn get_logger(&self, module: &'static str) -> slog::Logger;
+
+    /// Whether smart contracts should be executed in this context.
+    fn should_execute_contracts(&self) -> bool {
+        match CurrentState::with_env(|env| env.mode()) {
+            // When actually executing a transaction, we always run contracts.
+            state::Mode::Execute => true,
+            state::Mode::Simulate => {
+                // Backwards compatibility for the deprecated `allow_expensive_queries`.
+                if let Some(allow_expensive_queries) =
+                    self.local_config::<bool>(LOCAL_CONFIG_ALLOW_EXPENSIVE_QUERIES)
+                {
+                    slog::warn!(
+                        self.get_logger("runtime-sdk"),
+                        "The {} config option is DEPRECATED since April 2022 and will be removed in a future release. Use {} and {} instead.",
+                        LOCAL_CONFIG_ALLOW_EXPENSIVE_QUERIES,
+                        LOCAL_CONFIG_ESTIMATE_GAS_BY_SIMULATING_CONTRACTS,
+                        LOCAL_CONFIG_ALLOWED_QUERIES
+                    );
+                    return allow_expensive_queries;
+                };
+
+                // The non-deprecated config option.
+                self.local_config(LOCAL_CONFIG_ESTIMATE_GAS_BY_SIMULATING_CONTRACTS)
+                    .unwrap_or_default()
+            }
+            // When just checking a transaction, we always want to be fast and skip contracts.
+            state::Mode::Check | state::Mode::PreSchedule => false,
+        }
+    }
+
+    /// Whether `method` is an allowed query per policy in the local config.
+    fn is_allowed_query<R: crate::runtime::Runtime>(&self, method: &str) -> bool {
+        let config: Vec<BTreeMap<String, bool>> = self
+            .local_config(LOCAL_CONFIG_ALLOWED_QUERIES)
+            .unwrap_or_default();
+        let is_expensive = R::Modules::is_expensive_query(method);
+
+        // Backwards compatibility for the deprecated `allow_expensive_queries`.
+        if let Some(allow_expensive_queries) =
+            self.local_config::<bool>(LOCAL_CONFIG_ALLOW_EXPENSIVE_QUERIES)
+        {
+            slog::warn!(
+                self.get_logger("runtime-sdk"),
+                "The {} config option is DEPRECATED since April 2022 and will be removed in a future release. Use {} and {} instead.",
+                LOCAL_CONFIG_ALLOW_EXPENSIVE_QUERIES,
+                LOCAL_CONFIG_ESTIMATE_GAS_BY_SIMULATING_CONTRACTS,
+                LOCAL_CONFIG_ALLOWED_QUERIES
+            );
+            return (!is_expensive) || allow_expensive_queries;
+        };
+
+        // The non-deprecated config option.
+        config
+            .iter()
+            .find_map(|item| {
+                item.get(method)
+                    .or_else(|| {
+                        if !is_expensive {
+                            return None;
+                        }
+                        item.get(LOCAL_CONFIG_ALLOWED_QUERIES_ALL_EXPENSIVE)
+                    })
+                    .or_else(|| item.get(LOCAL_CONFIG_ALLOWED_QUERIES_ALL))
+                    .copied()
+            })
+            // If no config entry matches, the default is to allow only non-expensive queries.
+            .unwrap_or(!is_expensive)
+    }
+
+    /// Returns node operator-provided local configuration.
+    ///
+    /// This method will always return `None` in `Mode::ExecuteTx` contexts.
+    fn local_config<T>(&self, key: &str) -> Option<T>
+    where
+        T: cbor::Decode,
+    {
+        if CurrentState::with_env(|env| env.is_execute()) {
+            return None;
+        }
+
+        self.host_info().local_config.get(key).and_then(|v| {
+            cbor::from_value(v.clone()).unwrap_or_else(|e| {
+                let msg = format!(
+                    "Cannot interpret the value of \"{}\" in runtime's local config as a {}: {:?}",
+                    key,
+                    std::any::type_name::<T>(),
+                    e
+                );
+                slog::error!(self.get_logger("runtime-sdk"), "{}", msg);
+                panic!("{}", msg);
+            })
+        })
+    }
+
+    /// Information about the host environment.
+    fn host_info(&self) -> &HostInfo;
+
+    /// Runtime ID.
+    fn runtime_id(&self) -> &Namespace {
+        &self.host_info().runtime_id
+    }
+
+    /// The key manager, if the runtime is confidential.
+    fn key_manager(&self) -> Option<&dyn KeyManager>;
+
+    /// Whether the context has a key manager available (e.g. the runtime is confidential).
+    fn is_confidential(&self) -> bool {
+        self.key_manager().is_some()
+    }
+
+    /// Last runtime block header.
+    fn runtime_header(&self) -> &roothash::Header;
+
+    /// Results of executing the last successful runtime round.
+    fn runtime_round_results(&self) -> &roothash::RoundResults;
+
+    /// Consensus state.
+    fn consensus_state(&self) -> &consensus::state::ConsensusState;
+
+    /// Historical state.
+    fn history(&self) -> &dyn history::HistoryHost;
+
+    /// Current epoch.
+    fn epoch(&self) -> consensus::beacon::EpochTime;
+
+    /// Maximum number of consensus messages that the runtime can emit in this block.
+    fn max_messages(&self) -> u32;
+}
+
+/// Dispatch context for the whole batch.
+pub struct RuntimeBatchContext<'a, R: runtime::Runtime> {
+    host_info: &'a HostInfo,
+    key_manager: Option<Box<dyn KeyManager>>,
+    runtime_header: &'a roothash::Header,
+    runtime_round_results: &'a roothash::RoundResults,
+    consensus_state: &'a consensus::state::ConsensusState,
+    history: &'a dyn history::HistoryHost,
+    epoch: consensus::beacon::EpochTime,
+    logger: slog::Logger,
+
+    /// Maximum number of messages that can be emitted.
+    max_messages: u32,
+
+    _runtime: PhantomData<R>,
+}
+
+impl<'a, R: runtime::Runtime> RuntimeBatchContext<'a, R> {
+    /// Create a new dispatch context.
+    #[allow(clippy::too_many_arguments)]
+    pub fn new(
+        host_info: &'a HostInfo,
+        key_manager: Option<Box<dyn KeyManager>>,
+        runtime_header: &'a roothash::Header,
+        runtime_round_results: &'a roothash::RoundResults,
+        consensus_state: &'a consensus::state::ConsensusState,
+        history: &'a dyn history::HistoryHost,
+        epoch: consensus::beacon::EpochTime,
+        max_messages: u32,
+    ) -> Self {
+        Self {
+            host_info,
+            runtime_header,
+            runtime_round_results,
+            consensus_state,
+            history,
+            epoch,
+            key_manager,
+            logger: get_logger("runtime-sdk"),
+            max_messages,
+            _runtime: PhantomData,
+        }
+    }
+}
+
+impl<'a, R: runtime::Runtime> Context for RuntimeBatchContext<'a, R> {
+    type Runtime = R;
+
+    fn clone(&self) -> Self {
+        Self {
+            host_info: self.host_info,
+            runtime_header: self.runtime_header,
+            runtime_round_results: self.runtime_round_results,
+            consensus_state: self.consensus_state,
+            history: self.history,
+            epoch: self.epoch,
+            key_manager: self.key_manager.clone(),
+            logger: get_logger("runtime-sdk"),
+            max_messages: self.max_messages,
+            _runtime: PhantomData,
+        }
+    }
+
+    fn get_logger(&self, module: &'static str) -> slog::Logger {
+        self.logger.new(o!("sdk_module" => module))
+    }
+
+    fn host_info(&self) -> &HostInfo {
+        self.host_info
+    }
+
+    fn key_manager(&self) -> Option<&dyn KeyManager> {
+        self.key_manager.as_ref().map(Box::as_ref)
+    }
+
+    fn runtime_header(&self) -> &roothash::Header {
+        self.runtime_header
+    }
+
+    fn runtime_round_results(&self) -> &roothash::RoundResults {
+        self.runtime_round_results
+    }
+
+    fn consensus_state(&self) -> &consensus::state::ConsensusState {
+        self.consensus_state
+    }
+
+    fn history(&self) -> &dyn history::HistoryHost {
+        self.history
+    }
+
+    fn epoch(&self) -> consensus::beacon::EpochTime {
+        self.epoch
+    }
+
+    fn max_messages(&self) -> u32 {
+        self.max_messages
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/mod.rs.html b/rust/src/oasis_runtime_sdk/crypto/mod.rs.html new file mode 100644 index 0000000000..e25c3fb510 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/mod.rs.html @@ -0,0 +1,11 @@ +mod.rs - source
1
+2
+3
+4
+5
+
//! Cryptography.
+
+pub mod multisig;
+pub mod random;
+pub mod signature;
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/multisig/mod.rs.html b/rust/src/oasis_runtime_sdk/crypto/multisig/mod.rs.html new file mode 100644 index 0000000000..284e7af1c4 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/multisig/mod.rs.html @@ -0,0 +1,203 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+
use thiserror::Error;
+
+use crate::crypto::signature::{PublicKey, Signature};
+
+#[cfg(test)]
+mod test;
+
+/// Error.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("invalid config")]
+    InvalidConfig,
+    #[error("invalid signature set")]
+    InvalidSignatureSet,
+    #[error("insufficient weight")]
+    InsufficientWeight,
+}
+
+/// One of the signers in a multisig configuration.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Signer {
+    /// The public key of the signer.
+    pub public_key: PublicKey,
+    /// The weight of the signer.
+    pub weight: u64,
+}
+
+/// A set of signatures corresponding to a multisig configuration.
+/// The indices match the configuration's `signers` vec.
+pub type SignatureSet = [Option<Signature>];
+/// A `SignatureSet` owned in a `Vec`.
+pub type SignatureSetOwned = Vec<Option<Signature>>;
+
+/// A multisig configuration.
+/// A set of signers with total "weight" greater than or equal to a "threshold" can authenticate
+/// for the configuration.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Config {
+    /// The signers.
+    pub signers: Vec<Signer>,
+    /// The threshold.
+    pub threshold: u64,
+}
+
+impl Config {
+    /// Performs some sanity checks. This looks at the configuration only. There is no cryptographic
+    /// verification of any signatures.
+    pub fn validate_basic(&self) -> Result<(), Error> {
+        if self.threshold == 0 {
+            return Err(Error::InvalidConfig);
+        }
+        let mut total: u64 = 0;
+        for (i, signer) in self.signers.iter().enumerate() {
+            if self
+                .signers
+                .iter()
+                .take(i)
+                .any(|other_signer| signer.public_key == other_signer.public_key)
+            {
+                return Err(Error::InvalidConfig);
+            }
+            if signer.weight == 0 {
+                return Err(Error::InvalidConfig);
+            }
+            total = total
+                .checked_add(signer.weight)
+                .ok_or(Error::InvalidConfig)?;
+        }
+        if total < self.threshold {
+            return Err(Error::InvalidConfig);
+        }
+        Ok(())
+    }
+
+    /// Checks that the configuration and signature set are acceptable.
+    /// Returns vectors of public keys and signatures for batch verification of included signatures.
+    pub fn batch(
+        &self,
+        signature_set: &SignatureSet,
+    ) -> Result<(Vec<PublicKey>, Vec<Signature>), Error> {
+        self.validate_basic()?;
+        if signature_set.len() != self.signers.len() {
+            return Err(Error::InvalidSignatureSet);
+        }
+        let mut total = 0;
+        let mut public_keys = vec![];
+        let mut signatures = vec![];
+        for (signer, signature_o) in self.signers.iter().zip(signature_set.iter()) {
+            if let Some(signature) = signature_o {
+                total += signer.weight;
+                public_keys.push(signer.public_key.clone());
+                signatures.push(signature.clone());
+            }
+        }
+        if total < self.threshold {
+            return Err(Error::InsufficientWeight);
+        }
+        Ok((public_keys, signatures))
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/random.rs.html b/rust/src/oasis_runtime_sdk/crypto/random.rs.html new file mode 100644 index 0000000000..7751ce7070 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/random.rs.html @@ -0,0 +1,743 @@ +random.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+
//! Random number generator based on root VRF key and Merlin transcripts.
+use std::cell::RefCell;
+
+use anyhow::anyhow;
+use merlin::{Transcript, TranscriptRng};
+use rand_core::{CryptoRng, OsRng, RngCore};
+use schnorrkel::keys::{ExpansionMode, Keypair, MiniSecretKey};
+
+use oasis_core_runtime::common::crypto::hash::Hash;
+
+use crate::{
+    context::Context, dispatcher, keymanager::KeyManagerError, modules::core::Error, state::Mode,
+};
+
+/// RNG domain separation context.
+const RNG_CONTEXT: &[u8] = b"oasis-runtime-sdk/crypto: rng v1";
+/// Per-block root VRF key domain separation context.
+const VRF_KEY_CONTEXT: &[u8] = b"oasis-runtime-sdk/crypto: root vrf key v1";
+
+/// A root RNG that can be used to derive domain-separated leaf RNGs.
+pub struct RootRng {
+    inner: RefCell<Inner>,
+    mode: Mode,
+    valid: bool,
+}
+
+struct Inner {
+    /// Merlin transcript for initializing the RNG.
+    transcript: Transcript,
+    /// A transcript-based RNG (when initialized).
+    rng: Option<TranscriptRng>,
+}
+
+impl RootRng {
+    /// Create a new root RNG.
+    pub fn new(mode: Mode) -> Self {
+        Self {
+            inner: RefCell::new(Inner {
+                transcript: Transcript::new(RNG_CONTEXT),
+                rng: None,
+            }),
+            mode,
+            valid: true,
+        }
+    }
+
+    /// Create an invalid root RNG which will fail when any leaf RNGs are requested.
+    pub fn invalid() -> Self {
+        Self {
+            inner: RefCell::new(Inner {
+                transcript: Transcript::new(&[]),
+                rng: None,
+            }),
+            mode: Mode::Simulate, // Use a "safe" mode even though it will never be used.
+            valid: false,
+        }
+    }
+
+    fn derive_root_vrf_key<C: Context + ?Sized>(ctx: &C, mode: Mode) -> Result<Keypair, Error> {
+        let km = ctx
+            .key_manager()
+            .ok_or(Error::Abort(dispatcher::Error::KeyManagerFailure(
+                KeyManagerError::NotInitialized,
+            )))?;
+        let round_header_hash = ctx.runtime_header().encoded_hash();
+        let key_id = crate::keymanager::get_key_pair_id([
+            VRF_KEY_CONTEXT,
+            &[mode as u8],
+            round_header_hash.as_ref(),
+        ]);
+        let km_kp = km
+            .get_or_create_ephemeral_keys(key_id, ctx.epoch())
+            .map_err(|err| Error::Abort(dispatcher::Error::KeyManagerFailure(err)))?
+            .input_keypair;
+        // The KM returns an ed25519 key, but it needs to be in "expanded" form to use with
+        // schnorrkel. Please refer to [`schnorrkel::keys::MiniSecretKey`] for further details.
+        let kp = MiniSecretKey::from_bytes(km_kp.sk.0.as_ref())
+            .map_err(|err| {
+                Error::Abort(dispatcher::Error::KeyManagerFailure(
+                    KeyManagerError::Other(anyhow::anyhow!("{}", err)),
+                ))
+            })?
+            .expand_to_keypair(ExpansionMode::Uniform);
+
+        Ok(kp)
+    }
+
+    /// Append local entropy to the root RNG.
+    ///
+    /// # Non-determinism
+    ///
+    /// Using this method will result in the RNG being non-deterministic.
+    pub fn append_local_entropy(&self) {
+        if !self.valid {
+            return;
+        }
+
+        let mut bytes = [0u8; 32];
+        OsRng.fill_bytes(&mut bytes);
+
+        let mut inner = self.inner.borrow_mut();
+        inner.transcript.append_message(b"local-rng", &bytes);
+    }
+
+    /// Append an observed transaction hash to RNG transcript.
+    pub fn append_tx(&self, tx_hash: Hash) {
+        if !self.valid {
+            return;
+        }
+
+        let mut inner = self.inner.borrow_mut();
+        inner.transcript.append_message(b"tx", tx_hash.as_ref());
+    }
+
+    /// Append an observed subcontext to RNG transcript.
+    pub fn append_subcontext(&self) {
+        if !self.valid {
+            return;
+        }
+
+        let mut inner = self.inner.borrow_mut();
+        inner.transcript.append_message(b"subctx", &[]);
+    }
+
+    /// Create an independent leaf RNG using this RNG as its parent.
+    pub fn fork<C: Context + ?Sized>(&self, ctx: &C, pers: &[u8]) -> Result<LeafRng, Error> {
+        if !self.valid {
+            return Err(Error::InvalidArgument(anyhow!("rng is not available")));
+        }
+
+        let mut inner = self.inner.borrow_mut();
+
+        // Ensure the RNG is initialized and initialize it if not.
+        if inner.rng.is_none() {
+            // Derive the root VRF key for the current block.
+            let root_vrf_key = Self::derive_root_vrf_key(ctx, self.mode)?;
+
+            // Initialize the root RNG.
+            let rng = root_vrf_key
+                .vrf_create_hash(&mut inner.transcript)
+                .make_merlin_rng(&[]);
+            inner.rng = Some(rng);
+        }
+
+        // Generate the leaf RNG.
+        inner.transcript.append_message(b"fork", pers);
+
+        let rng_builder = inner.transcript.build_rng();
+        let parent_rng = inner.rng.as_mut().expect("rng must be initialized");
+        let rng = rng_builder.finalize(parent_rng);
+
+        Ok(LeafRng(rng))
+    }
+}
+
+/// A leaf RNG.
+pub struct LeafRng(TranscriptRng);
+
+impl RngCore for LeafRng {
+    fn next_u32(&mut self) -> u32 {
+        self.0.next_u32()
+    }
+
+    fn next_u64(&mut self) -> u64 {
+        self.0.next_u64()
+    }
+
+    fn fill_bytes(&mut self, dest: &mut [u8]) {
+        self.0.fill_bytes(dest)
+    }
+
+    fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), rand_core::Error> {
+        self.0.try_fill_bytes(dest)
+    }
+}
+
+impl CryptoRng for LeafRng {}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    use crate::{state::Mode, testing::mock};
+
+    #[test]
+    fn test_rng_basic() {
+        let mut mock = mock::Mock::default();
+        let ctx = mock.create_ctx_for_runtime::<mock::EmptyRuntime>(true);
+
+        // Create first root RNG.
+        let root_rng = RootRng::new(Mode::Execute);
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes1 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes1);
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes1_1 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes1_1);
+
+        assert_ne!(bytes1, bytes1_1, "rng should apply domain separation");
+
+        // Create second root RNG using the same context so the ephemeral key is shared.
+        let root_rng = RootRng::new(Mode::Execute);
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes2 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes2);
+
+        assert_eq!(bytes1, bytes2, "rng should be deterministic");
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes2_1 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes2_1);
+
+        assert_ne!(bytes2, bytes2_1, "rng should apply domain separation");
+        assert_eq!(bytes1_1, bytes2_1, "rng should be deterministic");
+
+        // Create third root RNG using the same context, but with different personalization.
+        let root_rng = RootRng::new(Mode::Execute);
+
+        let mut leaf_rng = root_rng
+            .fork(&ctx, b"domsep")
+            .expect("rng fork should work");
+        let mut bytes3 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes3);
+
+        assert_ne!(bytes2, bytes3, "rng should apply domain separation");
+
+        // Create another root RNG using the same context, but with different history.
+        let root_rng = RootRng::new(Mode::Execute);
+        root_rng
+            .append_tx("0000000000000000000000000000000000000000000000000000000000000001".into());
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes4 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes4);
+
+        assert_ne!(bytes2, bytes4, "rng should apply domain separation");
+
+        // Create another root RNG using the same context, but with different history.
+        let root_rng = RootRng::new(Mode::Execute);
+        root_rng
+            .append_tx("0000000000000000000000000000000000000000000000000000000000000002".into());
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes5 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes5);
+
+        assert_ne!(bytes4, bytes5, "rng should apply domain separation");
+
+        // Create another root RNG using the same context, but with same history as four.
+        let root_rng = RootRng::new(Mode::Execute);
+        root_rng
+            .append_tx("0000000000000000000000000000000000000000000000000000000000000001".into());
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes6 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes6);
+
+        assert_eq!(bytes4, bytes6, "rng should be deterministic");
+
+        // Create another root RNG using the same context, but with different history.
+        let root_rng = RootRng::new(Mode::Execute);
+        root_rng
+            .append_tx("0000000000000000000000000000000000000000000000000000000000000001".into());
+        root_rng
+            .append_tx("0000000000000000000000000000000000000000000000000000000000000002".into());
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes7 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes7);
+
+        assert_ne!(bytes4, bytes7, "rng should apply domain separation");
+
+        // Create another root RNG using the same context, but with different init point.
+        let root_rng = RootRng::new(Mode::Execute);
+        root_rng
+            .append_tx("0000000000000000000000000000000000000000000000000000000000000001".into());
+        let _ = root_rng.fork(&ctx, &[]).expect("rng fork should work"); // Force init.
+        root_rng
+            .append_tx("0000000000000000000000000000000000000000000000000000000000000002".into());
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes8 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes8);
+
+        assert_ne!(bytes7, bytes8, "rng should apply domain separation");
+        assert_ne!(bytes6, bytes8, "rng should apply domain separation");
+    }
+
+    #[test]
+    fn test_rng_fail_nonconfidential() {
+        let mut mock = mock::Mock::default();
+        let ctx = mock.create_ctx_for_runtime::<mock::EmptyRuntime>(false);
+
+        let root_rng = RootRng::new(Mode::Execute);
+        assert!(
+            root_rng.fork(&ctx, &[]).is_err(),
+            "rng fork should fail on non-confidential runtimes"
+        );
+    }
+
+    #[test]
+    fn test_rng_local_entropy() {
+        let mut mock = mock::Mock::default();
+        let ctx = mock.create_ctx_for_runtime::<mock::EmptyRuntime>(true);
+
+        // Create first root RNG.
+        let root_rng = RootRng::new(Mode::Execute);
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes1 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes1);
+
+        // Create second root RNG using the same context, but mix in local entropy.
+        let root_rng = RootRng::new(Mode::Execute);
+        root_rng.append_local_entropy();
+
+        let mut leaf_rng = root_rng.fork(&ctx, &[]).expect("rng fork should work");
+        let mut bytes2 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes2);
+
+        assert_ne!(bytes1, bytes2, "rng should apply domain separation");
+    }
+
+    #[test]
+    fn test_rng_parent_fork_propagation() {
+        let mut mock = mock::Mock::default();
+        let ctx = mock.create_ctx_for_runtime::<mock::EmptyRuntime>(true);
+
+        // Create first root RNG.
+        let root_rng = RootRng::new(Mode::Execute);
+
+        let mut leaf_rng = root_rng.fork(&ctx, b"a").expect("rng fork should work");
+        let mut bytes1 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes1);
+
+        let mut leaf_rng = root_rng.fork(&ctx, b"a").expect("rng fork should work");
+        let mut bytes1_1 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes1_1);
+
+        // Create second root RNG.
+        let root_rng = RootRng::new(Mode::Execute);
+
+        let mut leaf_rng = root_rng.fork(&ctx, b"b").expect("rng fork should work");
+        let mut bytes2 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes2);
+
+        let mut leaf_rng = root_rng.fork(&ctx, b"a").expect("rng fork should work");
+        let mut bytes2_1 = [0u8; 32];
+        leaf_rng.fill_bytes(&mut bytes2_1);
+
+        assert_ne!(
+            bytes1_1, bytes2_1,
+            "forks should propagate domain separator to parent"
+        );
+    }
+
+    #[test]
+    fn test_rng_invalid() {
+        let mut mock = mock::Mock::default();
+        let ctx = mock.create_ctx_for_runtime::<mock::EmptyRuntime>(true);
+
+        let root_rng = RootRng::invalid();
+        assert!(
+            root_rng.fork(&ctx, b"a").is_err(),
+            "rng fork should fail for invalid rng"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/signature/context.rs.html b/rust/src/oasis_runtime_sdk/crypto/signature/context.rs.html new file mode 100644 index 0000000000..f9c799355e --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/signature/context.rs.html @@ -0,0 +1,263 @@ +context.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+
//! Domain separation context helpers.
+use std::sync::Mutex;
+
+use once_cell::sync::Lazy;
+
+use oasis_core_runtime::common::{crypto::hash::Hash, namespace::Namespace};
+
+const CHAIN_CONTEXT_SEPARATOR: &[u8] = b" for chain ";
+
+static CHAIN_CONTEXT: Lazy<Mutex<Option<Vec<u8>>>> = Lazy::new(Default::default);
+
+/// Return the globally configured chain domain separation context.
+///
+/// The returned domain separation context is computed as:
+///
+/// ```plain
+/// <base> || " for chain " || <chain-context>
+/// ```
+///
+/// # Panics
+///
+/// This function will panic in case the global chain domain separation context was not previously
+/// set using `set_chain_context`.
+///
+pub fn get_chain_context_for(base: &[u8]) -> Vec<u8> {
+    let guard = CHAIN_CONTEXT.lock().unwrap();
+    let chain_context = match guard.as_ref() {
+        Some(cc) => cc,
+        None => {
+            drop(guard); // Avoid poisioning the global lock.
+            panic!("chain domain separation context must be configured");
+        }
+    };
+
+    let mut ctx = vec![0; base.len() + CHAIN_CONTEXT_SEPARATOR.len() + chain_context.len()];
+    ctx[..base.len()].copy_from_slice(base);
+    ctx[base.len()..base.len() + CHAIN_CONTEXT_SEPARATOR.len()]
+        .copy_from_slice(CHAIN_CONTEXT_SEPARATOR);
+    ctx[base.len() + CHAIN_CONTEXT_SEPARATOR.len()..].copy_from_slice(chain_context);
+    ctx
+}
+
+/// Configure the global chain domain separation context.
+///
+/// The domain separation context is computed as:
+///
+/// ```plain
+/// Base-16(H(<runtime-id> || <consensus-chain-context>))
+/// ```
+///
+/// # Panics
+///
+/// This function will panic in case the global chain domain separation context was already set.
+///
+pub fn set_chain_context(runtime_id: Namespace, consensus_chain_context: &str) {
+    let ctx = hex::encode(Hash::digest_bytes_list(&[
+        runtime_id.as_ref(),
+        consensus_chain_context.as_bytes(),
+    ]));
+    let mut guard = CHAIN_CONTEXT.lock().unwrap();
+    if let Some(ref existing) = *guard {
+        if cfg!(any(test, feature = "test")) && existing == ctx.as_bytes() {
+            return;
+        }
+        let ex = String::from_utf8(existing.clone()).unwrap();
+        drop(guard); // Avoid poisioning the global lock.
+        panic!("chain domain separation context already set: {ex}");
+    }
+    *guard = Some(ctx.into_bytes());
+}
+
+/// Test helper to serialize unit tests using the global chain context. The chain context is reset
+/// when this method is called.
+///
+/// # Example
+///
+/// ```rust
+/// # use oasis_runtime_sdk::crypto::signature::context::test_using_chain_context;
+/// let _guard = test_using_chain_context();
+/// // ... rest of the test code follows ...
+/// ```
+#[cfg(any(test, feature = "test"))]
+pub fn test_using_chain_context() -> std::sync::MutexGuard<'static, ()> {
+    static TEST_USING_CHAIN_CONTEXT: Lazy<Mutex<()>> = Lazy::new(Default::default);
+    let guard = TEST_USING_CHAIN_CONTEXT.lock().unwrap();
+    *CHAIN_CONTEXT.lock().unwrap() = None;
+
+    guard
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn test_chain_context() {
+        let _guard = test_using_chain_context();
+        set_chain_context(
+            "8000000000000000000000000000000000000000000000000000000000000000".into(),
+            "643fb06848be7e970af3b5b2d772eb8cfb30499c8162bc18ac03df2f5e22520e",
+        );
+
+        let ctx = get_chain_context_for(b"oasis-runtime-sdk/tx: v0");
+        assert_eq!(&String::from_utf8(ctx).unwrap(), "oasis-runtime-sdk/tx: v0 for chain ca4842870b97a6d5c0d025adce0b6a0dec94d2ba192ede70f96349cfbe3628b9");
+    }
+
+    #[test]
+    fn test_chain_context_not_configured() {
+        let _guard = test_using_chain_context();
+
+        let result = std::panic::catch_unwind(|| get_chain_context_for(b"test"));
+        assert!(result.is_err());
+    }
+
+    #[test]
+    fn test_chain_context_already_configured() {
+        let _guard = test_using_chain_context();
+        set_chain_context(
+            "8000000000000000000000000000000000000000000000000000000000000000".into(),
+            "643fb06848be7e970af3b5b2d772eb8cfb30499c8162bc18ac03df2f5e22520e",
+        );
+
+        let result = std::panic::catch_unwind(|| {
+            set_chain_context(
+                "8000000000000000000000000000000000000000000000000000000000000001".into(),
+                "643fb06848be7e970af3b5b2d772eb8cfb30499c8162bc18ac03df2f5e22520e",
+            )
+        });
+        assert!(result.is_err());
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/signature/digests.rs.html b/rust/src/oasis_runtime_sdk/crypto/signature/digests.rs.html new file mode 100644 index 0000000000..c5f9a6144f --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/signature/digests.rs.html @@ -0,0 +1,233 @@ +digests.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+
/// A digest that either passes through calls to an actual digest or returns
+/// pre-existing hash bytes..
+///
+/// For signing implementations that require a pre-filled digest instance to
+/// sign instead of plain digest bytes, construct an instance of `DummyDigest`
+/// with the bytes of the hash. The instance will return these bytes when
+/// finalized. It will panic if an attempt is made to update its state.
+///
+/// If it was initialized empty, it will pass all calls through to the actual
+/// digest function, useful for signers that do further internal hashing when
+/// signing.
+pub(crate) struct DummyDigest<D> {
+    underlying: Option<D>,
+    preexisting: Vec<u8>,
+}
+
+impl<D> DummyDigest<D> {
+    pub(crate) fn new_precomputed(bytes: &[u8]) -> Self {
+        Self {
+            underlying: None,
+            preexisting: bytes.to_vec(),
+        }
+    }
+}
+
+impl<D> Default for DummyDigest<D>
+where
+    D: Default,
+{
+    fn default() -> Self {
+        Self {
+            underlying: Some(D::default()),
+            preexisting: Vec::new(),
+        }
+    }
+}
+
+impl<D> Clone for DummyDigest<D>
+where
+    D: Clone,
+{
+    fn clone(&self) -> Self {
+        Self {
+            underlying: self.underlying.clone(),
+            preexisting: self.preexisting.clone(),
+        }
+    }
+}
+
+impl<D> digest::OutputSizeUser for DummyDigest<D>
+where
+    D: digest::OutputSizeUser,
+{
+    type OutputSize = <D as digest::OutputSizeUser>::OutputSize;
+}
+
+impl<D> digest::core_api::BlockSizeUser for DummyDigest<D>
+where
+    D: digest::core_api::BlockSizeUser,
+{
+    type BlockSize = <D as digest::core_api::BlockSizeUser>::BlockSize;
+}
+
+impl<D> digest::FixedOutput for DummyDigest<D>
+where
+    D: digest::FixedOutput,
+{
+    fn finalize_into(self, out: &mut digest::Output<Self>) {
+        if let Some(digest) = self.underlying {
+            digest.finalize_into(out);
+        } else {
+            out.as_mut_slice().copy_from_slice(&self.preexisting);
+        }
+    }
+}
+
+impl<D> digest::FixedOutputReset for DummyDigest<D>
+where
+    D: digest::FixedOutputReset,
+{
+    fn finalize_into_reset(&mut self, out: &mut digest::Output<Self>) {
+        if let Some(digest) = &mut self.underlying {
+            digest.finalize_into_reset(out);
+        } else {
+            out.as_mut_slice().copy_from_slice(&self.preexisting);
+        }
+    }
+}
+
+impl<D> digest::Reset for DummyDigest<D>
+where
+    D: digest::Reset,
+{
+    fn reset(&mut self) {
+        if let Some(ref mut digest) = self.underlying {
+            digest.reset();
+        } else {
+            panic!("mutating dummy digest with precomputed hash");
+        }
+    }
+}
+
+impl<D> digest::Update for DummyDigest<D>
+where
+    D: digest::Update,
+{
+    fn update(&mut self, data: &[u8]) {
+        if let Some(ref mut digest) = self.underlying {
+            digest.update(data);
+        } else {
+            panic!("mutating dummy digest with precomputed hash");
+        }
+    }
+}
+
+impl<D> digest::HashMarker for DummyDigest<D> where D: digest::HashMarker {}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/signature/ed25519.rs.html b/rust/src/oasis_runtime_sdk/crypto/signature/ed25519.rs.html new file mode 100644 index 0000000000..df631103e8 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/signature/ed25519.rs.html @@ -0,0 +1,621 @@ +ed25519.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+
//! Ed25519 signatures.
+use std::convert::TryInto;
+
+use base64::prelude::*;
+use curve25519_dalek::{digest::consts::U64, edwards::CompressedEdwardsY};
+use ed25519_dalek::Signer as _;
+use rand_core::RngCore;
+use sha2::{Digest as _, Sha512, Sha512_256};
+
+use oasis_core_runtime::common::crypto::signature::{
+    PublicKey as CorePublicKey, Signature as CoreSignature,
+};
+
+use crate::crypto::signature::{Error, Signature, Signer};
+
+/// An Ed25519 public key.
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, cbor::Encode, cbor::Decode)]
+#[cbor(transparent, no_default)]
+pub struct PublicKey(CorePublicKey);
+
+impl PublicKey {
+    /// Return a byte representation of this public key.
+    pub fn as_bytes(&self) -> &[u8] {
+        self.0.as_ref()
+    }
+
+    /// Construct a public key from a slice of bytes.
+    pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        // CorePublicKey::from doesn't support error checking.
+        if bytes.len() != CorePublicKey::len() {
+            return Err(Error::MalformedPublicKey);
+        }
+
+        // Ensure that the public key is a valid compressed point.
+        //
+        // Note: This could do the small order public key check,
+        // but just assume that signature verification will impose
+        // whatever semantics it desires.
+        let a = CompressedEdwardsY::from_slice(bytes).unwrap(); // Length is checked above.
+        let _a = match a.decompress() {
+            Some(point) => point,
+            None => return Err(Error::MalformedPublicKey),
+        };
+
+        Ok(PublicKey(CorePublicKey::from(bytes)))
+    }
+
+    /// Verify a signature.
+    pub fn verify(
+        &self,
+        context: &[u8],
+        message: &[u8],
+        signature: &Signature,
+    ) -> Result<(), Error> {
+        // CoreSignature::from doesn't support error checking either.
+        if signature.0.len() != CoreSignature::len() {
+            return Err(Error::MalformedSignature);
+        }
+        let sig: &[u8] = signature.0.as_ref();
+        let sig = CoreSignature::from(sig);
+
+        sig.verify(&self.0, context, message)
+            .map_err(|_| Error::VerificationFailed)
+    }
+
+    /// Verify signature without applying domain separation.
+    pub fn verify_raw(&self, message: &[u8], signature: &Signature) -> Result<(), Error> {
+        // CoreSignature::from doesn't support error checking either.
+        if signature.0.len() != CoreSignature::len() {
+            return Err(Error::MalformedSignature);
+        }
+        let sig: &[u8] = signature.0.as_ref();
+        let sig = CoreSignature::from(sig);
+
+        sig.verify_raw(&self.0, message)
+            .map_err(|_| Error::VerificationFailed)
+    }
+
+    /// Verify signature of a pre-hashed message.
+    pub fn verify_digest<D>(&self, digest: D, signature: &Signature) -> Result<(), Error>
+    where
+        D: ed25519_dalek::Digest<OutputSize = U64>,
+    {
+        let sig: ed25519_dalek::Signature = signature
+            .as_ref()
+            .try_into()
+            .map_err(|_| Error::MalformedSignature)?;
+        let pk: ed25519_dalek::VerifyingKey = self
+            .as_bytes()
+            .try_into()
+            .map_err(|_| Error::MalformedPublicKey)?;
+        pk.verify_prehashed(digest, None, &sig)
+            .map_err(|_| Error::VerificationFailed)
+    }
+}
+
+impl From<&'static str> for PublicKey {
+    fn from(s: &'static str) -> PublicKey {
+        PublicKey::from_bytes(&BASE64_STANDARD.decode(s).unwrap()).unwrap()
+    }
+}
+
+impl From<CorePublicKey> for PublicKey {
+    fn from(pk: CorePublicKey) -> PublicKey {
+        PublicKey(pk)
+    }
+}
+
+impl From<&CorePublicKey> for PublicKey {
+    fn from(pk: &CorePublicKey) -> PublicKey {
+        PublicKey(*pk)
+    }
+}
+
+impl From<PublicKey> for CorePublicKey {
+    fn from(pk: PublicKey) -> CorePublicKey {
+        pk.0
+    }
+}
+
+/// A memory-backed signer for Ed25519.
+pub struct MemorySigner {
+    key: Key,
+}
+
+/// The original version of the Ed25519 signer returned the "expanded" secret key from `to_bytes`.
+/// A contract may have stored the "expanded" key and expects its use to continue to succeed.
+/// For backwards compatibility, the signer works with both "expanded" and regular keys.
+/// New invocations receive a regular/proper key, and from-"expanded" ones get the old behavior.
+enum Key {
+    Expanded {
+        esk: ed25519_dalek::hazmat::ExpandedSecretKey,
+        /// The hash output that is used to create the "expanded" secret key.
+        /// It is stored to return from `from_bytes` because it is not recoverable from `esk`.
+        hash: zeroize::Zeroizing<[u8; 64]>,
+    },
+    Regular(ed25519_dalek::SigningKey),
+}
+
+impl Key {
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        match bytes.len() {
+            // It's a new/correct-style secret key.
+            32 => bytes
+                .try_into()
+                .map(ed25519_dalek::SigningKey::from_bytes)
+                .map(Self::Regular)
+                .map_err(|_| Error::MalformedPrivateKey),
+            // It's an "expanded" secret key, which is treated as the output of a 64-byte hash function.
+            64 => bytes
+                .try_into()
+                .map(|hash| Self::Expanded {
+                    esk: ed25519_dalek::hazmat::ExpandedSecretKey::from_bytes(&hash),
+                    hash: hash.into(),
+                })
+                .map_err(|_| Error::MalformedPrivateKey),
+            _ => Err(Error::MalformedPrivateKey),
+        }
+    }
+
+    fn to_bytes(&self) -> Vec<u8> {
+        match self {
+            Self::Expanded { hash, .. } => hash.to_vec(),
+            Self::Regular(sk) => sk.to_bytes().to_vec(),
+        }
+    }
+
+    fn sign(&self, message: &[u8]) -> Signature {
+        match self {
+            Self::Expanded { esk, .. } => {
+                let verifying_key = ed25519_dalek::VerifyingKey::from(esk);
+                ed25519_dalek::hazmat::raw_sign::<Sha512>(esk, message, &verifying_key)
+            }
+            Self::Regular(sk) => sk.sign(message),
+        }
+        .to_bytes()
+        .to_vec()
+        .into()
+    }
+
+    fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
+    where
+        D: ed25519_dalek::Digest<OutputSize = U64>,
+    {
+        match self {
+            Key::Expanded { esk, .. } => {
+                let verifying_key = ed25519_dalek::VerifyingKey::from(esk);
+                ed25519_dalek::hazmat::raw_sign_prehashed::<Sha512, _>(
+                    esk,
+                    digest,
+                    &verifying_key,
+                    None,
+                )
+            }
+            Key::Regular(sk) => sk.sign_prehashed(digest, None),
+        }
+        .map_err(|_| Error::SigningError)
+        .map(|sig| sig.to_bytes().to_vec().into())
+    }
+
+    fn public_key(&self) -> super::PublicKey {
+        let pk = match self {
+            Self::Expanded { esk, .. } => ed25519_dalek::VerifyingKey::from(esk),
+            Self::Regular(sk) => sk.verifying_key(),
+        };
+        super::PublicKey::Ed25519(PublicKey::from_bytes(pk.as_bytes()).unwrap())
+    }
+}
+
+impl MemorySigner {
+    pub fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
+    where
+        D: ed25519_dalek::Digest<OutputSize = U64>,
+    {
+        self.key.sign_digest(digest)
+    }
+}
+
+impl Signer for MemorySigner {
+    fn random(rng: &mut impl RngCore) -> Result<Self, Error> {
+        let mut seed = [0u8; 32];
+        rng.fill_bytes(&mut seed);
+        Self::new_from_seed(&seed)
+    }
+
+    fn new_from_seed(seed: &[u8]) -> Result<Self, Error> {
+        if seed.len() != 32 {
+            return Err(Error::MalformedPublicKey);
+        }
+        Self::from_bytes(seed)
+    }
+
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        Ok(Self {
+            key: Key::from_bytes(bytes)?,
+        })
+    }
+
+    fn to_bytes(&self) -> Vec<u8> {
+        self.key.to_bytes()
+    }
+
+    fn public_key(&self) -> super::PublicKey {
+        self.key.public_key()
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error> {
+        let mut digest = Sha512_256::new();
+        digest.update(context);
+        digest.update(message);
+        Ok(self.key.sign(&digest.finalize()))
+    }
+
+    fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error> {
+        Ok(self.key.sign(message))
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn legacy_esk_equivalence() {
+        let seed = [42u8; 32];
+        let signer = MemorySigner::new_from_seed(&seed).unwrap();
+
+        let esk = ed25519_dalek::hazmat::ExpandedSecretKey::from(&seed);
+        let esk_hash = Sha512::digest(seed);
+        let esk_signer = MemorySigner::from_bytes(&esk_hash).unwrap();
+
+        let esk_public_key = super::super::PublicKey::Ed25519(
+            PublicKey::from_bytes(&ed25519_dalek::VerifyingKey::from(&esk).to_bytes()).unwrap(),
+        );
+
+        assert_eq!(
+            esk_signer.to_bytes().as_slice(),
+            esk_hash.as_slice(),
+            "esk roundtrip"
+        );
+        assert_eq!(signer.to_bytes(), seed, "sk roundtrip");
+
+        let context = b"tests";
+        let message = b"hello, world!";
+        let digest = Sha512::new().chain_update(context).chain_update(message);
+
+        let sig = signer.sign(context, message).unwrap();
+        let esk_sig = esk_signer.sign(context, message).unwrap();
+        assert_eq!(sig, esk_sig, "sig != esk_sig");
+
+        let raw_sig = signer.sign_raw(message).unwrap();
+        let esk_raw_sig = esk_signer.sign_raw(message).unwrap();
+        assert_eq!(raw_sig, esk_raw_sig, "raw_sig != esk_raw_sig");
+
+        let digest_sig = signer.sign_digest(digest.clone()).unwrap();
+        let esk_digest_sig = esk_signer.sign_digest(digest).unwrap();
+        assert_eq!(digest_sig, esk_digest_sig, "digest_sig != esk_digest_sig");
+
+        assert_eq!(
+            signer.public_key(),
+            esk_public_key,
+            "signer pk != esk_public_key"
+        );
+        assert_eq!(
+            esk_signer.public_key(),
+            esk_public_key,
+            "esk_signer pk != esk_pubic_key"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/signature/mod.rs.html b/rust/src/oasis_runtime_sdk/crypto/signature/mod.rs.html new file mode 100644 index 0000000000..7efb762096 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/signature/mod.rs.html @@ -0,0 +1,1591 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+
//! Cryptographic signatures.
+use std::convert::TryFrom;
+
+use digest::{typenum::Unsigned as _, Digest as _};
+use rand_core::RngCore;
+use thiserror::Error;
+
+use crate::core::common::crypto::signature::{PublicKey as CorePublicKey, Signer as CoreSigner};
+
+pub mod context;
+mod digests;
+pub mod ed25519;
+pub mod secp256k1;
+pub mod secp256r1;
+pub mod secp384r1;
+pub mod sr25519;
+
+/// A specific combination of signature and hash.
+#[allow(non_camel_case_types)]
+#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, cbor::Encode, cbor::Decode)]
+pub enum SignatureType {
+    #[cbor(rename = "ed25519_oasis")]
+    Ed25519_Oasis,
+    #[cbor(rename = "ed25519_pure")]
+    Ed25519_Pure,
+    #[cbor(rename = "ed25519_prehashed_sha512")]
+    Ed25519_PrehashedSha512,
+    #[cbor(rename = "secp256k1_oasis")]
+    Secp256k1_Oasis,
+    #[cbor(rename = "secp256k1_prehashed_keccak256")]
+    Secp256k1_PrehashedKeccak256,
+    #[cbor(rename = "secp256k1_prehashed_sha256")]
+    Secp256k1_PrehashedSha256,
+    #[cbor(rename = "sr25519")]
+    Sr25519,
+    #[cbor(rename = "secp256r1_prehashed_sha256")]
+    Secp256r1_PrehashedSha256,
+    #[cbor(rename = "secp384r1_prehashed_sha384")]
+    Secp384r1_PrehashedSha384,
+}
+
+impl SignatureType {
+    pub fn as_int(&self) -> u8 {
+        match self {
+            Self::Ed25519_Oasis => 0,
+            Self::Ed25519_Pure => 1,
+            Self::Ed25519_PrehashedSha512 => 2,
+            Self::Secp256k1_Oasis => 3,
+            Self::Secp256k1_PrehashedKeccak256 => 4,
+            Self::Secp256k1_PrehashedSha256 => 5,
+            Self::Sr25519 => 6,
+            Self::Secp256r1_PrehashedSha256 => 7,
+            Self::Secp384r1_PrehashedSha384 => 8,
+        }
+    }
+
+    pub fn is_prehashed(&self) -> bool {
+        matches!(
+            self,
+            Self::Ed25519_PrehashedSha512
+                | Self::Secp256k1_PrehashedKeccak256
+                | Self::Secp256k1_PrehashedSha256
+                | Self::Secp256r1_PrehashedSha256
+                | Self::Secp384r1_PrehashedSha384
+        )
+    }
+
+    pub fn is_ed25519_variant(&self) -> bool {
+        matches!(
+            self,
+            Self::Ed25519_Oasis | Self::Ed25519_Pure | Self::Ed25519_PrehashedSha512
+        )
+    }
+
+    pub fn is_secp256k1_variant(&self) -> bool {
+        matches!(
+            self,
+            Self::Secp256k1_Oasis
+                | Self::Secp256k1_PrehashedKeccak256
+                | Self::Secp256k1_PrehashedSha256
+        )
+    }
+
+    pub fn is_secp256r1_variant(&self) -> bool {
+        matches!(self, Self::Secp256r1_PrehashedSha256)
+    }
+
+    pub fn is_secp384r1_variant(&self) -> bool {
+        matches!(self, Self::Secp384r1_PrehashedSha384)
+    }
+}
+
+impl TryFrom<u8> for SignatureType {
+    type Error = Error;
+
+    fn try_from(value: u8) -> Result<Self, Self::Error> {
+        match value {
+            0 => Ok(Self::Ed25519_Oasis),
+            1 => Ok(Self::Ed25519_Pure),
+            2 => Ok(Self::Ed25519_PrehashedSha512),
+            3 => Ok(Self::Secp256k1_Oasis),
+            4 => Ok(Self::Secp256k1_PrehashedKeccak256),
+            5 => Ok(Self::Secp256k1_PrehashedSha256),
+            6 => Ok(Self::Sr25519),
+            7 => Ok(Self::Secp256r1_PrehashedSha256),
+            8 => Ok(Self::Secp384r1_PrehashedSha384),
+            _ => Err(Error::InvalidArgument),
+        }
+    }
+}
+
+/// A public key used for signing.
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, cbor::Encode, cbor::Decode)]
+pub enum PublicKey {
+    #[cbor(rename = "ed25519")]
+    Ed25519(ed25519::PublicKey),
+
+    #[cbor(rename = "secp256k1")]
+    Secp256k1(secp256k1::PublicKey),
+
+    #[cbor(rename = "secp256r1")]
+    Secp256r1(secp256r1::PublicKey),
+
+    #[cbor(rename = "secp384r1")]
+    Secp384r1(secp384r1::PublicKey),
+
+    #[cbor(rename = "sr25519")]
+    Sr25519(sr25519::PublicKey),
+}
+
+/// Error.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("malformed public key")]
+    MalformedPublicKey,
+    #[error("malformed private key")]
+    MalformedPrivateKey,
+    #[error("malformed signature")]
+    MalformedSignature,
+    #[error("signature verification failed")]
+    VerificationFailed,
+    #[error("invalid argument")]
+    InvalidArgument,
+    #[error("invalid digest length")]
+    InvalidDigestLength,
+    #[error("other signing error")]
+    SigningError,
+}
+
+impl PublicKey {
+    /// Return the key type as string.
+    pub fn key_type(&self) -> &str {
+        match self {
+            Self::Ed25519(_) => "ed25519",
+            Self::Secp256k1(_) => "secp256k1",
+            Self::Secp256r1(_) => "secp256r1",
+            Self::Secp384r1(_) => "secp384r1",
+            Self::Sr25519(_) => "sr25519",
+        }
+    }
+
+    /// Return a byte representation of this public key.
+    pub fn as_bytes(&self) -> &[u8] {
+        match self {
+            PublicKey::Ed25519(pk) => pk.as_bytes(),
+            PublicKey::Secp256k1(pk) => pk.as_bytes(),
+            PublicKey::Secp256r1(pk) => pk.as_bytes(),
+            PublicKey::Secp384r1(pk) => pk.as_bytes(),
+            PublicKey::Sr25519(pk) => pk.as_bytes(),
+        }
+    }
+
+    /// Construct a public key from a slice of bytes.
+    pub fn from_bytes(sig_type: SignatureType, bytes: &[u8]) -> Result<Self, Error> {
+        match sig_type {
+            SignatureType::Ed25519_Oasis
+            | SignatureType::Ed25519_Pure
+            | SignatureType::Ed25519_PrehashedSha512 => {
+                Ok(Self::Ed25519(ed25519::PublicKey::from_bytes(bytes)?))
+            }
+            SignatureType::Secp256k1_Oasis
+            | SignatureType::Secp256k1_PrehashedKeccak256
+            | SignatureType::Secp256k1_PrehashedSha256 => {
+                Ok(Self::Secp256k1(secp256k1::PublicKey::from_bytes(bytes)?))
+            }
+            SignatureType::Secp256r1_PrehashedSha256 => {
+                Ok(Self::Secp256r1(secp256r1::PublicKey::from_bytes(bytes)?))
+            }
+            SignatureType::Secp384r1_PrehashedSha384 => {
+                Ok(Self::Secp384r1(secp384r1::PublicKey::from_bytes(bytes)?))
+            }
+            SignatureType::Sr25519 => Ok(Self::Sr25519(sr25519::PublicKey::from_bytes(bytes)?)),
+        }
+    }
+
+    /// Verify a signature.
+    pub fn verify(
+        &self,
+        context: &[u8],
+        message: &[u8],
+        signature: &Signature,
+    ) -> Result<(), Error> {
+        match self {
+            PublicKey::Ed25519(pk) => pk.verify(context, message, signature),
+            PublicKey::Secp256k1(pk) => pk.verify(context, message, signature),
+            PublicKey::Secp256r1(pk) => pk.verify(context, message, signature),
+            PublicKey::Secp384r1(pk) => pk.verify(context, message, signature),
+            PublicKey::Sr25519(pk) => pk.verify(context, message, signature),
+        }
+    }
+
+    /// Verify signature raw using the underlying method, without the domain
+    /// separation schema.
+    pub fn verify_raw(&self, message: &[u8], signature: &Signature) -> Result<(), Error> {
+        match self {
+            PublicKey::Ed25519(pk) => pk.verify_raw(message, signature),
+            PublicKey::Secp256k1(pk) => pk.verify_raw(message, signature),
+            PublicKey::Secp256r1(pk) => pk.verify_raw(message, signature),
+            PublicKey::Secp384r1(pk) => pk.verify_raw(message, signature),
+            PublicKey::Sr25519(_) => Err(Error::InvalidArgument),
+        }
+    }
+
+    /// Verify the signature of a message.
+    pub fn verify_by_type(
+        &self,
+        signature_type: SignatureType,
+        context_or_hash: &[u8],
+        message: &[u8],
+        signature: &Signature,
+    ) -> Result<(), Error> {
+        match self {
+            Self::Ed25519(pk) => match signature_type {
+                SignatureType::Ed25519_Oasis => pk.verify(context_or_hash, message, signature),
+                SignatureType::Ed25519_Pure => pk.verify_raw(message, signature),
+                SignatureType::Ed25519_PrehashedSha512 => {
+                    if context_or_hash.len()
+                        != <sha2::Sha512 as sha2::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    let digest =
+                        digests::DummyDigest::<sha2::Sha512>::new_precomputed(context_or_hash);
+                    pk.verify_digest(digest, signature)
+                }
+                _ => Err(Error::InvalidArgument),
+            },
+            Self::Secp256k1(pk) => match signature_type {
+                SignatureType::Secp256k1_Oasis => pk.verify(context_or_hash, message, signature),
+                SignatureType::Secp256k1_PrehashedKeccak256 => {
+                    if context_or_hash.len()
+                        != <sha3::Keccak256 as sha3::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    // Use SHA-256 for RFC6979 even if Keccak256 was used for the message.
+                    let digest = digests::DummyDigest::<k256::sha2::Sha256>::new_precomputed(
+                        context_or_hash,
+                    );
+                    pk.verify_digest(digest, signature)
+                }
+                SignatureType::Secp256k1_PrehashedSha256 => {
+                    if context_or_hash.len()
+                        != <sha2::Sha256 as sha2::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    let digest = digests::DummyDigest::<k256::sha2::Sha256>::new_precomputed(
+                        context_or_hash,
+                    );
+                    pk.verify_digest(digest, signature)
+                }
+                _ => Err(Error::InvalidArgument),
+            },
+            Self::Secp256r1(pk) => match signature_type {
+                SignatureType::Secp256r1_PrehashedSha256 => {
+                    if context_or_hash.len()
+                        != <sha2::Sha256 as sha2::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    let digest =
+                        digests::DummyDigest::<sha2::Sha256>::new_precomputed(context_or_hash);
+                    pk.verify_digest(digest, signature)
+                }
+                _ => Err(Error::InvalidArgument),
+            },
+            Self::Secp384r1(pk) => match signature_type {
+                SignatureType::Secp384r1_PrehashedSha384 => {
+                    if context_or_hash.len()
+                        != <sha2::Sha384 as sha2::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    let digest =
+                        digests::DummyDigest::<sha2::Sha384>::new_precomputed(context_or_hash);
+                    pk.verify_digest(digest, signature)
+                }
+                _ => Err(Error::InvalidArgument),
+            },
+            Self::Sr25519(_) => Err(Error::InvalidArgument),
+        }
+    }
+
+    /// Verify a batch of signatures of the same message.
+    pub fn verify_batch_multisig(
+        context: &[u8],
+        message: &[u8],
+        public_keys: &[PublicKey],
+        signatures: &[Signature],
+    ) -> Result<(), Error> {
+        if public_keys.len() != signatures.len() {
+            return Err(Error::InvalidArgument);
+        }
+
+        // TODO: Use actual batch verification.
+        for (pk, sig) in public_keys.iter().zip(signatures.iter()) {
+            pk.verify(context, message, sig)?;
+        }
+        Ok(())
+    }
+}
+
+impl AsRef<[u8]> for PublicKey {
+    fn as_ref(&self) -> &[u8] {
+        self.as_bytes()
+    }
+}
+
+impl PartialEq<CorePublicKey> for PublicKey {
+    fn eq(&self, other: &CorePublicKey) -> bool {
+        match self {
+            PublicKey::Ed25519(pk) => pk.as_bytes() == other.as_ref(),
+            _ => false,
+        }
+    }
+}
+
+impl TryFrom<PublicKey> for CorePublicKey {
+    type Error = &'static str;
+
+    fn try_from(pk: PublicKey) -> Result<Self, Self::Error> {
+        match pk {
+            PublicKey::Ed25519(pk) => Ok(pk.into()),
+            _ => Err("not an Ed25519 public key"),
+        }
+    }
+}
+
+impl From<CorePublicKey> for PublicKey {
+    fn from(pk: CorePublicKey) -> Self {
+        Self::Ed25519(pk.into())
+    }
+}
+
+/// Variable-length opaque signature.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[cbor(transparent)]
+pub struct Signature(Vec<u8>);
+
+impl AsRef<[u8]> for Signature {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl From<Vec<u8>> for Signature {
+    fn from(v: Vec<u8>) -> Signature {
+        Signature(v)
+    }
+}
+
+impl From<Signature> for Vec<u8> {
+    fn from(s: Signature) -> Vec<u8> {
+        s.0
+    }
+}
+
+/// Common trait for memory signers.
+pub trait Signer: Send + Sync {
+    /// Create a new random signer.
+    fn random(rng: &mut impl RngCore) -> Result<Self, Error>
+    where
+        Self: Sized;
+
+    /// Create a new signer from the given seed.
+    fn new_from_seed(seed: &[u8]) -> Result<Self, Error>
+    where
+        Self: Sized;
+
+    /// Recreate signer from a byte serialization.
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
+    where
+        Self: Sized;
+
+    /// Serialize the signer into bytes.
+    fn to_bytes(&self) -> Vec<u8>;
+
+    /// Return the public key counterpart to the signer's secret key.
+    fn public_key(&self) -> PublicKey;
+
+    /// Generate a signature over the context and message.
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>;
+
+    /// Generate a signature over the message.
+    fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>;
+}
+
+impl<T: Signer + ?Sized> Signer for std::sync::Arc<T> {
+    fn random(_rng: &mut impl RngCore) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn new_from_seed(_seed: &[u8]) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn from_bytes(_bytes: &[u8]) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn to_bytes(&self) -> Vec<u8> {
+        T::to_bytes(self)
+    }
+
+    fn public_key(&self) -> PublicKey {
+        T::public_key(self)
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error> {
+        T::sign(self, context, message)
+    }
+
+    fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error> {
+        T::sign_raw(self, message)
+    }
+}
+
+impl<T: CoreSigner> Signer for &T {
+    fn random(_rng: &mut impl RngCore) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn new_from_seed(_seed: &[u8]) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn from_bytes(_bytes: &[u8]) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn to_bytes(&self) -> Vec<u8> {
+        vec![]
+    }
+
+    fn public_key(&self) -> PublicKey {
+        PublicKey::Ed25519(self.public().into())
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error> {
+        let raw_sig = CoreSigner::sign(*self, context, message).map_err(|_| Error::SigningError)?;
+        Ok(Signature(raw_sig.as_ref().into()))
+    }
+
+    fn sign_raw(&self, _message: &[u8]) -> Result<Signature, Error> {
+        Err(Error::InvalidArgument)
+    }
+}
+
+impl Signer for crate::core::identity::Identity {
+    fn random(_rng: &mut impl RngCore) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn new_from_seed(_seed: &[u8]) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn from_bytes(_bytes: &[u8]) -> Result<Self, Error>
+    where
+        Self: Sized,
+    {
+        Err(Error::InvalidArgument)
+    }
+
+    fn to_bytes(&self) -> Vec<u8> {
+        vec![]
+    }
+
+    fn public_key(&self) -> PublicKey {
+        PublicKey::Ed25519(self.public().into())
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error> {
+        let raw_sig = CoreSigner::sign(self, context, message).map_err(|_| Error::SigningError)?;
+        Ok(Signature(raw_sig.as_ref().into()))
+    }
+
+    fn sign_raw(&self, _message: &[u8]) -> Result<Signature, Error> {
+        Err(Error::InvalidArgument)
+    }
+}
+
+/// A memory-backed signer.
+pub enum MemorySigner {
+    Ed25519(ed25519::MemorySigner),
+    Secp256k1(secp256k1::MemorySigner),
+    Secp256r1(secp256r1::MemorySigner),
+    Secp384r1(secp384r1::MemorySigner),
+}
+
+impl MemorySigner {
+    /// Create a new memory signer from a seed.
+    pub fn new_from_seed(sig_type: SignatureType, seed: &[u8]) -> Result<Self, Error> {
+        if sig_type.is_ed25519_variant() {
+            Ok(Self::Ed25519(ed25519::MemorySigner::new_from_seed(seed)?))
+        } else if sig_type.is_secp256k1_variant() {
+            Ok(Self::Secp256k1(secp256k1::MemorySigner::new_from_seed(
+                seed,
+            )?))
+        } else if sig_type.is_secp256r1_variant() {
+            Ok(Self::Secp256r1(secp256r1::MemorySigner::new_from_seed(
+                seed,
+            )?))
+        } else if sig_type.is_secp384r1_variant() {
+            Ok(Self::Secp384r1(secp384r1::MemorySigner::new_from_seed(
+                seed,
+            )?))
+        } else {
+            Err(Error::InvalidArgument)
+        }
+    }
+
+    /// Create a new signer for testing purposes.
+    pub fn new_test(sig_type: SignatureType, name: &str) -> Self {
+        if sig_type.is_secp384r1_variant() {
+            Self::new_from_seed(sig_type, &sha2::Sha384::digest(name)).unwrap()
+        } else {
+            Self::new_from_seed(sig_type, &sha2::Sha512_256::digest(name)).unwrap()
+        }
+    }
+
+    /// Reconstruct the signer from its byte representation.
+    pub fn from_bytes(sig_type: SignatureType, bytes: &[u8]) -> Result<Self, Error> {
+        if sig_type.is_ed25519_variant() {
+            Ok(Self::Ed25519(ed25519::MemorySigner::from_bytes(bytes)?))
+        } else if sig_type.is_secp256k1_variant() {
+            Ok(Self::Secp256k1(secp256k1::MemorySigner::from_bytes(bytes)?))
+        } else if sig_type.is_secp256r1_variant() {
+            Ok(Self::Secp256r1(secp256r1::MemorySigner::from_bytes(bytes)?))
+        } else if sig_type.is_secp384r1_variant() {
+            Ok(Self::Secp384r1(secp384r1::MemorySigner::from_bytes(bytes)?))
+        } else {
+            Err(Error::InvalidArgument)
+        }
+    }
+
+    /// Return a byte representation of the signer.
+    pub fn to_bytes(&self) -> Vec<u8> {
+        match self {
+            Self::Ed25519(signer) => signer.to_bytes(),
+            Self::Secp256k1(signer) => signer.to_bytes(),
+            Self::Secp256r1(signer) => signer.to_bytes(),
+            Self::Secp384r1(signer) => signer.to_bytes(),
+        }
+    }
+
+    /// Public key corresponding to the signer.
+    pub fn public_key(&self) -> PublicKey {
+        match self {
+            Self::Ed25519(signer) => signer.public_key(),
+            Self::Secp256k1(signer) => signer.public_key(),
+            Self::Secp256r1(signer) => signer.public_key(),
+            Self::Secp384r1(signer) => signer.public_key(),
+        }
+    }
+
+    /// Generate a signature with the private key over the context and message.
+    pub fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error> {
+        match self {
+            Self::Ed25519(signer) => signer.sign(context, message),
+            Self::Secp256k1(signer) => signer.sign(context, message),
+            Self::Secp256r1(signer) => signer.sign(context, message),
+            Self::Secp384r1(signer) => signer.sign(context, message),
+        }
+    }
+
+    /// Generate a signature with the private key over the message.
+    pub fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error> {
+        match self {
+            Self::Ed25519(signer) => signer.sign_raw(message),
+            Self::Secp256k1(signer) => signer.sign_raw(message),
+            Self::Secp256r1(signer) => signer.sign_raw(message),
+            Self::Secp384r1(signer) => signer.sign_raw(message),
+        }
+    }
+
+    /// Generate a signature for the specified message and optional context.
+    pub fn sign_by_type(
+        &self,
+        signature_type: SignatureType,
+        context_or_hash: &[u8],
+        message: &[u8],
+    ) -> Result<Signature, Error> {
+        match self {
+            Self::Ed25519(signer) => match signature_type {
+                SignatureType::Ed25519_Oasis => signer.sign(context_or_hash, message),
+                SignatureType::Ed25519_Pure => signer.sign_raw(message),
+                SignatureType::Ed25519_PrehashedSha512 => {
+                    if context_or_hash.len()
+                        != <sha2::Sha512 as sha2::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    let digest =
+                        digests::DummyDigest::<sha2::Sha512>::new_precomputed(context_or_hash);
+                    signer.sign_digest(digest)
+                }
+                _ => Err(Error::InvalidArgument),
+            },
+            Self::Secp256k1(signer) => match signature_type {
+                SignatureType::Secp256k1_Oasis => signer.sign(context_or_hash, message),
+                SignatureType::Secp256k1_PrehashedKeccak256 => {
+                    if context_or_hash.len()
+                        != <sha3::Keccak256 as sha3::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    // Use SHA-256 for RFC6979 even if Keccak256 was used for the message.
+                    let digest = digests::DummyDigest::<k256::sha2::Sha256>::new_precomputed(
+                        context_or_hash,
+                    );
+                    signer.sign_digest(digest)
+                }
+                SignatureType::Secp256k1_PrehashedSha256 => {
+                    if context_or_hash.len()
+                        != <sha2::Sha256 as sha2::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    let digest = digests::DummyDigest::<k256::sha2::Sha256>::new_precomputed(
+                        context_or_hash,
+                    );
+                    signer.sign_digest(digest)
+                }
+                _ => Err(Error::InvalidArgument),
+            },
+            Self::Secp256r1(signer) => match signature_type {
+                SignatureType::Secp256r1_PrehashedSha256 => {
+                    if context_or_hash.len()
+                        != <sha2::Sha256 as sha2::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    let digest =
+                        digests::DummyDigest::<sha2::Sha256>::new_precomputed(context_or_hash);
+                    signer.sign_digest(digest)
+                }
+                _ => Err(Error::InvalidArgument),
+            },
+            Self::Secp384r1(signer) => match signature_type {
+                SignatureType::Secp384r1_PrehashedSha384 => {
+                    if context_or_hash.len()
+                        != <sha2::Sha384 as sha2::digest::OutputSizeUser>::OutputSize::USIZE
+                    {
+                        return Err(Error::InvalidArgument);
+                    }
+                    let digest =
+                        digests::DummyDigest::<sha2::Sha384>::new_precomputed(context_or_hash);
+                    signer.sign_digest(digest)
+                }
+                _ => Err(Error::InvalidArgument),
+            },
+        }
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn test_signature_conversion() {
+        let raw = vec![0x00, 0x01, 0x02, 0x03];
+        let sig = Signature::from(raw.clone());
+        let v: Vec<u8> = sig.clone().into();
+        assert_eq!(v, raw);
+
+        let vref: &[u8] = v.as_ref();
+        assert_eq!(vref, sig.as_ref());
+    }
+
+    #[test]
+    fn test_memory_signer() {
+        let ctx = b"oasis-core/test: context";
+        let corrupt_ctx = b"oasis-core/test: wrong context";
+        let message = b"this is a message";
+        let corrupt_message = b"this isn't a message";
+
+        for sig_type in [
+            SignatureType::Ed25519_Oasis,
+            SignatureType::Ed25519_Pure,
+            SignatureType::Secp256k1_Oasis,
+        ] {
+            let signer = MemorySigner::new_test(sig_type, "memory signer test");
+            let pk = signer.public_key();
+
+            let signature = signer
+                .sign_by_type(sig_type, ctx, message)
+                .expect("signing should succeed");
+
+            pk.verify_by_type(sig_type, ctx, message, &signature)
+                .expect("signature should verify");
+            pk.verify_by_type(sig_type, ctx, corrupt_message, &signature)
+                .expect_err("signature should fail verification");
+            if matches!(sig_type, SignatureType::Ed25519_Oasis)
+                || matches!(sig_type, SignatureType::Secp256k1_Oasis)
+            {
+                pk.verify_by_type(sig_type, corrupt_ctx, message, &signature)
+                    .expect_err("signature should fail verification");
+                pk.verify_by_type(sig_type, corrupt_ctx, corrupt_message, &signature)
+                    .expect_err("signature should fail verification");
+            }
+        }
+    }
+
+    #[test]
+    fn test_memory_signer_prehashed() {
+        let message = b"this is a message";
+        let corrupt_message = b"this isn't a message";
+
+        let sig_types: &[(SignatureType, Box<dyn Fn(&[u8]) -> Vec<u8>>)] = &[
+            (
+                SignatureType::Ed25519_PrehashedSha512,
+                Box::new(|message| sha2::Sha512::digest(message).to_vec()),
+            ),
+            (
+                SignatureType::Secp256k1_PrehashedKeccak256,
+                Box::new(|message| sha3::Keccak256::digest(message).to_vec()),
+            ),
+            (
+                SignatureType::Secp256k1_PrehashedSha256,
+                Box::new(|message| sha2::Sha256::digest(message).to_vec()),
+            ),
+            (
+                SignatureType::Secp256r1_PrehashedSha256,
+                Box::new(|message| sha2::Sha256::digest(message).to_vec()),
+            ),
+            (
+                SignatureType::Secp384r1_PrehashedSha384,
+                Box::new(|message| sha2::Sha384::digest(message).to_vec()),
+            ),
+        ];
+
+        for (sig_type, hasher) in sig_types {
+            let hash = hasher(message);
+            let corrupt_hash = hasher(corrupt_message);
+
+            let signer = MemorySigner::new_test(*sig_type, "memory signer test");
+            let pk = signer.public_key();
+
+            let signature = signer
+                .sign_by_type(*sig_type, &hash, b"")
+                .expect("signing should succeed");
+            pk.verify_by_type(*sig_type, &hash, b"", &signature)
+                .expect("signature should verify");
+            pk.verify_by_type(*sig_type, &corrupt_hash, b"", &signature)
+                .expect_err("corrupt hash shouldn't verify");
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/signature/secp256k1.rs.html b/rust/src/oasis_runtime_sdk/crypto/signature/secp256k1.rs.html new file mode 100644 index 0000000000..a7bc30e61f --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/signature/secp256k1.rs.html @@ -0,0 +1,325 @@ +secp256k1.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+
//! Secp256k1 signatures.
+use base64::prelude::*;
+use digest::{consts::U32, Digest, FixedOutput};
+use k256::{
+    self,
+    ecdsa::{
+        self,
+        signature::{DigestSigner as _, DigestVerifier, Signer as _, Verifier as _},
+    },
+    elliptic_curve::sec1::{FromEncodedPoint, ToEncodedPoint},
+    sha2::Sha512_256,
+};
+use rand_core::RngCore;
+
+use crate::crypto::signature::{Error, Signature};
+
+/// A Secp256k1 public key (in compressed form).
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub struct PublicKey(k256::EncodedPoint);
+
+impl PublicKey {
+    /// Return a byte representation of this public key.
+    pub fn as_bytes(&self) -> &[u8] {
+        self.0.as_bytes()
+    }
+
+    /// Return an alternative byte representation used in deriving Ethereum-compatible addresses.
+    pub fn to_uncompressed_untagged_bytes(&self) -> Vec<u8> {
+        // Our wrapper type only accepts compressed points, so we shouldn't get None.
+        let pk = k256::PublicKey::from_encoded_point(&self.0).unwrap();
+        pk.to_encoded_point(false).as_bytes()[1..].to_vec()
+    }
+
+    /// Derive an Ethereum-compatible address.
+    pub fn to_eth_address(&self) -> Vec<u8> {
+        sha3::Keccak256::digest(self.to_uncompressed_untagged_bytes())[32 - 20..].to_vec()
+    }
+
+    /// Construct a public key from a slice of bytes.
+    pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        k256::EncodedPoint::from_bytes(bytes)
+            .map_err(|_| Error::MalformedPublicKey)
+            .map(PublicKey)
+    }
+
+    /// Verify a signature.
+    pub fn verify(
+        &self,
+        context: &[u8],
+        message: &[u8],
+        signature: &Signature,
+    ) -> Result<(), Error> {
+        let digest = Sha512_256::new()
+            .chain_update(context)
+            .chain_update(message);
+        self.verify_digest(digest, signature)
+            .map_err(|_| Error::VerificationFailed)
+    }
+
+    /// Verify signature without using any domain separation scheme.
+    pub fn verify_raw(&self, message: &[u8], signature: &Signature) -> Result<(), Error> {
+        let sig = ecdsa::Signature::from_der(signature.0.as_ref())
+            .map_err(|_| Error::MalformedSignature)?;
+        let verify_key = ecdsa::VerifyingKey::from_encoded_point(&self.0)
+            .map_err(|_| Error::MalformedPublicKey)?;
+        verify_key
+            .verify(message, &sig)
+            .map_err(|_| Error::VerificationFailed)
+    }
+
+    /// Verify signature of a pre-hashed message.
+    pub fn verify_digest<D>(&self, digest: D, signature: &Signature) -> Result<(), Error>
+    where
+        D: Digest + FixedOutput<OutputSize = U32>,
+    {
+        let sig = ecdsa::Signature::from_der(signature.as_ref())
+            .map_err(|_| Error::MalformedSignature)?;
+        let verify_key = ecdsa::VerifyingKey::from_encoded_point(&self.0)
+            .map_err(|_| Error::MalformedPublicKey)?;
+        verify_key
+            .verify_digest(digest, &sig)
+            .map_err(|_| Error::VerificationFailed)
+    }
+}
+
+impl From<&'static str> for PublicKey {
+    fn from(s: &'static str) -> PublicKey {
+        PublicKey::from_bytes(&BASE64_STANDARD.decode(s).unwrap()).unwrap()
+    }
+}
+
+impl cbor::Encode for PublicKey {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::Value::ByteString(self.as_bytes().to_vec())
+    }
+}
+
+impl cbor::Decode for PublicKey {
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => {
+                Self::from_bytes(&data).map_err(|_| cbor::DecodeError::UnexpectedType)
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+/// A memory-backed signer for Secp256k1.
+pub struct MemorySigner {
+    sk: ecdsa::SigningKey,
+}
+
+impl MemorySigner {
+    pub fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
+    where
+        D: Digest + FixedOutput<OutputSize = U32>,
+    {
+        let signature: ecdsa::Signature = self.sk.sign_digest(digest);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+}
+
+impl super::Signer for MemorySigner {
+    fn random(rng: &mut impl RngCore) -> Result<Self, Error> {
+        let mut seed = [0u8; 32];
+        rng.fill_bytes(&mut seed);
+        Self::new_from_seed(&seed)
+    }
+
+    fn new_from_seed(seed: &[u8]) -> Result<Self, Error> {
+        let sk = ecdsa::SigningKey::from_slice(seed).map_err(|_| Error::InvalidArgument)?;
+        Ok(Self { sk })
+    }
+
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        Ok(Self {
+            sk: ecdsa::SigningKey::from_slice(bytes).map_err(|_| Error::MalformedPrivateKey)?,
+        })
+    }
+
+    fn to_bytes(&self) -> Vec<u8> {
+        self.sk.to_bytes().to_vec()
+    }
+
+    fn public_key(&self) -> super::PublicKey {
+        super::PublicKey::Secp256k1(PublicKey(self.sk.verifying_key().to_encoded_point(true)))
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error> {
+        let digest = Sha512_256::new()
+            .chain_update(context)
+            .chain_update(message);
+        let signature: ecdsa::Signature = self.sk.sign_digest(digest);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+
+    fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error> {
+        let signature: ecdsa::Signature = self.sk.sign(message);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/signature/secp256r1.rs.html b/rust/src/oasis_runtime_sdk/crypto/signature/secp256r1.rs.html new file mode 100644 index 0000000000..022d609fdc --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/signature/secp256r1.rs.html @@ -0,0 +1,297 @@ +secp256r1.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+
//! Secp256r1 signatures.
+use base64::prelude::*;
+use digest::{consts::U32, core_api::BlockSizeUser, Digest, FixedOutput, FixedOutputReset};
+use k256::sha2::Sha512_256;
+use p256::{
+    self,
+    ecdsa::{
+        self,
+        signature::{DigestSigner as _, DigestVerifier, Signer as _, Verifier as _},
+    },
+};
+use rand_core::RngCore;
+
+use crate::crypto::signature::{Error, Signature};
+
+/// A Secp256r1 public key (in compressed form).
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub struct PublicKey(p256::EncodedPoint);
+
+impl PublicKey {
+    /// Return a byte representation of this public key.
+    pub fn as_bytes(&self) -> &[u8] {
+        self.0.as_bytes()
+    }
+
+    /// Construct a public key from a slice of bytes.
+    pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        p256::EncodedPoint::from_bytes(bytes)
+            .map_err(|_| Error::MalformedPublicKey)
+            .map(PublicKey)
+    }
+
+    /// Verify a signature.
+    pub fn verify(
+        &self,
+        context: &[u8],
+        message: &[u8],
+        signature: &Signature,
+    ) -> Result<(), Error> {
+        let digest = Sha512_256::new()
+            .chain_update(context)
+            .chain_update(message);
+        self.verify_digest(digest, signature)
+    }
+
+    /// Verify signature without using any domain separation scheme.
+    pub fn verify_raw(&self, message: &[u8], signature: &Signature) -> Result<(), Error> {
+        let sig = ecdsa::Signature::from_der(signature.0.as_ref())
+            .map_err(|_| Error::MalformedSignature)?;
+        let verify_key = ecdsa::VerifyingKey::from_encoded_point(&self.0)
+            .map_err(|_| Error::MalformedPublicKey)?;
+        verify_key
+            .verify(message, &sig)
+            .map_err(|_| Error::VerificationFailed)
+    }
+
+    /// Verify signature of a pre-hashed message.
+    pub fn verify_digest<D>(&self, digest: D, signature: &Signature) -> Result<(), Error>
+    where
+        D: Digest + FixedOutput<OutputSize = U32>,
+    {
+        let sig = ecdsa::Signature::from_der(signature.as_ref())
+            .map_err(|_| Error::MalformedSignature)?;
+        let verify_key = ecdsa::VerifyingKey::from_encoded_point(&self.0)
+            .map_err(|_| Error::MalformedPublicKey)?;
+        verify_key
+            .verify_digest(digest, &sig)
+            .map_err(|_| Error::VerificationFailed)
+    }
+}
+
+impl From<&'static str> for PublicKey {
+    fn from(s: &'static str) -> PublicKey {
+        PublicKey::from_bytes(&BASE64_STANDARD.decode(s).unwrap()).unwrap()
+    }
+}
+
+impl cbor::Encode for PublicKey {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::Value::ByteString(self.as_bytes().to_vec())
+    }
+}
+
+impl cbor::Decode for PublicKey {
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => {
+                Self::from_bytes(&data).map_err(|_| cbor::DecodeError::UnexpectedType)
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+/// A memory-backed signer for Secp256r1.
+pub struct MemorySigner {
+    sk: ecdsa::SigningKey,
+}
+
+impl MemorySigner {
+    pub fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
+    where
+        D: Digest + FixedOutput<OutputSize = U32> + BlockSizeUser + FixedOutputReset,
+    {
+        let signature: ecdsa::Signature = self.sk.sign_digest(digest);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+}
+
+impl super::Signer for MemorySigner {
+    fn random(rng: &mut impl RngCore) -> Result<Self, Error> {
+        let mut seed = [0u8; 32];
+        rng.fill_bytes(&mut seed);
+        Self::new_from_seed(&seed)
+    }
+
+    fn new_from_seed(seed: &[u8]) -> Result<Self, Error> {
+        let sk = ecdsa::SigningKey::from_slice(seed).map_err(|_| Error::InvalidArgument)?;
+        Ok(Self { sk })
+    }
+
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        Ok(Self {
+            sk: ecdsa::SigningKey::from_slice(bytes).map_err(|_| Error::MalformedPrivateKey)?,
+        })
+    }
+
+    fn to_bytes(&self) -> Vec<u8> {
+        self.sk.to_bytes().to_vec()
+    }
+
+    fn public_key(&self) -> super::PublicKey {
+        super::PublicKey::Secp256r1(PublicKey(self.sk.verifying_key().to_encoded_point(true)))
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error> {
+        let digest = sha2::Sha256::new()
+            .chain_update(context)
+            .chain_update(message);
+        let signature: ecdsa::Signature = self.sk.sign_digest(digest);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+
+    fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error> {
+        let signature: ecdsa::Signature = self.sk.sign(message);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/signature/secp384r1.rs.html b/rust/src/oasis_runtime_sdk/crypto/signature/secp384r1.rs.html new file mode 100644 index 0000000000..62a2947f52 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/signature/secp384r1.rs.html @@ -0,0 +1,295 @@ +secp384r1.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+
//! Secp384r1 signatures.
+use base64::prelude::*;
+use digest::{consts::U48, core_api::BlockSizeUser, Digest, FixedOutput, FixedOutputReset};
+use p384::{
+    self,
+    ecdsa::{
+        self,
+        signature::{DigestSigner as _, DigestVerifier, Signer as _, Verifier as _},
+    },
+};
+use rand_core::RngCore;
+
+use crate::crypto::signature::{Error, Signature};
+
+/// A Secp384r1 public key (in compressed form).
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub struct PublicKey(p384::EncodedPoint);
+
+impl PublicKey {
+    /// Return a byte representation of this public key.
+    pub fn as_bytes(&self) -> &[u8] {
+        self.0.as_bytes()
+    }
+
+    /// Construct a public key from a slice of bytes.
+    pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        p384::EncodedPoint::from_bytes(bytes)
+            .map_err(|_| Error::MalformedPublicKey)
+            .map(PublicKey)
+    }
+
+    /// Verify a signature.
+    pub fn verify(
+        &self,
+        context: &[u8],
+        message: &[u8],
+        signature: &Signature,
+    ) -> Result<(), Error> {
+        let digest = sha2::Sha384::new()
+            .chain_update(context)
+            .chain_update(message);
+        self.verify_digest(digest, signature)
+    }
+
+    /// Verify signature without using any domain separation scheme.
+    pub fn verify_raw(&self, message: &[u8], signature: &Signature) -> Result<(), Error> {
+        let sig = ecdsa::Signature::from_der(signature.0.as_ref())
+            .map_err(|_| Error::MalformedSignature)?;
+        let verify_key = ecdsa::VerifyingKey::from_encoded_point(&self.0)
+            .map_err(|_| Error::MalformedPublicKey)?;
+        verify_key
+            .verify(message, &sig)
+            .map_err(|_| Error::VerificationFailed)
+    }
+
+    /// Verify signature of a pre-hashed message.
+    pub fn verify_digest<D>(&self, digest: D, signature: &Signature) -> Result<(), Error>
+    where
+        D: Digest + FixedOutput<OutputSize = U48>,
+    {
+        let sig = ecdsa::Signature::from_der(signature.as_ref())
+            .map_err(|_| Error::MalformedSignature)?;
+        let verify_key = ecdsa::VerifyingKey::from_encoded_point(&self.0)
+            .map_err(|_| Error::MalformedPublicKey)?;
+        verify_key
+            .verify_digest(digest, &sig)
+            .map_err(|_| Error::VerificationFailed)
+    }
+}
+
+impl From<&'static str> for PublicKey {
+    fn from(s: &'static str) -> PublicKey {
+        PublicKey::from_bytes(&BASE64_STANDARD.decode(s).unwrap()).unwrap()
+    }
+}
+
+impl cbor::Encode for PublicKey {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::Value::ByteString(self.as_bytes().to_vec())
+    }
+}
+
+impl cbor::Decode for PublicKey {
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => {
+                Self::from_bytes(&data).map_err(|_| cbor::DecodeError::UnexpectedType)
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+/// A memory-backed signer for Secp384r1.
+pub struct MemorySigner {
+    sk: ecdsa::SigningKey,
+}
+
+impl MemorySigner {
+    pub fn sign_digest<D>(&self, digest: D) -> Result<Signature, Error>
+    where
+        D: Digest + FixedOutput<OutputSize = U48> + BlockSizeUser + FixedOutputReset,
+    {
+        let signature: ecdsa::Signature = self.sk.sign_digest(digest);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+}
+
+impl super::Signer for MemorySigner {
+    fn random(rng: &mut impl RngCore) -> Result<Self, Error> {
+        let mut seed = [0u8; 48];
+        rng.fill_bytes(&mut seed);
+        Self::new_from_seed(&seed)
+    }
+
+    fn new_from_seed(seed: &[u8]) -> Result<Self, Error> {
+        let sk = ecdsa::SigningKey::from_slice(seed).map_err(|_| Error::InvalidArgument)?;
+        Ok(Self { sk })
+    }
+
+    fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        Ok(Self {
+            sk: ecdsa::SigningKey::from_slice(bytes).map_err(|_| Error::MalformedPrivateKey)?,
+        })
+    }
+
+    fn to_bytes(&self) -> Vec<u8> {
+        self.sk.to_bytes().to_vec()
+    }
+
+    fn public_key(&self) -> super::PublicKey {
+        super::PublicKey::Secp384r1(PublicKey(self.sk.verifying_key().to_encoded_point(true)))
+    }
+
+    fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error> {
+        let digest = sha2::Sha384::new()
+            .chain_update(context)
+            .chain_update(message);
+        let signature: ecdsa::Signature = self.sk.sign_digest(digest);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+
+    fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error> {
+        let signature: ecdsa::Signature = self.sk.sign(message);
+        Ok(signature.to_der().as_bytes().to_vec().into())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/crypto/signature/sr25519.rs.html b/rust/src/oasis_runtime_sdk/crypto/signature/sr25519.rs.html new file mode 100644 index 0000000000..dacf7e6e07 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/crypto/signature/sr25519.rs.html @@ -0,0 +1,145 @@ +sr25519.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
//! Sr25519 signatures.
+use base64::prelude::*;
+use schnorrkel;
+use sha2::{Digest, Sha512_256};
+
+use crate::crypto::signature::{Error, Signature};
+
+/// A Sr25519 public key.
+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, cbor::Encode, cbor::Decode)]
+#[cbor(transparent, no_default)]
+pub struct PublicKey(Vec<u8>);
+
+impl PublicKey {
+    /// Return a byte representation of this public key.
+    pub fn as_bytes(&self) -> &[u8] {
+        // schnorrkel::keys::PublicKey only has to_bytes, which
+        // returns a new array.
+        //
+        // Since we need to return a reference the easiest way to
+        // placate the borrow-checker involves just keeping the
+        // byte-serialized form of the public key instead of the
+        // decompressed one, and doing point-decompression each
+        // time we want to actually do something useful.
+        &self.0
+    }
+
+    /// Construct a public key from a slice of bytes.
+    pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
+        // Ensure the bytes represents a valid public key.
+        PublicKey::decompress_public_key(bytes)?;
+        Ok(PublicKey(bytes.to_vec()))
+    }
+
+    /// Verify a signature.
+    pub fn verify(
+        &self,
+        context: &[u8],
+        message: &[u8],
+        signature: &Signature,
+    ) -> Result<(), Error> {
+        let public_key = PublicKey::decompress_public_key(&self.0)?;
+
+        let signature = schnorrkel::Signature::from_bytes(signature.as_ref())
+            .map_err(|_| Error::MalformedSignature)?;
+
+        // Convert the context to a Sr25519 SigningContext.
+        let context = schnorrkel::context::SigningContext::new(context);
+
+        // Generate a SigningTranscript from the context, and a pre-hash
+        // of the message.
+        //
+        // Note: This requires using Sha512_256 instead of our hash,
+        // due to the need for FixedOutput.
+        let mut digest = Sha512_256::new();
+        digest.update(message);
+        let transcript = context.hash256(digest);
+
+        public_key
+            .verify(transcript, &signature)
+            .map_err(|_| Error::VerificationFailed)
+    }
+
+    fn decompress_public_key(bytes: &[u8]) -> Result<schnorrkel::PublicKey, Error> {
+        schnorrkel::PublicKey::from_bytes(bytes).map_err(|_| Error::MalformedPublicKey)
+    }
+}
+
+impl From<&'static str> for PublicKey {
+    fn from(s: &'static str) -> PublicKey {
+        PublicKey::from_bytes(&BASE64_STANDARD.decode(s).unwrap()).unwrap()
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/dispatcher.rs.html b/rust/src/oasis_runtime_sdk/dispatcher.rs.html new file mode 100644 index 0000000000..912150cdf2 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/dispatcher.rs.html @@ -0,0 +1,2401 @@ +dispatcher.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+
//! Transaction dispatcher.
+use std::{
+    collections::{BTreeMap, BTreeSet},
+    convert::TryInto,
+    marker::PhantomData,
+    sync::{atomic::AtomicBool, Arc},
+};
+
+use anyhow::anyhow;
+use slog::error;
+use thiserror::Error;
+
+use oasis_core_runtime::{
+    self,
+    common::crypto::hash::Hash,
+    consensus::{roothash, verifier::Verifier},
+    enclave_rpc::dispatcher::Dispatcher as RpcDispatcher,
+    future::block_on,
+    protocol::{HostInfo, Protocol},
+    transaction::{
+        self,
+        dispatcher::{ExecuteBatchResult, ExecuteTxResult},
+        tags::Tags,
+        types::TxnBatch,
+    },
+    types::{CheckTxMetadata, CheckTxResult},
+};
+
+use crate::{
+    callformat,
+    context::{Context, RuntimeBatchContext},
+    enclave_rpc,
+    error::{Error as _, RuntimeError},
+    event::IntoTags,
+    keymanager::{KeyManagerClient, KeyManagerError},
+    module::{self, BlockHandler, MethodHandler, TransactionHandler},
+    modules,
+    modules::core::API as _,
+    runtime::Runtime,
+    schedule_control::ScheduleControlHost,
+    sender::SenderMeta,
+    state::{self, CurrentState, Mode, TransactionResult, TransactionWithMeta},
+    storage::{self, Prefix},
+    types,
+    types::transaction::{AuthProof, Transaction},
+};
+
+/// Unique module name.
+const MODULE_NAME: &str = "dispatcher";
+
+/// Error emitted by the dispatch process. Note that this indicates an error in the dispatch
+/// process itself and should not be used for any transaction-related errors.
+#[derive(Error, Debug, oasis_runtime_sdk_macros::Error)]
+#[sdk_error(abort_self)]
+pub enum Error {
+    #[error("dispatch aborted")]
+    #[sdk_error(code = 1)]
+    Aborted,
+
+    #[error("malformed transaction in batch: {0}")]
+    #[sdk_error(code = 2)]
+    MalformedTransactionInBatch(#[source] anyhow::Error),
+
+    #[error("query aborted: {0}")]
+    #[sdk_error(code = 3)]
+    QueryAborted(String),
+
+    #[error("key manager failure: {0}")]
+    #[sdk_error(code = 4)]
+    KeyManagerFailure(#[from] KeyManagerError),
+
+    #[error("batch out of gas")]
+    #[sdk_error(code = 5)]
+    BatchOutOfGas,
+}
+
+/// Result of dispatching a transaction.
+#[derive(Debug)]
+pub struct DispatchResult {
+    /// Transaction call result.
+    pub result: module::CallResult,
+    /// Transaction tags.
+    pub tags: Tags,
+    /// Transaction priority.
+    pub priority: u64,
+    /// Transaction sender metadata.
+    pub sender_metadata: SenderMeta,
+    /// Call format metadata.
+    pub call_format_metadata: callformat::Metadata,
+}
+
+impl DispatchResult {
+    fn new(
+        result: module::CallResult,
+        tags: Tags,
+        call_format_metadata: callformat::Metadata,
+    ) -> Self {
+        Self {
+            result,
+            tags,
+            priority: 0,
+            sender_metadata: Default::default(),
+            call_format_metadata,
+        }
+    }
+}
+
+impl From<module::CallResult> for DispatchResult {
+    fn from(result: module::CallResult) -> Self {
+        Self::new(result, vec![], callformat::Metadata::Empty)
+    }
+}
+
+/// Additional options for dispatch operations.
+#[derive(Default)]
+pub struct DispatchOptions<'a> {
+    /// Transaction size.
+    pub tx_size: u32,
+    /// Transaction index within the batch.
+    pub tx_index: usize,
+    /// Transaction hash.
+    pub tx_hash: Hash,
+    /// Optionally only allow methods for which the provided authorizer closure returns true.
+    pub method_authorizer: Option<&'a dyn Fn(&str) -> bool>,
+    /// Optionally skip authentication.
+    pub skip_authentication: bool,
+}
+
+/// The runtime dispatcher.
+pub struct Dispatcher<R: Runtime> {
+    host_info: HostInfo,
+    host: Arc<Protocol>,
+    key_manager: Option<Arc<KeyManagerClient>>,
+    consensus_verifier: Arc<dyn Verifier>,
+    schedule_control_host: Arc<dyn ScheduleControlHost>,
+    _runtime: PhantomData<R>,
+}
+
+impl<R: Runtime> Dispatcher<R> {
+    /// Create a new instance of the dispatcher for the given runtime.
+    ///
+    /// Note that the dispatcher is fully static and the constructor is only needed so that the
+    /// instance can be used directly with the dispatcher system provided by Oasis Core.
+    pub(super) fn new(
+        host: Arc<Protocol>,
+        key_manager: Option<Arc<KeyManagerClient>>,
+        consensus_verifier: Arc<dyn Verifier>,
+    ) -> Self {
+        Self {
+            host_info: host.get_host_info(),
+            key_manager,
+            consensus_verifier,
+            schedule_control_host: host.clone(),
+            host,
+            _runtime: PhantomData,
+        }
+    }
+
+    /// Decode a runtime transaction.
+    pub fn decode_tx<C: Context>(
+        ctx: &C,
+        tx: &[u8],
+    ) -> Result<types::transaction::Transaction, modules::core::Error> {
+        // Perform any checks before decoding.
+        R::Modules::approve_raw_tx(ctx, tx)?;
+
+        // Deserialize transaction.
+        let utx: types::transaction::UnverifiedTransaction = cbor::from_slice(tx)
+            .map_err(|e| modules::core::Error::MalformedTransaction(e.into()))?;
+
+        // Perform any checks before signature verification.
+        R::Modules::approve_unverified_tx(ctx, &utx)?;
+
+        match utx.1.as_slice() {
+            [AuthProof::Module(scheme)] => {
+                R::Modules::decode_tx(ctx, scheme, &utx.0)?.ok_or_else(|| {
+                    modules::core::Error::MalformedTransaction(anyhow!(
+                        "module-controlled transaction decoding scheme {} not supported",
+                        scheme
+                    ))
+                })
+            }
+            _ => utx
+                .verify()
+                .map_err(|e| modules::core::Error::MalformedTransaction(e.into())),
+        }
+    }
+
+    /// Run the dispatch steps inside a transaction context. This includes the before call hooks,
+    /// the call itself and after call hooks. The after call hooks are called regardless if the call
+    /// succeeds or not.
+    pub fn dispatch_tx_call<C: Context>(
+        ctx: &C,
+        call: types::transaction::Call,
+        opts: &DispatchOptions<'_>,
+    ) -> (module::CallResult, callformat::Metadata) {
+        let read_only = call.read_only;
+
+        // Dispatch the call.
+        let (result, metadata) = Self::_dispatch_tx_call(ctx, call, opts);
+
+        // Unconditionally call after handle call hook.
+        let result = match R::Modules::after_handle_call(ctx, result) {
+            Ok(result) => result,
+            Err(e) => {
+                // If the call failed, return the error.
+                return (e.into_call_result(), metadata);
+            }
+        };
+
+        // Make sure that a read-only call did not result in any modifications.
+        if read_only && CurrentState::with(|state| state.has_pending_store_updates()) {
+            return (
+                modules::core::Error::ReadOnlyTransaction.into_call_result(),
+                metadata,
+            );
+        }
+
+        (result, metadata)
+    }
+
+    fn _dispatch_tx_call<C: Context>(
+        ctx: &C,
+        call: types::transaction::Call,
+        opts: &DispatchOptions<'_>,
+    ) -> (module::CallResult, callformat::Metadata) {
+        if let Err(e) = R::Modules::before_handle_call(ctx, &call) {
+            return (e.into_call_result(), callformat::Metadata::Empty);
+        }
+
+        // Decode call based on specified call format.
+        let (call, call_format_metadata) = match callformat::decode_call(ctx, call, opts.tx_index) {
+            Ok(Some(result)) => result,
+            Ok(None) => {
+                return (
+                    module::CallResult::Ok(cbor::Value::Simple(cbor::SimpleValue::NullValue)),
+                    callformat::Metadata::Empty,
+                )
+            }
+            Err(err) => return (err.into_call_result(), callformat::Metadata::Empty),
+        };
+
+        // Apply optional method authorization.
+        if let Some(method_authorizer) = opts.method_authorizer {
+            if !method_authorizer(&call.method) {
+                return (
+                    modules::core::Error::Forbidden.into_call_result(),
+                    call_format_metadata,
+                );
+            }
+        }
+
+        if let Err(e) = R::Modules::before_authorized_call_dispatch(ctx, &call) {
+            return (e.into_call_result(), call_format_metadata);
+        }
+
+        let result = match R::Modules::dispatch_call(ctx, &call.method, call.body) {
+            module::DispatchResult::Handled(result) => result,
+            module::DispatchResult::Unhandled(_) => {
+                modules::core::Error::InvalidMethod(call.method).into_call_result()
+            }
+        };
+
+        (result, call_format_metadata)
+    }
+
+    /// Dispatch a runtime transaction in the given context with the provided options.
+    pub fn dispatch_tx_opts<C: Context>(
+        ctx: &C,
+        tx: types::transaction::Transaction,
+        opts: &DispatchOptions<'_>,
+    ) -> Result<DispatchResult, Error> {
+        // Run pre-processing hooks.
+        if !opts.skip_authentication {
+            if let Err(err) = R::Modules::authenticate_tx(ctx, &tx) {
+                return Ok(err.into_call_result().into());
+            }
+        }
+        let tx_auth_info = tx.auth_info.clone();
+        let is_read_only = tx.call.read_only;
+        let call = tx.call.clone(); // TODO: Avoid clone.
+
+        let result = CurrentState::with_transaction_opts(
+            state::Options::new().with_tx(TransactionWithMeta {
+                data: tx,
+                size: opts.tx_size,
+                index: opts.tx_index,
+                hash: opts.tx_hash,
+            }),
+            || {
+                let (result, call_format_metadata) = Self::dispatch_tx_call(ctx, call, opts);
+                if !result.is_success() || is_read_only {
+                    // Retrieve unconditional events.
+                    let events = CurrentState::with(|state| state.take_unconditional_events());
+
+                    return TransactionResult::Rollback(DispatchResult::new(
+                        result,
+                        events.into_tags(),
+                        call_format_metadata,
+                    ));
+                }
+
+                // Load priority.
+                let priority = R::Core::take_priority();
+                // Load sender metadata.
+                let sender_metadata = R::Core::take_sender_meta();
+
+                if CurrentState::with_env(|env| env.is_check_only()) {
+                    TransactionResult::Rollback(DispatchResult {
+                        result,
+                        tags: Vec::new(),
+                        priority,
+                        sender_metadata,
+                        call_format_metadata,
+                    })
+                } else {
+                    // Merge normal and unconditional events.
+                    let tags = CurrentState::with(|state| state.take_all_events().into_tags());
+
+                    TransactionResult::Commit(DispatchResult {
+                        result,
+                        tags,
+                        priority,
+                        sender_metadata,
+                        call_format_metadata,
+                    })
+                }
+            },
+        );
+
+        // Run after dispatch hooks.
+        R::Modules::after_dispatch_tx(ctx, &tx_auth_info, &result.result);
+
+        // Propagate batch aborts.
+        if let module::CallResult::Aborted(err) = result.result {
+            return Err(err);
+        }
+
+        Ok(result)
+    }
+
+    /// Dispatch a runtime transaction in the given context.
+    pub fn dispatch_tx<C: Context>(
+        ctx: &C,
+        tx_size: u32,
+        tx: types::transaction::Transaction,
+        tx_index: usize,
+    ) -> Result<DispatchResult, Error> {
+        Self::dispatch_tx_opts(
+            ctx,
+            tx,
+            &DispatchOptions {
+                tx_size,
+                tx_index,
+                ..Default::default()
+            },
+        )
+    }
+
+    /// Check whether the given transaction is valid.
+    pub fn check_tx<C: Context>(
+        ctx: &C,
+        tx_size: u32,
+        tx: Transaction,
+    ) -> Result<CheckTxResult, Error> {
+        // In case of any panics, treat it as a failed check instead of crashing the runtime.
+        let catch_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
+            Self::dispatch_tx(ctx, tx_size, tx, usize::MAX)
+        }));
+        let dispatch = match catch_result {
+            Ok(dispatch) => dispatch?,
+            Err(panic_err) => {
+                // Convert panics into transaction check failures as it is clearly the fault of a
+                // specific transaction.
+                return Ok(CheckTxResult {
+                    error: RuntimeError {
+                        module: MODULE_NAME.to_string(),
+                        code: 1,
+                        message: format!("transaction check aborted: {panic_err:?}"),
+                    },
+                    meta: None,
+                });
+            }
+        };
+
+        match dispatch.result {
+            module::CallResult::Ok(_) => Ok(CheckTxResult {
+                error: Default::default(),
+                meta: Some(CheckTxMetadata {
+                    priority: dispatch.priority,
+                    sender: dispatch.sender_metadata.id(),
+                    sender_seq: dispatch.sender_metadata.tx_nonce,
+                    sender_state_seq: dispatch.sender_metadata.state_nonce,
+                }),
+            }),
+
+            module::CallResult::Failed {
+                module,
+                code,
+                message,
+            } => Ok(CheckTxResult {
+                error: RuntimeError {
+                    module,
+                    code,
+                    message,
+                },
+                meta: None,
+            }),
+
+            module::CallResult::Aborted(err) => Err(err),
+        }
+    }
+
+    /// Execute the given transaction, returning unserialized results.
+    pub fn execute_tx_opts<C: Context>(
+        ctx: &C,
+        tx: Transaction,
+        opts: &DispatchOptions<'_>,
+    ) -> Result<(types::transaction::CallResult, Tags), Error> {
+        let dispatch_result = Self::dispatch_tx_opts(ctx, tx, opts)?;
+        let output: types::transaction::CallResult = callformat::encode_result(
+            ctx,
+            dispatch_result.result,
+            dispatch_result.call_format_metadata,
+        );
+
+        Ok((output, dispatch_result.tags))
+    }
+
+    /// Execute the given transaction.
+    pub fn execute_tx<C: Context>(
+        ctx: &C,
+        tx_size: u32,
+        tx_hash: Hash,
+        tx: Transaction,
+        tx_index: usize,
+    ) -> Result<ExecuteTxResult, Error> {
+        let (output, tags) = Self::execute_tx_opts(
+            ctx,
+            tx,
+            &DispatchOptions {
+                tx_size,
+                tx_index,
+                tx_hash,
+                ..Default::default()
+            },
+        )?;
+
+        Ok(ExecuteTxResult {
+            output: cbor::to_vec(output),
+            tags,
+        })
+    }
+
+    /// Prefetch prefixes for the given transaction.
+    pub fn prefetch_tx(
+        prefixes: &mut BTreeSet<Prefix>,
+        tx: types::transaction::Transaction,
+    ) -> Result<(), RuntimeError> {
+        match R::Modules::prefetch(prefixes, &tx.call.method, tx.call.body, &tx.auth_info) {
+            module::DispatchResult::Handled(r) => r,
+            module::DispatchResult::Unhandled(_) => Ok(()), // Unimplemented prefetch is allowed.
+        }
+    }
+
+    fn handle_last_round_messages<C: Context>(ctx: &C) -> Result<(), modules::core::Error> {
+        let message_events = ctx.runtime_round_results().messages.clone();
+
+        let mut handlers = CurrentState::with_store(|store| {
+            let store = storage::TypedStore::new(storage::PrefixStore::new(
+                store,
+                &modules::core::MODULE_NAME,
+            ));
+            let handlers: BTreeMap<u32, types::message::MessageEventHookInvocation> = store
+                .get(modules::core::state::MESSAGE_HANDLERS)
+                .unwrap_or_default();
+
+            handlers
+        });
+
+        for event in message_events {
+            let handler = handlers
+                .remove(&event.index)
+                .ok_or(modules::core::Error::MessageHandlerMissing(event.index))?;
+            let hook_name = handler.hook_name.clone();
+
+            R::Modules::dispatch_message_result(
+                ctx,
+                &hook_name,
+                types::message::MessageResult {
+                    event,
+                    context: handler.payload,
+                },
+            )
+            .ok_or(modules::core::Error::InvalidMethod(hook_name))?;
+        }
+
+        if !handlers.is_empty() {
+            error!(ctx.get_logger("dispatcher"), "message handler not invoked"; "unhandled" => ?handlers);
+            return Err(modules::core::Error::MessageHandlerNotInvoked);
+        }
+
+        Ok(())
+    }
+
+    fn save_emitted_message_handlers(handlers: Vec<types::message::MessageEventHookInvocation>) {
+        let message_handlers: BTreeMap<u32, types::message::MessageEventHookInvocation> = handlers
+            .into_iter()
+            .enumerate()
+            .map(|(idx, h)| (idx as u32, h))
+            .collect();
+
+        CurrentState::with_store(|store| {
+            let mut store = storage::TypedStore::new(storage::PrefixStore::new(
+                store,
+                &modules::core::MODULE_NAME,
+            ));
+            store.insert(modules::core::state::MESSAGE_HANDLERS, message_handlers);
+        });
+    }
+
+    /// Process the given runtime query.
+    pub fn dispatch_query<C: Context>(
+        ctx: &C,
+        method: &str,
+        args: Vec<u8>,
+    ) -> Result<Vec<u8>, RuntimeError> {
+        let args = cbor::from_slice(&args)
+            .map_err(|err| modules::core::Error::InvalidArgument(err.into()))?;
+
+        CurrentState::with_transaction(|| {
+            // Catch any panics that occur during query dispatch.
+            let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
+                // Perform state migrations if required.
+                R::migrate(ctx);
+
+                if !R::is_allowed_query(method) || !ctx.is_allowed_query::<R>(method) {
+                    return Err(modules::core::Error::Forbidden.into());
+                }
+
+                R::Modules::dispatch_query(ctx, method, args)
+                    .ok_or_else(|| modules::core::Error::InvalidMethod(method.into()))?
+            }));
+
+            // Always rollback any changes to storage. Note that this is usually a no-op because
+            // Oasis Core would rollback any storage changes related to queries, but this makes it
+            // explicit to ensure this remains the case regardless of upstream changes.
+            TransactionResult::Rollback(result)
+        })
+        .map_err(|err| -> RuntimeError { Error::QueryAborted(format!("{err:?}")).into() })?
+        .map(cbor::to_vec)
+    }
+
+    fn execute_batch_common<F>(
+        &self,
+        mut rt_ctx: transaction::Context<'_>,
+        f: F,
+    ) -> Result<ExecuteBatchResult, RuntimeError>
+    where
+        F: FnOnce(&RuntimeBatchContext<'_, R>) -> Result<Vec<ExecuteTxResult>, RuntimeError>,
+    {
+        // Prepare dispatch context.
+        let key_manager = self
+            .key_manager
+            .as_ref()
+            // NOTE: We are explicitly allowing private key operations during execution.
+            .map(|mgr| mgr.with_private_context());
+        let history = self.consensus_verifier.clone();
+
+        let root = storage::MKVSStore::new(&mut rt_ctx.runtime_state);
+        let ctx = RuntimeBatchContext::<'_, R>::new(
+            &self.host_info,
+            key_manager,
+            rt_ctx.header,
+            rt_ctx.round_results,
+            &rt_ctx.consensus_state,
+            &history,
+            rt_ctx.epoch,
+            rt_ctx.max_messages,
+        );
+
+        CurrentState::enter_opts(state::Options::new().with_mode(Mode::Execute), root, || {
+            // Perform state migrations if required.
+            R::migrate(&ctx);
+
+            // Handle last round message results.
+            Self::handle_last_round_messages(&ctx)?;
+
+            // Run begin block hooks.
+            R::Modules::begin_block(&ctx);
+
+            let results = f(&ctx)?;
+
+            // Run end block hooks.
+            R::Modules::end_block(&ctx);
+
+            // Process any emitted messages and block-level events.
+            let (messages, handlers, block_tags) = CurrentState::with(|state| {
+                let (messages, handlers) = state.take_messages().into_iter().unzip();
+                let block_tags = state.take_all_events().into_tags();
+
+                (messages, handlers, block_tags)
+            });
+            Self::save_emitted_message_handlers(handlers);
+
+            Ok(ExecuteBatchResult {
+                results,
+                messages,
+                block_tags,
+                tx_reject_hashes: vec![],
+                in_msgs_count: 0, // TODO: Support processing incoming messages.
+            })
+        })
+    }
+
+    /// Register EnclaveRPC methods.
+    pub fn register_enclaverpc(&self, rpc: &mut RpcDispatcher)
+    where
+        R: Runtime + Send + Sync + 'static,
+    {
+        enclave_rpc::Wrapper::<R>::wrap(
+            rpc,
+            self.host.clone(),
+            self.host_info.clone(),
+            self.key_manager.clone(),
+            self.consensus_verifier.clone(),
+        );
+    }
+}
+
+impl<R: Runtime + Send + Sync> transaction::dispatcher::Dispatcher for Dispatcher<R> {
+    fn execute_batch(
+        &self,
+        rt_ctx: transaction::Context<'_>,
+        batch: &TxnBatch,
+        _in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        self.execute_batch_common(
+            rt_ctx,
+            |ctx| -> Result<Vec<ExecuteTxResult>, RuntimeError> {
+                // If prefetch limit is set enable prefetch.
+                let prefetch_enabled = R::PREFETCH_LIMIT > 0;
+
+                let mut txs = Vec::with_capacity(batch.len());
+                let mut prefixes: BTreeSet<Prefix> = BTreeSet::new();
+                for tx in batch.iter() {
+                    let tx_size = tx.len().try_into().map_err(|_| {
+                        Error::MalformedTransactionInBatch(anyhow!("transaction too large"))
+                    })?;
+                    let tx_hash = Hash::digest_bytes(tx);
+                    // It is an error to include a malformed transaction in a batch. So instead of only
+                    // reporting a failed execution result, we fail the whole batch. This will make the compute
+                    // node vote for failure and the round will fail.
+                    //
+                    // Correct proposers should only include transactions which have passed check_tx.
+                    let tx = Self::decode_tx(ctx, tx)
+                        .map_err(|err| Error::MalformedTransactionInBatch(err.into()))?;
+                    txs.push((tx_size, tx_hash, tx.clone()));
+
+                    if prefetch_enabled {
+                        Self::prefetch_tx(&mut prefixes, tx)?;
+                    }
+                }
+                if prefetch_enabled {
+                    CurrentState::with_store(|store| {
+                        store.prefetch_prefixes(prefixes.into_iter().collect(), R::PREFETCH_LIMIT);
+                    })
+                }
+
+                // Execute the batch.
+                let mut results = Vec::with_capacity(batch.len());
+                for (index, (tx_size, tx_hash, tx)) in txs.into_iter().enumerate() {
+                    results.push(Self::execute_tx(ctx, tx_size, tx_hash, tx, index)?);
+                }
+
+                Ok(results)
+            },
+        )
+    }
+
+    fn schedule_and_execute_batch(
+        &self,
+        rt_ctx: transaction::Context<'_>,
+        batch: &mut TxnBatch,
+        _in_msgs: &[roothash::IncomingMessage],
+    ) -> Result<ExecuteBatchResult, RuntimeError> {
+        let cfg = R::SCHEDULE_CONTROL;
+        let mut tx_reject_hashes = Vec::new();
+
+        let mut result = self.execute_batch_common(
+            rt_ctx,
+            |ctx| -> Result<Vec<ExecuteTxResult>, RuntimeError> {
+                // Schedule and execute the batch.
+                //
+                // The idea is to keep scheduling transactions as long as we have some space
+                // available in the block as determined by gas use.
+                let mut new_batch = Vec::new();
+                let mut results = Vec::with_capacity(batch.len());
+                let mut requested_batch_len = cfg.initial_batch_size;
+                'batch: loop {
+                    // Remember length of last batch.
+                    let last_batch_len = batch.len();
+                    let last_batch_tx_hash = batch.last().map(|raw_tx| Hash::digest_bytes(raw_tx));
+
+                    for raw_tx in batch.drain(..) {
+                        // If we don't have enough gas for processing even the cheapest transaction
+                        // we are done. Same if we reached the runtime-imposed maximum tx count.
+                        let remaining_gas = R::Core::remaining_batch_gas();
+                        if remaining_gas < cfg.min_remaining_gas
+                            || new_batch.len() >= cfg.max_tx_count
+                        {
+                            break 'batch;
+                        }
+
+                        // Decode transaction.
+                        let tx_hash = Hash::digest_bytes(&raw_tx);
+                        let tx = match Self::decode_tx(ctx, &raw_tx) {
+                            Ok(tx) => tx,
+                            Err(_) => {
+                                // Transaction is malformed, make sure it gets removed from the
+                                // queue and don't include it in a block.
+                                tx_reject_hashes.push(tx_hash);
+                                continue;
+                            }
+                        };
+                        let tx_size = raw_tx.len().try_into().unwrap();
+
+                        // If we don't have enough gas remaining to process this transaction, just
+                        // skip it.
+                        if tx.auth_info.fee.gas > remaining_gas {
+                            continue;
+                        }
+                        // Same if we don't have enough consensus message slots.
+                        let remaining_messages = CurrentState::with(|state| {
+                            ctx.max_messages()
+                                .saturating_sub(state.emitted_messages_count() as u32)
+                        });
+                        if tx.auth_info.fee.consensus_messages > remaining_messages {
+                            continue;
+                        }
+
+                        // Determine the current transaction index.
+                        let tx_index = new_batch.len();
+
+                        // First run the transaction in check tx mode in a separate subcontext. If
+                        // that fails, skip and (sometimes) reject transaction.
+                        let skip = CurrentState::with_transaction_opts(
+                            state::Options::new().with_mode(Mode::PreSchedule),
+                            || -> Result<_, Error> {
+                                // First authenticate the transaction to get any nonce related errors.
+                                match R::Modules::authenticate_tx(ctx, &tx) {
+                                    Err(modules::core::Error::FutureNonce) => {
+                                        // Only skip transaction as it may become valid in the future.
+                                        return Ok(true);
+                                    }
+                                    Err(_) => {
+                                        // Skip and reject the transaction.
+                                    }
+                                    Ok(_) => {
+                                        // Run additional checks on the transaction.
+                                        let check_result = Self::dispatch_tx_opts(
+                                            ctx,
+                                            tx.clone(),
+                                            &DispatchOptions {
+                                                tx_size,
+                                                tx_index,
+                                                tx_hash,
+                                                skip_authentication: true, // Already done.
+                                                ..Default::default()
+                                            },
+                                        )?;
+                                        if check_result.result.is_success() {
+                                            // Checks successful, execute transaction as usual.
+                                            return Ok(false);
+                                        }
+                                    }
+                                }
+
+                                // Skip and reject the transaction.
+                                tx_reject_hashes.push(tx_hash);
+                                Ok(true)
+                            },
+                        )?;
+                        if skip {
+                            continue;
+                        }
+
+                        new_batch.push(raw_tx);
+                        results.push(Self::execute_tx(ctx, tx_size, tx_hash, tx, tx_index)?);
+                    }
+
+                    // If there's more room in the block and we got the maximum number of
+                    // transactions, request more transactions.
+                    if last_batch_tx_hash.is_some()
+                        && last_batch_len >= requested_batch_len as usize
+                    {
+                        if let Some(fetched_batch) = self
+                            .schedule_control_host
+                            .fetch_tx_batch(last_batch_tx_hash, cfg.batch_size)?
+                        {
+                            *batch = fetched_batch;
+                            requested_batch_len = cfg.batch_size;
+                            continue;
+                        }
+                        // No more transactions, let's just finish.
+                    }
+                    break;
+                }
+
+                // Replace input batch with newly generated batch.
+                *batch = new_batch.into();
+
+                Ok(results)
+            },
+        )?;
+
+        // Include rejected transaction hashes in the final result.
+        result.tx_reject_hashes = tx_reject_hashes;
+
+        Ok(result)
+    }
+
+    fn check_batch(
+        &self,
+        mut rt_ctx: transaction::Context<'_>,
+        batch: &TxnBatch,
+    ) -> Result<Vec<CheckTxResult>, RuntimeError> {
+        // If prefetch limit is set enable prefetch.
+        let prefetch_enabled = R::PREFETCH_LIMIT > 0;
+
+        // Prepare dispatch context.
+        let key_manager = self.key_manager.as_ref().map(|mgr| mgr.with_context());
+        let history = self.consensus_verifier.clone();
+
+        let root = storage::MKVSStore::new(&mut rt_ctx.runtime_state);
+        let ctx = RuntimeBatchContext::<'_, R>::new(
+            &self.host_info,
+            key_manager,
+            rt_ctx.header,
+            rt_ctx.round_results,
+            &rt_ctx.consensus_state,
+            &history,
+            rt_ctx.epoch,
+            rt_ctx.max_messages,
+        );
+
+        CurrentState::enter_opts(
+            state::Options::new().with_mode(state::Mode::Check),
+            root,
+            || {
+                // Perform state migrations if required.
+                R::migrate(&ctx);
+
+                // Prefetch.
+                let mut txs: Vec<Result<_, RuntimeError>> = Vec::with_capacity(batch.len());
+                let mut prefixes: BTreeSet<Prefix> = BTreeSet::new();
+                for tx in batch.iter() {
+                    let tx_size = tx.len().try_into().map_err(|_| {
+                        Error::MalformedTransactionInBatch(anyhow!("transaction too large"))
+                    })?;
+                    let res = match Self::decode_tx(&ctx, tx) {
+                        Ok(tx) => {
+                            if prefetch_enabled {
+                                Self::prefetch_tx(&mut prefixes, tx.clone()).map(|_| (tx_size, tx))
+                            } else {
+                                Ok((tx_size, tx))
+                            }
+                        }
+                        Err(err) => Err(err.into()),
+                    };
+                    txs.push(res);
+                }
+                if prefetch_enabled {
+                    CurrentState::with_store(|store| {
+                        store.prefetch_prefixes(prefixes.into_iter().collect(), R::PREFETCH_LIMIT);
+                    });
+                }
+
+                // Check the batch.
+                let mut results = Vec::with_capacity(batch.len());
+                for tx in txs.into_iter() {
+                    match tx {
+                        Ok((tx_size, tx)) => results.push(Self::check_tx(&ctx, tx_size, tx)?),
+                        Err(err) => results.push(CheckTxResult {
+                            error: err,
+                            meta: None,
+                        }),
+                    }
+                }
+
+                Ok(results)
+            },
+        )
+    }
+
+    fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>) {
+        // TODO: Implement support for graceful batch aborts (oasis-sdk#129).
+    }
+
+    fn query(
+        &self,
+        mut rt_ctx: transaction::Context<'_>,
+        method: &str,
+        args: Vec<u8>,
+    ) -> Result<Vec<u8>, RuntimeError> {
+        // Determine whether the method is allowed to access confidential state and provide an
+        // appropriately scoped instance of the key manager client.
+        let is_confidential_allowed = R::Modules::is_allowed_private_km_query(method)
+            && R::is_allowed_private_km_query(method);
+        if is_confidential_allowed {
+            // Perform consensus layer state integrity verification for any queries that allow
+            // access to confidential state.
+            block_on(self.consensus_verifier.verify_for_query(
+                rt_ctx.consensus_block.clone(),
+                rt_ctx.header.clone(),
+                rt_ctx.epoch,
+            ))?;
+            // Ensure the runtime is still ready to process requests.
+            rt_ctx.protocol.ensure_initialized()?;
+        }
+        let key_manager = self.key_manager.as_ref().map(|mgr| {
+            if is_confidential_allowed {
+                mgr.with_private_context()
+            } else {
+                mgr.with_context()
+            }
+        });
+
+        // Prepare dispatch context.
+        let history = self.consensus_verifier.clone();
+
+        let root = storage::MKVSStore::new(&mut rt_ctx.runtime_state);
+        let ctx = RuntimeBatchContext::<'_, R>::new(
+            &self.host_info,
+            key_manager,
+            rt_ctx.header,
+            rt_ctx.round_results,
+            &rt_ctx.consensus_state,
+            &history,
+            rt_ctx.epoch,
+            rt_ctx.max_messages,
+        );
+
+        CurrentState::enter_opts(
+            state::Options::new()
+                .with_mode(state::Mode::Check)
+                .with_rng_local_entropy(), // Mix in local (private) entropy for queries.
+            root,
+            || Self::dispatch_query(&ctx, method, args),
+        )
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::{
+        handler,
+        module::Module,
+        modules::{accounts, core},
+        sdk_derive,
+        state::{CurrentState, Options},
+        storage::Store,
+        testing::{configmap, keys, mock::Mock},
+        types::{token, transaction},
+        Version,
+    };
+    use cbor::Encode as _;
+
+    struct CoreConfig;
+    impl core::Config for CoreConfig {}
+    type Core = core::Module<CoreConfig>;
+    type Accounts = accounts::Module;
+
+    #[derive(Error, Debug, oasis_runtime_sdk_macros::Error)]
+    enum AlphabetError {
+        #[error("{0}")]
+        #[sdk_error(transparent, abort)]
+        Core(#[source] core::Error),
+    }
+
+    /// A module with multiple no-op methods; intended for testing routing.
+    struct AlphabetModule;
+
+    #[sdk_derive(Module)]
+    impl AlphabetModule {
+        const NAME: &'static str = "alphabet";
+        const VERSION: u32 = 42;
+        type Error = AlphabetError;
+        type Event = ();
+        type Parameters = ();
+        type Genesis = ();
+
+        #[handler(call = "alphabet.ReadOnly")]
+        fn read_only<C: Context>(_ctx: &C, _args: ()) -> Result<u64, AlphabetError> {
+            CurrentState::with_store(|store| {
+                let _ = store.get(b"key"); // Read something and ignore result.
+            });
+            Ok(42)
+        }
+
+        #[handler(call = "alphabet.NotReadOnly")]
+        fn not_read_only<C: Context>(_ctx: &C, _args: ()) -> Result<u64, AlphabetError> {
+            CurrentState::with_store(|store| {
+                store.insert(b"key", b"value");
+            });
+            Ok(10)
+        }
+
+        #[handler(call = "alphabet.Aborting")]
+        fn aborting<C: Context>(_ctx: &C, _args: ()) -> Result<(), AlphabetError> {
+            // Use a deeply nested abort to make sure this is handled correctly.
+            Err(AlphabetError::Core(core::Error::Abort(Error::Aborted)))
+        }
+
+        #[handler(query = "alphabet.Alpha")]
+        fn alpha<C: Context>(_ctx: &C, _args: ()) -> Result<(), AlphabetError> {
+            Ok(())
+        }
+
+        #[handler(query = "alphabet.Omega", expensive)]
+        fn expensive<C: Context>(_ctx: &C, _args: ()) -> Result<(), AlphabetError> {
+            // Nothing actually expensive here. We're just pretending for testing purposes.
+            Ok(())
+        }
+    }
+
+    impl module::BlockHandler for AlphabetModule {}
+    impl module::TransactionHandler for AlphabetModule {}
+    impl module::InvariantHandler for AlphabetModule {}
+
+    struct AlphabetRuntime;
+
+    impl Runtime for AlphabetRuntime {
+        const VERSION: Version = Version::new(0, 0, 0);
+        type Core = Core;
+        type Accounts = Accounts;
+        type Modules = (Core, AlphabetModule);
+
+        fn genesis_state() -> <Self::Modules as module::MigrationHandler>::Genesis {
+            (
+                core::Genesis {
+                    parameters: core::Parameters {
+                        max_batch_gas: u64::MAX,
+                        max_tx_size: 32 * 1024,
+                        max_tx_signers: 1,
+                        max_multisig_signers: 8,
+                        gas_costs: Default::default(),
+                        min_gas_price: BTreeMap::from([(token::Denomination::NATIVE, 0)]),
+                        dynamic_min_gas_price: Default::default(),
+                    },
+                },
+                (),
+            )
+        }
+    }
+
+    #[test]
+    fn test_allowed_queries_defaults() {
+        let mut mock = Mock::with_local_config(BTreeMap::new());
+        let mut ctx = mock.create_ctx_for_runtime::<AlphabetRuntime>(false);
+
+        Dispatcher::<AlphabetRuntime>::dispatch_query(
+            &mut ctx,
+            "alphabet.Alpha",
+            cbor::to_vec(().into_cbor_value()),
+        )
+        .expect("alphabet.Alpha is an inexpensive query, allowed by default");
+
+        Dispatcher::<AlphabetRuntime>::dispatch_query(
+            &mut ctx,
+            "alphabet.Omega",
+            cbor::to_vec(().into_cbor_value()),
+        )
+        .expect_err("alphabet.Omega is an expensive query, disallowed by default");
+    }
+
+    #[test]
+    fn test_allowed_queries_custom() {
+        let local_config = configmap! {
+            // Allow expensive gas estimation and expensive queries so they can be tested.
+            "estimate_gas_by_simulating_contracts" => true,
+            "allowed_queries" => vec![
+                configmap! {"alphabet.Alpha" => false},
+                configmap! {"all_expensive" => true},
+                configmap! {"all" => true}  // should have no effect on Alpha
+            ],
+        };
+        let mut mock = Mock::with_local_config(local_config);
+        let mut ctx = mock.create_ctx_for_runtime::<AlphabetRuntime>(false);
+
+        CurrentState::with_transaction_opts(Options::new().with_mode(state::Mode::Check), || {
+            Dispatcher::<AlphabetRuntime>::dispatch_query(
+                &mut ctx,
+                "alphabet.Alpha",
+                cbor::to_vec(().into_cbor_value()),
+            )
+            .expect_err("alphabet.Alpha is a disallowed query");
+
+            Dispatcher::<AlphabetRuntime>::dispatch_query(
+                &mut ctx,
+                "alphabet.Omega",
+                cbor::to_vec(().into_cbor_value()),
+            )
+            .expect("alphabet.Omega is an expensive query and expensive queries are allowed");
+
+            TransactionResult::Rollback(())
+        });
+    }
+
+    #[test]
+    fn test_dispatch_read_only_call() {
+        let mut mock = Mock::default();
+        let mut ctx = mock.create_ctx_for_runtime::<AlphabetRuntime>(false);
+
+        AlphabetRuntime::migrate(&mut ctx);
+
+        let mut tx = transaction::Transaction {
+            version: 1,
+            call: transaction::Call {
+                format: transaction::CallFormat::Plain,
+                method: "alphabet.ReadOnly".to_owned(),
+                read_only: true,
+                ..Default::default()
+            },
+            auth_info: transaction::AuthInfo {
+                signer_info: vec![transaction::SignerInfo::new_sigspec(
+                    keys::alice::sigspec(),
+                    0,
+                )],
+                fee: transaction::Fee {
+                    amount: token::BaseUnits::new(0, token::Denomination::NATIVE),
+                    gas: 1000,
+                    ..Default::default()
+                },
+                ..Default::default()
+            },
+        };
+
+        // Dispatch read-only transaction.
+        let dispatch_result =
+            Dispatcher::<AlphabetRuntime>::dispatch_tx(&mut ctx, 1024, tx.clone(), 0)
+                .expect("read only method dispatch should work");
+        let result = dispatch_result.result.unwrap();
+        let result: u64 = cbor::from_value(result).unwrap();
+        assert_eq!(result, 42);
+
+        // Dispatch read-only transaction of a method that writes.
+        tx.call.method = "alphabet.NotReadOnly".to_owned();
+
+        let dispatch_result = Dispatcher::<AlphabetRuntime>::dispatch_tx(&mut ctx, 1024, tx, 0)
+            .expect("read only method dispatch should work");
+        match dispatch_result.result {
+            module::CallResult::Failed {
+                module,
+                code,
+                message,
+            } => {
+                assert_eq!(&module, "core");
+                assert_eq!(code, 25);
+                assert_eq!(&message, "read-only transaction attempted modifications")
+            }
+            _ => panic!("not read only method execution did not fail"),
+        }
+    }
+
+    #[test]
+    fn test_dispatch_abort_forwarding() {
+        let mut mock = Mock::default();
+        let mut ctx = mock.create_ctx_for_runtime::<AlphabetRuntime>(false);
+
+        AlphabetRuntime::migrate(&mut ctx);
+
+        let tx = transaction::Transaction {
+            version: 1,
+            call: transaction::Call {
+                format: transaction::CallFormat::Plain,
+                method: "alphabet.Aborting".to_owned(),
+                ..Default::default()
+            },
+            auth_info: transaction::AuthInfo {
+                signer_info: vec![transaction::SignerInfo::new_sigspec(
+                    keys::alice::sigspec(),
+                    0,
+                )],
+                fee: transaction::Fee {
+                    amount: token::BaseUnits::new(0, token::Denomination::NATIVE),
+                    gas: 1000,
+                    ..Default::default()
+                },
+                ..Default::default()
+            },
+        };
+
+        // Dispatch transaction and make sure the abort gets propagated.
+        let dispatch_result =
+            Dispatcher::<AlphabetRuntime>::dispatch_tx(&mut ctx, 1024, tx.clone(), 0);
+        assert!(matches!(dispatch_result, Err(Error::Aborted)));
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/enclave_rpc.rs.html b/rust/src/oasis_runtime_sdk/enclave_rpc.rs.html new file mode 100644 index 0000000000..f840640fe0 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/enclave_rpc.rs.html @@ -0,0 +1,361 @@ +enclave_rpc.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+
//! Exposed EnclaveRPC methods.
+use std::{marker::PhantomData, sync::Arc};
+
+use anyhow::{anyhow, bail, Result};
+
+use crate::{
+    context::RuntimeBatchContext,
+    core::{
+        consensus::{
+            roothash::Header,
+            state::{
+                beacon::ImmutableState as BeaconState, registry::ImmutableState as RegistryState,
+                roothash::ImmutableState as RoothashState,
+            },
+            verifier::Verifier,
+        },
+        enclave_rpc::{
+            dispatcher::{
+                Dispatcher as RpcDispatcher, Method as RpcMethod,
+                MethodDescriptor as RpcMethodDescriptor,
+            },
+            types::Kind as RpcKind,
+            Context as RpcContext,
+        },
+        future::block_on,
+        protocol::{HostInfo, Protocol},
+        storage::mkvs,
+    },
+    dispatcher,
+    keymanager::KeyManagerClient,
+    module::MethodHandler,
+    state::{self, CurrentState},
+    storage::HostStore,
+    Runtime,
+};
+
+/// Name of the `query` method.
+pub const METHOD_QUERY: &str = "runtime-sdk/query";
+
+/// Arguments for the `query` method.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct QueryRequest {
+    pub round: u64,
+    pub method: String,
+    pub args: Vec<u8>,
+}
+
+/// EnclaveRPC dispatcher wrapper.
+pub(crate) struct Wrapper<R: Runtime> {
+    host_info: HostInfo,
+    host: Arc<Protocol>,
+    key_manager: Option<Arc<KeyManagerClient>>,
+    consensus_verifier: Arc<dyn Verifier>,
+    _runtime: PhantomData<R>,
+}
+
+impl<R> Wrapper<R>
+where
+    R: Runtime + Send + Sync + 'static,
+{
+    pub(crate) fn wrap(
+        rpc: &mut RpcDispatcher,
+        host: Arc<Protocol>,
+        host_info: HostInfo,
+        key_manager: Option<Arc<KeyManagerClient>>,
+        consensus_verifier: Arc<dyn Verifier>,
+    ) {
+        let wrapper = Box::leak(Box::new(Self {
+            host_info,
+            host,
+            key_manager,
+            consensus_verifier,
+            _runtime: PhantomData,
+        }));
+        rpc.add_methods(wrapper.methods());
+    }
+
+    fn methods(&'static self) -> Vec<RpcMethod> {
+        vec![RpcMethod::new(
+            RpcMethodDescriptor {
+                name: METHOD_QUERY.to_string(),
+                kind: RpcKind::NoiseSession,
+            },
+            move |ctx: &_, req: &_| self.rpc_query(ctx, req),
+        )]
+    }
+
+    fn ensure_session_endorsed(&self, ctx: &RpcContext) -> Result<()> {
+        let endorsed_by = ctx
+            .session_info
+            .as_ref()
+            .ok_or(anyhow!("not authorized"))?
+            .endorsed_by
+            .ok_or(anyhow!("not endorsed by host"))?;
+        let host_identity = self
+            .host
+            .get_identity()
+            .ok_or(anyhow!("local identity not available"))?
+            .node_identity()
+            .ok_or(anyhow!("node identity not available"))?;
+        if endorsed_by != host_identity {
+            bail!("not endorsed by host");
+        }
+        Ok(())
+    }
+
+    fn rpc_query(&self, ctx: &RpcContext, req: &QueryRequest) -> Result<Vec<u8>> {
+        self.ensure_session_endorsed(ctx)?;
+
+        // Determine whether the method is allowed to access confidential state and provide an
+        // appropriately scoped instance of the key manager client.
+        let is_confidential_allowed = R::Modules::is_allowed_private_km_query(&req.method)
+            && R::is_allowed_private_km_query(&req.method);
+        let key_manager = self.key_manager.as_ref().map(|mgr| {
+            if is_confidential_allowed {
+                mgr.with_private_context()
+            } else {
+                mgr.with_context()
+            }
+        });
+
+        // Fetch latest consensus layer state.
+        let state = block_on(self.consensus_verifier.latest_state())?;
+        let roothash = RoothashState::new(&state);
+        let roots = roothash
+            .round_roots(self.host_info.runtime_id, req.round)?
+            .ok_or(anyhow!("root not found"))?;
+        let beacon = BeaconState::new(&state);
+        let epoch = beacon.epoch()?;
+        let registry = RegistryState::new(&state);
+        let runtime = registry
+            .runtime(&self.host_info.runtime_id)?
+            .ok_or(anyhow!("runtime not found"))?;
+
+        // Prepare dispatch context.
+        let history = self.consensus_verifier.clone();
+        let root = HostStore::new(
+            self.host.clone(),
+            mkvs::Root {
+                namespace: self.host_info.runtime_id,
+                version: req.round,
+                root_type: mkvs::RootType::State,
+                hash: roots.state_root,
+            },
+        );
+        // TODO: This is currently limited as we have no nice way of getting a good known header. We
+        // need to expose more stuff in roothash and then limit the query to latest round. Until
+        // then any queries requiring access to features like timestamp will fail as we need to
+        // ensure we use safe values for these arguments.
+        let header = Header {
+            namespace: self.host_info.runtime_id,
+            round: req.round,
+            io_root: roots.io_root,
+            state_root: roots.state_root,
+            ..Default::default()
+        };
+        let round_results = Default::default();
+        let max_messages = runtime.executor.max_messages;
+
+        let ctx = RuntimeBatchContext::<'_, R>::new(
+            &self.host_info,
+            key_manager,
+            &header,
+            &round_results,
+            &state,
+            &history,
+            epoch,
+            max_messages,
+        );
+
+        CurrentState::enter_opts(
+            state::Options::new()
+                .with_mode(state::Mode::Check)
+                .with_rng_local_entropy(), // Mix in local (private) entropy for queries.
+            root,
+            || dispatcher::Dispatcher::<R>::dispatch_query(&ctx, &req.method, req.args.clone()),
+        )
+        .map_err(Into::into)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/error.rs.html b/rust/src/oasis_runtime_sdk/error.rs.html new file mode 100644 index 0000000000..42b7bd2e95 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/error.rs.html @@ -0,0 +1,385 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+
//! Error types for runtimes.
+pub use oasis_core_runtime::types::Error as RuntimeError;
+
+use crate::{dispatcher, module::CallResult};
+
+/// A runtime error that gets propagated to the caller.
+///
+/// It extends `std::error::Error` with module name and error code so that errors can be easily
+/// serialized and transferred between different processes.
+///
+/// This trait can be derived:
+/// ```
+/// # #[cfg(feature = "oasis-runtime-sdk-macros")]
+/// # mod example {
+/// # use oasis_runtime_sdk_macros::Error;
+/// const MODULE_NAME: &str = "my-module";
+/// #[derive(Clone, Debug, Error, thiserror::Error)]
+/// #[sdk_error(autonumber)] // `module_name` meta is required if `MODULE_NAME` isn't in scope
+/// enum Error {
+///    #[error("invalid argument")]
+///    InvalidArgument,          // autonumbered to 0
+///
+///    #[error("forbidden")]
+///    #[sdk_error(code = 401)]  // manually numbered to 403 (`code` or autonumbering is required)
+///    Forbidden,
+/// }
+/// # }
+/// ```
+pub trait Error: std::error::Error {
+    /// Name of the module that emitted the error.
+    fn module_name(&self) -> &str;
+
+    /// Error code uniquely identifying the error.
+    fn code(&self) -> u32;
+
+    /// Converts the error into a call result.
+    fn into_call_result(self) -> CallResult
+    where
+        Self: Sized,
+    {
+        match self.into_abort() {
+            Ok(err) => CallResult::Aborted(err),
+            Err(failed) => CallResult::Failed {
+                module: failed.module_name().to_owned(),
+                code: failed.code(),
+                message: failed.to_string(),
+            },
+        }
+    }
+
+    /// Consumes self and returns either `Ok(err)` (where `err` is a dispatcher error) when batch
+    /// should abort or `Err(self)` when this is just a regular error.
+    fn into_abort(self) -> Result<dispatcher::Error, Self>
+    where
+        Self: Sized,
+    {
+        Err(self)
+    }
+}
+
+impl Error for std::convert::Infallible {
+    fn module_name(&self) -> &str {
+        "(none)"
+    }
+
+    fn code(&self) -> u32 {
+        Default::default()
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    const MODULE_NAME_1: &str = "test1";
+    const MODULE_NAME_2: &str = "test2";
+
+    #[derive(thiserror::Error, Debug, oasis_runtime_sdk_macros::Error)]
+    #[sdk_error(module_name = "MODULE_NAME_1")]
+    enum ChildError {
+        #[error("first error")]
+        #[sdk_error(code = 1)]
+        Error1,
+
+        #[error("second error")]
+        #[sdk_error(code = 2)]
+        Error2,
+    }
+
+    #[derive(thiserror::Error, Debug, oasis_runtime_sdk_macros::Error)]
+    #[sdk_error(module_name = "MODULE_NAME_2")]
+    enum ParentError {
+        #[error("first error")]
+        #[sdk_error(code = 1)]
+        NotForwarded(#[source] ChildError),
+
+        #[error("nested error")]
+        #[sdk_error(transparent)]
+        Nested(#[source] ChildError),
+    }
+
+    #[derive(thiserror::Error, Debug, oasis_runtime_sdk_macros::Error)]
+    enum ParentParentError {
+        #[error("nested nested error")]
+        #[sdk_error(transparent)]
+        Nested(#[source] ParentError),
+    }
+
+    #[test]
+    fn test_error_sources_1() {
+        let err = ParentError::Nested(ChildError::Error1);
+        let result = err.into_call_result();
+
+        match result {
+            CallResult::Failed {
+                module,
+                code,
+                message: _,
+            } => {
+                assert_eq!(module, "test1");
+                assert_eq!(code, 1);
+            }
+            _ => panic!("expected failed result, got: {:?}", result),
+        }
+
+        let err = ParentError::Nested(ChildError::Error2);
+        let result = err.into_call_result();
+
+        match result {
+            CallResult::Failed {
+                module,
+                code,
+                message: _,
+            } => {
+                assert_eq!(module, "test1");
+                assert_eq!(code, 2);
+            }
+            _ => panic!("expected failed result, got: {:?}", result),
+        }
+    }
+
+    #[test]
+    fn test_error_sources_2() {
+        let err = ParentError::NotForwarded(ChildError::Error1);
+        let result = err.into_call_result();
+
+        match result {
+            CallResult::Failed {
+                module,
+                code,
+                message: _,
+            } => {
+                assert_eq!(module, "test2");
+                assert_eq!(code, 1);
+            }
+            _ => panic!("expected failed result, got: {:?}", result),
+        }
+
+        let err = ParentError::NotForwarded(ChildError::Error2);
+        let result = err.into_call_result();
+
+        match result {
+            CallResult::Failed {
+                module,
+                code,
+                message: _,
+            } => {
+                assert_eq!(module, "test2");
+                assert_eq!(code, 1);
+            }
+            _ => panic!("expected failed result, got: {:?}", result),
+        }
+    }
+
+    #[test]
+    fn test_error_sources_3() {
+        let err = ParentParentError::Nested(ParentError::Nested(ChildError::Error1));
+        let result = err.into_call_result();
+
+        match result {
+            CallResult::Failed {
+                module,
+                code,
+                message: _,
+            } => {
+                assert_eq!(module, "test1");
+                assert_eq!(code, 1);
+            }
+            _ => panic!("expected failed result, got: {:?}", result),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/event.rs.html b/rust/src/oasis_runtime_sdk/event.rs.html new file mode 100644 index 0000000000..4fc193ca43 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/event.rs.html @@ -0,0 +1,185 @@ +event.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+
//! Event types for runtimes.
+use std::collections::BTreeMap;
+
+use oasis_core_runtime::transaction::tags::{Tag, Tags};
+
+/// An event emitted by the runtime.
+///
+/// This trait can be derived:
+/// ```
+/// # #[cfg(feature = "oasis-runtime-sdk-macros")]
+/// # mod example {
+/// # use oasis_runtime_sdk_macros::Event;
+/// const MODULE_NAME: &str = "my-module";
+/// #[derive(Clone, Debug, cbor::Encode, Event)]
+/// #[cbor(untagged)]
+/// #[sdk_event(autonumber)] // `module_name` meta is required if `MODULE_NAME` isn't in scope
+/// enum MyEvent {
+///    Greeting(String),      // autonumbered to 0
+///    #[sdk_event(code = 2)] // manually numbered to 2 (`code` is required if not autonumbering)
+///    DontPanic,
+///    Salutation {           // autonumbered to 1
+///        plural: bool,
+///    }
+/// }
+/// # }
+/// ```
+pub trait Event: Sized + cbor::Encode {
+    /// Name of the module that emitted the event.
+    fn module_name() -> &'static str;
+
+    /// Code uniquely identifying the event.
+    fn code(&self) -> u32;
+
+    /// Converts an event into an event tag.
+    ///
+    /// # Key
+    ///
+    /// ```text
+    /// <module (variable size bytes)> <code (big-endian u32)>
+    /// ```
+    ///
+    /// # Value
+    ///
+    /// CBOR-serialized event value.
+    ///
+    fn into_event_tag(self) -> EventTag {
+        etag_for_event(Self::module_name(), self.code(), cbor::to_value(self))
+    }
+}
+
+impl Event for () {
+    fn module_name() -> &'static str {
+        "(none)"
+    }
+
+    fn code(&self) -> u32 {
+        Default::default()
+    }
+}
+
+/// Generate an EventTag corresponding to the passed event triple.
+pub fn etag_for_event(module_name: &str, code: u32, value: cbor::Value) -> EventTag {
+    EventTag {
+        key: [module_name.as_bytes(), &code.to_be_bytes()]
+            .concat()
+            .to_vec(),
+        value,
+    }
+}
+
+/// A key-value pair representing an emitted event that will be emitted as a tag.
+#[derive(Clone, Debug)]
+pub struct EventTag {
+    pub key: Vec<u8>,
+    pub value: cbor::Value,
+}
+
+/// Event tags with values accumulated by key.
+pub type EventTags = BTreeMap<Vec<u8>, Vec<cbor::Value>>;
+
+/// Provides method for converting event tags into events.
+pub trait IntoTags {
+    fn into_tags(self) -> Tags;
+}
+
+impl IntoTags for EventTags {
+    fn into_tags(self) -> Tags {
+        self.into_iter()
+            .map(|(k, v)| Tag::new(k, cbor::to_vec(v)))
+            .collect()
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/history.rs.html b/rust/src/oasis_runtime_sdk/history.rs.html new file mode 100644 index 0000000000..61dad3016b --- /dev/null +++ b/rust/src/oasis_runtime_sdk/history.rs.html @@ -0,0 +1,101 @@ +history.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
//! Historic state access.
+use oasis_core_runtime::{
+    consensus::{state::ConsensusState, verifier::Verifier, Event},
+    future::block_on,
+    types::EventKind,
+};
+
+/// Unique module name.
+const MODULE_NAME: &str = "history";
+
+/// History host errors.
+#[derive(Debug, thiserror::Error, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("failed to fetch block from host")]
+    #[sdk_error(code = 1)]
+    FailedToFetchBlock,
+
+    #[error("failed to fetch events from host")]
+    #[sdk_error(code = 2)]
+    FailedToFetchEvents,
+}
+
+/// Interface to the runtime host to fetch historic information.
+pub trait HistoryHost {
+    /// Fetch historic consensus state after executing the block at given height.
+    fn consensus_state_at(&self, height: u64) -> Result<ConsensusState, Error>;
+
+    /// Fetch events emitted during execution of the block at given height.
+    fn consensus_events_at(&self, height: u64, kind: EventKind) -> Result<Vec<Event>, Error>;
+}
+
+impl HistoryHost for Box<dyn HistoryHost> {
+    fn consensus_state_at(&self, height: u64) -> Result<ConsensusState, Error> {
+        HistoryHost::consensus_state_at(&**self, height)
+    }
+
+    fn consensus_events_at(&self, height: u64, kind: EventKind) -> Result<Vec<Event>, Error> {
+        HistoryHost::consensus_events_at(&**self, height, kind)
+    }
+}
+
+impl<V: Verifier> HistoryHost for V {
+    fn consensus_state_at(&self, height: u64) -> Result<ConsensusState, Error> {
+        block_on(self.state_at(height)).map_err(|_| Error::FailedToFetchBlock)
+    }
+
+    fn consensus_events_at(&self, height: u64, kind: EventKind) -> Result<Vec<Event>, Error> {
+        block_on(self.events_at(height, kind)).map_err(|_| Error::FailedToFetchEvents)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/keymanager.rs.html b/rust/src/oasis_runtime_sdk/keymanager.rs.html new file mode 100644 index 0000000000..5a1eb88ea7 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/keymanager.rs.html @@ -0,0 +1,695 @@ +keymanager.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+
//! Keymanager interface.
+use std::sync::Arc;
+
+use tiny_keccak::{Hasher, TupleHash};
+
+use oasis_core_keymanager::client::{KeyManagerClient as CoreKeyManagerClient, RemoteClient};
+pub use oasis_core_keymanager::{
+    api::KeyManagerError,
+    crypto::{KeyPair, KeyPairId, SignedPublicKey, StateKey},
+    policy::TrustedSigners,
+};
+use oasis_core_runtime::{
+    common::{crypto::signature::PublicKey, namespace::Namespace},
+    consensus::{beacon::EpochTime, verifier::Verifier},
+    future::block_on,
+    identity::Identity,
+    protocol::Protocol,
+    RpcDispatcher,
+};
+
+/// Key manager interface. This is a runtime context-resident convenience
+/// wrapper to the keymanager configured for the runtime.
+pub(crate) struct KeyManagerClient {
+    inner: Arc<dyn CoreKeyManagerClient>,
+}
+
+impl KeyManagerClient {
+    /// Create a new key manager client using the default remote client from oasis-core.
+    pub(crate) fn new(
+        runtime_id: Namespace,
+        protocol: Arc<Protocol>,
+        consensus_verifier: Arc<dyn Verifier>,
+        identity: Arc<Identity>,
+        rpc: &mut RpcDispatcher,
+        key_cache_sizes: usize,
+        signers: TrustedSigners,
+    ) -> Self {
+        let remote_client = Arc::new(RemoteClient::new_runtime(
+            runtime_id,
+            protocol,
+            consensus_verifier,
+            identity,
+            key_cache_sizes,
+            signers,
+        ));
+
+        // Setup the quote policy update handler.
+        let handler_remote_client = remote_client.clone();
+        rpc.set_keymanager_quote_policy_update_handler(Some(Box::new(move |policy| {
+            block_on(handler_remote_client.set_quote_policy(policy));
+        })));
+
+        // Setup the status update handler.
+        let handler_remote_client = remote_client.clone();
+        rpc.set_keymanager_status_update_handler(Some(Box::new(move |status| {
+            block_on(handler_remote_client.set_status(status))
+                .expect("failed to update km client status");
+        })));
+
+        KeyManagerClient {
+            inner: remote_client,
+        }
+    }
+
+    /// Create a client proxy which will forward calls to the inner client using the given context.
+    /// Only public key queries will be allowed.
+    pub(crate) fn with_context(self: &Arc<Self>) -> Box<dyn KeyManager> {
+        Box::new(KeyManagerClientWithContext::new(self.clone(), false)) as Box<dyn KeyManager>
+    }
+
+    /// Create a client proxy which will forward calls to the inner client using the given context.
+    /// Public and private key queries will be allowed.
+    pub(crate) fn with_private_context(self: &Arc<Self>) -> Box<dyn KeyManager> {
+        Box::new(KeyManagerClientWithContext::new(self.clone(), true)) as Box<dyn KeyManager>
+    }
+
+    /// Key manager runtime identifier this client is connected to. It may be `None` in case the
+    /// identifier is not known yet (e.g. the client has not yet been initialized).
+    ///
+    /// See the oasis-core documentation for details.
+    pub(crate) fn runtime_id(&self) -> Option<Namespace> {
+        self.inner.runtime_id()
+    }
+
+    /// Key manager runtime signing key used to sign messages from the key manager.
+    ///
+    /// See the oasis-core documentation for details.
+    pub(crate) fn runtime_signing_key(&self) -> Option<PublicKey> {
+        self.inner.runtime_signing_key()
+    }
+
+    /// Clear local key cache.
+    ///
+    /// See the oasis-core documentation for details.
+    pub(crate) fn clear_cache(&self) {
+        self.inner.clear_cache()
+    }
+
+    /// Get or create named key pair.
+    ///
+    /// See the oasis-core documentation for details.
+    pub(crate) async fn get_or_create_keys(
+        &self,
+        key_pair_id: KeyPairId,
+    ) -> Result<KeyPair, KeyManagerError> {
+        retryable(|| self.inner.get_or_create_keys(key_pair_id, 0)).await
+    }
+
+    /// Get public key for a key pair id.
+    ///
+    /// See the oasis-core documentation for details.
+    pub(crate) async fn get_public_key(
+        &self,
+        key_pair_id: KeyPairId,
+    ) -> Result<SignedPublicKey, KeyManagerError> {
+        retryable(|| self.inner.get_public_key(key_pair_id, 0)).await
+    }
+
+    /// Get or create named ephemeral key pair for given epoch.
+    ///
+    /// See the oasis-core documentation for details.
+    pub(crate) async fn get_or_create_ephemeral_keys(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<KeyPair, KeyManagerError> {
+        retryable(|| self.inner.get_or_create_ephemeral_keys(key_pair_id, epoch)).await
+    }
+
+    /// Get ephemeral public key for an epoch and a key pair id.
+    ///
+    /// See the oasis-core documentation for details.
+    pub(crate) async fn get_public_ephemeral_key(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<SignedPublicKey, KeyManagerError> {
+        retryable(|| self.inner.get_public_ephemeral_key(key_pair_id, epoch)).await
+    }
+}
+
+/// Decorator for remote method calls that can be safely retried.
+async fn retryable<A>(action: A) -> Result<A::Item, A::Error>
+where
+    A: tokio_retry::Action,
+{
+    let retry_strategy = tokio_retry::strategy::ExponentialBackoff::from_millis(4)
+        .max_delay(std::time::Duration::from_millis(250))
+        .map(tokio_retry::strategy::jitter)
+        .take(5);
+
+    tokio_retry::Retry::spawn(retry_strategy, action).await
+}
+
+/// Key manager interface.
+pub trait KeyManager {
+    /// Key manager runtime identifier this client is connected to. It may be `None` in case the
+    /// identifier is not known yet (e.g. the client has not yet been initialized).
+    ///
+    /// See the oasis-core documentation for details.
+    fn runtime_id(&self) -> Option<Namespace>;
+
+    /// Key manager runtime signing key used to sign messages from the key manager.
+    ///
+    /// See the oasis-core documentation for details.
+    fn runtime_signing_key(&self) -> Option<PublicKey>;
+
+    /// Clear local key cache.
+    ///
+    /// See the oasis-core documentation for details.
+    fn clear_cache(&self);
+
+    /// Get or create named key pair.
+    ///
+    /// See the oasis-core documentation for details. This variant of the method
+    /// synchronously blocks for the result.
+    fn get_or_create_keys(&self, key_pair_id: KeyPairId) -> Result<KeyPair, KeyManagerError>;
+
+    /// Get public key for a key pair id.
+    ///
+    /// See the oasis-core documentation for details. This variant of the method
+    /// synchronously blocks for the result.
+    fn get_public_key(&self, key_pair_id: KeyPairId) -> Result<SignedPublicKey, KeyManagerError>;
+
+    /// Get or create named ephemeral key pair for given epoch.
+    ///
+    /// See the oasis-core documentation for details. This variant of the method
+    /// synchronously blocks for the result.
+    fn get_or_create_ephemeral_keys(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<KeyPair, KeyManagerError>;
+
+    /// Get ephemeral public key for an epoch and a key pair id.
+    ///
+    /// See the oasis-core documentation for details. This variant of the method
+    /// synchronously blocks for the result.
+    fn get_public_ephemeral_key(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<SignedPublicKey, KeyManagerError>;
+
+    fn box_clone(&self) -> Box<dyn KeyManager>;
+}
+
+impl Clone for Box<dyn KeyManager> {
+    fn clone(&self) -> Box<dyn KeyManager> {
+        self.box_clone()
+    }
+}
+
+/// Convenience wrapper around an existing KeyManagerClient instance which uses
+/// a default io context for all calls.
+#[derive(Clone)]
+pub struct KeyManagerClientWithContext {
+    parent: Arc<KeyManagerClient>,
+    allow_private: bool,
+}
+
+impl KeyManagerClientWithContext {
+    fn new(parent: Arc<KeyManagerClient>, allow_private: bool) -> KeyManagerClientWithContext {
+        KeyManagerClientWithContext {
+            parent,
+            allow_private,
+        }
+    }
+
+    /// Get or create named key pair.
+    ///
+    /// See the oasis-core documentation for details.
+    async fn get_or_create_keys_async(
+        &self,
+        key_pair_id: KeyPairId,
+    ) -> Result<KeyPair, KeyManagerError> {
+        if !self.allow_private {
+            return Err(KeyManagerError::Other(anyhow::anyhow!(
+                "not allowed by local runtime policy"
+            )));
+        }
+
+        self.parent.get_or_create_keys(key_pair_id).await
+    }
+
+    /// Get public key for a key pair id.
+    ///
+    /// See the oasis-core documentation for details.
+    async fn get_public_key_async(
+        &self,
+        key_pair_id: KeyPairId,
+    ) -> Result<SignedPublicKey, KeyManagerError> {
+        self.parent.get_public_key(key_pair_id).await
+    }
+
+    /// Get ephemeral public key for an epoch and a key pair id.
+    ///
+    /// See the oasis-core documentation for details.
+    async fn get_or_create_ephemeral_keys_async(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<KeyPair, KeyManagerError> {
+        if !self.allow_private {
+            return Err(KeyManagerError::Other(anyhow::anyhow!(
+                "not allowed by local runtime policy"
+            )));
+        }
+
+        self.parent
+            .get_or_create_ephemeral_keys(key_pair_id, epoch)
+            .await
+    }
+
+    /// Get ephemeral public key for an epoch and a key pair id.
+    ///
+    /// See the oasis-core documentation for details.
+    async fn get_public_ephemeral_key_async(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<SignedPublicKey, KeyManagerError> {
+        self.parent
+            .get_public_ephemeral_key(key_pair_id, epoch)
+            .await
+    }
+}
+
+impl KeyManager for KeyManagerClientWithContext {
+    fn runtime_id(&self) -> Option<Namespace> {
+        self.parent.runtime_id()
+    }
+
+    fn runtime_signing_key(&self) -> Option<PublicKey> {
+        self.parent.runtime_signing_key()
+    }
+
+    fn clear_cache(&self) {
+        self.parent.clear_cache();
+    }
+
+    fn get_or_create_keys(&self, key_pair_id: KeyPairId) -> Result<KeyPair, KeyManagerError> {
+        block_on(self.get_or_create_keys_async(key_pair_id))
+    }
+
+    fn get_public_key(&self, key_pair_id: KeyPairId) -> Result<SignedPublicKey, KeyManagerError> {
+        block_on(self.get_public_key_async(key_pair_id))
+    }
+
+    fn get_or_create_ephemeral_keys(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<KeyPair, KeyManagerError> {
+        block_on(self.get_or_create_ephemeral_keys_async(key_pair_id, epoch))
+    }
+
+    fn get_public_ephemeral_key(
+        &self,
+        key_pair_id: KeyPairId,
+        epoch: EpochTime,
+    ) -> Result<SignedPublicKey, KeyManagerError> {
+        block_on(self.get_public_ephemeral_key_async(key_pair_id, epoch))
+    }
+
+    fn box_clone(&self) -> Box<dyn KeyManager> {
+        Box::new(self.clone())
+    }
+}
+
+/// Key pair ID domain separation context.
+pub const KEY_PAIR_ID_CONTEXT: &[u8] = b"oasis-runtime-sdk/keymanager: key pair id";
+
+/// Derive a `KeyPairId` for use with the key manager functions.
+pub fn get_key_pair_id<'a, C>(context: C) -> KeyPairId
+where
+    C: IntoIterator<Item = &'a [u8]> + 'a,
+{
+    let mut h = TupleHash::v256(KEY_PAIR_ID_CONTEXT);
+    for item in context.into_iter() {
+        h.update(item);
+    }
+    let mut key_pair_id = [0u8; 32];
+    h.finalize(&mut key_pair_id);
+
+    KeyPairId(key_pair_id)
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/lib.rs.html b/rust/src/oasis_runtime_sdk/lib.rs.html new file mode 100644 index 0000000000..2a3a1b368c --- /dev/null +++ b/rust/src/oasis_runtime_sdk/lib.rs.html @@ -0,0 +1,87 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
//! Oasis runtime SDK.
+#![feature(test)]
+#![feature(associated_type_defaults)]
+#![deny(rust_2018_idioms, unreachable_pub)]
+
+pub mod callformat;
+pub mod config;
+pub mod context;
+pub mod crypto;
+pub mod dispatcher;
+pub mod enclave_rpc;
+pub mod error;
+pub mod event;
+pub mod history;
+pub mod keymanager;
+pub mod module;
+pub mod modules;
+pub mod runtime;
+pub mod schedule_control;
+pub mod sender;
+pub mod state;
+pub mod storage;
+pub mod subcall;
+pub mod testing;
+pub mod types;
+
+pub use crate::{
+    context::Context, core::common::version::Version, module::Module, runtime::Runtime,
+    state::CurrentState,
+};
+
+// Re-export the appropriate version of the oasis-core-runtime library.
+pub use oasis_core_runtime as core;
+
+// Re-export the cbor crate.
+pub use cbor;
+
+// Re-export the SDK support proc-macros.
+#[cfg(feature = "oasis-runtime-sdk-macros")]
+pub use oasis_runtime_sdk_macros::*;
+
+// Required so that proc-macros can refer to items within this crate.
+use crate as oasis_runtime_sdk;
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/module.rs.html b/rust/src/oasis_runtime_sdk/module.rs.html new file mode 100644 index 0000000000..1ed1861ae3 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/module.rs.html @@ -0,0 +1,1529 @@ +module.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+
//! Runtime modules.
+use std::{
+    collections::{BTreeMap, BTreeSet},
+    fmt::Debug,
+};
+
+use cbor::Encode as _;
+use impl_trait_for_tuples::impl_for_tuples;
+
+use crate::{
+    context::Context,
+    dispatcher, error,
+    error::Error as _,
+    event, modules,
+    modules::core::types::{MethodHandlerInfo, ModuleInfo},
+    state::CurrentState,
+    storage,
+    storage::Prefix,
+    types::{
+        address::Address,
+        message::MessageResult,
+        transaction::{self, AuthInfo, Call, Transaction, UnverifiedTransaction},
+    },
+};
+
+/// Result of invoking the method handler.
+pub enum DispatchResult<B, R> {
+    Handled(R),
+    Unhandled(B),
+}
+
+impl<B, R> DispatchResult<B, R> {
+    /// Transforms `DispatchResult<B, R>` into `Result<R, E>`, mapping `Handled(r)` to `Ok(r)` and
+    /// `Unhandled(_)` to `Err(err)`.
+    pub fn ok_or<E>(self, err: E) -> Result<R, E> {
+        match self {
+            DispatchResult::Handled(result) => Ok(result),
+            DispatchResult::Unhandled(_) => Err(err),
+        }
+    }
+
+    /// Transforms `DispatchResult<B, R>` into `Result<R, E>`, mapping `Handled(r)` to `Ok(r)` and
+    /// `Unhandled(_)` to `Err(err)` using the provided function.
+    pub fn ok_or_else<E, F: FnOnce() -> E>(self, errf: F) -> Result<R, E> {
+        match self {
+            DispatchResult::Handled(result) => Ok(result),
+            DispatchResult::Unhandled(_) => Err(errf()),
+        }
+    }
+}
+
+/// A variant of `types::transaction::CallResult` but used for dispatch purposes so the dispatch
+/// process can use a different representation.
+///
+/// Specifically, this type is not serializable.
+#[derive(Debug)]
+pub enum CallResult {
+    /// Call has completed successfully.
+    Ok(cbor::Value),
+
+    /// Call has completed with failure.
+    Failed {
+        module: String,
+        code: u32,
+        message: String,
+    },
+
+    /// A fatal error has occurred and the batch must be aborted.
+    Aborted(dispatcher::Error),
+}
+
+impl CallResult {
+    /// Check whether the call result indicates a successful operation or not.
+    pub fn is_success(&self) -> bool {
+        matches!(self, CallResult::Ok(_))
+    }
+
+    #[cfg(any(test, feature = "test"))]
+    pub fn unwrap(self) -> cbor::Value {
+        match self {
+            Self::Ok(v) => v,
+            Self::Failed {
+                module,
+                code,
+                message,
+            } => panic!("{module} reported failure with code {code}: {message}"),
+            Self::Aborted(e) => panic!("tx aborted with error: {e}"),
+        }
+    }
+
+    #[cfg(any(test, feature = "test"))]
+    pub fn unwrap_failed(self) -> (String, u32) {
+        match self {
+            Self::Ok(_) => panic!("call result indicates success"),
+            Self::Failed { module, code, .. } => (module, code),
+            Self::Aborted(e) => panic!("tx aborted with error: {e}"),
+        }
+    }
+}
+
+impl From<CallResult> for transaction::CallResult {
+    fn from(v: CallResult) -> Self {
+        match v {
+            CallResult::Ok(data) => Self::Ok(data),
+            CallResult::Failed {
+                module,
+                code,
+                message,
+            } => Self::Failed {
+                module,
+                code,
+                message,
+            },
+            CallResult::Aborted(err) => Self::Failed {
+                module: err.module_name().to_string(),
+                code: err.code(),
+                message: err.to_string(),
+            },
+        }
+    }
+}
+
+/// A convenience function for dispatching method calls.
+pub fn dispatch_call<C, B, R, E, F>(
+    ctx: &C,
+    body: cbor::Value,
+    f: F,
+) -> DispatchResult<cbor::Value, CallResult>
+where
+    C: Context,
+    B: cbor::Decode,
+    R: cbor::Encode,
+    E: error::Error,
+    F: FnOnce(&C, B) -> Result<R, E>,
+{
+    DispatchResult::Handled((|| {
+        let args = match cbor::from_value(body)
+            .map_err(|err| modules::core::Error::InvalidArgument(err.into()))
+        {
+            Ok(args) => args,
+            Err(err) => return err.into_call_result(),
+        };
+
+        match f(ctx, args) {
+            Ok(value) => CallResult::Ok(cbor::to_value(value)),
+            Err(err) => err.into_call_result(),
+        }
+    })())
+}
+
+/// A convenience function for dispatching queries.
+pub fn dispatch_query<C, B, R, E, F>(
+    ctx: &C,
+    body: cbor::Value,
+    f: F,
+) -> DispatchResult<cbor::Value, Result<cbor::Value, error::RuntimeError>>
+where
+    C: Context,
+    B: cbor::Decode,
+    R: cbor::Encode,
+    E: error::Error,
+    error::RuntimeError: From<E>,
+    F: FnOnce(&C, B) -> Result<R, E>,
+{
+    DispatchResult::Handled((|| {
+        let args = cbor::from_value(body).map_err(|err| -> error::RuntimeError {
+            modules::core::Error::InvalidArgument(err.into()).into()
+        })?;
+        Ok(cbor::to_value(f(ctx, args)?))
+    })())
+}
+
+/// Method handler.
+pub trait MethodHandler {
+    /// Add storage prefixes to prefetch.
+    fn prefetch(
+        _prefixes: &mut BTreeSet<Prefix>,
+        _method: &str,
+        body: cbor::Value,
+        _auth_info: &AuthInfo,
+    ) -> DispatchResult<cbor::Value, Result<(), error::RuntimeError>> {
+        // Default implementation indicates that the call was not handled.
+        DispatchResult::Unhandled(body)
+    }
+
+    /// Dispatch a call.
+    fn dispatch_call<C: Context>(
+        _ctx: &C,
+        _method: &str,
+        body: cbor::Value,
+    ) -> DispatchResult<cbor::Value, CallResult> {
+        // Default implementation indicates that the call was not handled.
+        DispatchResult::Unhandled(body)
+    }
+
+    /// Dispatch a query.
+    fn dispatch_query<C: Context>(
+        _ctx: &C,
+        _method: &str,
+        args: cbor::Value,
+    ) -> DispatchResult<cbor::Value, Result<cbor::Value, error::RuntimeError>> {
+        // Default implementation indicates that the query was not handled.
+        DispatchResult::Unhandled(args)
+    }
+
+    /// Dispatch a message result.
+    fn dispatch_message_result<C: Context>(
+        _ctx: &C,
+        _handler_name: &str,
+        result: MessageResult,
+    ) -> DispatchResult<MessageResult, ()> {
+        // Default implementation indicates that the query was not handled.
+        DispatchResult::Unhandled(result)
+    }
+
+    /// Lists the names of all RPC methods exposed by this module. The result is informational
+    /// only. An empty return vector means that the implementor does not care to list the methods,
+    /// or the implementor is a tuple of modules.
+    fn supported_methods() -> Vec<MethodHandlerInfo> {
+        vec![]
+    }
+
+    /// Checks whether the given query method is tagged as expensive.
+    fn is_expensive_query(_method: &str) -> bool {
+        false
+    }
+
+    /// Checks whether the given query is allowed to access private key manager state.
+    fn is_allowed_private_km_query(_method: &str) -> bool {
+        false
+    }
+
+    /// Checks whether the given call is allowed to be called interactively via read-only
+    /// transactions.
+    fn is_allowed_interactive_call(_method: &str) -> bool {
+        false
+    }
+}
+
+#[impl_for_tuples(30)]
+impl MethodHandler for Tuple {
+    fn prefetch(
+        prefixes: &mut BTreeSet<Prefix>,
+        method: &str,
+        body: cbor::Value,
+        auth_info: &AuthInfo,
+    ) -> DispatchResult<cbor::Value, Result<(), error::RuntimeError>> {
+        // Return on first handler that can handle the method.
+        for_tuples!( #(
+            let body = match Tuple::prefetch(prefixes, method, body, auth_info) {
+                DispatchResult::Handled(result) => return DispatchResult::Handled(result),
+                DispatchResult::Unhandled(body) => body,
+            };
+        )* );
+
+        DispatchResult::Unhandled(body)
+    }
+
+    fn dispatch_call<C: Context>(
+        ctx: &C,
+        method: &str,
+        body: cbor::Value,
+    ) -> DispatchResult<cbor::Value, CallResult> {
+        // Return on first handler that can handle the method.
+        for_tuples!( #(
+            let body = match Tuple::dispatch_call::<C>(ctx, method, body) {
+                DispatchResult::Handled(result) => return DispatchResult::Handled(result),
+                DispatchResult::Unhandled(body) => body,
+            };
+        )* );
+
+        DispatchResult::Unhandled(body)
+    }
+
+    fn dispatch_query<C: Context>(
+        ctx: &C,
+        method: &str,
+        args: cbor::Value,
+    ) -> DispatchResult<cbor::Value, Result<cbor::Value, error::RuntimeError>> {
+        // Return on first handler that can handle the method.
+        for_tuples!( #(
+            let args = match Tuple::dispatch_query::<C>(ctx, method, args) {
+                DispatchResult::Handled(result) => return DispatchResult::Handled(result),
+                DispatchResult::Unhandled(args) => args,
+            };
+        )* );
+
+        DispatchResult::Unhandled(args)
+    }
+
+    fn dispatch_message_result<C: Context>(
+        ctx: &C,
+        handler_name: &str,
+        result: MessageResult,
+    ) -> DispatchResult<MessageResult, ()> {
+        // Return on first handler that can handle the method.
+        for_tuples!( #(
+            let result = match Tuple::dispatch_message_result::<C>(ctx, handler_name, result) {
+                DispatchResult::Handled(result) => return DispatchResult::Handled(result),
+                DispatchResult::Unhandled(result) => result,
+            };
+        )* );
+
+        DispatchResult::Unhandled(result)
+    }
+
+    fn is_expensive_query(method: &str) -> bool {
+        for_tuples!( #(
+            if Tuple::is_expensive_query(method) {
+                return true;
+            }
+        )* );
+        false
+    }
+
+    fn is_allowed_private_km_query(method: &str) -> bool {
+        for_tuples!( #(
+            if Tuple::is_allowed_private_km_query(method) {
+                return true;
+            }
+        )* );
+        false
+    }
+
+    fn is_allowed_interactive_call(method: &str) -> bool {
+        for_tuples!( #(
+            if Tuple::is_allowed_interactive_call(method) {
+                return true;
+            }
+        )* );
+        false
+    }
+}
+
+/// An authentication decision for cases where multiple handlers are available.
+#[derive(Clone, Debug)]
+pub enum AuthDecision {
+    /// Authentication passed, continue with the next authentication handler.
+    Continue,
+    /// Authentication passed, no further authentication handlers should be called.
+    Stop,
+}
+
+/// Transaction handler.
+pub trait TransactionHandler {
+    /// Judge if a raw transaction is good enough to undergo decoding.
+    /// This takes place before even decoding the transaction.
+    fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), modules::core::Error> {
+        // Default implementation doesn't do any checks.
+        Ok(())
+    }
+
+    /// Judge if an unverified transaction is good enough to undergo verification.
+    /// This takes place before even verifying signatures.
+    fn approve_unverified_tx<C: Context>(
+        _ctx: &C,
+        _utx: &UnverifiedTransaction,
+    ) -> Result<(), modules::core::Error> {
+        // Default implementation doesn't do any checks.
+        Ok(())
+    }
+
+    /// Decode a transaction that was sent with module-controlled decoding and verify any
+    /// signatures.
+    ///
+    /// Postcondition: if returning a Transaction, that transaction must pass `validate_basic`.
+    ///
+    /// Returns Ok(Some(_)) if the module is in charge of the encoding scheme identified by _scheme
+    /// or Ok(None) otherwise.
+    fn decode_tx<C: Context>(
+        _ctx: &C,
+        _scheme: &str,
+        _body: &[u8],
+    ) -> Result<Option<Transaction>, modules::core::Error> {
+        // Default implementation is not in charge of any schemes.
+        Ok(None)
+    }
+
+    /// Authenticate a transaction.
+    ///
+    /// Note that any signatures have already been verified.
+    fn authenticate_tx<C: Context>(
+        _ctx: &C,
+        _tx: &Transaction,
+    ) -> Result<AuthDecision, modules::core::Error> {
+        // Default implementation accepts all transactions.
+        Ok(AuthDecision::Continue)
+    }
+
+    /// Perform any action after authentication, within the transaction context.
+    ///
+    /// At this point call format has not yet been decoded so peeking into the call may not be
+    /// possible in case the call is encrypted.
+    fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), modules::core::Error> {
+        // Default implementation doesn't do anything.
+        Ok(())
+    }
+
+    /// Perform any action after authentication and decoding, within the transaction context.
+    ///
+    /// At this point, the call has been decoded according to the call format,
+    /// and method authorizers have run.
+    fn before_authorized_call_dispatch<C: Context>(
+        _ctx: &C,
+        _call: &Call,
+    ) -> Result<(), modules::core::Error> {
+        // Default implementation doesn't do anything.
+        Ok(())
+    }
+
+    /// Perform any action after call, within the transaction context.
+    ///
+    /// If an error is returned the transaction call fails and updates are rolled back.
+    fn after_handle_call<C: Context>(
+        _ctx: &C,
+        result: CallResult,
+    ) -> Result<CallResult, modules::core::Error> {
+        // Default implementation doesn't do anything.
+        Ok(result)
+    }
+
+    /// Perform any action after dispatching the transaction, in batch context.
+    fn after_dispatch_tx<C: Context>(_ctx: &C, _tx_auth_info: &AuthInfo, _result: &CallResult) {
+        // Default implementation doesn't do anything.
+    }
+}
+
+#[impl_for_tuples(30)]
+impl TransactionHandler for Tuple {
+    fn approve_raw_tx<C: Context>(ctx: &C, tx: &[u8]) -> Result<(), modules::core::Error> {
+        for_tuples!( #( Tuple::approve_raw_tx(ctx, tx)?; )* );
+        Ok(())
+    }
+
+    fn approve_unverified_tx<C: Context>(
+        ctx: &C,
+        utx: &UnverifiedTransaction,
+    ) -> Result<(), modules::core::Error> {
+        for_tuples!( #( Tuple::approve_unverified_tx(ctx, utx)?; )* );
+        Ok(())
+    }
+
+    fn decode_tx<C: Context>(
+        ctx: &C,
+        scheme: &str,
+        body: &[u8],
+    ) -> Result<Option<Transaction>, modules::core::Error> {
+        for_tuples!( #(
+            let decoded = Tuple::decode_tx(ctx, scheme, body)?;
+            if (decoded.is_some()) {
+                return Ok(decoded);
+            }
+        )* );
+        Ok(None)
+    }
+
+    fn authenticate_tx<C: Context>(
+        ctx: &C,
+        tx: &Transaction,
+    ) -> Result<AuthDecision, modules::core::Error> {
+        for_tuples!( #(
+            match Tuple::authenticate_tx(ctx, tx)? {
+                AuthDecision::Stop => return Ok(AuthDecision::Stop),
+                AuthDecision::Continue => {},
+            }
+        )* );
+
+        Ok(AuthDecision::Continue)
+    }
+
+    fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), modules::core::Error> {
+        for_tuples!( #( Tuple::before_handle_call(ctx, call)?; )* );
+        Ok(())
+    }
+
+    fn before_authorized_call_dispatch<C: Context>(
+        ctx: &C,
+        call: &Call,
+    ) -> Result<(), modules::core::Error> {
+        for_tuples!( #( Tuple::before_authorized_call_dispatch(ctx, call)?; )* );
+        Ok(())
+    }
+
+    fn after_handle_call<C: Context>(
+        ctx: &C,
+        mut result: CallResult,
+    ) -> Result<CallResult, modules::core::Error> {
+        for_tuples!( #(
+            result = Tuple::after_handle_call(ctx, result)?;
+        )* );
+        Ok(result)
+    }
+
+    fn after_dispatch_tx<C: Context>(ctx: &C, tx_auth_info: &AuthInfo, result: &CallResult) {
+        for_tuples!( #( Tuple::after_dispatch_tx(ctx, tx_auth_info, result); )* );
+    }
+}
+
+/// Fee proxy handler.
+pub trait FeeProxyHandler {
+    /// Resolve the proxy payer for the given transaction. If no payer could be resolved, `None`
+    /// should be returned.
+    fn resolve_payer<C: Context>(
+        ctx: &C,
+        tx: &Transaction,
+    ) -> Result<Option<Address>, modules::core::Error>;
+}
+
+#[impl_for_tuples(30)]
+impl FeeProxyHandler for Tuple {
+    fn resolve_payer<C: Context>(
+        ctx: &C,
+        tx: &Transaction,
+    ) -> Result<Option<Address>, modules::core::Error> {
+        for_tuples!( #(
+            if let Some(payer) = Tuple::resolve_payer(ctx, tx)? {
+                return Ok(Some(payer));
+            }
+        )* );
+
+        Ok(None)
+    }
+}
+
+/// Migration handler.
+pub trait MigrationHandler {
+    /// Genesis state type.
+    ///
+    /// If this state is expensive to compute and not often updated, prefer
+    /// to make the genesis type something like `once_cell::unsync::Lazy<T>`.
+    type Genesis;
+
+    /// Initialize state from genesis or perform a migration.
+    ///
+    /// Should return true in case metadata has been changed.
+    fn init_or_migrate<C: Context>(
+        _ctx: &C,
+        _meta: &mut modules::core::types::Metadata,
+        _genesis: Self::Genesis,
+    ) -> bool {
+        // Default implementation doesn't perform any migrations.
+        false
+    }
+}
+
+#[allow(clippy::type_complexity)]
+#[impl_for_tuples(30)]
+impl MigrationHandler for Tuple {
+    for_tuples!( type Genesis = ( #( Tuple::Genesis ),* ); );
+
+    fn init_or_migrate<C: Context>(
+        ctx: &C,
+        meta: &mut modules::core::types::Metadata,
+        genesis: Self::Genesis,
+    ) -> bool {
+        [for_tuples!( #( Tuple::init_or_migrate(ctx, meta, genesis.Tuple) ),* )]
+            .iter()
+            .any(|x| *x)
+    }
+}
+
+/// Block handler.
+pub trait BlockHandler {
+    /// Perform any common actions at the start of the block (before any transactions have been
+    /// executed).
+    fn begin_block<C: Context>(_ctx: &C) {
+        // Default implementation doesn't do anything.
+    }
+
+    /// Perform any common actions at the end of the block (after all transactions have been
+    /// executed).
+    fn end_block<C: Context>(_ctx: &C) {
+        // Default implementation doesn't do anything.
+    }
+}
+
+#[impl_for_tuples(30)]
+impl BlockHandler for Tuple {
+    fn begin_block<C: Context>(ctx: &C) {
+        for_tuples!( #( Tuple::begin_block(ctx); )* );
+    }
+
+    fn end_block<C: Context>(ctx: &C) {
+        for_tuples!( #( Tuple::end_block(ctx); )* );
+    }
+}
+
+/// Invariant handler.
+pub trait InvariantHandler {
+    /// Check invariants.
+    fn check_invariants<C: Context>(_ctx: &C) -> Result<(), modules::core::Error> {
+        // Default implementation doesn't do anything.
+        Ok(())
+    }
+}
+
+#[impl_for_tuples(30)]
+impl InvariantHandler for Tuple {
+    /// Check the invariants in all modules in the tuple.
+    fn check_invariants<C: Context>(ctx: &C) -> Result<(), modules::core::Error> {
+        for_tuples!( #( Tuple::check_invariants(ctx)?; )* );
+        Ok(())
+    }
+}
+
+/// Info handler.
+pub trait ModuleInfoHandler {
+    /// Reports info about the module (or modules, if `Self` is a tuple).
+    fn module_info<C: Context>(_ctx: &C) -> BTreeMap<String, ModuleInfo>;
+}
+
+impl<M: Module + MethodHandler> ModuleInfoHandler for M {
+    fn module_info<C: Context>(_ctx: &C) -> BTreeMap<String, ModuleInfo> {
+        let mut info = BTreeMap::new();
+        info.insert(
+            Self::NAME.to_string(),
+            ModuleInfo {
+                version: Self::VERSION,
+                params: Self::params().into_cbor_value(),
+                methods: Self::supported_methods(),
+            },
+        );
+        info
+    }
+}
+
+#[impl_for_tuples(30)]
+impl ModuleInfoHandler for Tuple {
+    #[allow(clippy::let_and_return)]
+    fn module_info<C: Context>(ctx: &C) -> BTreeMap<String, ModuleInfo> {
+        let mut merged = BTreeMap::new();
+        for_tuples!( #(
+            merged.extend(Tuple::module_info(ctx));
+        )* );
+        merged
+    }
+}
+
+/// A runtime module.
+pub trait Module {
+    /// Module name.
+    const NAME: &'static str;
+
+    /// Module version.
+    const VERSION: u32 = 1;
+
+    /// Module error type.
+    type Error: error::Error + 'static;
+
+    /// Module event type.
+    type Event: event::Event + 'static;
+
+    /// Module parameters.
+    type Parameters: Parameters + 'static;
+
+    /// Return the module's parameters.
+    fn params() -> Self::Parameters {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &Self::NAME);
+            let store = storage::TypedStore::new(store);
+            store.get(Self::Parameters::STORE_KEY).unwrap_or_default()
+        })
+    }
+
+    /// Set the module's parameters.
+    fn set_params(params: Self::Parameters) {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &Self::NAME);
+            let mut store = storage::TypedStore::new(store);
+            store.insert(Self::Parameters::STORE_KEY, params);
+        });
+    }
+}
+
+/// Parameters for a runtime module.
+pub trait Parameters: Debug + Default + cbor::Encode + cbor::Decode {
+    type Error;
+
+    /// Store key used for storing parameters.
+    const STORE_KEY: &'static [u8] = &[0x00];
+
+    /// Perform basic parameter validation.
+    fn validate_basic(&self) -> Result<(), Self::Error> {
+        // No validation by default.
+        Ok(())
+    }
+}
+
+impl Parameters for () {
+    type Error = std::convert::Infallible;
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::testing::mock;
+
+    /// An authentication handler that always continues.
+    struct TestAuthContinue;
+    /// An authentication handler that always stops.
+    struct TestAuthStop;
+    /// An authentication handler that always fails.
+    struct TestAuthFail;
+
+    impl super::TransactionHandler for TestAuthContinue {
+        fn authenticate_tx<C: Context>(
+            _ctx: &C,
+            _tx: &Transaction,
+        ) -> Result<AuthDecision, modules::core::Error> {
+            Ok(AuthDecision::Continue)
+        }
+    }
+
+    impl super::TransactionHandler for TestAuthStop {
+        fn authenticate_tx<C: Context>(
+            _ctx: &C,
+            _tx: &Transaction,
+        ) -> Result<AuthDecision, modules::core::Error> {
+            Ok(AuthDecision::Stop)
+        }
+    }
+
+    impl super::TransactionHandler for TestAuthFail {
+        fn authenticate_tx<C: Context>(
+            _ctx: &C,
+            _tx: &Transaction,
+        ) -> Result<AuthDecision, modules::core::Error> {
+            Err(modules::core::Error::NotAuthenticated)
+        }
+    }
+
+    #[test]
+    fn test_authenticate_tx() {
+        let mut mock = mock::Mock::default();
+        let ctx = mock.create_ctx();
+        let tx = mock::transaction();
+
+        // Make sure mock authentication handlers behave as expected.
+        let result = TestAuthContinue::authenticate_tx(&ctx, &tx).unwrap();
+        assert!(matches!(result, AuthDecision::Continue));
+        let result = TestAuthStop::authenticate_tx(&ctx, &tx).unwrap();
+        assert!(matches!(result, AuthDecision::Stop));
+        let _ = TestAuthFail::authenticate_tx(&ctx, &tx).unwrap_err();
+
+        // Make sure that composed variants behave as expected.
+        type Composed1 = (TestAuthContinue, TestAuthContinue, TestAuthContinue);
+        let result = Composed1::authenticate_tx(&ctx, &tx).unwrap();
+        assert!(matches!(result, AuthDecision::Continue));
+
+        type Composed2 = (TestAuthContinue, TestAuthStop, TestAuthContinue);
+        let result = Composed2::authenticate_tx(&ctx, &tx).unwrap();
+        assert!(matches!(result, AuthDecision::Stop));
+
+        type Composed3 = (TestAuthContinue, TestAuthStop, TestAuthFail);
+        let result = Composed3::authenticate_tx(&ctx, &tx).unwrap();
+        assert!(matches!(result, AuthDecision::Stop));
+
+        type Composed4 = (TestAuthFail, TestAuthStop, TestAuthContinue);
+        let _ = Composed4::authenticate_tx(&ctx, &tx).unwrap_err();
+
+        type Composed5 = (TestAuthContinue, TestAuthContinue, TestAuthFail);
+        let _ = Composed5::authenticate_tx(&ctx, &tx).unwrap_err();
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/access/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/access/mod.rs.html new file mode 100644 index 0000000000..0d1034bf84 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/access/mod.rs.html @@ -0,0 +1,143 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+
//! Method access control module.
+use once_cell::unsync::Lazy;
+use thiserror::Error;
+
+use crate::{
+    context::Context,
+    module::{self, Module as _},
+    modules, sdk_derive,
+    state::CurrentState,
+    types::transaction,
+};
+
+#[cfg(test)]
+mod test;
+pub mod types;
+
+/// Unique module name.
+const MODULE_NAME: &str = "access";
+
+/// Errors emitted by the access module.
+#[derive(Error, Debug, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("caller is not authorized to call method")]
+    #[sdk_error(code = 1)]
+    NotAuthorized,
+}
+
+/// Module configuration.
+#[allow(clippy::declare_interior_mutable_const)]
+pub trait Config: 'static {
+    /// To filter methods by caller address, add them to this mapping.
+    ///
+    /// If the mapping is empty, no method is filtered.
+    const METHOD_AUTHORIZATIONS: Lazy<types::Authorization> = Lazy::new(types::Authorization::new);
+}
+
+/// The method access control module.
+pub struct Module<Cfg: Config> {
+    _cfg: std::marker::PhantomData<Cfg>,
+}
+
+#[sdk_derive(Module)]
+impl<Cfg: Config> Module<Cfg> {
+    const NAME: &'static str = MODULE_NAME;
+    const VERSION: u32 = 1;
+    type Error = Error;
+    type Event = ();
+    type Parameters = ();
+    type Genesis = ();
+}
+
+impl<Cfg: Config> module::TransactionHandler for Module<Cfg> {
+    fn before_authorized_call_dispatch<C: Context>(
+        _ctx: &C,
+        call: &transaction::Call,
+    ) -> Result<(), modules::core::Error> {
+        let tx_caller_address = CurrentState::with_env(|env| env.tx_caller_address());
+        #[allow(clippy::borrow_interior_mutable_const)]
+        if Cfg::METHOD_AUTHORIZATIONS.is_authorized(&call.method, &tx_caller_address) {
+            Ok(())
+        } else {
+            Err(modules::core::Error::InvalidArgument(
+                Error::NotAuthorized.into(),
+            ))
+        }
+    }
+}
+
+impl<Cfg: Config> module::BlockHandler for Module<Cfg> {}
+
+impl<Cfg: Config> module::InvariantHandler for Module<Cfg> {}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/access/types.rs.html b/rust/src/oasis_runtime_sdk/modules/access/types.rs.html new file mode 100644 index 0000000000..80bc1c0f5b --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/access/types.rs.html @@ -0,0 +1,145 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
//! Method access control module types.
+use std::collections::{BTreeMap, BTreeSet};
+
+use crate::types::address::Address;
+
+/// A set of addresses that can be used to define access control for a particular method.
+pub type Addresses = BTreeSet<Address>;
+
+/// A specific kind of method authorization.
+pub enum MethodAuthorization {
+    /// Only allow method calls from these addresses;
+    /// for other callers, the method call will fail.
+    AllowFrom(Addresses),
+}
+
+impl MethodAuthorization {
+    /// Helper for creating a method authorization type that
+    /// only allows callers with the given addresses.
+    pub fn allow_from<I: IntoIterator<Item = Address>>(it: I) -> Self {
+        Self::AllowFrom(BTreeSet::from_iter(it))
+    }
+
+    pub(super) fn is_authorized(&self, address: &Address) -> bool {
+        match self {
+            Self::AllowFrom(addrs) => addrs.contains(address),
+        }
+    }
+}
+
+/// A set of methods that are subject to access control.
+pub type Methods = BTreeMap<String, MethodAuthorization>;
+
+/// A specific kind of access control.
+pub enum Authorization {
+    /// Control a statically configured set of methods, each with a
+    /// statically configured set of addresses that are allowed to call it.
+    FilterOnly(Methods),
+}
+
+impl Authorization {
+    /// Return a new access control configuration.
+    pub fn new() -> Self {
+        Self::FilterOnly(BTreeMap::new())
+    }
+
+    /// Helper for creating a static access control configuration.
+    pub fn with_filtered_methods<S, I>(it: I) -> Self
+    where
+        S: AsRef<str>,
+        I: IntoIterator<Item = (S, MethodAuthorization)>,
+    {
+        Self::FilterOnly(BTreeMap::from_iter(
+            it.into_iter()
+                .map(|(name, authz)| (name.as_ref().to_string(), authz)),
+        ))
+    }
+
+    pub(super) fn is_authorized(&self, method: &str, address: &Address) -> bool {
+        match self {
+            Self::FilterOnly(meths) => meths
+                .get(method)
+                .map(|authz| authz.is_authorized(address))
+                .unwrap_or(true),
+        }
+    }
+}
+
+impl Default for Authorization {
+    fn default() -> Self {
+        Self::FilterOnly(BTreeMap::default())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/accounts/fee.rs.html b/rust/src/oasis_runtime_sdk/modules/accounts/fee.rs.html new file mode 100644 index 0000000000..62a2a60019 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/accounts/fee.rs.html @@ -0,0 +1,507 @@ +fee.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
//! Fee manager.
+use std::collections::BTreeMap;
+
+use crate::types::{address::Address, token};
+
+/// The per-block fee manager that records what fees have been charged by the current transaction,
+/// how much should be refunded and what were all of the fee payments in the current block.
+///
+/// Note that the fee manager does not perform any state modifications by itself.
+#[derive(Clone, Default, Debug)]
+pub struct FeeManager {
+    /// Fees charged for the current transaction.
+    tx_fee: Option<TransactionFee>,
+    /// Fees charged in the current block.
+    block_fees: BTreeMap<token::Denomination, u128>,
+}
+
+/// Information about fees charged for the current transaction.
+#[derive(Clone, Default, Debug)]
+pub struct TransactionFee {
+    /// Transaction fee payer address.
+    payer: Address,
+    /// Denomination of the transaction fee.
+    denomination: token::Denomination,
+    /// Amount charged before transaction execution.
+    charged: u128,
+    /// Amount that should be refunded after transaction execution.
+    refunded: u128,
+}
+
+impl TransactionFee {
+    /// Denomination of the transaction fee.
+    pub fn denomination(&self) -> token::Denomination {
+        self.denomination.clone()
+    }
+
+    /// Transaction fee amount.
+    pub fn amount(&self) -> u128 {
+        self.charged.saturating_sub(self.refunded)
+    }
+
+    /// Transaction fee payer address.
+    pub fn payer(&self) -> Address {
+        self.payer
+    }
+}
+
+impl FeeManager {
+    /// Create a new per-block fee manager.
+    pub fn new() -> Self {
+        Self::default()
+    }
+
+    /// Fees charged for the current transaction.
+    pub fn tx_fee(&self) -> Option<&TransactionFee> {
+        self.tx_fee.as_ref()
+    }
+
+    /// Record that a transaction fee has been charged.
+    ///
+    /// This method should only be called after the charged fee has been subtracted from the payer's
+    /// account (e.g. reflected in state).
+    pub fn record_fee(&mut self, payer: Address, amount: &token::BaseUnits) {
+        let tx_fee = self.tx_fee.get_or_insert_with(|| TransactionFee {
+            payer,
+            denomination: amount.denomination().clone(),
+            ..Default::default()
+        });
+
+        assert!(payer == tx_fee.payer, "transaction fee payer cannot change");
+        assert!(
+            amount.denomination() == &tx_fee.denomination,
+            "transaction fee denomination cannot change"
+        );
+
+        tx_fee.charged = tx_fee
+            .charged
+            .checked_add(amount.amount())
+            .expect("should never overflow");
+    }
+
+    /// Record that a portion of the previously charged transaction fee should be refunded.
+    pub fn record_refund(&mut self, amount: u128) {
+        if amount == 0 || self.tx_fee.is_none() {
+            return;
+        }
+
+        let tx_fee = self.tx_fee.as_mut().unwrap();
+        tx_fee.refunded = std::cmp::min(tx_fee.refunded.saturating_add(amount), tx_fee.charged);
+    }
+
+    /// Commit the currently open transaction fee by moving the final recorded amount into the fees
+    /// charged for the current block.
+    ///
+    /// Note that this does not perform any state modifications and the caller is assumed to apply
+    /// any updates after calling this method.
+    #[must_use = "fee updates should be applied after calling commit"]
+    pub fn commit_tx(&mut self) -> FeeUpdates {
+        let tx_fee = self.tx_fee.take().unwrap_or_default();
+        if tx_fee.amount() > 0 {
+            let block_fees = self
+                .block_fees
+                .entry(tx_fee.denomination.clone())
+                .or_default();
+
+            // Add to per-block accumulator.
+            *block_fees = block_fees
+                .checked_add(tx_fee.amount())
+                .expect("should never overflow");
+        }
+
+        FeeUpdates {
+            payer: tx_fee.payer,
+            refund: token::BaseUnits::new(tx_fee.refunded, tx_fee.denomination),
+        }
+    }
+
+    /// Commit the fees accumulated for the current block, returning the resulting map.
+    ///
+    /// Note that this does not perform any state modifications and the caller is assumed to apply
+    /// any updates after calling this method.
+    #[must_use = "accumulated fees should be applied after calling commit"]
+    pub fn commit_block(self) -> BTreeMap<token::Denomination, u128> {
+        self.block_fees
+    }
+}
+
+/// Fee updates to apply to state after `commit_tx`.
+///
+/// This assumes that the initial fee charge has already happened, see the description of
+/// `FeeManager::record_fee` for details.
+pub struct FeeUpdates {
+    /// Fee payer.
+    pub payer: Address,
+    /// Amount that should be refunded to fee payer.
+    pub refund: token::BaseUnits,
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    use crate::{
+        testing::keys,
+        types::token::{self, Denomination},
+    };
+
+    #[test]
+    fn test_basic_refund() {
+        let mut mgr = FeeManager::new();
+
+        assert!(mgr.tx_fee().is_none());
+
+        // First transaction with refund.
+        let fee = token::BaseUnits::new(1_000_000, Denomination::NATIVE);
+        mgr.record_fee(keys::alice::address(), &fee);
+
+        let tx_fee = mgr.tx_fee().expect("tx_fee should be set");
+        assert_eq!(tx_fee.payer(), keys::alice::address());
+        assert_eq!(&tx_fee.denomination(), fee.denomination());
+        assert_eq!(tx_fee.amount(), fee.amount());
+
+        mgr.record_refund(400_000);
+
+        let tx_fee = mgr.tx_fee().expect("tx_fee should be set");
+        assert_eq!(tx_fee.payer(), keys::alice::address());
+        assert_eq!(&tx_fee.denomination(), fee.denomination());
+        assert_eq!(tx_fee.amount(), 600_000, "should take refund into account");
+
+        let fee_updates = mgr.commit_tx();
+        assert_eq!(fee_updates.payer, keys::alice::address());
+        assert_eq!(
+            fee_updates.refund,
+            token::BaseUnits::new(400_000, Denomination::NATIVE)
+        );
+        assert!(mgr.tx_fee().is_none());
+
+        // Some more transactions.
+        mgr.record_fee(
+            keys::bob::address(),
+            &token::BaseUnits::new(50_000, Denomination::NATIVE),
+        );
+        let fee_updates = mgr.commit_tx();
+        assert_eq!(fee_updates.payer, keys::bob::address());
+        assert_eq!(
+            fee_updates.refund,
+            token::BaseUnits::new(0, Denomination::NATIVE)
+        );
+
+        mgr.record_fee(
+            keys::dave::address(),
+            &token::BaseUnits::new(25_000, "TEST".parse().unwrap()),
+        );
+        mgr.record_fee(
+            keys::dave::address(),
+            &token::BaseUnits::new(5_000, "TEST".parse().unwrap()),
+        );
+        let fee_updates = mgr.commit_tx();
+        assert_eq!(fee_updates.payer, keys::dave::address());
+        assert_eq!(
+            fee_updates.refund,
+            token::BaseUnits::new(0, "TEST".parse().unwrap())
+        );
+
+        let block_fees = mgr.commit_block();
+        assert_eq!(block_fees.len(), 2);
+        assert_eq!(block_fees[&Denomination::NATIVE], 650_000);
+        assert_eq!(block_fees[&"TEST".parse().unwrap()], 30_000);
+    }
+
+    #[test]
+    fn test_refund_without_charge() {
+        let mut mgr = FeeManager::new();
+
+        mgr.record_refund(1_000);
+        assert!(
+            mgr.tx_fee().is_none(),
+            "refund should not be recorded if no charge"
+        );
+
+        let fee_updates = mgr.commit_tx();
+        assert_eq!(fee_updates.payer, Default::default());
+        assert_eq!(
+            fee_updates.refund,
+            token::BaseUnits::new(0, Default::default())
+        );
+
+        let block_fees = mgr.commit_block();
+        assert!(block_fees.is_empty(), "there should be no recorded fees");
+    }
+
+    #[test]
+    #[should_panic(expected = "transaction fee payer cannot change")]
+    fn test_fail_payer_change() {
+        let mut mgr = FeeManager::new();
+
+        let fee = token::BaseUnits::new(1_000_000, Denomination::NATIVE);
+        mgr.record_fee(keys::alice::address(), &fee);
+        mgr.record_fee(keys::bob::address(), &fee); // Should panic.
+    }
+
+    #[test]
+    #[should_panic(expected = "transaction fee denomination cannot change")]
+    fn test_fail_denomination_change() {
+        let mut mgr = FeeManager::new();
+
+        let fee = token::BaseUnits::new(1_000_000, Denomination::NATIVE);
+        mgr.record_fee(keys::alice::address(), &fee);
+
+        let fee = token::BaseUnits::new(1_000_000, "TEST".parse().unwrap());
+        mgr.record_fee(keys::alice::address(), &fee); // Should panic.
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/accounts/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/accounts/mod.rs.html new file mode 100644 index 0000000000..6a6caac515 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/accounts/mod.rs.html @@ -0,0 +1,2303 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+
//! Accounts module.
+use std::{
+    cmp::Ordering,
+    collections::{BTreeMap, BTreeSet},
+    convert::TryInto,
+};
+
+use num_traits::Zero;
+use once_cell::sync::Lazy;
+use thiserror::Error;
+
+use crate::{
+    context::Context,
+    core::common::quantity::Quantity,
+    handler, migration,
+    module::{self, FeeProxyHandler, Module as _, Parameters as _},
+    modules,
+    modules::core::{Error as CoreError, API as _},
+    runtime::Runtime,
+    sdk_derive,
+    sender::SenderMeta,
+    state::CurrentState,
+    storage,
+    storage::Prefix,
+    types::{
+        address::{Address, SignatureAddressSpec},
+        token,
+        transaction::{AuthInfo, Transaction},
+    },
+};
+
+pub mod fee;
+#[cfg(test)]
+pub(crate) mod test;
+pub mod types;
+
+/// Unique module name.
+const MODULE_NAME: &str = "accounts";
+
+/// Maximum delta that the transaction nonce can be in the future from the current nonce to still
+/// be accepted during transaction checks.
+const MAX_CHECK_NONCE_FUTURE_DELTA: u64 = 0; // Increase once supported in Oasis Core.
+
+/// Errors emitted by the accounts module.
+#[derive(Error, Debug, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("invalid argument")]
+    #[sdk_error(code = 1)]
+    InvalidArgument,
+
+    #[error("insufficient balance")]
+    #[sdk_error(code = 2)]
+    InsufficientBalance,
+
+    #[error("forbidden by policy")]
+    #[sdk_error(code = 3)]
+    Forbidden,
+
+    #[error("not found")]
+    #[sdk_error(code = 4)]
+    NotFound,
+
+    #[error("core: {0}")]
+    #[sdk_error(transparent)]
+    Core(#[from] modules::core::Error),
+}
+
+/// Events emitted by the accounts module.
+#[derive(Debug, cbor::Encode, oasis_runtime_sdk_macros::Event)]
+#[cbor(untagged)]
+pub enum Event {
+    #[sdk_event(code = 1)]
+    Transfer {
+        from: Address,
+        to: Address,
+        amount: token::BaseUnits,
+    },
+
+    #[sdk_event(code = 2)]
+    Burn {
+        owner: Address,
+        amount: token::BaseUnits,
+    },
+
+    #[sdk_event(code = 3)]
+    Mint {
+        owner: Address,
+        amount: token::BaseUnits,
+    },
+}
+
+/// Gas costs.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct GasCosts {
+    pub tx_transfer: u64,
+}
+
+/// Parameters for the accounts module.
+#[derive(Clone, Default, Debug, cbor::Encode, cbor::Decode)]
+pub struct Parameters {
+    pub transfers_disabled: bool,
+    pub gas_costs: GasCosts,
+
+    #[cbor(optional)]
+    pub debug_disable_nonce_check: bool,
+
+    #[cbor(optional)]
+    pub denomination_infos: BTreeMap<token::Denomination, types::DenominationInfo>,
+}
+
+/// Errors emitted during rewards parameter validation.
+#[derive(Error, Debug)]
+pub enum ParameterValidationError {
+    #[error("debug option used: {0}")]
+    DebugOptionUsed(String),
+}
+
+impl module::Parameters for Parameters {
+    type Error = ParameterValidationError;
+
+    #[cfg(not(feature = "unsafe-allow-debug"))]
+    fn validate_basic(&self) -> Result<(), Self::Error> {
+        if self.debug_disable_nonce_check {
+            return Err(ParameterValidationError::DebugOptionUsed(
+                "debug_disable_nonce_check".to_string(),
+            ));
+        }
+
+        Ok(())
+    }
+}
+
+/// Genesis state for the accounts module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Genesis {
+    pub parameters: Parameters,
+    pub accounts: BTreeMap<Address, types::Account>,
+    pub balances: BTreeMap<Address, BTreeMap<token::Denomination, u128>>,
+    pub total_supplies: BTreeMap<token::Denomination, u128>,
+}
+
+/// Interface that can be called from other modules.
+pub trait API {
+    /// Transfer an amount from one account to the other.
+    fn transfer(from: Address, to: Address, amount: &token::BaseUnits) -> Result<(), Error>;
+
+    /// Transfer an amount from one account to the other without emitting an event.
+    fn transfer_silent(from: Address, to: Address, amount: &token::BaseUnits) -> Result<(), Error>;
+
+    /// Mint new tokens, increasing the total supply.
+    fn mint(to: Address, amount: &token::BaseUnits) -> Result<(), Error>;
+
+    /// Burn existing tokens, decreasing the total supply.
+    fn burn(from: Address, amount: &token::BaseUnits) -> Result<(), Error>;
+
+    /// Sets an account's nonce.
+    fn set_nonce(address: Address, nonce: u64);
+
+    /// Fetch an account's current nonce.
+    fn get_nonce(address: Address) -> Result<u64, Error>;
+
+    /// Increments an account's nonce.
+    fn inc_nonce(address: Address);
+
+    /// Sets an account's balance of the given denomination.
+    ///
+    /// # Warning
+    ///
+    /// This method is dangerous as it can result in invariant violations.
+    fn set_balance(address: Address, amount: &token::BaseUnits);
+
+    /// Fetch an account's balance of the given denomination.
+    fn get_balance(address: Address, denomination: token::Denomination) -> Result<u128, Error>;
+
+    /// Ensures that the given account has at least the specified balance.
+    fn ensure_balance(address: Address, amount: &token::BaseUnits) -> Result<(), Error> {
+        let balance = Self::get_balance(address, amount.denomination().clone())?;
+        if balance < amount.amount() {
+            Err(Error::InsufficientBalance)
+        } else {
+            Ok(())
+        }
+    }
+
+    /// Fetch an account's current balances.
+    fn get_balances(address: Address) -> Result<types::AccountBalances, Error>;
+
+    /// Fetch addresses.
+    fn get_addresses(denomination: token::Denomination) -> Result<Vec<Address>, Error>;
+
+    /// Fetch total supplies.
+    fn get_total_supplies() -> Result<BTreeMap<token::Denomination, u128>, Error>;
+
+    /// Sets the total supply for the given denomination.
+    ///
+    /// # Warning
+    ///
+    /// This method is dangerous as it can result in invariant violations.
+    fn set_total_supply(amount: &token::BaseUnits);
+
+    /// Fetch information about a denomination.
+    fn get_denomination_info(
+        denomination: &token::Denomination,
+    ) -> Result<types::DenominationInfo, Error>;
+
+    /// Moves the amount into the per-transaction fee accumulator.
+    fn charge_tx_fee(from: Address, amount: &token::BaseUnits) -> Result<(), modules::core::Error>;
+
+    /// Indicates that the unused portion of the transaction fee should be refunded after the
+    /// transaction completes (even in case it fails).
+    fn set_refund_unused_tx_fee(refund: bool);
+
+    /// Take the flag indicating that the unused portion of the transaction fee should be refunded
+    /// after the transaction completes is set.
+    ///
+    /// After calling this method the flag is reset to `false`.
+    fn take_refund_unused_tx_fee() -> bool;
+
+    /// Check transaction signer account nonces.
+    /// Return payer address.
+    fn check_signer_nonces<C: Context>(
+        ctx: &C,
+        tx_auth_info: &AuthInfo,
+    ) -> Result<Address, modules::core::Error>;
+
+    /// Update transaction signer account nonces.
+    fn update_signer_nonces<C: Context>(
+        ctx: &C,
+        tx_auth_info: &AuthInfo,
+    ) -> Result<(), modules::core::Error>;
+}
+
+/// State schema constants.
+pub mod state {
+    /// Map of account addresses to account metadata.
+    pub const ACCOUNTS: &[u8] = &[0x01];
+    /// Map of account addresses to map of denominations to balances.
+    pub const BALANCES: &[u8] = &[0x02];
+    /// Map of total supplies (per denomination).
+    pub const TOTAL_SUPPLY: &[u8] = &[0x03];
+}
+
+pub struct Module;
+
+/// Module's address that has the common pool.
+///
+/// oasis1qz78phkdan64g040cvqvqpwkplfqf6tj6uwcsh30
+pub static ADDRESS_COMMON_POOL: Lazy<Address> =
+    Lazy::new(|| Address::from_module(MODULE_NAME, "common-pool"));
+/// Module's address that has the fee accumulator.
+///
+/// oasis1qp3r8hgsnphajmfzfuaa8fhjag7e0yt35cjxq0u4
+pub static ADDRESS_FEE_ACCUMULATOR: Lazy<Address> =
+    Lazy::new(|| Address::from_module(MODULE_NAME, "fee-accumulator"));
+
+/// This is needed to properly iterate over the BALANCES map.
+#[derive(Clone, PartialEq, PartialOrd, Eq, Ord)]
+struct AddressWithDenomination(Address, token::Denomination);
+
+#[derive(Error, Debug)]
+enum AWDError {
+    #[error("malformed address")]
+    MalformedAddress,
+
+    #[error("malformed denomination")]
+    MalformedDenomination,
+}
+
+impl std::convert::TryFrom<&[u8]> for AddressWithDenomination {
+    type Error = AWDError;
+
+    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> {
+        let address =
+            Address::try_from(&bytes[..Address::SIZE]).map_err(|_| AWDError::MalformedAddress)?;
+        let denomination = token::Denomination::try_from(&bytes[Address::SIZE..])
+            .map_err(|_| AWDError::MalformedDenomination)?;
+        Ok(AddressWithDenomination(address, denomination))
+    }
+}
+
+impl Module {
+    /// Add given amount of tokens to the specified account's balance.
+    fn add_amount(addr: Address, amount: &token::BaseUnits) -> Result<(), Error> {
+        if amount.amount() == 0 {
+            return Ok(());
+        }
+
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let balances = storage::PrefixStore::new(store, &state::BALANCES);
+            let mut account = storage::TypedStore::new(storage::PrefixStore::new(balances, &addr));
+            let mut value: u128 = account.get(amount.denomination()).unwrap_or_default();
+
+            value = value
+                .checked_add(amount.amount())
+                .ok_or(Error::InvalidArgument)?;
+            account.insert(amount.denomination(), value);
+            Ok(())
+        })
+    }
+
+    /// Subtract given amount of tokens from the specified account's balance.
+    fn sub_amount(addr: Address, amount: &token::BaseUnits) -> Result<(), Error> {
+        if amount.amount() == 0 {
+            return Ok(());
+        }
+
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let balances = storage::PrefixStore::new(store, &state::BALANCES);
+            let mut account = storage::TypedStore::new(storage::PrefixStore::new(balances, &addr));
+            let mut value: u128 = account.get(amount.denomination()).unwrap_or_default();
+
+            value = value
+                .checked_sub(amount.amount())
+                .ok_or(Error::InsufficientBalance)?;
+            account.insert(amount.denomination(), value);
+            Ok(())
+        })
+    }
+
+    /// Increment the total supply for the given amount.
+    fn inc_total_supply(amount: &token::BaseUnits) -> Result<(), Error> {
+        if amount.amount() == 0 {
+            return Ok(());
+        }
+
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut total_supplies =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::TOTAL_SUPPLY));
+            let mut total_supply: u128 = total_supplies
+                .get(amount.denomination())
+                .unwrap_or_default();
+
+            total_supply = total_supply
+                .checked_add(amount.amount())
+                .ok_or(Error::InvalidArgument)?;
+            total_supplies.insert(amount.denomination(), total_supply);
+            Ok(())
+        })
+    }
+
+    /// Decrement the total supply for the given amount.
+    fn dec_total_supply(amount: &token::BaseUnits) -> Result<(), Error> {
+        if amount.amount() == 0 {
+            return Ok(());
+        }
+
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut total_supplies =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::TOTAL_SUPPLY));
+            let mut total_supply: u128 = total_supplies
+                .get(amount.denomination())
+                .unwrap_or_default();
+
+            total_supply = total_supply
+                .checked_sub(amount.amount())
+                .ok_or(Error::InsufficientBalance)?;
+            total_supplies.insert(amount.denomination(), total_supply);
+            Ok(())
+        })
+    }
+
+    /// Get all balances.
+    fn get_all_balances() -> Result<BTreeMap<Address, BTreeMap<token::Denomination, u128>>, Error> {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let balances =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::BALANCES));
+
+            // Unfortunately, we can't just return balances.iter().collect() here,
+            // because the stored format doesn't match -- we need this workaround
+            // instead.
+
+            let balmap: BTreeMap<AddressWithDenomination, u128> = balances.iter().collect();
+
+            let mut b: BTreeMap<Address, BTreeMap<token::Denomination, u128>> = BTreeMap::new();
+
+            for (addrden, amt) in &balmap {
+                let addr = &addrden.0;
+                let den = &addrden.1;
+
+                // Fetch existing account's balances or insert blank ones.
+                let addr_bals = b.entry(*addr).or_default();
+
+                // Add to given denomination's balance or insert it if new.
+                addr_bals
+                    .entry(den.clone())
+                    .and_modify(|a| *a += amt)
+                    .or_insert_with(|| *amt);
+            }
+
+            Ok(b)
+        })
+    }
+}
+
+/// Context key for the per-transaction unused fee refund decision.
+const CONTEXT_KEY_TX_FEE_REFUND_UNUSED: &str = "accounts.TxRefundUnusedFee";
+/// Context key for the per block fee manager.
+const CONTEXT_KEY_FEE_MANAGER: &str = "accounts.FeeManager";
+
+impl API for Module {
+    fn transfer(from: Address, to: Address, amount: &token::BaseUnits) -> Result<(), Error> {
+        if CurrentState::with_env(|env| env.is_check_only()) || amount.amount() == 0 {
+            return Ok(());
+        }
+
+        Self::transfer_silent(from, to, amount)?;
+
+        // Emit a transfer event.
+        CurrentState::with(|state| {
+            state.emit_event(Event::Transfer {
+                from,
+                to,
+                amount: amount.clone(),
+            })
+        });
+
+        Ok(())
+    }
+
+    fn transfer_silent(from: Address, to: Address, amount: &token::BaseUnits) -> Result<(), Error> {
+        // Subtract from source account.
+        Self::sub_amount(from, amount)?;
+        // Add to destination account.
+        Self::add_amount(to, amount)?;
+
+        Ok(())
+    }
+
+    fn mint(to: Address, amount: &token::BaseUnits) -> Result<(), Error> {
+        if CurrentState::with_env(|env| env.is_check_only()) || amount.amount() == 0 {
+            return Ok(());
+        }
+
+        // Add to destination account.
+        Self::add_amount(to, amount)?;
+
+        // Increase total supply.
+        Self::inc_total_supply(amount)?;
+
+        // Emit a mint event.
+        CurrentState::with(|state| {
+            state.emit_event(Event::Mint {
+                owner: to,
+                amount: amount.clone(),
+            });
+        });
+
+        Ok(())
+    }
+
+    fn burn(from: Address, amount: &token::BaseUnits) -> Result<(), Error> {
+        if CurrentState::with_env(|env| env.is_check_only()) || amount.amount() == 0 {
+            return Ok(());
+        }
+
+        // Remove from target account.
+        Self::sub_amount(from, amount)?;
+
+        // Decrease total supply.
+        Self::dec_total_supply(amount)
+            .expect("target account had enough balance so total supply should not underflow");
+
+        // Emit a burn event.
+        CurrentState::with(|state| {
+            state.emit_event(Event::Burn {
+                owner: from,
+                amount: amount.clone(),
+            });
+        });
+
+        Ok(())
+    }
+
+    fn set_nonce(address: Address, nonce: u64) {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut accounts =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::ACCOUNTS));
+            let mut account: types::Account = accounts.get(address).unwrap_or_default();
+            account.nonce = nonce;
+            accounts.insert(address, account);
+        })
+    }
+
+    fn get_nonce(address: Address) -> Result<u64, Error> {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let accounts =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::ACCOUNTS));
+            let account: types::Account = accounts.get(address).unwrap_or_default();
+            Ok(account.nonce)
+        })
+    }
+
+    fn inc_nonce(address: Address) {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut accounts =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::ACCOUNTS));
+            let mut account: types::Account = accounts.get(address).unwrap_or_default();
+            account.nonce = account.nonce.saturating_add(1);
+            accounts.insert(address, account);
+        })
+    }
+
+    fn set_balance(address: Address, amount: &token::BaseUnits) {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let balances = storage::PrefixStore::new(store, &state::BALANCES);
+            let mut account =
+                storage::TypedStore::new(storage::PrefixStore::new(balances, &address));
+            account.insert(amount.denomination(), amount.amount());
+        });
+    }
+
+    fn get_balance(address: Address, denomination: token::Denomination) -> Result<u128, Error> {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let balances = storage::PrefixStore::new(store, &state::BALANCES);
+            let account = storage::TypedStore::new(storage::PrefixStore::new(balances, &address));
+
+            Ok(account.get(denomination).unwrap_or_default())
+        })
+    }
+
+    fn get_balances(address: Address) -> Result<types::AccountBalances, Error> {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let balances = storage::PrefixStore::new(store, &state::BALANCES);
+            let account = storage::TypedStore::new(storage::PrefixStore::new(balances, &address));
+
+            Ok(types::AccountBalances {
+                balances: account.iter().collect(),
+            })
+        })
+    }
+
+    fn get_addresses(denomination: token::Denomination) -> Result<Vec<Address>, Error> {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let balances: BTreeMap<AddressWithDenomination, Quantity> =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::BALANCES))
+                    .iter()
+                    .collect();
+
+            Ok(balances
+                .into_keys()
+                .filter(|bal| bal.1 == denomination)
+                .map(|bal| bal.0)
+                .collect())
+        })
+    }
+
+    fn get_total_supplies() -> Result<BTreeMap<token::Denomination, u128>, Error> {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let ts =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::TOTAL_SUPPLY));
+
+            Ok(ts.iter().collect())
+        })
+    }
+
+    fn set_total_supply(amount: &token::BaseUnits) {
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut total_supplies =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::TOTAL_SUPPLY));
+            total_supplies.insert(amount.denomination(), amount.amount());
+        });
+    }
+
+    fn get_denomination_info(
+        denomination: &token::Denomination,
+    ) -> Result<types::DenominationInfo, Error> {
+        Self::params()
+            .denomination_infos
+            .get(denomination)
+            .cloned()
+            .ok_or(Error::NotFound)
+    }
+
+    fn charge_tx_fee(from: Address, amount: &token::BaseUnits) -> Result<(), modules::core::Error> {
+        if CurrentState::with_env(|env| env.is_simulation()) {
+            return Ok(());
+        }
+
+        Self::sub_amount(from, amount).map_err(|_| modules::core::Error::InsufficientFeeBalance)?;
+
+        CurrentState::with(|state| {
+            state
+                .block_value::<fee::FeeManager>(CONTEXT_KEY_FEE_MANAGER)
+                .or_default()
+                .record_fee(from, amount);
+        });
+
+        Ok(())
+    }
+
+    fn set_refund_unused_tx_fee(refund: bool) {
+        CurrentState::with(|state| {
+            if state.env().is_simulation() {
+                return;
+            }
+
+            state
+                .block_value(CONTEXT_KEY_TX_FEE_REFUND_UNUSED)
+                .set(refund);
+        });
+    }
+
+    fn take_refund_unused_tx_fee() -> bool {
+        CurrentState::with(|state| {
+            if state.env().is_simulation() {
+                return false;
+            }
+
+            state
+                .block_value(CONTEXT_KEY_TX_FEE_REFUND_UNUSED)
+                .take()
+                .unwrap_or(false)
+        })
+    }
+
+    fn check_signer_nonces<C: Context>(
+        _ctx: &C,
+        auth_info: &AuthInfo,
+    ) -> Result<Address, modules::core::Error> {
+        let is_pre_schedule = CurrentState::with_env(|env| env.is_pre_schedule());
+        let is_check_only = CurrentState::with_env(|env| env.is_check_only());
+
+        // TODO: Optimize the check/update pair so that the accounts are
+        // fetched only once.
+        let params = Self::params();
+        let sender = CurrentState::with_store(|store| {
+            // Fetch information about each signer.
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let accounts =
+                storage::TypedStore::new(storage::PrefixStore::new(&mut store, &state::ACCOUNTS));
+            let mut sender = None;
+            for si in auth_info.signer_info.iter() {
+                let address = si.address_spec.address();
+                let account: types::Account = accounts.get(address).unwrap_or_default();
+
+                // First signer pays for the fees and is considered the sender.
+                if sender.is_none() {
+                    sender = Some(SenderMeta {
+                        address,
+                        tx_nonce: si.nonce,
+                        state_nonce: account.nonce,
+                    });
+                }
+
+                // When nonce checking is disabled, skip the rest of the checks.
+                if params.debug_disable_nonce_check {
+                    continue;
+                }
+
+                // Check signer nonce against the corresponding account nonce.
+                match si.nonce.cmp(&account.nonce) {
+                    Ordering::Less => {
+                        // In the past and will never become valid, reject.
+                        return Err(modules::core::Error::InvalidNonce);
+                    }
+                    Ordering::Equal => {} // Ok.
+                    Ordering::Greater => {
+                        // If too much in the future, reject.
+                        if si.nonce - account.nonce > MAX_CHECK_NONCE_FUTURE_DELTA {
+                            return Err(modules::core::Error::InvalidNonce);
+                        }
+
+                        // If in the future and this is before scheduling, reject with separate error
+                        // that will make the scheduler skip the transaction.
+                        if is_pre_schedule {
+                            return Err(modules::core::Error::FutureNonce);
+                        }
+
+                        // If in the future and this is during execution, reject.
+                        if !is_check_only {
+                            return Err(modules::core::Error::InvalidNonce);
+                        }
+
+                        // If in the future and this is during checks, accept.
+                    }
+                }
+            }
+
+            Ok(sender)
+        })?;
+
+        // Configure the sender.
+        let sender = sender.expect("at least one signer is always present");
+        let sender_address = sender.address;
+        if is_check_only {
+            <C::Runtime as Runtime>::Core::set_sender_meta(sender);
+        }
+
+        Ok(sender_address)
+    }
+
+    fn update_signer_nonces<C: Context>(
+        _ctx: &C,
+        auth_info: &AuthInfo,
+    ) -> Result<(), modules::core::Error> {
+        CurrentState::with_store(|store| {
+            // Fetch information about each signer.
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut accounts =
+                storage::TypedStore::new(storage::PrefixStore::new(&mut store, &state::ACCOUNTS));
+            for si in auth_info.signer_info.iter() {
+                let address = si.address_spec.address();
+                let mut account: types::Account = accounts.get(address).unwrap_or_default();
+
+                // Update nonce.
+                account.nonce = account
+                    .nonce
+                    .checked_add(1)
+                    .ok_or(modules::core::Error::InvalidNonce)?; // Should never overflow.
+                accounts.insert(address, account);
+            }
+            Ok(())
+        })
+    }
+}
+
+#[sdk_derive(Module)]
+impl Module {
+    const NAME: &'static str = MODULE_NAME;
+    type Error = Error;
+    type Event = Event;
+    type Parameters = Parameters;
+    type Genesis = Genesis;
+
+    #[migration(init)]
+    pub fn init(genesis: Genesis) {
+        CurrentState::with_store(|store| {
+            // Create accounts.
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut accounts =
+                storage::TypedStore::new(storage::PrefixStore::new(&mut store, &state::ACCOUNTS));
+            for (address, account) in genesis.accounts {
+                accounts.insert(address, account);
+            }
+
+            // Create balances.
+            let mut balances = storage::PrefixStore::new(&mut store, &state::BALANCES);
+            let mut computed_total_supply: BTreeMap<token::Denomination, u128> = BTreeMap::new();
+            for (address, denominations) in genesis.balances.iter() {
+                let mut account =
+                    storage::TypedStore::new(storage::PrefixStore::new(&mut balances, &address));
+                for (denomination, value) in denominations {
+                    account.insert(denomination, value);
+
+                    // Update computed total supply.
+                    computed_total_supply
+                        .entry(denomination.clone())
+                        .and_modify(|v| *v += value)
+                        .or_insert_with(|| *value);
+                }
+            }
+
+            // Validate and set total supply.
+            let mut total_supplies = storage::TypedStore::new(storage::PrefixStore::new(
+                &mut store,
+                &state::TOTAL_SUPPLY,
+            ));
+            for (denomination, total_supply) in genesis.total_supplies.iter() {
+                let computed = computed_total_supply
+                    .remove(denomination)
+                    .expect("unexpected total supply");
+                assert!(
+                    &computed == total_supply,
+                    "unexpected total supply (expected: {total_supply} got: {computed})",
+                );
+
+                total_supplies.insert(denomination, total_supply);
+            }
+            if let Some((denomination, total_supply)) = computed_total_supply.iter().next() {
+                panic!("missing expected total supply: {total_supply} {denomination}",);
+            }
+        });
+
+        // Validate genesis parameters.
+        genesis
+            .parameters
+            .validate_basic()
+            .expect("invalid genesis parameters");
+
+        // Set genesis parameters.
+        Self::set_params(genesis.parameters);
+    }
+
+    #[handler(prefetch = "accounts.Transfer")]
+    fn prefetch_transfer(
+        add_prefix: &mut dyn FnMut(Prefix),
+        body: cbor::Value,
+        auth_info: &AuthInfo,
+    ) -> Result<(), crate::error::RuntimeError> {
+        let args: types::Transfer = cbor::from_value(body).map_err(|_| Error::InvalidArgument)?;
+        let from = auth_info.signer_info[0].address_spec.address();
+
+        // Prefetch accounts 'to'.
+        add_prefix(Prefix::from(
+            [MODULE_NAME.as_bytes(), state::ACCOUNTS, args.to.as_ref()].concat(),
+        ));
+        add_prefix(Prefix::from(
+            [MODULE_NAME.as_bytes(), state::BALANCES, args.to.as_ref()].concat(),
+        ));
+        // Prefetch accounts 'from'.
+        add_prefix(Prefix::from(
+            [MODULE_NAME.as_bytes(), state::ACCOUNTS, from.as_ref()].concat(),
+        ));
+        add_prefix(Prefix::from(
+            [MODULE_NAME.as_bytes(), state::BALANCES, from.as_ref()].concat(),
+        ));
+
+        Ok(())
+    }
+
+    #[handler(call = "accounts.Transfer")]
+    fn tx_transfer<C: Context>(_ctx: &C, body: types::Transfer) -> Result<(), Error> {
+        let params = Self::params();
+
+        // Reject transfers when they are disabled.
+        if params.transfers_disabled {
+            return Err(Error::Forbidden);
+        }
+
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_transfer)?;
+
+        let tx_caller_address = CurrentState::with_env(|env| env.tx_caller_address());
+        Self::transfer(tx_caller_address, body.to, &body.amount)?;
+
+        Ok(())
+    }
+
+    #[handler(query = "accounts.Nonce")]
+    fn query_nonce<C: Context>(_ctx: &C, args: types::NonceQuery) -> Result<u64, Error> {
+        Self::get_nonce(args.address)
+    }
+
+    #[handler(query = "accounts.Addresses", expensive)]
+    fn query_addresses<C: Context>(
+        _ctx: &C,
+        args: types::AddressesQuery,
+    ) -> Result<Vec<Address>, Error> {
+        Self::get_addresses(args.denomination)
+    }
+
+    #[handler(query = "accounts.Balances")]
+    fn query_balances<C: Context>(
+        _ctx: &C,
+        args: types::BalancesQuery,
+    ) -> Result<types::AccountBalances, Error> {
+        Self::get_balances(args.address)
+    }
+
+    #[handler(query = "accounts.DenominationInfo")]
+    fn query_denomination_info<C: Context>(
+        _ctx: &C,
+        args: types::DenominationInfoQuery,
+    ) -> Result<types::DenominationInfo, Error> {
+        Self::get_denomination_info(&args.denomination)
+    }
+}
+
+impl module::TransactionHandler for Module {
+    fn authenticate_tx<C: Context>(
+        ctx: &C,
+        tx: &Transaction,
+    ) -> Result<module::AuthDecision, modules::core::Error> {
+        // Check nonces.
+        let default_payer = Self::check_signer_nonces(ctx, &tx.auth_info)?;
+
+        // Attempt to resolve a proxy fee payer if set.
+        let payer =
+            <C::Runtime as Runtime>::FeeProxy::resolve_payer(ctx, tx)?.unwrap_or(default_payer);
+
+        // Charge the specified amount of fees.
+        if !tx.auth_info.fee.amount.amount().is_zero() {
+            if CurrentState::with_env(|env| env.is_check_only()) {
+                // Do not update balances during transaction checks. In case of checks, only do it
+                // after all the other checks have already passed as otherwise retrying the
+                // transaction will not be possible.
+                Self::ensure_balance(payer, &tx.auth_info.fee.amount)
+                    .map_err(|_| modules::core::Error::InsufficientFeeBalance)?;
+
+                // Make sure to record the payer during transaction checks.
+                CurrentState::with(|state| {
+                    state
+                        .block_value::<fee::FeeManager>(CONTEXT_KEY_FEE_MANAGER)
+                        .or_default()
+                        .record_fee(payer, &tx.auth_info.fee.amount);
+                });
+            } else {
+                // Actually perform the move.
+                Self::charge_tx_fee(payer, &tx.auth_info.fee.amount)?;
+            }
+
+            let gas_price = tx.auth_info.fee.gas_price();
+            // Set transaction priority.
+            <C::Runtime as Runtime>::Core::set_priority(gas_price.try_into().unwrap_or(u64::MAX));
+        }
+
+        // Do not update nonces early during transaction checks. In case of checks, only do it after
+        // all the other checks have already passed as otherwise retrying the transaction will not
+        // be possible.
+        if !CurrentState::with_env(|env| env.is_check_only()) {
+            Self::update_signer_nonces(ctx, &tx.auth_info)?;
+        }
+
+        Ok(module::AuthDecision::Continue)
+    }
+
+    fn after_handle_call<C: Context>(
+        _ctx: &C,
+        result: module::CallResult,
+    ) -> Result<module::CallResult, modules::core::Error> {
+        // Check whether unused part of the fee should be refunded.
+        let refund_fee = if Self::take_refund_unused_tx_fee() {
+            let remaining_gas = <C::Runtime as Runtime>::Core::remaining_tx_gas();
+            let gas_price = CurrentState::with_env(|env| env.tx_auth_info().fee.gas_price());
+
+            gas_price.saturating_mul(remaining_gas.into())
+        } else {
+            0
+        };
+
+        CurrentState::with(|state| {
+            let mgr = state
+                .block_value::<fee::FeeManager>(CONTEXT_KEY_FEE_MANAGER)
+                .or_default();
+
+            // Update the per-tx fee accumulator. State must be updated in `after_dispatch_tx` as
+            // otherwise any state updates may be reverted in case call result is a failure.
+            mgr.record_refund(refund_fee);
+
+            // Emit event for paid fee.
+            let tx_fee = mgr.tx_fee().cloned().unwrap_or_default();
+            if tx_fee.amount() > 0 {
+                state.emit_unconditional_event(Event::Transfer {
+                    from: tx_fee.payer(),
+                    to: *ADDRESS_FEE_ACCUMULATOR,
+                    amount: token::BaseUnits::new(tx_fee.amount(), tx_fee.denomination()),
+                });
+            }
+        });
+
+        Ok(result)
+    }
+
+    fn after_dispatch_tx<C: Context>(
+        ctx: &C,
+        tx_auth_info: &AuthInfo,
+        result: &module::CallResult,
+    ) {
+        // Move transaction fees into the per-block fee accumulator.
+        let fee_updates = CurrentState::with(|state| {
+            let mgr = state
+                .block_value::<fee::FeeManager>(CONTEXT_KEY_FEE_MANAGER)
+                .or_default();
+            mgr.commit_tx()
+        });
+        // Refund any fees. This needs to happen after tx dispatch to ensure state is updated.
+        Self::add_amount(fee_updates.payer, &fee_updates.refund).unwrap();
+
+        if !CurrentState::with_env(|env| env.is_check_only()) {
+            // Do nothing further outside transaction checks.
+            return;
+        }
+        if !matches!(result, module::CallResult::Ok(_)) {
+            // Do nothing in case the call failed to allow retries.
+            return;
+        }
+
+        // Update payer balance.
+        Self::sub_amount(fee_updates.payer, &tx_auth_info.fee.amount).unwrap(); // Already checked.
+
+        // Update nonces.
+        Self::update_signer_nonces(ctx, tx_auth_info).unwrap();
+    }
+}
+
+impl module::BlockHandler for Module {
+    fn end_block<C: Context>(ctx: &C) {
+        // Determine the fees that are available for disbursement from the last block.
+        let mut previous_fees = Self::get_balances(*ADDRESS_FEE_ACCUMULATOR)
+            .expect("get_balances must succeed")
+            .balances;
+
+        // Drain previous fees from the fee accumulator.
+        for (denom, remainder) in &previous_fees {
+            Self::sub_amount(
+                *ADDRESS_FEE_ACCUMULATOR,
+                &token::BaseUnits::new(*remainder, denom.clone()),
+            )
+            .expect("sub_amount must succeed");
+        }
+
+        // Disburse transaction fees to entities controlling all the good nodes in the committee.
+        let addrs: Vec<Address> = ctx
+            .runtime_round_results()
+            .good_compute_entities
+            .iter()
+            .map(|pk| Address::from_sigspec(&SignatureAddressSpec::Ed25519(pk.into())))
+            .collect();
+
+        if !addrs.is_empty() {
+            let amounts: Vec<_> = previous_fees
+                .iter()
+                .filter_map(|(denom, fee)| {
+                    let fee = fee
+                        .checked_div(addrs.len() as u128)
+                        .expect("addrs is non-empty");
+
+                    // Filter out zero-fee entries to avoid needless operations.
+                    if fee.is_zero() {
+                        None
+                    } else {
+                        Some(token::BaseUnits::new(fee, denom.clone()))
+                    }
+                })
+                .collect();
+
+            for address in addrs {
+                for amount in &amounts {
+                    let remaining = previous_fees
+                        .get_mut(amount.denomination())
+                        .expect("designated denomination should be there");
+                    *remaining = remaining
+                        .checked_sub(amount.amount())
+                        .expect("there should be enough to disburse");
+
+                    Self::add_amount(address, amount)
+                        .expect("add_amount must succeed for fee disbursement");
+
+                    // Emit transfer event for fee disbursement.
+                    CurrentState::with(|state| {
+                        state.emit_event(Event::Transfer {
+                            from: *ADDRESS_FEE_ACCUMULATOR,
+                            to: address,
+                            amount: amount.clone(),
+                        });
+                    });
+                }
+            }
+        }
+
+        // Transfer remainder to a common pool account.
+        for (denom, remainder) in previous_fees.into_iter() {
+            if remainder.is_zero() {
+                continue;
+            }
+
+            let amount = token::BaseUnits::new(remainder, denom);
+            Self::add_amount(*ADDRESS_COMMON_POOL, &amount)
+                .expect("add_amount must succeed for transfer to common pool");
+
+            // Emit transfer event for fee disbursement.
+            CurrentState::with(|state| {
+                state.emit_event(Event::Transfer {
+                    from: *ADDRESS_FEE_ACCUMULATOR,
+                    to: *ADDRESS_COMMON_POOL,
+                    amount,
+                })
+            });
+        }
+
+        // Fees for the active block should be transferred to the fee accumulator address.
+        let block_fees = CurrentState::with(|state| {
+            let mgr = state
+                .block_value::<fee::FeeManager>(CONTEXT_KEY_FEE_MANAGER)
+                .take()
+                .unwrap_or_default();
+            mgr.commit_block().into_iter()
+        });
+
+        for (denom, amount) in block_fees {
+            Self::add_amount(
+                *ADDRESS_FEE_ACCUMULATOR,
+                &token::BaseUnits::new(amount, denom),
+            )
+            .expect("add_amount must succeed for transfer to fee accumulator")
+        }
+    }
+}
+
+impl module::InvariantHandler for Module {
+    /// Check invariants.
+    fn check_invariants<C: Context>(_ctx: &C) -> Result<(), CoreError> {
+        // All account balances should sum up to the total supply for their
+        // corresponding denominations.
+
+        #[allow(clippy::or_fun_call)]
+        let balances = Self::get_all_balances().or(Err(CoreError::InvariantViolation(
+            "unable to get balances of all accounts".to_string(),
+        )))?;
+        #[allow(clippy::or_fun_call)]
+        let total_supplies = Self::get_total_supplies().or(Err(CoreError::InvariantViolation(
+            "unable to get total supplies".to_string(),
+        )))?;
+
+        // First, compute total supplies based on account balances.
+        let mut computed_ts: BTreeMap<token::Denomination, u128> = BTreeMap::new();
+
+        for bals in balances.values() {
+            for (den, amt) in bals {
+                computed_ts
+                    .entry(den.clone())
+                    .and_modify(|a| *a += amt)
+                    .or_insert_with(|| *amt);
+            }
+        }
+
+        // Now check if the computed and given total supplies match.
+        for (den, ts) in &total_supplies {
+            // Return error if total supplies have a denomination that we
+            // didn't encounter when computing total supplies based on account
+            // balances.
+            #[allow(clippy::or_fun_call)]
+            let computed = computed_ts
+                .remove(den)
+                .ok_or(CoreError::InvariantViolation(
+                    "unexpected denomination".to_string(),
+                ))?;
+
+            if &computed != ts {
+                // Computed and actual total supplies don't match.
+                return Err(CoreError::InvariantViolation(format!(
+                    "computed and actual total supplies don't match (computed={computed}, actual={ts})",
+                )));
+            }
+        }
+
+        // There should be no remaining denominations in the computed supplies,
+        // because that would mean that accounts have denominations that don't
+        // appear in the total supplies table, which would obviously be wrong.
+        if computed_ts.is_empty() {
+            Ok(())
+        } else {
+            Err(CoreError::InvariantViolation(
+                "encountered denomination that isn't present in total supplies table".to_string(),
+            ))
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/accounts/types.rs.html b/rust/src/oasis_runtime_sdk/modules/accounts/types.rs.html new file mode 100644 index 0000000000..c1ff90552a --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/accounts/types.rs.html @@ -0,0 +1,111 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+
//! Account module types.
+use std::collections::BTreeMap;
+
+use crate::types::{address::Address, token};
+
+/// Transfer call.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Transfer {
+    pub to: Address,
+    pub amount: token::BaseUnits,
+}
+
+/// Account metadata.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Account {
+    #[cbor(optional)]
+    pub nonce: u64,
+}
+
+/// Arguments for the Nonce query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct NonceQuery {
+    pub address: Address,
+}
+
+/// Arguments for the Addresses query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct AddressesQuery {
+    pub denomination: token::Denomination,
+}
+
+/// Arguments for the Balances query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct BalancesQuery {
+    pub address: Address,
+}
+
+/// Balances in an account.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct AccountBalances {
+    pub balances: BTreeMap<token::Denomination, u128>,
+}
+
+/// Arguments for the DenominationInfo query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct DenominationInfoQuery {
+    pub denomination: token::Denomination,
+}
+
+/// Information about a denomination.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct DenominationInfo {
+    /// Number of decimals that the denomination is using.
+    pub decimals: u8,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/consensus/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/consensus/mod.rs.html new file mode 100644 index 0000000000..767a7a5e50 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/consensus/mod.rs.html @@ -0,0 +1,995 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+
//! Consensus module.
+//!
+//! Low level consensus module for communicating with the consensus layer.
+use std::{convert::TryInto, num::NonZeroUsize, str::FromStr, sync::Mutex};
+
+use oasis_runtime_sdk_macros::handler;
+use once_cell::sync::Lazy;
+use thiserror::Error;
+
+use oasis_core_runtime::{
+    common::{namespace::Namespace, versioned::Versioned},
+    consensus::{
+        beacon::EpochTime,
+        roothash::{Message, RoundRoots, StakingMessage},
+        staking,
+        staking::{Account as ConsensusAccount, Delegation as ConsensusDelegation},
+        state::{
+            beacon::ImmutableState as BeaconImmutableState,
+            roothash::ImmutableState as RoothashImmutableState,
+            staking::ImmutableState as StakingImmutableState, StateError,
+        },
+        HEIGHT_LATEST,
+    },
+};
+
+use crate::{
+    context::Context,
+    core::common::crypto::hash::Hash,
+    history, migration, module,
+    module::{Module as _, Parameters as _},
+    modules,
+    modules::core::API as _,
+    sdk_derive,
+    state::CurrentState,
+    types::{
+        address::{Address, SignatureAddressSpec},
+        message::MessageEventHookInvocation,
+        token,
+        transaction::{AddressSpec, CallerAddress},
+    },
+    Runtime,
+};
+
+#[cfg(test)]
+mod test;
+pub mod types;
+
+/// Unique module name.
+const MODULE_NAME: &str = "consensus";
+
+/// Gas costs.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct GasCosts {
+    /// Cost of the internal round_root call.
+    pub round_root: u64,
+}
+
+/// Parameters for the consensus module.
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct Parameters {
+    pub gas_costs: GasCosts,
+
+    pub consensus_denomination: token::Denomination,
+    pub consensus_scaling_factor: u64,
+
+    /// Minimum amount that is allowed to be delegated. This should be greater than or equal to what
+    /// is configured in the consensus layer as the consensus layer will do its own checks.
+    ///
+    /// The amount is in consensus units.
+    pub min_delegate_amount: u128,
+}
+
+impl Default for Parameters {
+    fn default() -> Self {
+        Self {
+            gas_costs: Default::default(),
+            consensus_denomination: token::Denomination::from_str("TEST").unwrap(),
+            consensus_scaling_factor: 1,
+            min_delegate_amount: 0,
+        }
+    }
+}
+
+/// Errors emitted during rewards parameter validation.
+#[derive(Error, Debug)]
+pub enum ParameterValidationError {
+    #[error("consensus scaling factor set to zero")]
+    ZeroScalingFactor,
+
+    #[error("consensus scaling factor is not a power of 10")]
+    ScalingFactorNotPowerOf10,
+}
+
+impl module::Parameters for Parameters {
+    type Error = ParameterValidationError;
+
+    fn validate_basic(&self) -> Result<(), Self::Error> {
+        if self.consensus_scaling_factor == 0 {
+            return Err(ParameterValidationError::ZeroScalingFactor);
+        }
+
+        let log = self.consensus_scaling_factor.ilog10();
+        if 10u64.pow(log) != self.consensus_scaling_factor {
+            return Err(ParameterValidationError::ScalingFactorNotPowerOf10);
+        }
+
+        Ok(())
+    }
+}
+/// Events emitted by the consensus module (none so far).
+#[derive(Debug, cbor::Encode, oasis_runtime_sdk_macros::Event)]
+#[cbor(untagged)]
+pub enum Event {}
+
+/// Genesis state for the consensus module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Genesis {
+    pub parameters: Parameters,
+}
+
+#[derive(Error, Debug, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("invalid argument")]
+    #[sdk_error(code = 1)]
+    InvalidArgument,
+
+    #[error("invalid denomination")]
+    #[sdk_error(code = 2)]
+    InvalidDenomination,
+
+    #[error("internal state: {0}")]
+    #[sdk_error(code = 3)]
+    InternalStateError(#[from] StateError),
+
+    #[error("core: {0}")]
+    #[sdk_error(transparent)]
+    Core(#[from] modules::core::Error),
+
+    #[error("consensus incompatible signer")]
+    #[sdk_error(code = 4)]
+    ConsensusIncompatibleSigner,
+
+    #[error("amount not representable")]
+    #[sdk_error(code = 5)]
+    AmountNotRepresentable,
+
+    #[error("amount is lower than the minimum delegation amount")]
+    #[sdk_error(code = 6)]
+    UnderMinDelegationAmount,
+
+    #[error("history: {0}")]
+    #[sdk_error(transparent)]
+    History(#[from] history::Error),
+}
+
+/// Interface that can be called from other modules.
+pub trait API {
+    /// Transfer an amount from the runtime account.
+    fn transfer<C: Context>(
+        ctx: &C,
+        to: Address,
+        amount: &token::BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error>;
+
+    /// Withdraw an amount into the runtime account.
+    fn withdraw<C: Context>(
+        ctx: &C,
+        from: Address,
+        amount: &token::BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error>;
+
+    /// Escrow an amount of the runtime account funds.
+    fn escrow<C: Context>(
+        ctx: &C,
+        to: Address,
+        amount: &token::BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error>;
+
+    /// Reclaim an amount of runtime staked shares.
+    fn reclaim_escrow<C: Context>(
+        ctx: &C,
+        from: Address,
+        amount: u128,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error>;
+
+    /// Returns consensus token denomination.
+    fn consensus_denomination() -> Result<token::Denomination, Error>;
+
+    /// Ensures transaction signer is consensus compatible.
+    fn ensure_compatible_tx_signer() -> Result<(), Error>;
+
+    /// Query consensus account info.
+    fn account<C: Context>(ctx: &C, addr: Address) -> Result<ConsensusAccount, Error>;
+
+    /// Query consensus delegation info.
+    fn delegation<C: Context>(
+        ctx: &C,
+        delegator_addr: Address,
+        escrow_addr: Address,
+    ) -> Result<ConsensusDelegation, Error>;
+
+    /// Convert runtime amount to consensus amount, scaling as needed.
+    fn amount_from_consensus<C: Context>(ctx: &C, amount: u128) -> Result<u128, Error>;
+
+    /// Convert consensus amount to runtime amount, scaling as needed.
+    fn amount_to_consensus<C: Context>(ctx: &C, amount: u128) -> Result<u128, Error>;
+
+    /// Determine consensus height corresponding to the given epoch transition. This query may be
+    /// expensive in case the epoch is far back.
+    fn height_for_epoch<C: Context>(ctx: &C, epoch: EpochTime) -> Result<u64, Error>;
+
+    /// Round roots return the round roots for the given runtime ID and round.
+    fn round_roots<C: Context>(
+        ctx: &C,
+        runtime_id: Namespace,
+        round: u64,
+    ) -> Result<Option<RoundRoots>, Error>;
+}
+
+pub struct Module;
+
+impl Module {
+    fn ensure_consensus_denomination(denomination: &token::Denomination) -> Result<(), Error> {
+        if denomination != &Self::consensus_denomination()? {
+            return Err(Error::InvalidDenomination);
+        }
+
+        Ok(())
+    }
+}
+
+#[sdk_derive(Module)]
+impl Module {
+    const NAME: &'static str = MODULE_NAME;
+    const VERSION: u32 = 1;
+    type Error = Error;
+    type Event = Event;
+    type Parameters = Parameters;
+    type Genesis = Genesis;
+
+    #[migration(init)]
+    pub fn init(genesis: Genesis) {
+        // Validate genesis parameters.
+        genesis
+            .parameters
+            .validate_basic()
+            .expect("invalid genesis parameters");
+
+        // Set genesis parameters.
+        Self::set_params(genesis.parameters);
+    }
+
+    #[handler(call = "consensus.RoundRoot", internal)]
+    fn internal_round_root<C: Context>(
+        ctx: &C,
+        body: types::RoundRootBody,
+    ) -> Result<Option<Hash>, Error> {
+        let params = Self::params();
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.round_root)?;
+
+        Ok(
+            Self::round_roots(ctx, body.runtime_id, body.round)?.map(|rr| match body.kind {
+                types::RootKind::IO => rr.io_root,
+                types::RootKind::State => rr.state_root,
+            }),
+        )
+    }
+}
+
+impl API for Module {
+    fn transfer<C: Context>(
+        ctx: &C,
+        to: Address,
+        amount: &token::BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error> {
+        Self::ensure_consensus_denomination(amount.denomination())?;
+        let amount = Self::amount_to_consensus(ctx, amount.amount())?;
+
+        CurrentState::with(|state| {
+            state.emit_message(
+                ctx,
+                Message::Staking(Versioned::new(
+                    0,
+                    StakingMessage::Transfer(staking::Transfer {
+                        to: to.into(),
+                        amount: amount.into(),
+                    }),
+                )),
+                hook,
+            )
+        })?;
+
+        Ok(())
+    }
+
+    fn withdraw<C: Context>(
+        ctx: &C,
+        from: Address,
+        amount: &token::BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error> {
+        Self::ensure_consensus_denomination(amount.denomination())?;
+        let amount = Self::amount_to_consensus(ctx, amount.amount())?;
+
+        CurrentState::with(|state| {
+            state.emit_message(
+                ctx,
+                Message::Staking(Versioned::new(
+                    0,
+                    StakingMessage::Withdraw(staking::Withdraw {
+                        from: from.into(),
+                        amount: amount.into(),
+                    }),
+                )),
+                hook,
+            )
+        })?;
+
+        Ok(())
+    }
+
+    fn escrow<C: Context>(
+        ctx: &C,
+        to: Address,
+        amount: &token::BaseUnits,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error> {
+        Self::ensure_consensus_denomination(amount.denomination())?;
+        let amount = Self::amount_to_consensus(ctx, amount.amount())?;
+
+        if amount < Self::params().min_delegate_amount {
+            return Err(Error::UnderMinDelegationAmount);
+        }
+
+        CurrentState::with(|state| {
+            state.emit_message(
+                ctx,
+                Message::Staking(Versioned::new(
+                    0,
+                    StakingMessage::AddEscrow(staking::Escrow {
+                        account: to.into(),
+                        amount: amount.into(),
+                    }),
+                )),
+                hook,
+            )
+        })?;
+
+        Ok(())
+    }
+
+    fn reclaim_escrow<C: Context>(
+        ctx: &C,
+        from: Address,
+        shares: u128,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error> {
+        CurrentState::with(|state| {
+            state.emit_message(
+                ctx,
+                Message::Staking(Versioned::new(
+                    0,
+                    StakingMessage::ReclaimEscrow(staking::ReclaimEscrow {
+                        account: from.into(),
+                        shares: shares.into(),
+                    }),
+                )),
+                hook,
+            )
+        })?;
+
+        Ok(())
+    }
+
+    fn consensus_denomination() -> Result<token::Denomination, Error> {
+        Ok(Self::params().consensus_denomination)
+    }
+
+    fn ensure_compatible_tx_signer() -> Result<(), Error> {
+        CurrentState::with_env(|env| match env.tx_auth_info().signer_info[0].address_spec {
+            AddressSpec::Signature(SignatureAddressSpec::Ed25519(_)) => Ok(()),
+            AddressSpec::Internal(CallerAddress::Address(_)) if env.is_simulation() => {
+                // During simulations, the caller may be overriden in case of confidential runtimes
+                // which would cause this check to always fail, making gas estimation incorrect.
+                //
+                // Note that this is optimistic as a `CallerAddres::Address(_)` can still be
+                // incompatible, but as long as this is only allowed during simulations it shouldn't
+                // result in any problems.
+                Ok(())
+            }
+            _ => Err(Error::ConsensusIncompatibleSigner),
+        })
+    }
+
+    fn account<C: Context>(ctx: &C, addr: Address) -> Result<ConsensusAccount, Error> {
+        let state = StakingImmutableState::new(ctx.consensus_state());
+        state
+            .account(addr.into())
+            .map_err(Error::InternalStateError)
+    }
+
+    fn delegation<C: Context>(
+        ctx: &C,
+        delegator_addr: Address,
+        escrow_addr: Address,
+    ) -> Result<ConsensusDelegation, Error> {
+        let state = StakingImmutableState::new(ctx.consensus_state());
+        state
+            .delegation(delegator_addr.into(), escrow_addr.into())
+            .map_err(Error::InternalStateError)
+    }
+
+    fn amount_from_consensus<C: Context>(_ctx: &C, amount: u128) -> Result<u128, Error> {
+        let scaling_factor = Self::params().consensus_scaling_factor;
+        amount
+            .checked_mul(scaling_factor.into())
+            .ok_or(Error::AmountNotRepresentable)
+    }
+
+    fn amount_to_consensus<C: Context>(_ctx: &C, amount: u128) -> Result<u128, Error> {
+        let scaling_factor = Self::params().consensus_scaling_factor;
+        let scaled = amount
+            .checked_div(scaling_factor.into())
+            .ok_or(Error::AmountNotRepresentable)?;
+
+        // Ensure there is no remainder as that is not representable in the consensus layer.
+        let remainder = amount
+            .checked_rem(scaling_factor.into())
+            .ok_or(Error::AmountNotRepresentable)?;
+        if remainder != 0 {
+            return Err(Error::AmountNotRepresentable);
+        }
+
+        Ok(scaled)
+    }
+
+    fn height_for_epoch<C: Context>(ctx: &C, epoch: EpochTime) -> Result<u64, Error> {
+        static HEIGHT_CACHE: Lazy<Mutex<lru::LruCache<EpochTime, u64>>> =
+            Lazy::new(|| Mutex::new(lru::LruCache::new(NonZeroUsize::new(128).unwrap())));
+
+        // Check the cache first to avoid more expensive traversals.
+        let mut cache = HEIGHT_CACHE.lock().unwrap();
+        if let Some(height) = cache.get(&epoch) {
+            return Ok(*height);
+        }
+
+        // Resolve height for the given epoch.
+        let mut height = HEIGHT_LATEST;
+        loop {
+            let state = ctx.history().consensus_state_at(height)?;
+
+            let beacon = BeaconImmutableState::new(&state);
+
+            let mut epoch_state = beacon.future_epoch_state()?;
+            if epoch_state.height > state.height().try_into().unwrap() {
+                // Use current epoch if future epoch is in the future.
+                epoch_state = beacon.epoch_state().unwrap();
+            }
+            height = epoch_state.height.try_into().unwrap();
+
+            // Cache height for later queries.
+            cache.put(epoch_state.epoch, height);
+
+            if epoch_state.epoch == epoch {
+                return Ok(height);
+            }
+
+            assert!(epoch_state.epoch > epoch);
+            assert!(height > 1);
+
+            // Go one height before epoch transition.
+            height -= 1;
+        }
+    }
+
+    fn round_roots<C: Context>(
+        ctx: &C,
+        runtime_id: Namespace,
+        round: u64,
+    ) -> Result<Option<RoundRoots>, Error> {
+        let roothash = RoothashImmutableState::new(ctx.consensus_state());
+        roothash
+            .round_roots(runtime_id, round)
+            .map_err(Error::InternalStateError)
+    }
+}
+
+impl module::TransactionHandler for Module {}
+
+impl module::BlockHandler for Module {}
+
+impl module::InvariantHandler for Module {}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/consensus/types.rs.html b/rust/src/oasis_runtime_sdk/modules/consensus/types.rs.html new file mode 100644 index 0000000000..c3899b8566 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/consensus/types.rs.html @@ -0,0 +1,37 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+
use oasis_core_runtime::common::namespace::Namespace;
+
+/// Kind of root.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum RootKind {
+    State = 1,
+    IO = 2,
+}
+
+/// Internal round root call body.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct RoundRootBody {
+    pub runtime_id: Namespace,
+    pub round: u64,
+    pub kind: RootKind,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/consensus_accounts/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/consensus_accounts/mod.rs.html new file mode 100644 index 0000000000..37944df674 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/consensus_accounts/mod.rs.html @@ -0,0 +1,1999 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+
//! Consensus accounts module.
+//!
+//! This module allows consensus transfers in and out of the runtime account,
+//! while keeping track of amount deposited per account.
+use std::{collections::BTreeSet, convert::TryInto, num::NonZeroUsize};
+
+use once_cell::sync::Lazy;
+use thiserror::Error;
+
+use oasis_core_runtime::{
+    consensus::{
+        self,
+        beacon::{EpochTime, EPOCH_INVALID},
+        staking::{self, Account as ConsensusAccount, AddEscrowResult, ReclaimEscrowResult},
+    },
+    types::EventKind,
+};
+use oasis_runtime_sdk_macros::{handler, sdk_derive};
+
+use crate::{
+    context::Context,
+    error, migration, module,
+    module::Module as _,
+    modules,
+    modules::{
+        accounts::API as _,
+        core::{Error as CoreError, API as _},
+    },
+    runtime::Runtime,
+    state::CurrentState,
+    storage::Prefix,
+    types::{
+        address::Address,
+        message::{MessageEvent, MessageEventHookInvocation},
+        token,
+        transaction::AuthInfo,
+    },
+};
+
+pub mod state;
+#[cfg(test)]
+mod test;
+pub mod types;
+
+/// Unique module name.
+const MODULE_NAME: &str = "consensus_accounts";
+
+#[derive(Error, Debug, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("invalid argument")]
+    #[sdk_error(code = 1)]
+    InvalidArgument,
+
+    #[error("invalid denomination")]
+    #[sdk_error(code = 2)]
+    InvalidDenomination,
+
+    #[error("insufficient balance")]
+    #[sdk_error(code = 3)]
+    InsufficientBalance,
+
+    #[error("forbidden by policy")]
+    #[sdk_error(code = 4)]
+    Forbidden,
+
+    #[error("consensus: {0}")]
+    #[sdk_error(transparent)]
+    Consensus(#[from] modules::consensus::Error),
+
+    #[error("core: {0}")]
+    #[sdk_error(transparent)]
+    Core(#[from] modules::core::Error),
+}
+
+/// Gas costs.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct GasCosts {
+    pub tx_deposit: u64,
+    pub tx_withdraw: u64,
+    pub tx_delegate: u64,
+    pub tx_undelegate: u64,
+
+    /// Cost of storing a delegation/undelegation receipt.
+    pub store_receipt: u64,
+    /// Cost of taking a delegation/undelegation receipt.
+    pub take_receipt: u64,
+}
+
+/// Parameters for the consensus module.
+#[derive(Clone, Default, Debug, cbor::Encode, cbor::Decode)]
+pub struct Parameters {
+    pub gas_costs: GasCosts,
+
+    /// Whether delegate functionality should be disabled.
+    pub disable_delegate: bool,
+    /// Whether undelegate functionality should be disabled.
+    pub disable_undelegate: bool,
+    /// Whether deposit functionality should be disabled.
+    pub disable_deposit: bool,
+    /// Whether withdraw functionality should be disabled.
+    pub disable_withdraw: bool,
+}
+
+impl module::Parameters for Parameters {
+    type Error = ();
+}
+
+/// Events emitted by the consensus accounts module.
+#[derive(Debug, cbor::Encode, oasis_runtime_sdk_macros::Event)]
+#[cbor(untagged)]
+pub enum Event {
+    #[sdk_event(code = 1)]
+    Deposit {
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+        #[cbor(optional)]
+        error: Option<types::ConsensusError>,
+    },
+
+    #[sdk_event(code = 2)]
+    Withdraw {
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+        #[cbor(optional)]
+        error: Option<types::ConsensusError>,
+    },
+
+    #[sdk_event(code = 3)]
+    Delegate {
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+        #[cbor(optional)]
+        error: Option<types::ConsensusError>,
+    },
+
+    #[sdk_event(code = 4)]
+    UndelegateStart {
+        from: Address,
+        nonce: u64,
+        to: Address,
+        shares: u128,
+        debond_end_time: EpochTime,
+        #[cbor(optional)]
+        error: Option<types::ConsensusError>,
+    },
+
+    #[sdk_event(code = 5)]
+    UndelegateDone {
+        from: Address,
+        to: Address,
+        shares: u128,
+        amount: token::BaseUnits,
+    },
+}
+
+/// Genesis state for the consensus module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Genesis {
+    pub parameters: Parameters,
+}
+
+/// Interface that can be called from other modules.
+pub trait API {
+    /// Transfer from consensus staking account to runtime account.
+    ///
+    /// # Arguments
+    ///
+    /// * `nonce`: A caller-provided sequence number that will help identify the success/fail events.
+    ///   When called from a deposit transaction, we use the signer nonce.
+    fn deposit<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+    ) -> Result<(), Error>;
+
+    /// Transfer from runtime account to consensus staking account.
+    ///
+    /// # Arguments
+    ///
+    /// * `nonce`: A caller-provided sequence number that will help identify the success/fail events.
+    ///   When called from a withdraw transaction, we use the signer nonce.
+    fn withdraw<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+    ) -> Result<(), Error>;
+
+    /// Delegate from runtime account to consensus staking account.
+    ///
+    /// # Arguments
+    ///
+    /// * `nonce`: A caller-provided sequence number that will help identify the success/fail events.
+    ///   When called from a delegate transaction, we use the signer nonce.
+    fn delegate<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+        receipt: bool,
+    ) -> Result<(), Error>;
+
+    /// Start the undelegation process of the given number of shares from consensus staking account
+    /// to runtime account.
+    ///
+    /// # Arguments
+    ///
+    /// * `nonce`: A caller-provided sequence number that will help identify the success/fail events.
+    ///   When called from an undelegate transaction, we use the signer nonce.
+    fn undelegate<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        shares: u128,
+        receipt: bool,
+    ) -> Result<(), Error>;
+}
+
+pub struct Module<Consensus: modules::consensus::API> {
+    _consensus: std::marker::PhantomData<Consensus>,
+}
+
+/// Module's address that has the tokens pending withdrawal.
+///
+/// oasis1qr677rv0dcnh7ys4yanlynysvnjtk9gnsyhvm6ln
+pub static ADDRESS_PENDING_WITHDRAWAL: Lazy<Address> =
+    Lazy::new(|| Address::from_module(MODULE_NAME, "pending-withdrawal"));
+
+/// Module's address that has the tokens pending delegation.
+///
+/// oasis1qzcdegtf7aunxr5n5pw7n5xs3u7cmzlz9gwmq49r
+pub static ADDRESS_PENDING_DELEGATION: Lazy<Address> =
+    Lazy::new(|| Address::from_module(MODULE_NAME, "pending-delegation"));
+
+const CONSENSUS_TRANSFER_HANDLER: &str = "consensus.TransferFromRuntime";
+const CONSENSUS_WITHDRAW_HANDLER: &str = "consensus.WithdrawIntoRuntime";
+const CONSENSUS_DELEGATE_HANDLER: &str = "consensus.Delegate";
+const CONSENSUS_UNDELEGATE_HANDLER: &str = "consensus.Undelegate";
+
+impl<Consensus: modules::consensus::API> API for Module<Consensus> {
+    fn deposit<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+    ) -> Result<(), Error> {
+        // XXX: could check consensus state if allowance for the runtime account
+        // exists, but consensus state could be outdated since last block, so
+        // just try to withdraw.
+
+        // Do withdraw from the consensus account and update the account state if
+        // successful.
+        Consensus::withdraw(
+            ctx,
+            from,
+            &amount,
+            MessageEventHookInvocation::new(
+                CONSENSUS_WITHDRAW_HANDLER.to_string(),
+                types::ConsensusWithdrawContext {
+                    from,
+                    nonce,
+                    address: to,
+                    amount: amount.clone(),
+                },
+            ),
+        )?;
+
+        Ok(())
+    }
+
+    fn withdraw<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+    ) -> Result<(), Error> {
+        // Transfer out of runtime account and update the account state if successful.
+        Consensus::transfer(
+            ctx,
+            to,
+            &amount,
+            MessageEventHookInvocation::new(
+                CONSENSUS_TRANSFER_HANDLER.to_string(),
+                types::ConsensusTransferContext {
+                    to,
+                    nonce,
+                    address: from,
+                    amount: amount.clone(),
+                },
+            ),
+        )?;
+
+        if CurrentState::with_env(|env| env.is_check_only()) {
+            return Ok(());
+        }
+
+        // Transfer the given amount to the module's withdrawal account to make sure the tokens
+        // remain available until actually withdrawn.
+        <C::Runtime as Runtime>::Accounts::transfer(from, *ADDRESS_PENDING_WITHDRAWAL, &amount)
+            .map_err(|_| Error::InsufficientBalance)?;
+
+        Ok(())
+    }
+
+    fn delegate<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        amount: token::BaseUnits,
+        receipt: bool,
+    ) -> Result<(), Error> {
+        Consensus::escrow(
+            ctx,
+            to,
+            &amount,
+            MessageEventHookInvocation::new(
+                CONSENSUS_DELEGATE_HANDLER.to_string(),
+                types::ConsensusDelegateContext {
+                    from,
+                    nonce,
+                    to,
+                    amount: amount.clone(),
+                    receipt,
+                },
+            ),
+        )?;
+
+        if CurrentState::with_env(|env| env.is_check_only()) {
+            return Ok(());
+        }
+
+        // Transfer the given amount to the module's delegation account to make sure the tokens
+        // remain available until actually delegated.
+        <C::Runtime as Runtime>::Accounts::transfer(from, *ADDRESS_PENDING_DELEGATION, &amount)
+            .map_err(|_| Error::InsufficientBalance)?;
+
+        Ok(())
+    }
+
+    fn undelegate<C: Context>(
+        ctx: &C,
+        from: Address,
+        nonce: u64,
+        to: Address,
+        shares: u128,
+        receipt: bool,
+    ) -> Result<(), Error> {
+        // Subtract shares from delegation, making sure there are enough there.
+        state::sub_delegation(to, from, shares)?;
+
+        Consensus::reclaim_escrow(
+            ctx,
+            from,
+            shares,
+            MessageEventHookInvocation::new(
+                CONSENSUS_UNDELEGATE_HANDLER.to_string(),
+                types::ConsensusUndelegateContext {
+                    from,
+                    nonce,
+                    to,
+                    shares,
+                    receipt,
+                },
+            ),
+        )?;
+
+        Ok(())
+    }
+}
+
+#[sdk_derive(Module)]
+impl<Consensus: modules::consensus::API> Module<Consensus> {
+    const NAME: &'static str = MODULE_NAME;
+    const VERSION: u32 = 1;
+    type Error = Error;
+    type Event = Event;
+    type Parameters = Parameters;
+    type Genesis = Genesis;
+
+    #[migration(init)]
+    pub fn init(genesis: Genesis) {
+        // Set genesis parameters.
+        Self::set_params(genesis.parameters);
+    }
+
+    /// Deposit in the runtime.
+    #[handler(call = "consensus.Deposit")]
+    fn tx_deposit<C: Context>(ctx: &C, body: types::Deposit) -> Result<(), Error> {
+        let params = Self::params();
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_deposit)?;
+
+        // Check whether deposit is allowed.
+        if params.disable_deposit {
+            return Err(Error::Forbidden);
+        }
+
+        let signer = CurrentState::with_env(|env| env.tx_auth_info().signer_info[0].clone());
+        Consensus::ensure_compatible_tx_signer()?;
+
+        let address = signer.address_spec.address();
+        let nonce = signer.nonce;
+        Self::deposit(ctx, address, nonce, body.to.unwrap_or(address), body.amount)
+    }
+
+    /// Withdraw from the runtime.
+    #[handler(prefetch = "consensus.Withdraw")]
+    fn prefetch_withdraw(
+        add_prefix: &mut dyn FnMut(Prefix),
+        _body: cbor::Value,
+        auth_info: &AuthInfo,
+    ) -> Result<(), error::RuntimeError> {
+        // Prefetch withdrawing account balance.
+        let addr = auth_info.signer_info[0].address_spec.address();
+        add_prefix(Prefix::from(
+            [
+                modules::accounts::Module::NAME.as_bytes(),
+                modules::accounts::state::BALANCES,
+                addr.as_ref(),
+            ]
+            .concat(),
+        ));
+        Ok(())
+    }
+
+    #[handler(call = "consensus.Withdraw")]
+    fn tx_withdraw<C: Context>(ctx: &C, body: types::Withdraw) -> Result<(), Error> {
+        let params = Self::params();
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_withdraw)?;
+
+        // Check whether withdraw is allowed.
+        if params.disable_withdraw {
+            return Err(Error::Forbidden);
+        }
+
+        // Signer.
+        if body.to.is_none() {
+            // If no `to` field is specified, i.e. withdrawing to the transaction sender's account,
+            // only allow the consensus-compatible single-Ed25519-key signer type. Otherwise, the
+            // tokens would get stuck in an account that you can't sign for on the consensus layer.
+            Consensus::ensure_compatible_tx_signer()?;
+        }
+
+        let signer = CurrentState::with_env(|env| env.tx_auth_info().signer_info[0].clone());
+        let address = signer.address_spec.address();
+        let nonce = signer.nonce;
+        Self::withdraw(ctx, address, nonce, body.to.unwrap_or(address), body.amount)
+    }
+
+    #[handler(call = "consensus.Delegate")]
+    fn tx_delegate<C: Context>(ctx: &C, body: types::Delegate) -> Result<(), Error> {
+        let params = Self::params();
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_delegate)?;
+        let store_receipt = body.receipt > 0;
+        if store_receipt {
+            <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.store_receipt)?;
+        }
+
+        // Check whether delegate is allowed.
+        if params.disable_delegate {
+            return Err(Error::Forbidden);
+        }
+        // Make sure receipts can only be requested internally (e.g. via subcalls).
+        if store_receipt && !CurrentState::with_env(|env| env.is_internal()) {
+            return Err(Error::InvalidArgument);
+        }
+
+        // Signer.
+        let signer = CurrentState::with_env(|env| env.tx_auth_info().signer_info[0].clone());
+        let from = signer.address_spec.address();
+        let nonce = if store_receipt {
+            body.receipt // Use receipt identifier as the nonce.
+        } else {
+            signer.nonce // Use signer nonce as the nonce.
+        };
+        Self::delegate(ctx, from, nonce, body.to, body.amount, store_receipt)
+    }
+
+    #[handler(call = "consensus.Undelegate")]
+    fn tx_undelegate<C: Context>(ctx: &C, body: types::Undelegate) -> Result<(), Error> {
+        let params = Self::params();
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_undelegate)?;
+        let store_receipt = body.receipt > 0;
+        if store_receipt {
+            <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.store_receipt)?;
+        }
+
+        // Check whether undelegate is allowed.
+        if params.disable_undelegate {
+            return Err(Error::Forbidden);
+        }
+        // Make sure receipts can only be requested internally (e.g. via subcalls).
+        if store_receipt && !CurrentState::with_env(|env| env.is_internal()) {
+            return Err(Error::InvalidArgument);
+        }
+
+        // Signer.
+        let signer = CurrentState::with_env(|env| env.tx_auth_info().signer_info[0].clone());
+        let to = signer.address_spec.address();
+        let nonce = if store_receipt {
+            body.receipt // Use receipt identifer as the nonce.
+        } else {
+            signer.nonce // Use signer nonce as the nonce.
+        };
+        Self::undelegate(ctx, body.from, nonce, to, body.shares, store_receipt)
+    }
+
+    #[handler(call = "consensus.TakeReceipt", internal)]
+    fn internal_take_receipt<C: Context>(
+        _ctx: &C,
+        body: types::TakeReceipt,
+    ) -> Result<Option<types::Receipt>, Error> {
+        let params = Self::params();
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.take_receipt)?;
+
+        if !body.kind.is_valid() {
+            return Err(Error::InvalidArgument);
+        }
+
+        Ok(state::take_receipt(
+            CurrentState::with_env(|env| env.tx_caller_address()),
+            body.kind,
+            body.id,
+        ))
+    }
+
+    #[handler(query = "consensus.Balance")]
+    fn query_balance<C: Context>(
+        _ctx: &C,
+        args: types::BalanceQuery,
+    ) -> Result<types::AccountBalance, Error> {
+        let denomination = Consensus::consensus_denomination()?;
+        let balances = <C::Runtime as Runtime>::Accounts::get_balances(args.address)
+            .map_err(|_| Error::InvalidArgument)?;
+        let balance = balances
+            .balances
+            .get(&denomination)
+            .copied()
+            .unwrap_or_default();
+        Ok(types::AccountBalance { balance })
+    }
+
+    #[handler(query = "consensus.Account")]
+    fn query_consensus_account<C: Context>(
+        ctx: &C,
+        args: types::ConsensusAccountQuery,
+    ) -> Result<ConsensusAccount, Error> {
+        Consensus::account(ctx, args.address).map_err(|_| Error::InvalidArgument)
+    }
+
+    #[handler(query = "consensus.Delegation")]
+    fn query_delegation<C: Context>(
+        _ctx: &C,
+        args: types::DelegationQuery,
+    ) -> Result<types::DelegationInfo, Error> {
+        state::get_delegation(args.from, args.to)
+    }
+
+    #[handler(query = "consensus.Delegations")]
+    fn query_delegations<C: Context>(
+        _ctx: &C,
+        args: types::DelegationsQuery,
+    ) -> Result<Vec<types::ExtendedDelegationInfo>, Error> {
+        state::get_delegations(args.from)
+    }
+
+    #[handler(query = "consensus.Undelegations")]
+    fn query_undelegations<C: Context>(
+        _ctx: &C,
+        args: types::UndelegationsQuery,
+    ) -> Result<Vec<types::UndelegationInfo>, Error> {
+        state::get_undelegations(args.to)
+    }
+
+    #[handler(message_result = CONSENSUS_TRANSFER_HANDLER)]
+    fn message_result_transfer<C: Context>(
+        ctx: &C,
+        me: MessageEvent,
+        context: types::ConsensusTransferContext,
+    ) {
+        if !me.is_success() {
+            // Transfer out failed, refund the balance.
+            <C::Runtime as Runtime>::Accounts::transfer(
+                *ADDRESS_PENDING_WITHDRAWAL,
+                context.address,
+                &context.amount,
+            )
+            .expect("should have enough balance");
+
+            // Emit withdraw failed event.
+            CurrentState::with(|state| {
+                state.emit_event(Event::Withdraw {
+                    from: context.address,
+                    nonce: context.nonce,
+                    to: context.to,
+                    amount: context.amount.clone(),
+                    error: Some(me.into()),
+                });
+            });
+            return;
+        }
+
+        // Burn the withdrawn tokens.
+        <C::Runtime as Runtime>::Accounts::burn(*ADDRESS_PENDING_WITHDRAWAL, &context.amount)
+            .expect("should have enough balance");
+
+        // Emit withdraw successful event.
+        CurrentState::with(|state| {
+            state.emit_event(Event::Withdraw {
+                from: context.address,
+                nonce: context.nonce,
+                to: context.to,
+                amount: context.amount.clone(),
+                error: None,
+            });
+        });
+    }
+
+    #[handler(message_result = CONSENSUS_WITHDRAW_HANDLER)]
+    fn message_result_withdraw<C: Context>(
+        ctx: &C,
+        me: MessageEvent,
+        context: types::ConsensusWithdrawContext,
+    ) {
+        if !me.is_success() {
+            // Transfer in failed, emit deposit failed event.
+            CurrentState::with(|state| {
+                state.emit_event(Event::Deposit {
+                    from: context.from,
+                    nonce: context.nonce,
+                    to: context.address,
+                    amount: context.amount.clone(),
+                    error: Some(me.into()),
+                });
+            });
+            return;
+        }
+
+        // Update runtime state.
+        <C::Runtime as Runtime>::Accounts::mint(context.address, &context.amount).unwrap();
+
+        // Emit deposit successful event.
+        CurrentState::with(|state| {
+            state.emit_event(Event::Deposit {
+                from: context.from,
+                nonce: context.nonce,
+                to: context.address,
+                amount: context.amount.clone(),
+                error: None,
+            });
+        });
+    }
+
+    #[handler(message_result = CONSENSUS_DELEGATE_HANDLER)]
+    fn message_result_delegate<C: Context>(
+        ctx: &C,
+        me: MessageEvent,
+        context: types::ConsensusDelegateContext,
+    ) {
+        if !me.is_success() {
+            // Delegation failed, refund the balance.
+            <C::Runtime as Runtime>::Accounts::transfer(
+                *ADDRESS_PENDING_DELEGATION,
+                context.from,
+                &context.amount,
+            )
+            .expect("should have enough balance");
+
+            // Store receipt if requested.
+            if context.receipt {
+                state::set_receipt(
+                    context.from,
+                    types::ReceiptKind::Delegate,
+                    context.nonce,
+                    types::Receipt {
+                        error: Some(me.clone().into()),
+                        ..Default::default()
+                    },
+                );
+            }
+
+            // Emit delegation failed event.
+            CurrentState::with(|state| {
+                state.emit_event(Event::Delegate {
+                    from: context.from,
+                    nonce: context.nonce,
+                    to: context.to,
+                    amount: context.amount,
+                    error: Some(me.into()),
+                });
+            });
+            return;
+        }
+
+        // Burn the delegated tokens.
+        <C::Runtime as Runtime>::Accounts::burn(*ADDRESS_PENDING_DELEGATION, &context.amount)
+            .expect("should have enough balance");
+
+        // Record delegation.
+        let result = me
+            .result
+            .expect("event from consensus should have a result");
+        let result: AddEscrowResult = cbor::from_value(result).unwrap();
+        let shares = result.new_shares.try_into().unwrap();
+
+        state::add_delegation(context.from, context.to, shares).unwrap();
+
+        // Store receipt if requested.
+        if context.receipt {
+            state::set_receipt(
+                context.from,
+                types::ReceiptKind::Delegate,
+                context.nonce,
+                types::Receipt {
+                    shares,
+                    ..Default::default()
+                },
+            );
+        }
+
+        // Emit delegation successful event.
+        CurrentState::with(|state| {
+            state.emit_event(Event::Delegate {
+                from: context.from,
+                nonce: context.nonce,
+                to: context.to,
+                amount: context.amount,
+                error: None,
+            });
+        });
+    }
+
+    #[handler(message_result = CONSENSUS_UNDELEGATE_HANDLER)]
+    fn message_result_undelegate<C: Context>(
+        ctx: &C,
+        me: MessageEvent,
+        context: types::ConsensusUndelegateContext,
+    ) {
+        if !me.is_success() {
+            // Undelegation failed, add shares back.
+            state::add_delegation(context.to, context.from, context.shares).unwrap();
+
+            // Store receipt if requested.
+            if context.receipt {
+                state::set_receipt(
+                    context.to,
+                    types::ReceiptKind::UndelegateStart,
+                    context.nonce,
+                    types::Receipt {
+                        error: Some(me.clone().into()),
+                        ..Default::default()
+                    },
+                );
+            }
+
+            // Emit undelegation failed event.
+            CurrentState::with(|state| {
+                state.emit_event(Event::UndelegateStart {
+                    from: context.from,
+                    nonce: context.nonce,
+                    to: context.to,
+                    shares: context.shares,
+                    debond_end_time: EPOCH_INVALID,
+                    error: Some(me.into()),
+                });
+            });
+            return;
+        }
+
+        // Queue undelegation processing at the debond end epoch. Further processing will happen in
+        // the end block handler.
+        let result = me
+            .result
+            .expect("event from consensus should have a result");
+        let result: ReclaimEscrowResult = cbor::from_value(result).unwrap();
+        let debonding_shares = result.debonding_shares.try_into().unwrap();
+
+        let receipt = if context.receipt {
+            context.nonce
+        } else {
+            0 // No receipt needed for UndelegateEnd.
+        };
+
+        let done_receipt = state::add_undelegation(
+            context.from,
+            context.to,
+            result.debond_end_time,
+            debonding_shares,
+            receipt,
+        )
+        .unwrap();
+
+        // Store receipt if requested.
+        if context.receipt {
+            state::set_receipt(
+                context.to,
+                types::ReceiptKind::UndelegateStart,
+                context.nonce,
+                types::Receipt {
+                    epoch: result.debond_end_time,
+                    receipt: done_receipt,
+                    ..Default::default()
+                },
+            );
+        }
+
+        // Emit undelegation started event.
+        CurrentState::with(|state| {
+            state.emit_event(Event::UndelegateStart {
+                from: context.from,
+                nonce: context.nonce,
+                to: context.to,
+                shares: context.shares,
+                debond_end_time: result.debond_end_time,
+                error: None,
+            });
+        });
+    }
+}
+
+impl<Consensus: modules::consensus::API> module::TransactionHandler for Module<Consensus> {}
+
+impl<Consensus: modules::consensus::API> module::BlockHandler for Module<Consensus> {
+    fn end_block<C: Context>(ctx: &C) {
+        // Only do work in case the epoch has changed since the last processed block.
+        if !<C::Runtime as Runtime>::Core::has_epoch_changed() {
+            return;
+        }
+
+        let logger = ctx.get_logger("consensus_accounts");
+        slog::debug!(logger, "epoch changed, processing queued undelegations";
+            "epoch" => ctx.epoch(),
+        );
+
+        let mut reclaims: lru::LruCache<(EpochTime, Address), (u128, u128)> =
+            lru::LruCache::new(NonZeroUsize::new(128).unwrap());
+
+        let own_address = Address::from_runtime_id(ctx.runtime_id());
+        let denomination = Consensus::consensus_denomination().unwrap();
+        let qd = state::get_queued_undelegations(ctx.epoch()).unwrap();
+        for ud in qd {
+            let udi = state::take_undelegation(&ud).unwrap();
+
+            slog::debug!(logger, "processing undelegation";
+                "shares" => udi.shares,
+            );
+
+            // Determine total amount the runtime got during the reclaim operation.
+            let (total_amount, total_shares) =
+                if let Some(totals) = reclaims.get(&(ud.epoch, ud.from)) {
+                    *totals
+                } else {
+                    // Fetch consensus height corresponding to the given epoch transition. This
+                    // query may be expensive in case the epoch is far back, but the node is
+                    // guaranteed to have it as it was the state after the last normal round
+                    // (otherwise we would have already processed this epoch).
+                    let height = Consensus::height_for_epoch(ctx, ud.epoch)
+                        .expect("failed to determine height for epoch");
+
+                    // Find the relevant reclaim escrow event.
+                    //
+                    // There will always be exactly one matching reclaim escrow event here, because
+                    // debonding delegations get merged at the consensus layer when there are
+                    // multiple reclaims for the same accounts on the same epoch.
+                    let totals = ctx
+                        .history()
+                        .consensus_events_at(height, EventKind::Staking)
+                        .expect("failed to fetch historic events")
+                        .iter()
+                        .find_map(|ev| match ev {
+                            consensus::Event::Staking(staking::Event {
+                                escrow:
+                                    Some(staking::EscrowEvent::Reclaim {
+                                        owner,
+                                        escrow,
+                                        amount,
+                                        shares,
+                                    }),
+                                ..
+                            }) if owner == &own_address.into() && escrow == &ud.from.into() => {
+                                Some((amount.try_into().unwrap(), shares.try_into().unwrap()))
+                            }
+                            _ => None,
+                        })
+                        .expect("reclaim event should have been emitted");
+
+                    reclaims.put((ud.epoch, ud.from), totals);
+                    totals
+                };
+
+            // Compute proportion of received amount (shares * total_amount / total_shares).
+            let amount = udi
+                .shares
+                .checked_mul(total_amount)
+                .expect("shares * total_amount should not overflow")
+                .checked_div(total_shares)
+                .expect("total_shares should not be zero");
+            let raw_amount = Consensus::amount_from_consensus(ctx, amount).unwrap();
+            let amount = token::BaseUnits::new(raw_amount, denomination.clone());
+
+            // Mint the given number of tokens.
+            <C::Runtime as Runtime>::Accounts::mint(ud.to, &amount).unwrap();
+
+            // Store receipt if requested.
+            if udi.receipt > 0 {
+                state::set_receipt(
+                    ud.to,
+                    types::ReceiptKind::UndelegateDone,
+                    udi.receipt,
+                    types::Receipt {
+                        amount: raw_amount,
+                        ..Default::default()
+                    },
+                );
+            }
+
+            // Emit undelegation done event.
+            CurrentState::with(|state| {
+                state.emit_event(Event::UndelegateDone {
+                    from: ud.from,
+                    to: ud.to,
+                    shares: udi.shares,
+                    amount,
+                });
+            });
+        }
+    }
+}
+
+impl<Consensus: modules::consensus::API> module::InvariantHandler for Module<Consensus> {
+    /// Check invariants.
+    fn check_invariants<C: Context>(ctx: &C) -> Result<(), CoreError> {
+        // Total supply of the designated consensus layer token denomination
+        // should be less than or equal to the balance of the runtime's general
+        // account in the consensus layer.
+
+        let den = Consensus::consensus_denomination().unwrap();
+        #[allow(clippy::or_fun_call)]
+        let ts = <C::Runtime as Runtime>::Accounts::get_total_supplies().or(Err(
+            CoreError::InvariantViolation("unable to get total supplies".to_string()),
+        ))?;
+
+        let rt_addr = Address::from_runtime_id(ctx.runtime_id());
+        let rt_acct = Consensus::account(ctx, rt_addr).unwrap_or_default();
+        let rt_ga_balance = rt_acct.general.balance;
+        let rt_ga_balance: u128 = rt_ga_balance.try_into().unwrap_or(u128::MAX);
+
+        let rt_ga_balance = Consensus::amount_from_consensus(ctx, rt_ga_balance).map_err(|_| {
+            CoreError::InvariantViolation(
+                "runtime's consensus balance is not representable".to_string(),
+            )
+        })?;
+
+        if let Some(total_supply) = ts.get(&den) {
+            if total_supply > &rt_ga_balance {
+                return Err(CoreError::InvariantViolation(
+                    format!("total supply ({total_supply}) is greater than runtime's general account balance ({rt_ga_balance})"),
+                ));
+            }
+        }
+
+        // Check that the number of shares the runtime has escrowed in consensus is >= what is in
+        // its internally tracked delegation state.
+
+        let delegations = state::get_delegations_by_destination()
+            .map_err(|_| CoreError::InvariantViolation("unable to get delegations".to_string()))?;
+
+        for (to, shares) in delegations {
+            let cons_shares = Consensus::delegation(ctx, rt_addr, to)
+                .map_err(|err| {
+                    CoreError::InvariantViolation(format!(
+                        "unable to fetch consensus delegation {rt_addr} -> {to}: {err}"
+                    ))
+                })?
+                .shares;
+
+            if cons_shares < shares.into() {
+                return Err(CoreError::InvariantViolation(format!(
+                    "runtime does not have enough shares delegated to {to} (expected: {shares} got: {cons_shares}"
+                )));
+            }
+        }
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/consensus_accounts/state.rs.html b/rust/src/oasis_runtime_sdk/modules/consensus_accounts/state.rs.html new file mode 100644 index 0000000000..165f350c7c --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/consensus_accounts/state.rs.html @@ -0,0 +1,931 @@ +state.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+
//! State schema.
+use std::{
+    collections::BTreeMap,
+    convert::{TryFrom, TryInto},
+};
+
+use oasis_core_runtime::consensus::beacon::EpochTime;
+
+use crate::{
+    state::CurrentState,
+    storage::{self, Store},
+    types::address::Address,
+};
+
+use super::{types, Error, MODULE_NAME};
+
+/// Map of active delegations.
+pub const DELEGATIONS: &[u8] = &[0x01];
+/// Map of undelegations.
+pub const UNDELEGATIONS: &[u8] = &[0x02];
+/// An undelegation queue.
+pub const UNDELEGATION_QUEUE: &[u8] = &[0x03];
+/// Receipts.
+pub const RECEIPTS: &[u8] = &[0x04];
+
+/// Add delegation for a given (from, to) pair.
+///
+/// The given shares are added to any existing delegation that may exist for the same (from, to)
+/// address pair. If no delegation exists a new one is created.
+pub fn add_delegation(from: Address, to: Address, shares: u128) -> Result<(), Error> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let delegations = storage::PrefixStore::new(store, &DELEGATIONS);
+        let mut account = storage::TypedStore::new(storage::PrefixStore::new(delegations, &from));
+        let mut di: types::DelegationInfo = account.get(to).unwrap_or_default();
+
+        di.shares = di
+            .shares
+            .checked_add(shares)
+            .ok_or(Error::InvalidArgument)?;
+
+        account.insert(to, di);
+
+        Ok(())
+    })
+}
+
+/// Subtract delegation from a given (from, to) pair.
+pub fn sub_delegation(from: Address, to: Address, shares: u128) -> Result<(), Error> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let delegations = storage::PrefixStore::new(store, &DELEGATIONS);
+        let mut account = storage::TypedStore::new(storage::PrefixStore::new(delegations, &from));
+        let mut di: types::DelegationInfo = account.get(to).unwrap_or_default();
+
+        di.shares = di
+            .shares
+            .checked_sub(shares)
+            .ok_or(Error::InsufficientBalance)?;
+
+        if di.shares > 0 {
+            account.insert(to, di);
+        } else {
+            account.remove(to);
+        }
+
+        Ok(())
+    })
+}
+
+/// Retrieve delegation metadata for a given (from, to) pair.
+///
+/// In case no delegation exists for the given (from, to) address pair, an all-zero delegation
+/// metadata are returned.
+pub fn get_delegation(from: Address, to: Address) -> Result<types::DelegationInfo, Error> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let delegations = storage::PrefixStore::new(store, &DELEGATIONS);
+        let account = storage::TypedStore::new(storage::PrefixStore::new(delegations, &from));
+        Ok(account.get(to).unwrap_or_default())
+    })
+}
+
+/// Retrieve all delegation metadata originating from a given address.
+pub fn get_delegations(from: Address) -> Result<Vec<types::ExtendedDelegationInfo>, Error> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let delegations = storage::PrefixStore::new(store, &DELEGATIONS);
+        let account = storage::TypedStore::new(storage::PrefixStore::new(delegations, &from));
+
+        Ok(account
+            .iter()
+            .map(
+                |(to, di): (Address, types::DelegationInfo)| -> types::ExtendedDelegationInfo {
+                    types::ExtendedDelegationInfo {
+                        to,
+                        shares: di.shares,
+                    }
+                },
+            )
+            .collect())
+    })
+}
+
+/// This is needed to properly iterate over the DELEGATIONS map.
+#[derive(Clone, PartialEq, PartialOrd, Eq, Ord)]
+struct AddressPair(Address, Address);
+
+#[derive(Error, Debug)]
+enum APError {
+    #[error("malformed address")]
+    MalformedAddress,
+}
+
+impl TryFrom<&[u8]> for AddressPair {
+    type Error = APError;
+
+    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> {
+        let a =
+            Address::try_from(&bytes[..Address::SIZE]).map_err(|_| APError::MalformedAddress)?;
+        let b =
+            Address::try_from(&bytes[Address::SIZE..]).map_err(|_| APError::MalformedAddress)?;
+        Ok(AddressPair(a, b))
+    }
+}
+
+/// Return the number of delegated shares for each destination escrow account.
+pub fn get_delegations_by_destination() -> Result<BTreeMap<Address, u128>, Error> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let delegations = storage::TypedStore::new(storage::PrefixStore::new(store, &DELEGATIONS));
+
+        let mut by_destination: BTreeMap<Address, u128> = BTreeMap::new();
+        for (ap, di) in delegations.iter::<AddressPair, types::DelegationInfo>() {
+            let total = by_destination.entry(ap.1).or_default();
+            *total = total.checked_add(di.shares).ok_or(Error::InvalidArgument)?;
+        }
+
+        Ok(by_destination)
+    })
+}
+
+/// Record new undelegation and add to undelegation queue.
+///
+/// In case an undelegation for the given (from, to, epoch) tuple already exists, the undelegation
+/// entry is merged by adding shares. When a non-zero receipt identifier is passed, the identifier
+/// is set in case the existing entry has no such identifier yet.
+///
+/// It returns the receipt identifier of the undelegation done receipt.
+pub fn add_undelegation(
+    from: Address,
+    to: Address,
+    epoch: EpochTime,
+    shares: u128,
+    receipt: u64,
+) -> Result<u64, Error> {
+    CurrentState::with_store(|mut root_store| {
+        let store = storage::PrefixStore::new(&mut root_store, &MODULE_NAME);
+        let undelegations = storage::PrefixStore::new(store, &UNDELEGATIONS);
+        let account = storage::PrefixStore::new(undelegations, &to);
+        let mut entry = storage::TypedStore::new(storage::PrefixStore::new(account, &from));
+        let mut di: types::DelegationInfo = entry.get(epoch.to_storage_key()).unwrap_or_default();
+
+        if receipt > 0 && di.receipt == 0 {
+            di.receipt = receipt;
+        }
+        let done_receipt = di.receipt;
+
+        di.shares = di
+            .shares
+            .checked_add(shares)
+            .ok_or(Error::InvalidArgument)?;
+
+        entry.insert(epoch.to_storage_key(), di);
+
+        // Add to undelegation queue (if existing item is there, this will have no effect).
+        let store = storage::PrefixStore::new(root_store, &MODULE_NAME);
+        let mut queue = storage::PrefixStore::new(store, &UNDELEGATION_QUEUE);
+        queue.insert(
+            &queue_entry_key(from, to, epoch),
+            &[0xF6], /* CBOR NULL */
+        );
+
+        Ok(done_receipt)
+    })
+}
+
+fn queue_entry_key(from: Address, to: Address, epoch: EpochTime) -> Vec<u8> {
+    [&epoch.to_storage_key(), to.as_ref(), from.as_ref()].concat()
+}
+
+/// Remove an existing undelegation and return it.
+///
+/// In case the undelegation doesn't exist, returns a default-constructed DelegationInfo.
+pub fn take_undelegation(ud: &Undelegation) -> Result<types::DelegationInfo, Error> {
+    CurrentState::with_store(|mut root_store| {
+        // Get and remove undelegation metadata.
+        let store = storage::PrefixStore::new(&mut root_store, &MODULE_NAME);
+        let undelegations = storage::PrefixStore::new(store, &UNDELEGATIONS);
+        let account = storage::PrefixStore::new(undelegations, &ud.to);
+        let mut entry = storage::TypedStore::new(storage::PrefixStore::new(account, &ud.from));
+        let di: types::DelegationInfo = entry.get(ud.epoch.to_storage_key()).unwrap_or_default();
+        entry.remove(ud.epoch.to_storage_key());
+
+        // Remove queue entry.
+        let store = storage::PrefixStore::new(root_store, &MODULE_NAME);
+        let mut queue = storage::PrefixStore::new(store, &UNDELEGATION_QUEUE);
+        queue.remove(&queue_entry_key(ud.from, ud.to, ud.epoch));
+
+        Ok(di)
+    })
+}
+
+struct AddressWithEpoch {
+    from: Address,
+    epoch: EpochTime,
+}
+
+impl TryFrom<&[u8]> for AddressWithEpoch {
+    type Error = anyhow::Error;
+
+    fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
+        if value.len() != Address::SIZE + 8 {
+            anyhow::bail!("incorrect address with epoch key size");
+        }
+
+        Ok(Self {
+            from: Address::try_from(&value[..Address::SIZE])?,
+            epoch: EpochTime::from_be_bytes(value[Address::SIZE..].try_into()?),
+        })
+    }
+}
+
+/// Retrieve all undelegation metadata to a given address.
+pub fn get_undelegations(to: Address) -> Result<Vec<types::UndelegationInfo>, Error> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let undelegations = storage::PrefixStore::new(store, &UNDELEGATIONS);
+        let account = storage::TypedStore::new(storage::PrefixStore::new(undelegations, &to));
+
+        Ok(account
+            .iter()
+            .map(
+                |(ae, di): (AddressWithEpoch, types::DelegationInfo)| -> types::UndelegationInfo {
+                    types::UndelegationInfo {
+                        from: ae.from,
+                        epoch: ae.epoch,
+                        shares: di.shares,
+                    }
+                },
+            )
+            .collect())
+    })
+}
+
+/// Undelegation metadata.
+pub struct Undelegation {
+    pub from: Address,
+    pub to: Address,
+    pub epoch: EpochTime,
+}
+
+impl<'a> TryFrom<&'a [u8]> for Undelegation {
+    type Error = anyhow::Error;
+
+    fn try_from(value: &'a [u8]) -> Result<Self, Self::Error> {
+        // Decode a storage key of the format (epoch, to, from).
+        if value.len() != 2 * Address::SIZE + 8 {
+            anyhow::bail!("incorrect undelegation key size");
+        }
+
+        Ok(Self {
+            epoch: EpochTime::from_be_bytes(value[..8].try_into()?),
+            to: Address::from_bytes(&value[8..8 + Address::SIZE])?,
+            from: Address::from_bytes(&value[8 + Address::SIZE..])?,
+        })
+    }
+}
+
+/// Retrieve all queued undelegations for epochs earlier than or equal to the passed epoch.
+pub fn get_queued_undelegations(epoch: EpochTime) -> Result<Vec<Undelegation>, Error> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let queue = storage::TypedStore::new(storage::PrefixStore::new(store, &UNDELEGATION_QUEUE));
+
+        Ok(queue
+            .iter()
+            .map(|(k, _): (Undelegation, ())| k)
+            .take_while(|ud| ud.epoch <= epoch)
+            .collect())
+    })
+}
+
+/// Store the given receipt.
+pub fn set_receipt(owner: Address, kind: types::ReceiptKind, id: u64, receipt: types::Receipt) {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let receipts = storage::PrefixStore::new(store, &RECEIPTS);
+        let of_owner = storage::PrefixStore::new(receipts, &owner);
+        let kind = [kind as u8];
+        let mut of_kind = storage::TypedStore::new(storage::PrefixStore::new(of_owner, &kind));
+
+        of_kind.insert(id.to_be_bytes(), receipt);
+    });
+}
+
+/// Remove the given receipt from storage if it exists and return it, otherwise return `None`.
+pub fn take_receipt(owner: Address, kind: types::ReceiptKind, id: u64) -> Option<types::Receipt> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let receipts = storage::PrefixStore::new(store, &RECEIPTS);
+        let of_owner = storage::PrefixStore::new(receipts, &owner);
+        let kind = [kind as u8];
+        let mut of_kind = storage::TypedStore::new(storage::PrefixStore::new(of_owner, &kind));
+
+        let receipt = of_kind.get(id.to_be_bytes());
+        of_kind.remove(id.to_be_bytes());
+
+        receipt
+    })
+}
+
+/// A trait that exists solely to convert `beacon::EpochTime` to bytes for use as a storage key.
+trait ToStorageKey {
+    fn to_storage_key(&self) -> [u8; 8];
+}
+
+impl ToStorageKey for EpochTime {
+    fn to_storage_key(&self) -> [u8; 8] {
+        self.to_be_bytes()
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::testing::{keys, mock};
+
+    #[test]
+    fn test_delegation() {
+        let _mock = mock::Mock::default();
+
+        add_delegation(keys::alice::address(), keys::bob::address(), 500).unwrap();
+        add_delegation(keys::alice::address(), keys::bob::address(), 500).unwrap();
+
+        let di = get_delegation(keys::bob::address(), keys::alice::address()).unwrap();
+        assert_eq!(di.shares, 0);
+        let di = get_delegation(keys::alice::address(), keys::bob::address()).unwrap();
+        assert_eq!(di.shares, 1000);
+
+        let dis = get_delegations(keys::bob::address()).unwrap();
+        assert!(dis.is_empty());
+        let dis = get_delegations(keys::alice::address()).unwrap();
+        assert_eq!(dis.len(), 1);
+        assert_eq!(dis[0].shares, 1000);
+
+        let totals = get_delegations_by_destination().unwrap();
+        assert_eq!(totals.len(), 1);
+        assert_eq!(totals[&keys::bob::address()], 1000);
+
+        sub_delegation(keys::alice::address(), keys::bob::address(), 100).unwrap();
+
+        let di = get_delegation(keys::alice::address(), keys::bob::address()).unwrap();
+        assert_eq!(di.shares, 900);
+
+        let totals = get_delegations_by_destination().unwrap();
+        assert_eq!(totals.len(), 1);
+        assert_eq!(totals[&keys::bob::address()], 900);
+
+        add_delegation(keys::bob::address(), keys::bob::address(), 200).unwrap();
+
+        let totals = get_delegations_by_destination().unwrap();
+        assert_eq!(totals.len(), 1);
+        assert_eq!(totals[&keys::bob::address()], 1100);
+
+        add_delegation(keys::bob::address(), keys::alice::address(), 100).unwrap();
+
+        let totals = get_delegations_by_destination().unwrap();
+        assert_eq!(totals.len(), 2);
+        assert_eq!(totals[&keys::alice::address()], 100);
+        assert_eq!(totals[&keys::bob::address()], 1100);
+    }
+
+    #[test]
+    fn test_undelegation() {
+        let _mock = mock::Mock::default();
+
+        add_undelegation(keys::alice::address(), keys::bob::address(), 42, 500, 12).unwrap();
+        add_undelegation(keys::alice::address(), keys::bob::address(), 42, 500, 24).unwrap();
+        add_undelegation(keys::alice::address(), keys::bob::address(), 84, 200, 36).unwrap();
+
+        let qd = get_queued_undelegations(10).unwrap();
+        assert!(qd.is_empty());
+        let qd = get_queued_undelegations(42).unwrap();
+        assert_eq!(qd.len(), 1);
+        assert_eq!(qd[0].from, keys::alice::address());
+        assert_eq!(qd[0].to, keys::bob::address());
+        assert_eq!(qd[0].epoch, 42);
+        let qd = get_queued_undelegations(43).unwrap();
+        assert_eq!(qd.len(), 1);
+        assert_eq!(qd[0].from, keys::alice::address());
+        assert_eq!(qd[0].to, keys::bob::address());
+        assert_eq!(qd[0].epoch, 42);
+
+        let udis = get_undelegations(keys::alice::address()).unwrap();
+        assert!(udis.is_empty());
+        let udis = get_undelegations(keys::bob::address()).unwrap();
+        assert_eq!(udis.len(), 2);
+        assert_eq!(udis[0].from, keys::alice::address());
+        assert_eq!(udis[0].shares, 1000);
+        assert_eq!(udis[0].epoch, 42);
+        assert_eq!(udis[1].from, keys::alice::address());
+        assert_eq!(udis[1].shares, 200);
+        assert_eq!(udis[1].epoch, 84);
+
+        let di = take_undelegation(&qd[0]).unwrap();
+        assert_eq!(di.shares, 1000);
+        assert_eq!(di.receipt, 12, "receipt id should not be overwritten");
+
+        let qd = get_queued_undelegations(42).unwrap();
+        assert!(qd.is_empty());
+
+        let udis = get_undelegations(keys::bob::address()).unwrap();
+        assert_eq!(udis.len(), 1);
+    }
+
+    #[test]
+    fn test_receipts() {
+        let _mock = mock::Mock::default();
+
+        let receipt = types::Receipt {
+            shares: 123,
+            ..Default::default()
+        };
+        set_receipt(
+            keys::alice::address(),
+            types::ReceiptKind::Delegate,
+            42,
+            receipt.clone(),
+        );
+
+        let dec_receipt = take_receipt(keys::alice::address(), types::ReceiptKind::Delegate, 10);
+        assert!(dec_receipt.is_none(), "missing receipt should return None");
+
+        let dec_receipt = take_receipt(
+            keys::alice::address(),
+            types::ReceiptKind::UndelegateStart,
+            42,
+        );
+        assert!(dec_receipt.is_none(), "missing receipt should return None");
+
+        let dec_receipt = take_receipt(
+            keys::alice::address(),
+            types::ReceiptKind::UndelegateDone,
+            42,
+        );
+        assert!(dec_receipt.is_none(), "missing receipt should return None");
+
+        let dec_receipt = take_receipt(keys::alice::address(), types::ReceiptKind::Delegate, 42);
+        assert_eq!(dec_receipt, Some(receipt), "receipt should be correct");
+
+        let dec_receipt = take_receipt(keys::alice::address(), types::ReceiptKind::Delegate, 42);
+        assert!(dec_receipt.is_none(), "receipt should have been removed");
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/consensus_accounts/types.rs.html b/rust/src/oasis_runtime_sdk/modules/consensus_accounts/types.rs.html new file mode 100644 index 0000000000..645578f3ad --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/consensus_accounts/types.rs.html @@ -0,0 +1,449 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+
//! Consensus module types.
+use oasis_core_runtime::consensus::beacon::EpochTime;
+
+use crate::types::{address::Address, message::MessageEvent, token};
+
+/// Deposit into runtime call.
+/// Transfer from consensus staking to an account in this runtime.
+/// The transaction signer has a consensus layer allowance benefiting this runtime's staking
+/// address. The `to` address runtime account gets the tokens.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Deposit {
+    #[cbor(optional)]
+    pub to: Option<Address>,
+    pub amount: token::BaseUnits,
+}
+
+/// Withdraw from runtime call.
+/// Transfer from an account in this runtime to consensus staking.
+/// The `to` address consensus staking account gets the tokens.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Withdraw {
+    #[cbor(optional)]
+    pub to: Option<Address>,
+    pub amount: token::BaseUnits,
+}
+
+/// Delegate from runtime call.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Delegate {
+    pub to: Address,
+    pub amount: token::BaseUnits,
+    #[cbor(optional)]
+    pub receipt: u64,
+}
+
+/// Undelegate into runtime call.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Undelegate {
+    pub from: Address,
+    pub shares: u128,
+    #[cbor(optional)]
+    pub receipt: u64,
+}
+
+/// Kind of receipt.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+#[cfg_attr(test, derive(PartialEq, Eq))]
+#[repr(u8)]
+pub enum ReceiptKind {
+    #[default]
+    Invalid = 0,
+    Delegate = 1,
+    UndelegateStart = 2,
+    UndelegateDone = 3,
+}
+
+impl ReceiptKind {
+    /// Whether the receipt kind is valid.
+    pub fn is_valid(&self) -> bool {
+        !matches!(self, Self::Invalid)
+    }
+}
+
+/// Take receipt internal runtime call.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct TakeReceipt {
+    pub kind: ReceiptKind,
+    pub id: u64,
+}
+
+/// A receipt.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+#[cfg_attr(test, derive(PartialEq, Eq))]
+pub struct Receipt {
+    /// Shares received (for delegations).
+    #[cbor(optional)]
+    pub shares: u128,
+
+    /// Undelegate end epoch.
+    #[cbor(optional)]
+    pub epoch: EpochTime,
+
+    /// Undelegate end receipt.
+    #[cbor(optional)]
+    pub receipt: u64,
+
+    /// Amount of tokens received.
+    #[cbor(optional)]
+    pub amount: u128,
+
+    /// Consensus layer error.
+    #[cbor(optional)]
+    pub error: Option<ConsensusError>,
+}
+
+/// Balance query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct BalanceQuery {
+    pub address: Address,
+}
+
+/// Consensus account query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ConsensusAccountQuery {
+    pub address: Address,
+}
+
+/// Delegation query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct DelegationQuery {
+    pub from: Address,
+    pub to: Address,
+}
+
+/// Delegations query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct DelegationsQuery {
+    pub from: Address,
+}
+
+/// Undelegations query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct UndelegationsQuery {
+    pub to: Address,
+}
+
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct AccountBalance {
+    pub balance: u128,
+}
+
+/// Information about a delegation.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct DelegationInfo {
+    /// The amount of owned shares.
+    pub shares: u128,
+
+    /// Receipt identifier for this undelegation.
+    #[cbor(optional)]
+    pub receipt: u64,
+}
+
+/// Extended information about a delegation.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ExtendedDelegationInfo {
+    /// Address delegated to.
+    pub to: Address,
+    /// The amount of owned shares.
+    pub shares: u128,
+}
+
+/// Information about an undelegation.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct UndelegationInfo {
+    /// Address being undelegated from.
+    pub from: Address,
+    /// Epoch when the undelegation will be complete.
+    pub epoch: EpochTime,
+    /// The amount of undelegated shares.
+    pub shares: u128,
+}
+
+/// Context for consensus transfer message handler.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ConsensusTransferContext {
+    pub address: Address,
+    #[cbor(optional)]
+    pub nonce: u64,
+    #[cbor(optional)]
+    pub to: Address,
+    pub amount: token::BaseUnits,
+}
+
+/// Context for consensus withdraw message handler.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ConsensusWithdrawContext {
+    #[cbor(optional)]
+    pub from: Address,
+    #[cbor(optional)]
+    pub nonce: u64,
+    pub address: Address,
+    pub amount: token::BaseUnits,
+}
+
+/// Context for consensus delegate message handler.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode, Default)]
+pub struct ConsensusDelegateContext {
+    pub from: Address,
+    pub nonce: u64,
+    pub to: Address,
+    pub amount: token::BaseUnits,
+    #[cbor(optional)]
+    pub receipt: bool,
+}
+
+/// Context for consensus undelegate message handler.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode, Default)]
+pub struct ConsensusUndelegateContext {
+    pub from: Address,
+    pub nonce: u64,
+    pub to: Address,
+    pub shares: u128,
+    #[cbor(optional)]
+    pub receipt: bool,
+}
+
+/// Error details from the consensus layer.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct ConsensusError {
+    #[cbor(optional)]
+    pub module: String,
+
+    #[cbor(optional)]
+    pub code: u32,
+}
+
+impl From<MessageEvent> for ConsensusError {
+    fn from(me: MessageEvent) -> Self {
+        Self {
+            module: me.module,
+            code: me.code,
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/core/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/core/mod.rs.html new file mode 100644 index 0000000000..ced4db1939 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/core/mod.rs.html @@ -0,0 +1,2673 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+
//! Core definitions module.
+use std::{
+    collections::{BTreeMap, BTreeSet},
+    convert::{TryFrom, TryInto},
+    fmt::Display,
+};
+
+use anyhow::anyhow;
+use oasis_runtime_sdk_macros::{handler, sdk_derive};
+use thiserror::Error;
+
+use crate::{
+    callformat,
+    context::Context,
+    core::consensus::beacon::EpochTime,
+    dispatcher,
+    error::Error as SDKError,
+    keymanager, migration,
+    module::{
+        self, CallResult, InvariantHandler as _, MethodHandler as _, Module as _,
+        ModuleInfoHandler as _,
+    },
+    sender::SenderMeta,
+    state::{CurrentState, Mode, Options, TransactionWithMeta},
+    storage::{self},
+    types::{
+        token::{self, Denomination},
+        transaction::{
+            self, AddressSpec, AuthProof, Call, CallFormat, CallerAddress, SignerInfo, Transaction,
+            UnverifiedTransaction,
+        },
+    },
+    Runtime,
+};
+
+use self::types::RuntimeInfoResponse;
+
+#[cfg(test)]
+mod test;
+pub mod types;
+
+/// Unique module name.
+pub const MODULE_NAME: &str = "core";
+
+/// Errors emitted by the core module.
+#[derive(Error, Debug, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("malformed transaction: {0}")]
+    #[sdk_error(code = 1)]
+    MalformedTransaction(#[source] anyhow::Error),
+
+    #[error("invalid transaction: {0}")]
+    #[sdk_error(code = 2)]
+    InvalidTransaction(#[from] transaction::Error),
+
+    #[error("invalid method: {0}")]
+    #[sdk_error(code = 3)]
+    InvalidMethod(String),
+
+    #[error("invalid nonce")]
+    #[sdk_error(code = 4)]
+    InvalidNonce,
+
+    #[error("insufficient balance to pay fees")]
+    #[sdk_error(code = 5)]
+    InsufficientFeeBalance,
+
+    #[error("out of message slots")]
+    #[sdk_error(code = 6)]
+    OutOfMessageSlots,
+
+    #[error("message handler not invoked")]
+    #[sdk_error(code = 8)]
+    MessageHandlerNotInvoked,
+
+    #[error("missing message handler")]
+    #[sdk_error(code = 9)]
+    MessageHandlerMissing(u32),
+
+    #[error("invalid argument: {0}")]
+    #[sdk_error(code = 10)]
+    InvalidArgument(#[source] anyhow::Error),
+
+    #[error("gas overflow")]
+    #[sdk_error(code = 11)]
+    GasOverflow,
+
+    #[error("out of gas (limit: {0} wanted: {1})")]
+    #[sdk_error(code = 12)]
+    OutOfGas(u64, u64),
+
+    #[error("too many authentication slots")]
+    #[sdk_error(code = 15)]
+    TooManyAuth,
+
+    #[error("multisig too many signers")]
+    #[sdk_error(code = 16)]
+    MultisigTooManySigners,
+
+    #[error("invariant violation: {0}")]
+    #[sdk_error(code = 17)]
+    InvariantViolation(String),
+
+    #[error("invalid call format: {0}")]
+    #[sdk_error(code = 18)]
+    InvalidCallFormat(#[source] anyhow::Error),
+
+    #[error("{0}")]
+    #[sdk_error(transparent, abort)]
+    Abort(#[source] dispatcher::Error),
+
+    #[error("no module could authenticate the transaction")]
+    #[sdk_error(code = 19)]
+    NotAuthenticated,
+
+    #[error("gas price too low")]
+    #[sdk_error(code = 20)]
+    GasPriceTooLow,
+
+    #[error("forbidden in secure build")]
+    #[sdk_error(code = 21)]
+    ForbiddenInSecureBuild,
+
+    #[error("forbidden by node policy")]
+    #[sdk_error(code = 22)]
+    Forbidden,
+
+    #[error("transaction is too large")]
+    #[sdk_error(code = 23)]
+    OversizedTransaction,
+
+    #[error("transaction is expired or not yet valid")]
+    #[sdk_error(code = 24)]
+    ExpiredTransaction,
+
+    #[error("read-only transaction attempted modifications")]
+    #[sdk_error(code = 25)]
+    ReadOnlyTransaction,
+
+    #[error("future nonce")]
+    #[sdk_error(code = 26)]
+    FutureNonce,
+
+    #[error("call depth exceeded (depth: {0} max: {1})")]
+    #[sdk_error(code = 27)]
+    CallDepthExceeded(u16, u16),
+
+    #[error("{0}")]
+    #[sdk_error(transparent)]
+    TxSimulationFailed(#[from] TxSimulationFailure),
+}
+
+impl Error {
+    /// Generate a proper OutOfGas error, depending on whether the module is configured to emit gas
+    /// use information or not.
+    pub fn out_of_gas<Cfg: Config>(limit: u64, wanted: u64) -> Self {
+        if Cfg::EMIT_GAS_USED_EVENTS {
+            Self::OutOfGas(limit, wanted)
+        } else {
+            // Mask gas used information.
+            Self::OutOfGas(0, 0)
+        }
+    }
+}
+
+/// Simulation failure error.
+#[derive(Error, Debug)]
+pub struct TxSimulationFailure {
+    message: String,
+    module_name: String,
+    code: u32,
+}
+
+impl TxSimulationFailure {
+    /// Returns true if the failure is "core::Error::OutOfGas".
+    pub fn is_error_core_out_of_gas(&self) -> bool {
+        self.module_name == MODULE_NAME && self.code == 12
+    }
+}
+
+impl Display for TxSimulationFailure {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        write!(f, "{}", self.message)
+    }
+}
+
+impl SDKError for TxSimulationFailure {
+    fn module_name(&self) -> &str {
+        &self.module_name
+    }
+
+    fn code(&self) -> u32 {
+        self.code
+    }
+}
+
+impl TryFrom<CallResult> for TxSimulationFailure {
+    type Error = anyhow::Error;
+
+    fn try_from(value: CallResult) -> Result<Self, Self::Error> {
+        match value {
+            CallResult::Failed {
+                module,
+                code,
+                message,
+            } => Ok(TxSimulationFailure {
+                code,
+                module_name: module,
+                message,
+            }),
+            _ => Err(anyhow!("CallResult not Failed")),
+        }
+    }
+}
+
+/// Events emitted by the core module.
+#[derive(Debug, PartialEq, Eq, cbor::Encode, oasis_runtime_sdk_macros::Event)]
+#[cbor(untagged)]
+pub enum Event {
+    #[sdk_event(code = 1)]
+    GasUsed { amount: u64 },
+}
+
+/// Gas costs.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct GasCosts {
+    pub tx_byte: u64,
+    pub storage_byte: u64,
+
+    pub auth_signature: u64,
+    pub auth_multisig_signer: u64,
+
+    pub callformat_x25519_deoxysii: u64,
+}
+
+/// Dynamic min gas price parameters.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct DynamicMinGasPrice {
+    /// Enables the dynamic min gas price feature which dynamically adjusts the minimum gas price
+    /// based on block fullness, inspired by EIP-1559.
+    ///
+    /// Only takes effect if `min_gas_price`(s) are set.
+    pub enabled: bool,
+
+    /// Target block gas usage indicates the desired block gas usage as a percentage of the total
+    /// block gas limit.
+    ///
+    /// The min gas price will adjust up or down depending on whether the actual gas usage is above
+    /// or below this target.
+    pub target_block_gas_usage_percentage: u8,
+    /// Represents a constant value used to limit the rate at which the min price can change
+    /// between blocks.
+    ///
+    /// For example, if `min_price_max_change_denominator` is set to 8, the maximum change in
+    /// min price is 12.5% between blocks.
+    pub min_price_max_change_denominator: u8,
+}
+
+/// Errors emitted during core parameter validation.
+#[derive(Error, Debug)]
+pub enum ParameterValidationError {
+    #[error("invalid dynamic target block gas usage percentage (10-100)")]
+    InvalidTargetBlockGasUsagePercentage,
+    #[error("invalid dynamic min price max change denominator (1-50)")]
+    InvalidMinPriceMaxChangeDenominator,
+}
+/// Parameters for the core module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Parameters {
+    pub max_batch_gas: u64,
+    pub max_tx_size: u32,
+    pub max_tx_signers: u32,
+    pub max_multisig_signers: u32,
+    pub gas_costs: GasCosts,
+    pub min_gas_price: BTreeMap<token::Denomination, u128>,
+    pub dynamic_min_gas_price: DynamicMinGasPrice,
+}
+
+impl module::Parameters for Parameters {
+    type Error = ParameterValidationError;
+
+    fn validate_basic(&self) -> Result<(), Self::Error> {
+        // Validate dynamic min gas price parameters.
+        let dmgp = &self.dynamic_min_gas_price;
+        if dmgp.enabled {
+            if dmgp.target_block_gas_usage_percentage < 10
+                || dmgp.target_block_gas_usage_percentage > 100
+            {
+                return Err(ParameterValidationError::InvalidTargetBlockGasUsagePercentage);
+            }
+            if dmgp.min_price_max_change_denominator < 1
+                || dmgp.min_price_max_change_denominator > 50
+            {
+                return Err(ParameterValidationError::InvalidMinPriceMaxChangeDenominator);
+            }
+        }
+        Ok(())
+    }
+}
+
+/// Interface that can be called from other modules.
+pub trait API {
+    /// Module configuration.
+    type Config: Config;
+
+    /// Attempt to use gas. If the gas specified would cause either total used to exceed
+    /// its limit, fails with Error::OutOfGas or Error::BatchOutOfGas, and neither gas usage is
+    /// increased.
+    fn use_batch_gas(gas: u64) -> Result<(), Error>;
+
+    /// Attempt to use gas. If the gas specified would cause either total used to exceed
+    /// its limit, fails with Error::OutOfGas or Error::BatchOutOfGas, and neither gas usage is
+    /// increased.
+    fn use_tx_gas(gas: u64) -> Result<(), Error>;
+
+    /// Returns the remaining batch-wide gas.
+    fn remaining_batch_gas() -> u64;
+
+    /// Returns the total batch-wide gas used.
+    fn used_batch_gas() -> u64;
+
+    /// Return the remaining tx-wide gas.
+    fn remaining_tx_gas() -> u64;
+
+    /// Return the used tx-wide gas.
+    fn used_tx_gas() -> u64;
+
+    /// Configured maximum amount of gas that can be used in a batch.
+    fn max_batch_gas() -> u64;
+
+    /// Configured minimum gas price.
+    fn min_gas_price(denom: &token::Denomination) -> Option<u128>;
+
+    /// Sets the transaction priority to the provided amount.
+    fn set_priority(priority: u64);
+
+    /// Takes and returns the stored transaction priority.
+    fn take_priority() -> u64;
+
+    /// Set transaction sender metadata.
+    fn set_sender_meta(meta: SenderMeta);
+
+    /// Takes and returns the stored transaction sender metadata.
+    fn take_sender_meta() -> SenderMeta;
+
+    /// Returns the configured max iterations in the binary search for the estimate
+    /// gas.
+    fn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64;
+
+    /// Check whether the epoch has changed since last processed block.
+    fn has_epoch_changed() -> bool;
+}
+
+/// Genesis state for the accounts module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Genesis {
+    pub parameters: Parameters,
+}
+
+/// Local configuration that can be provided by the node operator.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct LocalConfig {
+    /// Minimum gas price to accept.
+    #[cbor(optional)]
+    pub min_gas_price: BTreeMap<token::Denomination, u128>,
+
+    /// When estimating gas in `core.EstimateGas`, simulate the tx (and report) only up to this much
+    /// used gas. This limit is more likely to be relevant if `estimate_gas_by_simulating_contracts` is
+    /// enabled in the local config. The special value of 0 means that the maximum amount of gas in a
+    /// batch will be used.
+    #[cbor(optional)]
+    pub max_estimated_gas: u64,
+
+    /// The maximum number of iterations of the binary search to be done when simulating contracts for
+    /// gas estimation in `core.EstimateGas`.
+    /// The special value of 0 means that binary search won't be performed, and the transaction will be
+    /// simulated using maximum possible gas, which might return an overestimation in some special cases.
+    /// This setting should likely be kept at 0, unless the runtime is using the EVM module.
+    #[cbor(optional)]
+    pub estimate_gas_search_max_iters: u64,
+}
+
+/// State schema constants.
+pub mod state {
+    /// Runtime metadata.
+    pub const METADATA: &[u8] = &[0x01];
+    /// Map of message idx to message handlers for messages emitted in previous round.
+    pub const MESSAGE_HANDLERS: &[u8] = &[0x02];
+    /// Last processed epoch for detecting epoch changes.
+    pub const LAST_EPOCH: &[u8] = &[0x03];
+    /// Dynamic min gas price.
+    pub const DYNAMIC_MIN_GAS_PRICE: &[u8] = &[0x04];
+}
+
+/// Module configuration.
+#[allow(clippy::declare_interior_mutable_const)]
+pub trait Config: 'static {
+    /// Default local minimum gas price configuration that is used in case no overrides are set in
+    /// local per-node configuration.
+    const DEFAULT_LOCAL_MIN_GAS_PRICE: once_cell::unsync::Lazy<
+        BTreeMap<token::Denomination, u128>,
+    > = once_cell::unsync::Lazy::new(BTreeMap::new);
+
+    /// Default local estimate gas max search iterations configuration that is used in case no overrides
+    /// are set in the local per-node configuration.
+    const DEFAULT_LOCAL_ESTIMATE_GAS_SEARCH_MAX_ITERS: u64 = 0;
+
+    /// Estimated gas amount to be added to failed transaction simulations for selected methods.
+    const ESTIMATE_GAS_EXTRA_FAIL: once_cell::unsync::Lazy<BTreeMap<&'static str, u64>> =
+        once_cell::unsync::Lazy::new(BTreeMap::new);
+
+    /// Methods which are exempt from minimum gas price requirements.
+    const MIN_GAS_PRICE_EXEMPT_METHODS: once_cell::unsync::Lazy<BTreeSet<&'static str>> =
+        once_cell::unsync::Lazy::new(BTreeSet::new);
+
+    /// Whether gas used events should be emitted for every transaction.
+    ///
+    /// Confidential runtimes may want to disable this as it is a possible side channel.
+    const EMIT_GAS_USED_EVENTS: bool = true;
+
+    /// Whether to allow submission of read-only transactions in an interactive way.
+    ///
+    /// Note that execution of such transactions is allowed to access confidential state.
+    const ALLOW_INTERACTIVE_READ_ONLY_TRANSACTIONS: bool = false;
+
+    /// The gas cost of the internal call to retrieve the current calldata public key.
+    const GAS_COST_CALL_CALLDATA_PUBLIC_KEY: u64 = 20;
+    /// The gas cost of the internal call to retrieve the current epoch.
+    const GAS_COST_CALL_CURRENT_EPOCH: u64 = 10;
+}
+
+pub struct Module<Cfg: Config> {
+    _cfg: std::marker::PhantomData<Cfg>,
+}
+
+const CONTEXT_KEY_GAS_USED: &str = "core.GasUsed";
+const CONTEXT_KEY_PRIORITY: &str = "core.Priority";
+const CONTEXT_KEY_SENDER_META: &str = "core.SenderMeta";
+const CONTEXT_KEY_EPOCH_CHANGED: &str = "core.EpochChanged";
+
+impl<Cfg: Config> API for Module<Cfg> {
+    type Config = Cfg;
+
+    fn use_batch_gas(gas: u64) -> Result<(), Error> {
+        // Do not enforce batch limits for checks.
+        if CurrentState::with_env(|env| env.is_check_only()) {
+            return Ok(());
+        }
+        let batch_gas_limit = Self::params().max_batch_gas;
+        let batch_gas_used = Self::used_batch_gas();
+        // NOTE: Going over the batch limit should trigger an abort as the scheduler should never
+        //       allow scheduling past the batch limit but a malicious proposer might include too
+        //       many transactions. Make sure to vote for failure in this case.
+        let batch_new_gas_used = batch_gas_used
+            .checked_add(gas)
+            .ok_or(Error::Abort(dispatcher::Error::BatchOutOfGas))?;
+        if batch_new_gas_used > batch_gas_limit {
+            return Err(Error::Abort(dispatcher::Error::BatchOutOfGas));
+        }
+
+        CurrentState::with(|state| {
+            state
+                .block_value::<u64>(CONTEXT_KEY_GAS_USED)
+                .set(batch_new_gas_used);
+        });
+
+        Ok(())
+    }
+
+    fn use_tx_gas(gas: u64) -> Result<(), Error> {
+        let (gas_limit, gas_used) = CurrentState::with(|state| {
+            (
+                state.env().tx_auth_info().fee.gas,
+                *state.local_value::<u64>(CONTEXT_KEY_GAS_USED).or_default(),
+            )
+        });
+        let new_gas_used = {
+            let sum = gas_used.checked_add(gas).ok_or(Error::GasOverflow)?;
+            if sum > gas_limit {
+                return Err(Error::out_of_gas::<Cfg>(gas_limit, sum));
+            }
+            sum
+        };
+
+        Self::use_batch_gas(gas)?;
+
+        CurrentState::with(|state| {
+            *state.local_value::<u64>(CONTEXT_KEY_GAS_USED).or_default() = new_gas_used;
+        });
+
+        Ok(())
+    }
+
+    fn remaining_batch_gas() -> u64 {
+        let batch_gas_limit = Self::params().max_batch_gas;
+        batch_gas_limit.saturating_sub(Self::used_batch_gas())
+    }
+
+    fn used_batch_gas() -> u64 {
+        CurrentState::with(|state| {
+            state
+                .block_value::<u64>(CONTEXT_KEY_GAS_USED)
+                .get()
+                .cloned()
+                .unwrap_or_default()
+        })
+    }
+
+    fn remaining_tx_gas() -> u64 {
+        let (gas_limit, gas_used) = CurrentState::with(|state| {
+            (
+                state.env().tx_auth_info().fee.gas,
+                *state.local_value::<u64>(CONTEXT_KEY_GAS_USED).or_default(),
+            )
+        });
+        let remaining_tx = gas_limit.saturating_sub(gas_used);
+        // Also check remaining batch gas limit and return the minimum of the two.
+        let remaining_batch = Self::remaining_batch_gas();
+        std::cmp::min(remaining_tx, remaining_batch)
+    }
+
+    fn used_tx_gas() -> u64 {
+        CurrentState::with(|state| *state.local_value::<u64>(CONTEXT_KEY_GAS_USED).or_default())
+    }
+
+    fn max_batch_gas() -> u64 {
+        Self::params().max_batch_gas
+    }
+
+    fn min_gas_price(denom: &token::Denomination) -> Option<u128> {
+        Self::min_gas_prices().get(denom).copied()
+    }
+
+    fn set_priority(priority: u64) {
+        CurrentState::with(|state| {
+            state.block_value::<u64>(CONTEXT_KEY_PRIORITY).set(priority);
+        })
+    }
+
+    fn take_priority() -> u64 {
+        CurrentState::with(|state| {
+            state
+                .block_value::<u64>(CONTEXT_KEY_PRIORITY)
+                .take()
+                .unwrap_or_default()
+        })
+    }
+
+    fn set_sender_meta(meta: SenderMeta) {
+        CurrentState::with(|state| {
+            state
+                .block_value::<SenderMeta>(CONTEXT_KEY_SENDER_META)
+                .set(meta);
+        });
+    }
+
+    fn take_sender_meta() -> SenderMeta {
+        CurrentState::with(|state| {
+            state
+                .block_value::<SenderMeta>(CONTEXT_KEY_SENDER_META)
+                .take()
+                .unwrap_or_default()
+        })
+    }
+
+    fn estimate_gas_search_max_iters<C: Context>(ctx: &C) -> u64 {
+        ctx.local_config(MODULE_NAME)
+            .as_ref()
+            .map(|cfg: &LocalConfig| cfg.estimate_gas_search_max_iters)
+            .unwrap_or(Cfg::DEFAULT_LOCAL_ESTIMATE_GAS_SEARCH_MAX_ITERS)
+    }
+
+    fn has_epoch_changed() -> bool {
+        CurrentState::with(|state| {
+            *state
+                .block_value(CONTEXT_KEY_EPOCH_CHANGED)
+                .get()
+                .unwrap_or(&false)
+        })
+    }
+}
+
+#[sdk_derive(Module)]
+impl<Cfg: Config> Module<Cfg> {
+    const NAME: &'static str = MODULE_NAME;
+    type Error = Error;
+    type Event = Event;
+    type Parameters = Parameters;
+    type Genesis = Genesis;
+
+    #[migration(init)]
+    pub fn init(genesis: Genesis) {
+        // Set genesis parameters.
+        Self::set_params(genesis.parameters);
+    }
+
+    /// Run a transaction in simulation and return how much gas it uses. This looks up the method
+    /// in the context's method registry. Transactions that fail still use gas, and this query will
+    /// estimate that and return successfully, so do not use this query to see if a transaction will
+    /// succeed.
+    #[handler(query = "core.EstimateGas", allow_private_km)]
+    pub fn query_estimate_gas<C: Context>(
+        ctx: &C,
+        mut args: types::EstimateGasQuery,
+    ) -> Result<u64, Error> {
+        let mut extra_gas = 0u64;
+        // In case the runtime is confidential we are unable to authenticate the caller so we must
+        // make sure to zeroize it to avoid leaking private information.
+        if ctx.is_confidential() {
+            args.caller = Some(
+                args.caller
+                    .unwrap_or_else(|| {
+                        args.tx
+                            .auth_info
+                            .signer_info
+                            .first()
+                            .map(|si| si.address_spec.caller_address())
+                            .unwrap_or(CallerAddress::Address(Default::default()))
+                    })
+                    .zeroized(),
+            );
+            args.propagate_failures = false; // Likely to fail as caller is zeroized.
+        }
+        // Assume maximum amount of gas in a batch, a reasonable maximum fee and maximum amount of consensus messages.
+        args.tx.auth_info.fee.gas = {
+            let local_max_estimated_gas = Self::get_local_max_estimated_gas(ctx);
+            if local_max_estimated_gas == 0 {
+                Self::params().max_batch_gas
+            } else {
+                local_max_estimated_gas
+            }
+        };
+        args.tx.auth_info.fee.amount =
+            token::BaseUnits::new(u64::MAX.into(), token::Denomination::NATIVE);
+        args.tx.auth_info.fee.consensus_messages = ctx.max_messages();
+        // Estimate transaction size. Since the transaction given to us is not signed, we need to
+        // estimate how large each of the auth proofs would be.
+        let auth_proofs: Result<_, Error> = args
+            .tx
+            .auth_info
+            .signer_info
+            .iter()
+            .map(|si| match si.address_spec {
+                // For the signature address spec we assume a signature auth proof of 64 bytes.
+                transaction::AddressSpec::Signature(_) => {
+                    Ok(transaction::AuthProof::Signature(vec![0; 64].into()))
+                }
+                // For the multisig address spec assume all the signers sign with a 64-byte signature.
+                transaction::AddressSpec::Multisig(ref cfg) => {
+                    Ok(transaction::AuthProof::Multisig(
+                        cfg.signers
+                            .iter()
+                            .map(|_| Some(vec![0; 64].into()))
+                            .collect(),
+                    ))
+                }
+                // Internal address specs should never appear as they are not serializable.
+                transaction::AddressSpec::Internal(_) => Err(Error::MalformedTransaction(anyhow!(
+                    "internal address spec used"
+                ))),
+            })
+            .collect();
+        let tx_envelope =
+            transaction::UnverifiedTransaction(cbor::to_vec(args.tx.clone()), auth_proofs?);
+        let tx_size: u32 = cbor::to_vec(tx_envelope)
+            .len()
+            .try_into()
+            .map_err(|_| Error::InvalidArgument(anyhow!("transaction too large")))?;
+        let propagate_failures = args.propagate_failures;
+        let bs_max_iters = Self::estimate_gas_search_max_iters(ctx);
+
+        // Update the address used within the transaction when caller address is passed.
+        if let Some(caller) = args.caller.clone() {
+            // Include additional gas for each signature verification since we will be overwriting
+            // the signer infos below.
+            extra_gas = extra_gas.saturating_add(
+                Self::compute_signature_verification_cost(
+                    &Self::params(),
+                    &args.tx.auth_info.signer_info,
+                )
+                .unwrap_or_default(),
+            );
+
+            args.tx.auth_info.signer_info = vec![transaction::SignerInfo {
+                address_spec: transaction::AddressSpec::Internal(caller),
+                nonce: args
+                    .tx
+                    .auth_info
+                    .signer_info
+                    .first()
+                    .map(|si| si.nonce)
+                    .unwrap_or_default(),
+            }];
+        }
+
+        // Determine if we need to add any extra gas for failing calls.
+        #[allow(clippy::borrow_interior_mutable_const)]
+        let extra_gas_fail = *Cfg::ESTIMATE_GAS_EXTRA_FAIL
+            .get(args.tx.call.method.as_str())
+            .unwrap_or(&0);
+
+        // Simulates transaction with a specific gas limit.
+        let simulate = |tx: &transaction::Transaction, gas: u64, report_failure: bool| {
+            let mut tx = tx.clone();
+            tx.auth_info.fee.gas = gas;
+            let call = tx.call.clone(); // TODO: Avoid clone.
+
+            CurrentState::with_transaction_opts(
+                Options::new()
+                    .with_mode(Mode::Simulate)
+                    .with_tx(TransactionWithMeta {
+                        data: tx,
+                        size: tx_size,
+                        index: 0,
+                        hash: Default::default(),
+                    }),
+                || {
+                    let (result, _) = dispatcher::Dispatcher::<C::Runtime>::dispatch_tx_call(
+                        ctx,
+                        call,
+                        &Default::default(),
+                    );
+                    if !result.is_success() && report_failure {
+                        // Report failure.
+                        let err: TxSimulationFailure = result.try_into().unwrap(); // Guaranteed to be a Failed CallResult.
+                        return Err(Error::TxSimulationFailed(err));
+                    }
+                    // Don't report success or failure. If the call fails, we still report
+                    // how much gas it uses while it fails.
+                    let gas_used = Self::used_batch_gas();
+                    if result.is_success() {
+                        Ok(gas_used)
+                    } else {
+                        Ok(gas_used.saturating_add(extra_gas_fail).clamp(0, gas))
+                    }
+                },
+            )
+        };
+
+        // Do a binary search for exact gas limit.
+        let (cap, mut lo, mut hi) = (
+            args.tx.auth_info.fee.gas,
+            10_u128,
+            args.tx.auth_info.fee.gas as u128,
+        ); // Use u128 to avoid overflows when computing the mid point.
+
+        // Count iterations, and remember if fast path was tried.
+        let (mut iters, mut fast_path_tried) = (0, false);
+        // The following two variables are used to control the special case where a transaction fails
+        // and we check if the error is due to out-of-gas by re-simulating the transaction with maximum
+        // gas limit. This is needed due to EVM transactions failing with a "reverted" error when
+        // not having enough gas for EIP-150 (and not with "out-of-gas").
+        let (mut has_succeeded, mut tried_with_max_gas) = (false, false);
+        while (lo + 1 < hi) && iters < bs_max_iters {
+            iters += 1;
+
+            let mid = (hi + lo) / 2;
+            match simulate(&args.tx, mid as u64, true) {
+                Ok(r) => {
+                    // Estimate success. Try with lower gas.
+                    hi = mid;
+
+                    // The transaction succeeded at least once, meaning any future failure is due
+                    // to insufficient gas limit.
+                    has_succeeded = true;
+
+                    // Optimization: In vast majority of cases the initially returned gas estimate
+                    // might already be a good one. Check if this is the case to speed up the convergence.
+                    if !fast_path_tried && (lo + 1 < hi) {
+                        fast_path_tried = true;
+
+                        // If simulate with the returned estimate succeeds, we can further shrink the
+                        // high limit of the binary search.
+                        match simulate(&args.tx, r, true) {
+                            Ok(_) => hi = r as u128,
+                            _ => continue,
+                        }
+                        // If simulate with one unit of gas smaller fails, we know the exact estimate.
+                        match simulate(&args.tx, r - 1, true) {
+                            Err(_) => {
+                                // Stop the gas search.
+                                break;
+                            }
+                            _ => continue,
+                        }
+                    }
+                }
+                Err(_) if has_succeeded => {
+                    // Transaction previously succeeded. Transaction failed due to insufficient gas limit,
+                    // regardless of the actual returned error.
+                    // Try with higher gas.
+                    lo = mid
+                }
+                Err(Error::TxSimulationFailed(failure)) if failure.is_error_core_out_of_gas() => {
+                    // Estimate failed due to insufficient gas limit. Try with higher gas.
+                    lo = mid
+                }
+                r @ Err(_) => {
+                    let mut res = r;
+                    if !tried_with_max_gas {
+                        tried_with_max_gas = true;
+                        // Transaction failed and simulation with max gas was not yet tried.
+                        // Try simulating with maximum gas once:
+                        //  - if fails, the transaction will always fail, stop the binary search.
+                        //  - if succeeds, remember that transaction is failing due to insufficient gas
+                        //    and continue the search.
+                        res = simulate(&args.tx, cap, true)
+                    }
+                    match res {
+                        Ok(_) => {
+                            has_succeeded = true;
+                            // Transaction can succeed. Try with higher gas.
+                            lo = mid
+                        }
+                        err if propagate_failures => {
+                            // Estimate failed (not with out-of-gas) and caller wants error propagation -> early exit and return the error.
+                            return err;
+                        }
+                        _ => {
+                            // Estimate failed (not with out-of-gas) but caller wants to know the gas usage.
+                            // Exit loop and do one final estimate without error propagation.
+                            // NOTE: don't continue the binary search for failing transactions as the convergence
+                            // for these could take somewhat long and the estimate with default max gas is likely good.
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+
+        // hi == cap if binary search is disabled or this is a failing transaction.
+        let result = if hi == cap.into() {
+            // Simulate one last time with maximum gas limit.
+            simulate(&args.tx, cap, propagate_failures)
+        } else {
+            Ok(hi as u64)
+        };
+
+        // Make sure the final result is clamped.
+        result.map(|est| est.saturating_add(extra_gas).clamp(0, cap))
+    }
+
+    /// Check invariants of all modules in the runtime.
+    #[handler(query = "core.CheckInvariants", expensive)]
+    fn query_check_invariants<C: Context>(ctx: &C, _args: ()) -> Result<(), Error> {
+        <C::Runtime as Runtime>::Modules::check_invariants(ctx)
+    }
+
+    fn calldata_public_key_common<C: Context>(
+        ctx: &C,
+    ) -> Result<types::CallDataPublicKeyQueryResponse, Error> {
+        let key_manager = ctx
+            .key_manager()
+            .ok_or_else(|| Error::InvalidArgument(anyhow!("key manager not available")))?;
+        let epoch = ctx.epoch();
+        let public_key = key_manager
+            .get_public_ephemeral_key(callformat::get_key_pair_id(epoch), epoch)
+            .map_err(|err| match err {
+                keymanager::KeyManagerError::InvalidEpoch(..) => {
+                    Error::InvalidCallFormat(anyhow!("invalid epoch"))
+                }
+                _ => Error::Abort(err.into()),
+            })?;
+
+        Ok(types::CallDataPublicKeyQueryResponse { public_key, epoch })
+    }
+
+    /// Retrieve the public key for encrypting call data.
+    #[handler(query = "core.CallDataPublicKey")]
+    fn query_calldata_public_key<C: Context>(
+        ctx: &C,
+        _args: (),
+    ) -> Result<types::CallDataPublicKeyQueryResponse, Error> {
+        Self::calldata_public_key_common(ctx)
+    }
+
+    /// Retrieve the public key for encrypting call data (internally exposed call).
+    #[handler(call = "core.CallDataPublicKey", internal)]
+    fn internal_calldata_public_key<C: Context>(
+        ctx: &C,
+        _args: (),
+    ) -> Result<types::CallDataPublicKeyQueryResponse, Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_CALLDATA_PUBLIC_KEY)?;
+        Self::calldata_public_key_common(ctx)
+    }
+
+    /// Retrieve the current epoch.
+    #[handler(call = "core.CurrentEpoch", internal)]
+    fn internal_current_epoch<C: Context>(ctx: &C, _args: ()) -> Result<u64, Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_CURRENT_EPOCH)?;
+        Ok(ctx.epoch())
+    }
+
+    /// Query the minimum gas price.
+    #[handler(query = "core.MinGasPrice")]
+    fn query_min_gas_price<C: Context>(
+        ctx: &C,
+        _args: (),
+    ) -> Result<BTreeMap<token::Denomination, u128>, Error> {
+        let mut mgp = Self::min_gas_prices();
+
+        // Generate a combined view with local overrides.
+        for (denom, price) in mgp.iter_mut() {
+            let local_mgp = Self::get_local_min_gas_price(ctx, denom);
+            if local_mgp > *price {
+                *price = local_mgp;
+            }
+        }
+
+        Ok(mgp)
+    }
+
+    /// Return basic information about the module and the containing runtime.
+    #[handler(query = "core.RuntimeInfo")]
+    fn query_runtime_info<C: Context>(ctx: &C, _args: ()) -> Result<RuntimeInfoResponse, Error> {
+        Ok(RuntimeInfoResponse {
+            runtime_version: <C::Runtime as Runtime>::VERSION,
+            state_version: <C::Runtime as Runtime>::STATE_VERSION,
+            modules: <C::Runtime as Runtime>::Modules::module_info(ctx),
+        })
+    }
+
+    /// Execute a read-only transaction in an interactive mode.
+    ///
+    /// # Warning
+    ///
+    /// This query is allowed access to private key manager state.
+    #[handler(query = "core.ExecuteReadOnlyTx", expensive, allow_private_km)]
+    fn query_execute_read_only_tx<C: Context>(
+        ctx: &C,
+        args: types::ExecuteReadOnlyTxQuery,
+    ) -> Result<types::ExecuteReadOnlyTxResponse, Error> {
+        if !Cfg::ALLOW_INTERACTIVE_READ_ONLY_TRANSACTIONS {
+            return Err(Error::Forbidden);
+        }
+
+        CurrentState::with_transaction_opts(Options::new().with_mode(Mode::Simulate), || {
+            // TODO: Use separate batch gas limit for query execution.
+
+            // Decode transaction and verify signature.
+            let tx_size = args
+                .tx
+                .len()
+                .try_into()
+                .map_err(|_| Error::OversizedTransaction)?;
+            let tx = dispatcher::Dispatcher::<C::Runtime>::decode_tx(ctx, &args.tx)?;
+
+            // Only read-only transactions are allowed in interactive queries.
+            if !tx.call.read_only {
+                return Err(Error::InvalidArgument(anyhow::anyhow!(
+                    "only read-only transactions are allowed"
+                )));
+            }
+            // Only transactions with expiry are allowed in interactive queries.
+            if tx.auth_info.not_before.is_none() || tx.auth_info.not_after.is_none() {
+                return Err(Error::InvalidArgument(anyhow::anyhow!(
+                    "only read-only transactions with expiry are allowed"
+                )));
+            }
+
+            // Execute transaction.
+            let (result, _) = dispatcher::Dispatcher::<C::Runtime>::execute_tx_opts(
+                ctx,
+                tx,
+                &dispatcher::DispatchOptions {
+                    tx_size,
+                    method_authorizer: Some(&|method| {
+                        // Ensure that the inner method is allowed to be called from an interactive
+                        // context to avoid unexpected pitfalls.
+                        <C::Runtime as Runtime>::Modules::is_allowed_interactive_call(method)
+                            && <C::Runtime as Runtime>::is_allowed_interactive_call(method)
+                    }),
+                    ..Default::default()
+                },
+            )
+            .map_err(|err| Error::InvalidArgument(err.into()))?;
+
+            Ok(types::ExecuteReadOnlyTxResponse { result })
+        })
+    }
+}
+
+impl<Cfg: Config> Module<Cfg> {
+    fn min_gas_prices() -> BTreeMap<Denomination, u128> {
+        let params = Self::params();
+        if params.dynamic_min_gas_price.enabled {
+            CurrentState::with_store(|store| {
+                let store =
+                    storage::TypedStore::new(storage::PrefixStore::new(store, &MODULE_NAME));
+                store
+                    .get(state::DYNAMIC_MIN_GAS_PRICE)
+                    // Use static min gas price when dynamic price was not yet computed.
+                    .unwrap_or(params.min_gas_price)
+            })
+        } else {
+            params.min_gas_price
+        }
+    }
+
+    fn get_local_min_gas_price<C: Context>(ctx: &C, denom: &token::Denomination) -> u128 {
+        #[allow(clippy::borrow_interior_mutable_const)]
+        ctx.local_config(MODULE_NAME)
+            .as_ref()
+            .map(|cfg: &LocalConfig| cfg.min_gas_price.get(denom).copied())
+            .unwrap_or_else(|| Cfg::DEFAULT_LOCAL_MIN_GAS_PRICE.get(denom).copied())
+            .unwrap_or_default()
+    }
+
+    fn get_local_max_estimated_gas<C: Context>(ctx: &C) -> u64 {
+        ctx.local_config(MODULE_NAME)
+            .as_ref()
+            .map(|cfg: &LocalConfig| cfg.max_estimated_gas)
+            .unwrap_or_default()
+    }
+
+    fn enforce_min_gas_price<C: Context>(ctx: &C, call: &Call) -> Result<(), Error> {
+        // If the method is exempt from min gas price requirements, checks always pass.
+        #[allow(clippy::borrow_interior_mutable_const)]
+        if Cfg::MIN_GAS_PRICE_EXEMPT_METHODS.contains(call.method.as_str()) {
+            return Ok(());
+        }
+
+        let fee = CurrentState::with_env(|env| env.tx_auth_info().fee.clone());
+        let denom = fee.amount.denomination();
+
+        match Self::min_gas_price(denom) {
+            // If the denomination is not among the global set, reject.
+            None => return Err(Error::GasPriceTooLow),
+
+            // Otherwise, allow overrides during local checks.
+            Some(min_gas_price) => {
+                if CurrentState::with_env(|env| env.is_check_only()) {
+                    let local_mgp = Self::get_local_min_gas_price(ctx, denom);
+
+                    // Reject during local checks.
+                    if fee.gas_price() < local_mgp {
+                        return Err(Error::GasPriceTooLow);
+                    }
+                }
+
+                if fee.gas_price() < min_gas_price {
+                    return Err(Error::GasPriceTooLow);
+                }
+            }
+        }
+
+        Ok(())
+    }
+
+    fn compute_signature_verification_cost(
+        params: &Parameters,
+        signer_info: &[SignerInfo],
+    ) -> Option<u64> {
+        let mut num_signature: u64 = 0;
+        let mut num_multisig_signer: u64 = 0;
+        for si in signer_info {
+            match &si.address_spec {
+                AddressSpec::Signature(_) => {
+                    num_signature = num_signature.checked_add(1)?;
+                }
+                AddressSpec::Multisig(config) => {
+                    num_multisig_signer =
+                        num_multisig_signer.checked_add(config.signers.len() as u64)?;
+                }
+                AddressSpec::Internal(_) => {}
+            }
+        }
+
+        let signature_cost = num_signature.checked_mul(params.gas_costs.auth_signature)?;
+        let multisig_signer_cost =
+            num_multisig_signer.checked_mul(params.gas_costs.auth_multisig_signer)?;
+        let sum = signature_cost.checked_add(multisig_signer_cost)?;
+
+        Some(sum)
+    }
+}
+
+impl<Cfg: Config> module::TransactionHandler for Module<Cfg> {
+    fn approve_raw_tx<C: Context>(_ctx: &C, tx: &[u8]) -> Result<(), Error> {
+        let params = Self::params();
+        if tx.len() > params.max_tx_size.try_into().unwrap() {
+            return Err(Error::OversizedTransaction);
+        }
+        Ok(())
+    }
+
+    fn approve_unverified_tx<C: Context>(
+        _ctx: &C,
+        utx: &UnverifiedTransaction,
+    ) -> Result<(), Error> {
+        let params = Self::params();
+        if utx.1.len() > params.max_tx_signers as usize {
+            return Err(Error::TooManyAuth);
+        }
+        for auth_proof in &utx.1 {
+            if let AuthProof::Multisig(config) = auth_proof {
+                if config.len() > params.max_multisig_signers as usize {
+                    return Err(Error::MultisigTooManySigners);
+                }
+            }
+        }
+        Ok(())
+    }
+
+    fn authenticate_tx<C: Context>(
+        ctx: &C,
+        tx: &Transaction,
+    ) -> Result<module::AuthDecision, Error> {
+        // Check whether the transaction is currently valid.
+        let round = ctx.runtime_header().round;
+        if let Some(not_before) = tx.auth_info.not_before {
+            if round < not_before {
+                // Too early.
+                return Err(Error::ExpiredTransaction);
+            }
+        }
+        if let Some(not_after) = tx.auth_info.not_after {
+            if round > not_after {
+                // Too late.
+                return Err(Error::ExpiredTransaction);
+            }
+        }
+
+        Ok(module::AuthDecision::Continue)
+    }
+
+    fn before_handle_call<C: Context>(ctx: &C, call: &Call) -> Result<(), Error> {
+        // Ensure that specified gas limit is not greater than batch gas limit.
+        let params = Self::params();
+        let fee = CurrentState::with_env(|env| env.tx_auth_info().fee.clone());
+        if fee.gas > params.max_batch_gas {
+            return Err(Error::GasOverflow);
+        }
+        if fee.consensus_messages > ctx.max_messages() {
+            return Err(Error::OutOfMessageSlots);
+        }
+
+        // Skip additional checks/gas payment for internally generated transactions.
+        if CurrentState::with_env(|env| env.is_internal()) {
+            return Ok(());
+        }
+
+        // Enforce minimum gas price constraints.
+        Self::enforce_min_gas_price(ctx, call)?;
+
+        // Charge gas for transaction size.
+        let tx_size = CurrentState::with_env(|env| env.tx_size());
+        Self::use_tx_gas(
+            params
+                .gas_costs
+                .tx_byte
+                .checked_mul(tx_size.into())
+                .ok_or(Error::GasOverflow)?,
+        )?;
+
+        // Charge gas for signature verification.
+        let total = CurrentState::with_env(|env| {
+            Self::compute_signature_verification_cost(&params, &env.tx_auth_info().signer_info)
+        })
+        .ok_or(Error::GasOverflow)?;
+        Self::use_tx_gas(total)?;
+
+        // Charge gas for callformat.
+        match call.format {
+            CallFormat::Plain => {} // No additional gas required.
+            CallFormat::EncryptedX25519DeoxysII => {
+                Self::use_tx_gas(params.gas_costs.callformat_x25519_deoxysii)?
+            }
+        }
+
+        Ok(())
+    }
+
+    fn after_handle_call<C: Context>(
+        ctx: &C,
+        result: module::CallResult,
+    ) -> Result<module::CallResult, Error> {
+        // Skip handling for internally generated calls.
+        if CurrentState::with_env(|env| env.is_internal()) {
+            return Ok(result);
+        }
+
+        let params = Self::params();
+
+        // Compute storage update gas cost.
+        let storage_gas = if params.gas_costs.storage_byte > 0 {
+            let storage_update_bytes =
+                CurrentState::with(|state| state.pending_store_update_byte_size());
+            params
+                .gas_costs
+                .storage_byte
+                .saturating_mul(storage_update_bytes as u64)
+        } else {
+            0
+        };
+
+        // Compute message gas cost.
+        let message_gas = {
+            let emitted_message_count =
+                CurrentState::with(|state| state.emitted_messages_local_count());
+            // Determine how much each message emission costs based on max_batch_gas and the number
+            // of messages that can be emitted per batch.
+            let message_gas_cost = params
+                .max_batch_gas
+                .checked_div(ctx.max_messages().into())
+                .unwrap_or(u64::MAX); // If no messages are allowed, cost is infinite.
+            message_gas_cost.saturating_mul(emitted_message_count as u64)
+        };
+
+        // Compute the gas amount that the transaction should pay in the end.
+        let used_gas = Self::used_tx_gas();
+        let max_gas = std::cmp::max(used_gas, std::cmp::max(storage_gas, message_gas));
+
+        // Make sure the transaction actually pays for the maximum gas. Note that failure here is
+        // fine since the extra resources (storage updates or emitted consensus messages) have not
+        // actually been spent yet (this happens at the end of the round).
+        let maybe_out_of_gas = Self::use_tx_gas(max_gas - used_gas); // Cannot overflow as max_gas >= used_gas.
+
+        // Emit gas used event.
+        if Cfg::EMIT_GAS_USED_EVENTS {
+            let used_gas = Self::used_tx_gas();
+            CurrentState::with(|state| {
+                state.emit_unconditional_event(Event::GasUsed { amount: used_gas });
+            });
+        }
+
+        // Evaluate the result of the above `use_tx_gas` here to make sure we emit the event.
+        maybe_out_of_gas?;
+
+        Ok(result)
+    }
+}
+
+/// Computes the new minimum gas price based on the current gas usage and the target gas usage.
+///
+/// The new price is computed as follows (inspired by EIP-1559):
+///  - If the actual gas used is greater than the target gas used, increase the minimum gas price.
+///  - If the actual gas used is less than the target gas used, decrease the minimum gas price.
+///
+/// The price change is controlled by the `min_price_max_change_denominator` parameter.
+fn min_gas_price_update(
+    gas_used: u128,
+    target_gas_used: u128,
+    min_price_max_change_denominator: u128,
+    current_price: u128,
+) -> u128 {
+    // If the target gas used is zero or the denominator is zero, don't change the price.
+    if target_gas_used == 0 || min_price_max_change_denominator == 0 {
+        return current_price;
+    }
+
+    // Calculate the difference (as a percentage) between the actual gas used in the block and the target gas used.
+    let delta = (gas_used.max(target_gas_used) - gas_used.min(target_gas_used)).saturating_mul(100)
+        / target_gas_used;
+
+    // Calculate the change in gas price and divide by `min_price_max_change_denominator`.
+    let price_change =
+        (current_price.saturating_mul(delta) / 100) / min_price_max_change_denominator;
+
+    // Adjust the current price based on whether the gas used was above or below the target.
+    if gas_used > target_gas_used {
+        current_price.saturating_add(price_change)
+    } else {
+        current_price.saturating_sub(price_change)
+    }
+}
+
+impl<Cfg: Config> module::BlockHandler for Module<Cfg> {
+    fn begin_block<C: Context>(ctx: &C) {
+        CurrentState::with(|state| {
+            let epoch = ctx.epoch();
+
+            // Load previous epoch.
+            let mut store = storage::PrefixStore::new(state.store(), &MODULE_NAME);
+            let mut tstore = storage::TypedStore::new(&mut store);
+            let previous_epoch: EpochTime = tstore.get(state::LAST_EPOCH).unwrap_or_default();
+            if epoch != previous_epoch {
+                tstore.insert(state::LAST_EPOCH, epoch);
+            }
+
+            // Set the epoch changed key as needed.
+            state
+                .block_value(CONTEXT_KEY_EPOCH_CHANGED)
+                .set(epoch != previous_epoch);
+        });
+    }
+
+    fn end_block<C: Context>(_ctx: &C) {
+        let params = Self::params();
+        if !params.dynamic_min_gas_price.enabled {
+            return;
+        }
+
+        // Update dynamic min gas price for next block, inspired by EIP-1559.
+        //
+        // Adjust the min gas price for each block based on the gas used in the previous block and the desired target
+        // gas usage set by `target_block_gas_usage_percentage`.
+        let gas_used = Self::used_batch_gas() as u128;
+        let max_batch_gas = Self::max_batch_gas() as u128;
+        let target_gas_used = max_batch_gas.saturating_mul(
+            params
+                .dynamic_min_gas_price
+                .target_block_gas_usage_percentage as u128,
+        ) / 100;
+
+        // Compute new prices.
+        let mut mgp = Self::min_gas_prices();
+        mgp.iter_mut().for_each(|(d, price)| {
+            let mut new_min_price = min_gas_price_update(
+                gas_used,
+                target_gas_used,
+                params
+                    .dynamic_min_gas_price
+                    .min_price_max_change_denominator as u128,
+                *price,
+            );
+
+            // Ensure that the new price is at least the minimum gas price.
+            if let Some(min_price) = params.min_gas_price.get(d) {
+                if new_min_price < *min_price {
+                    new_min_price = *min_price;
+                }
+            }
+            *price = new_min_price;
+        });
+
+        // Update min prices.
+        CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut tstore = storage::TypedStore::new(&mut store);
+            tstore.insert(state::DYNAMIC_MIN_GAS_PRICE, mgp);
+        });
+    }
+}
+
+impl<Cfg: Config> module::InvariantHandler for Module<Cfg> {}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/core/types.rs.html b/rust/src/oasis_runtime_sdk/modules/core/types.rs.html new file mode 100644 index 0000000000..e181de5221 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/core/types.rs.html @@ -0,0 +1,189 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+
use std::collections::BTreeMap;
+
+use crate::{
+    keymanager::SignedPublicKey,
+    types::transaction::{CallResult, CallerAddress, Transaction},
+};
+
+/// Key in the versions map used for the global state version.
+pub const VERSION_GLOBAL_KEY: &str = "";
+
+/// Basic per-module metadata; tracked in core module's state.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Metadata {
+    /// A set of state versions for all supported modules.
+    pub versions: BTreeMap<String, u32>,
+}
+
+/// Arguments for the EstimateGas query.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct EstimateGasQuery {
+    /// The address of the caller for which to do estimation. If not specified the authentication
+    /// information from the passed transaction is used.
+    #[cbor(optional)]
+    pub caller: Option<CallerAddress>,
+    /// The unsigned transaction to estimate.
+    pub tx: Transaction,
+    /// If the estimate gas query should fail in case of transaction failures.
+    /// If true, the query will return the transaction error and not the gas estimation.
+    /// Defaults to false.
+    #[cbor(optional)]
+    pub propagate_failures: bool,
+}
+
+/// Response to the call data public key query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct CallDataPublicKeyQueryResponse {
+    /// Public key used for deriving the shared secret for encrypting call data.
+    pub public_key: SignedPublicKey,
+    /// Epoch of the ephemeral runtime key.
+    pub epoch: u64,
+}
+
+#[derive(Debug, Copy, Clone, cbor::Encode, cbor::Decode)]
+#[cfg_attr(test, derive(PartialEq, Eq))]
+pub enum MethodHandlerKind {
+    #[cbor(rename = "call")]
+    Call,
+    // `Prefetch` is omitted because it is an implementation detail of handling `Call`s.
+    #[cbor(rename = "query")]
+    Query,
+    #[cbor(rename = "message_result")]
+    MessageResult,
+}
+
+#[derive(Debug, Clone, cbor::Encode, cbor::Decode)]
+#[cfg_attr(test, derive(PartialEq, Eq))]
+#[cbor(no_default)]
+pub struct MethodHandlerInfo {
+    pub kind: MethodHandlerKind,
+    pub name: String,
+}
+
+/// Metadata for an individual module.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cfg_attr(test, derive(PartialEq, Eq))]
+#[cbor(no_default)]
+pub struct ModuleInfo {
+    pub version: u32,
+    pub params: cbor::Value,
+    pub methods: Vec<MethodHandlerInfo>,
+}
+
+/// Response to the RuntimeInfo query.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cfg_attr(test, derive(PartialEq, Eq))]
+#[cbor(no_default)]
+pub struct RuntimeInfoResponse {
+    pub runtime_version: oasis_core_runtime::common::version::Version,
+    pub state_version: u32,
+    pub modules: BTreeMap<String, ModuleInfo>,
+}
+
+/// Arguments for the ExecuteReadOnlyTx query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ExecuteReadOnlyTxQuery {
+    pub tx: Vec<u8>,
+}
+
+/// Response to the ExecuteReadOnlyTx query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ExecuteReadOnlyTxResponse {
+    pub result: CallResult,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/mod.rs.html new file mode 100644 index 0000000000..e076815215 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/mod.rs.html @@ -0,0 +1,19 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+
//! Runtime modules included with the SDK.
+
+pub mod access;
+pub mod accounts;
+pub mod consensus;
+pub mod consensus_accounts;
+pub mod core;
+pub mod rewards;
+pub mod rofl;
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rewards/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/rewards/mod.rs.html new file mode 100644 index 0000000000..4514e292e7 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rewards/mod.rs.html @@ -0,0 +1,473 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+
//! Rewards module.
+use std::convert::{TryFrom, TryInto};
+
+use num_traits::Zero;
+use once_cell::sync::Lazy;
+use thiserror::Error;
+
+use crate::{
+    context::Context,
+    core::consensus::beacon,
+    migration,
+    module::{self, Module as _, Parameters as _},
+    modules::{self, accounts::API as _, core::API as _},
+    runtime::Runtime,
+    sdk_derive,
+    state::CurrentState,
+    storage::{self, Store},
+    types::address::{Address, SignatureAddressSpec},
+};
+
+#[cfg(test)]
+mod test;
+pub mod types;
+
+/// Unique module name.
+const MODULE_NAME: &str = "rewards";
+
+/// Errors emitted by the rewards module.
+#[derive(Error, Debug, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("invalid argument")]
+    #[sdk_error(code = 1)]
+    InvalidArgument,
+}
+
+/// Parameters for the rewards module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Parameters {
+    pub schedule: types::RewardSchedule,
+
+    pub participation_threshold_numerator: u64,
+    pub participation_threshold_denominator: u64,
+}
+
+/// Errors emitted during rewards parameter validation.
+#[derive(Error, Debug)]
+pub enum ParameterValidationError {
+    #[error("invalid participation threshold (numerator > denominator)")]
+    InvalidParticipationThreshold,
+
+    #[error("invalid schedule")]
+    InvalidSchedule(#[from] types::RewardScheduleError),
+}
+
+impl module::Parameters for Parameters {
+    type Error = ParameterValidationError;
+
+    fn validate_basic(&self) -> Result<(), Self::Error> {
+        self.schedule.validate_basic()?;
+
+        if self.participation_threshold_numerator > self.participation_threshold_denominator {
+            return Err(ParameterValidationError::InvalidParticipationThreshold);
+        }
+        if self.participation_threshold_denominator.is_zero() {
+            return Err(ParameterValidationError::InvalidParticipationThreshold);
+        }
+
+        Ok(())
+    }
+}
+
+/// Genesis state for the rewards module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Genesis {
+    pub parameters: Parameters,
+}
+
+/// State schema constants.
+pub mod state {
+    // 0x01 is reserved.
+
+    /// Map of epochs to rewards pending distribution.
+    pub const REWARDS: &[u8] = &[0x02];
+}
+
+/// Rewards module.
+pub struct Module;
+
+/// Module's address that has the reward pool.
+///
+/// oasis1qp7x0q9qahahhjas0xde8w0v04ctp4pqzu5mhjav
+pub static ADDRESS_REWARD_POOL: Lazy<Address> =
+    Lazy::new(|| Address::from_module(MODULE_NAME, "reward-pool"));
+
+#[sdk_derive(Module)]
+impl Module {
+    const NAME: &'static str = MODULE_NAME;
+    const VERSION: u32 = 2;
+    type Error = Error;
+    type Event = ();
+    type Parameters = Parameters;
+    type Genesis = Genesis;
+
+    #[migration(init)]
+    fn init(genesis: Genesis) {
+        genesis
+            .parameters
+            .validate_basic()
+            .expect("invalid genesis parameters");
+
+        // Set genesis parameters.
+        Self::set_params(genesis.parameters);
+    }
+
+    #[migration(from = 1)]
+    fn migrate_v1_to_v2() {
+        CurrentState::with_store(|store| {
+            // Version 2 removes the LAST_EPOCH storage state which was at 0x01.
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            store.remove(&[0x01]);
+        });
+    }
+}
+
+impl module::TransactionHandler for Module {}
+
+impl module::BlockHandler for Module {
+    fn end_block<C: Context>(ctx: &C) {
+        let epoch = ctx.epoch();
+
+        // Load rewards accumulator for the current epoch.
+        let mut rewards: types::EpochRewards = CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let epochs =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::REWARDS));
+            epochs.get(epoch.to_storage_key()).unwrap_or_default()
+        });
+
+        // Reward each good entity.
+        for entity_id in &ctx.runtime_round_results().good_compute_entities {
+            let address = Address::from_sigspec(&SignatureAddressSpec::Ed25519(entity_id.into()));
+            rewards.pending.entry(address).or_default().increment();
+        }
+
+        // Punish each bad entity by forbidding rewards for this epoch.
+        for entity_id in &ctx.runtime_round_results().bad_compute_entities {
+            let address = Address::from_sigspec(&SignatureAddressSpec::Ed25519(entity_id.into()));
+            rewards.pending.entry(address).or_default().forbid();
+        }
+
+        // Disburse any rewards for previous epochs when the epoch changes.
+        if <C::Runtime as Runtime>::Core::has_epoch_changed() {
+            let epoch_rewards = CurrentState::with_store(|store| {
+                let store = storage::PrefixStore::new(store, &MODULE_NAME);
+                let mut epochs =
+                    storage::TypedStore::new(storage::PrefixStore::new(store, &state::REWARDS));
+                let epoch_rewards: Vec<(DecodableEpochTime, types::EpochRewards)> =
+                    epochs.iter().collect();
+
+                // Remove all epochs that we will process.
+                for (epoch, _) in &epoch_rewards {
+                    epochs.remove(epoch.0.to_storage_key());
+                }
+
+                epoch_rewards
+            });
+
+            // Process accumulated rewards for previous epochs.
+            let params = Self::params();
+            'epochs: for (epoch, rewards) in epoch_rewards {
+                let epoch = epoch.0;
+
+                // Fetch reward schedule for the given epoch.
+                let reward = params.schedule.for_epoch(epoch);
+                if reward.amount().is_zero() {
+                    continue;
+                }
+
+                // Disburse rewards.
+                for address in rewards.for_disbursement(
+                    params.participation_threshold_numerator,
+                    params.participation_threshold_denominator,
+                ) {
+                    match <C::Runtime as Runtime>::Accounts::transfer(
+                        *ADDRESS_REWARD_POOL,
+                        address,
+                        &reward,
+                    ) {
+                        Ok(_) => {}
+                        Err(modules::accounts::Error::InsufficientBalance) => {
+                            // Since rewards are the same for the whole epoch, if there is not
+                            // enough in the pool, just continue with the next epoch which may
+                            // specify a lower amount or a different denomination.
+                            continue 'epochs;
+                        }
+                        Err(err) => panic!("failed to disburse rewards: {err:?}"),
+                    }
+                }
+            }
+        }
+
+        // Update rewards for current epoch.
+        CurrentState::with_store(|store| {
+            let store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut epochs =
+                storage::TypedStore::new(storage::PrefixStore::new(store, &state::REWARDS));
+            epochs.insert(epoch.to_storage_key(), rewards);
+        });
+    }
+}
+
+impl module::InvariantHandler for Module {}
+
+/// A trait that exists solely to convert `beacon::EpochTime` to bytes for use as a storage key.
+trait ToStorageKey {
+    fn to_storage_key(&self) -> [u8; 8];
+}
+
+impl ToStorageKey for beacon::EpochTime {
+    fn to_storage_key(&self) -> [u8; 8] {
+        self.to_be_bytes()
+    }
+}
+
+/// A struct that exists solely to decode `beacon::EpochTime` previously encoded via `ToStorageKey`.
+struct DecodableEpochTime(beacon::EpochTime);
+
+impl TryFrom<&[u8]> for DecodableEpochTime {
+    type Error = std::array::TryFromSliceError;
+
+    fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
+        Ok(DecodableEpochTime(beacon::EpochTime::from_be_bytes(
+            value.try_into()?,
+        )))
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rewards/types.rs.html b/rust/src/oasis_runtime_sdk/modules/rewards/types.rs.html new file mode 100644 index 0000000000..df19cc16d2 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rewards/types.rs.html @@ -0,0 +1,721 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+
//! Rewards module types.
+use std::collections::BTreeMap;
+
+use thiserror::Error;
+
+use crate::{
+    core::consensus::beacon,
+    types::{address::Address, token},
+};
+
+/// One of the time periods in the reward schedule.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct RewardStep {
+    pub until: beacon::EpochTime,
+    pub amount: token::BaseUnits,
+}
+
+/// A reward schedule.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct RewardSchedule {
+    pub steps: Vec<RewardStep>,
+}
+
+/// Errors emitted during reward schedule validation.
+#[derive(Error, Debug)]
+pub enum RewardScheduleError {
+    #[error("steps not sorted correctly")]
+    StepsNotSorted,
+}
+
+impl RewardSchedule {
+    /// Perform basic reward schedule validation.
+    pub fn validate_basic(&self) -> Result<(), RewardScheduleError> {
+        let mut last_epoch = Default::default();
+        for step in &self.steps {
+            if step.until <= last_epoch {
+                return Err(RewardScheduleError::StepsNotSorted);
+            }
+            last_epoch = step.until;
+        }
+        Ok(())
+    }
+
+    /// Compute the per-entity reward amount for the given epoch based on the schedule.
+    pub fn for_epoch(&self, epoch: beacon::EpochTime) -> token::BaseUnits {
+        for step in &self.steps {
+            if epoch < step.until {
+                return step.amount.clone();
+            }
+        }
+
+        // End of the schedule, default to no rewards.
+        Default::default()
+    }
+}
+
+/// Action that should be taken for a given address when disbursing rewards.
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum RewardAction {
+    Reward(u64),
+    NoReward,
+}
+
+impl RewardAction {
+    /// Increment the reward counter associated with the reward.
+    ///
+    /// In case the action is `NoReward` nothing is changed.
+    pub fn increment(&mut self) {
+        match self {
+            RewardAction::Reward(ref mut v) => *v += 1,
+            RewardAction::NoReward => {
+                // Do not change state as the entity has been penalized for the epoch.
+            }
+        }
+    }
+
+    /// Forbids any rewards from accumulating.
+    pub fn forbid(&mut self) {
+        *self = RewardAction::NoReward;
+    }
+
+    /// Value of the reward counter.
+    pub fn value(&self) -> u64 {
+        match self {
+            RewardAction::Reward(v) => *v,
+            RewardAction::NoReward => 0,
+        }
+    }
+}
+
+impl Default for RewardAction {
+    fn default() -> Self {
+        RewardAction::Reward(0)
+    }
+}
+
+impl cbor::Encode for RewardAction {
+    fn into_cbor_value(self) -> cbor::Value {
+        match self {
+            Self::Reward(r) => cbor::Value::Unsigned(r),
+            Self::NoReward => cbor::Value::Simple(cbor::SimpleValue::NullValue),
+        }
+    }
+}
+
+impl cbor::Decode for RewardAction {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Self::NoReward)
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::Unsigned(v) => Ok(Self::Reward(v)),
+            cbor::Value::Simple(cbor::SimpleValue::NullValue) => Ok(Self::NoReward),
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+/// Rewards for the epoch.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct EpochRewards {
+    pub pending: BTreeMap<Address, RewardAction>,
+}
+
+impl EpochRewards {
+    /// Returns an iterator over addresses that should be rewarded.
+    pub fn for_disbursement(
+        &self,
+        threshold_numerator: u64,
+        threshold_denominator: u64,
+    ) -> impl Iterator<Item = Address> + '_ {
+        let max_v = self
+            .pending
+            .iter()
+            .fold(0, |acc, (_, action)| std::cmp::max(acc, action.value()));
+
+        let (_, overflow) = threshold_numerator.overflowing_mul(max_v);
+        let threshold = if overflow {
+            max_v
+                .checked_div(threshold_denominator)
+                .unwrap_or(0)
+                .saturating_mul(threshold_numerator)
+        } else {
+            threshold_numerator
+                .saturating_mul(max_v)
+                .checked_div(threshold_denominator)
+                .unwrap_or(0)
+        };
+
+        self.pending
+            .iter()
+            .filter_map(move |(address, action)| match action {
+                RewardAction::Reward(v) => {
+                    if *v < threshold {
+                        None
+                    } else {
+                        Some(*address)
+                    }
+                }
+                RewardAction::NoReward => None,
+            })
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::testing::keys;
+
+    use super::*;
+
+    #[test]
+    fn test_reward_action() {
+        let mut act = RewardAction::default();
+        act.increment();
+        act.increment();
+        act.increment();
+
+        assert!(matches!(act, RewardAction::Reward(3)));
+
+        act.forbid();
+
+        act.increment();
+        act.increment();
+
+        assert!(matches!(act, RewardAction::NoReward));
+    }
+
+    #[test]
+    fn test_reward_action_serialization() {
+        let actions = vec![
+            RewardAction::Reward(0),
+            RewardAction::Reward(42),
+            RewardAction::NoReward,
+        ];
+        for act in actions {
+            let encoded = &cbor::to_vec(act.clone());
+            let round_trip: RewardAction =
+                cbor::from_slice(encoded).expect("round-trip should succeed");
+            assert_eq!(round_trip, act, "reward actions should round-trip");
+        }
+    }
+
+    #[test]
+    fn test_reward_schedule_validation_fail_1() {
+        let schedule = RewardSchedule {
+            steps: vec![
+                RewardStep {
+                    until: 10,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+                RewardStep {
+                    until: 10,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+                RewardStep {
+                    until: 15,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+            ],
+        };
+        schedule
+            .validate_basic()
+            .expect_err("validation with duplicate steps should fail");
+    }
+
+    #[test]
+    fn test_reward_schedule_validation_fail_2() {
+        let schedule = RewardSchedule {
+            steps: vec![
+                RewardStep {
+                    until: 10,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+                RewardStep {
+                    until: 5,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+                RewardStep {
+                    until: 15,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+            ],
+        };
+        schedule
+            .validate_basic()
+            .expect_err("validation with unsorted steps should fail");
+    }
+
+    #[test]
+    fn test_reward_schedule_validation_ok() {
+        let schedule = RewardSchedule {
+            steps: vec![
+                RewardStep {
+                    until: 5,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+                RewardStep {
+                    until: 10,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+                RewardStep {
+                    until: 15,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+            ],
+        };
+        schedule
+            .validate_basic()
+            .expect("validation of correct schedule should not fail");
+    }
+
+    #[test]
+    fn test_reward_schedule() {
+        let schedule = RewardSchedule {
+            steps: vec![
+                RewardStep {
+                    until: 5,
+                    amount: token::BaseUnits::new(3000, token::Denomination::NATIVE),
+                },
+                RewardStep {
+                    until: 10,
+                    amount: token::BaseUnits::new(2000, token::Denomination::NATIVE),
+                },
+                RewardStep {
+                    until: 15,
+                    amount: token::BaseUnits::new(1000, token::Denomination::NATIVE),
+                },
+            ],
+        };
+
+        assert_eq!(schedule.for_epoch(1).amount(), 3000);
+        assert_eq!(schedule.for_epoch(3).amount(), 3000);
+        assert_eq!(schedule.for_epoch(5).amount(), 2000);
+        assert_eq!(schedule.for_epoch(6).amount(), 2000);
+        assert_eq!(schedule.for_epoch(9).amount(), 2000);
+        assert_eq!(schedule.for_epoch(10).amount(), 1000);
+        assert_eq!(schedule.for_epoch(14).amount(), 1000);
+        assert_eq!(schedule.for_epoch(15).amount(), 0);
+        assert_eq!(schedule.for_epoch(20).amount(), 0);
+        assert_eq!(schedule.for_epoch(100).amount(), 0);
+    }
+
+    #[test]
+    fn test_epoch_rewards() {
+        let epoch_rewards = EpochRewards {
+            pending: {
+                let mut pending = BTreeMap::new();
+                pending.insert(keys::alice::address(), RewardAction::Reward(10));
+                pending.insert(keys::bob::address(), RewardAction::NoReward);
+                pending.insert(keys::charlie::address(), RewardAction::Reward(5));
+                pending
+            },
+        };
+
+        // Alice and Charlie have >= 0.
+        let rewards: Vec<_> = epoch_rewards.for_disbursement(0, 0).collect();
+        assert_eq!(
+            rewards,
+            vec![keys::charlie::address(), keys::alice::address()]
+        );
+        // Alice and Charlie have >= 0.
+        let rewards: Vec<_> = epoch_rewards.for_disbursement(0, 0).collect();
+        assert_eq!(
+            rewards,
+            vec![keys::charlie::address(), keys::alice::address()]
+        );
+        // Only Alice has >= 7.5.
+        let rewards: Vec<_> = epoch_rewards.for_disbursement(3, 4).collect();
+        assert_eq!(rewards, vec![keys::alice::address()]);
+    }
+
+    #[test]
+    fn test_epoch_rewards_overflow() {
+        let epoch_rewards = EpochRewards {
+            pending: {
+                let mut pending = BTreeMap::new();
+                pending.insert(keys::alice::address(), RewardAction::Reward(u64::MAX));
+                pending.insert(keys::charlie::address(), RewardAction::Reward(u64::MAX / 2));
+                pending
+            },
+        };
+
+        // Alice and Charlie have >= 0.
+        let rewards: Vec<_> = epoch_rewards.for_disbursement(0, 0).collect();
+        assert_eq!(
+            rewards,
+            vec![keys::charlie::address(), keys::alice::address()]
+        );
+        // Alice and Charlie have >= 1/2.
+        let rewards: Vec<_> = epoch_rewards.for_disbursement(1, 2).collect();
+        assert_eq!(
+            rewards,
+            vec![keys::charlie::address(), keys::alice::address()]
+        );
+        // Only Alice has >= 3/4, but due to overflow both will be counted.
+        let rewards: Vec<_> = epoch_rewards.for_disbursement(3, 4).collect();
+        assert_eq!(rewards, vec![keys::alice::address()]);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/client.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/client.rs.html new file mode 100644 index 0000000000..da253508d3 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/client.rs.html @@ -0,0 +1,1089 @@ +client.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+
use std::{
+    collections::{BTreeMap, HashSet},
+    sync::{
+        atomic::{AtomicU64, Ordering},
+        Arc,
+    },
+    time::Duration,
+};
+
+use anyhow::{anyhow, Result};
+use tokio::sync::{mpsc, oneshot};
+
+use crate::{
+    core::{
+        consensus::{
+            registry::{SGXConstraints, TEEHardware},
+            state::{
+                beacon::ImmutableState as BeaconState, registry::ImmutableState as RegistryState,
+            },
+        },
+        enclave_rpc::{client::RpcClient, session},
+        host::{self, Host as _},
+    },
+    crypto::signature::{PublicKey, Signer},
+    enclave_rpc::{QueryRequest, METHOD_QUERY},
+    modules::{accounts::types::NonceQuery, core::types::EstimateGasQuery},
+    state::CurrentState,
+    storage::HostStore,
+    types::{
+        address::{Address, SignatureAddressSpec},
+        token,
+        transaction::{self, CallerAddress},
+    },
+};
+
+use super::{processor, App};
+
+/// Size of various command queues.
+const CMDQ_BACKLOG: usize = 16;
+
+/// EnclaveRPC endpoint for communicating with the RONL component.
+const ENCLAVE_RPC_ENDPOINT_RONL: &str = "ronl";
+
+/// Transaction submission options.
+#[derive(Clone, Debug)]
+pub struct SubmitTxOpts {
+    /// Optional timeout when submitting a transaction. Setting this to `None` means that the host
+    /// node timeout will be used.
+    pub timeout: Option<Duration>,
+}
+
+impl Default for SubmitTxOpts {
+    fn default() -> Self {
+        Self {
+            timeout: Some(Duration::from_millis(15_000)), // 15 seconds.
+        }
+    }
+}
+
+/// A runtime client meant for use within runtimes.
+pub struct Client<A: App> {
+    imp: ClientImpl<A>,
+    submission_mgr: Arc<SubmissionManager<A>>,
+}
+
+impl<A> Client<A>
+where
+    A: App,
+{
+    /// Create a new runtime client.
+    pub(super) fn new(
+        state: Arc<processor::State<A>>,
+        cmdq: mpsc::WeakSender<processor::Command>,
+    ) -> Self {
+        let imp = ClientImpl::new(state, cmdq);
+        let mut submission_mgr = SubmissionManager::new(imp.clone());
+        submission_mgr.start();
+
+        Self {
+            imp,
+            submission_mgr: Arc::new(submission_mgr),
+        }
+    }
+
+    /// Retrieve the latest known runtime round.
+    pub async fn latest_round(&self) -> Result<u64> {
+        self.imp.latest_round().await
+    }
+
+    /// Retrieve the nonce for the given account.
+    pub async fn account_nonce(&self, round: u64, address: Address) -> Result<u64> {
+        self.imp.account_nonce(round, address).await
+    }
+
+    /// Retrieve the gas price in the given denomination.
+    pub async fn gas_price(&self, round: u64, denom: &token::Denomination) -> Result<u128> {
+        self.imp.gas_price(round, denom).await
+    }
+
+    /// Securely query the on-chain runtime component.
+    pub async fn query<Rq, Rs>(&self, round: u64, method: &str, args: Rq) -> Result<Rs>
+    where
+        Rq: cbor::Encode,
+        Rs: cbor::Decode + Send + 'static,
+    {
+        self.imp.query(round, method, args).await
+    }
+
+    /// Securely perform gas estimation.
+    pub async fn estimate_gas(&self, req: EstimateGasQuery) -> Result<u64> {
+        self.imp.estimate_gas(req).await
+    }
+
+    /// Sign a given transaction, submit it and wait for block inclusion.
+    ///
+    /// This method supports multiple transaction signers.
+    pub async fn multi_sign_and_submit_tx(
+        &self,
+        signers: &[Arc<dyn Signer>],
+        tx: transaction::Transaction,
+    ) -> Result<transaction::CallResult> {
+        self.multi_sign_and_submit_tx_opts(signers, tx, SubmitTxOpts::default())
+            .await
+    }
+
+    /// Sign a given transaction, submit it and wait for block inclusion.
+    ///
+    /// This method supports multiple transaction signers.
+    pub async fn multi_sign_and_submit_tx_opts(
+        &self,
+        signers: &[Arc<dyn Signer>],
+        tx: transaction::Transaction,
+        opts: SubmitTxOpts,
+    ) -> Result<transaction::CallResult> {
+        self.submission_mgr
+            .multi_sign_and_submit_tx(signers, tx, opts)
+            .await
+    }
+
+    /// Sign a given transaction, submit it and wait for block inclusion.
+    pub async fn sign_and_submit_tx(
+        &self,
+        signer: Arc<dyn Signer>,
+        tx: transaction::Transaction,
+    ) -> Result<transaction::CallResult> {
+        self.multi_sign_and_submit_tx(&[signer], tx).await
+    }
+
+    /// Run a closure inside a `CurrentState` context with store for the given round.
+    pub async fn with_store_for_round<F, R>(&self, round: u64, f: F) -> Result<R>
+    where
+        F: FnOnce() -> Result<R> + Send + 'static,
+        R: Send + 'static,
+    {
+        self.imp.with_store_for_round(round, f).await
+    }
+
+    /// Return a store corresponding to the given round.
+    pub async fn store_for_round(&self, round: u64) -> Result<HostStore> {
+        self.imp.store_for_round(round).await
+    }
+}
+
+impl<A> Clone for Client<A>
+where
+    A: App,
+{
+    fn clone(&self) -> Self {
+        Self {
+            imp: self.imp.clone(),
+            submission_mgr: self.submission_mgr.clone(),
+        }
+    }
+}
+
+struct ClientImpl<A: App> {
+    state: Arc<processor::State<A>>,
+    cmdq: mpsc::WeakSender<processor::Command>,
+    latest_round: Arc<AtomicU64>,
+    rpc: Arc<RpcClient>,
+}
+
+impl<A> ClientImpl<A>
+where
+    A: App,
+{
+    fn new(state: Arc<processor::State<A>>, cmdq: mpsc::WeakSender<processor::Command>) -> Self {
+        Self {
+            cmdq,
+            latest_round: Arc::new(AtomicU64::new(0)),
+            rpc: Arc::new(RpcClient::new_runtime(
+                state.host.clone(),
+                ENCLAVE_RPC_ENDPOINT_RONL,
+                session::Builder::default()
+                    .use_endorsement(true)
+                    .quote_policy(None) // Forbid all until configured.
+                    .local_identity(state.identity.clone())
+                    .remote_enclaves(Some(HashSet::new())), // Forbid all until configured.
+                2, // Maximum number of sessions (one extra for reserve).
+                1, // Maximum number of sessions per peer (we only communicate with RONL).
+                1, // Stale session timeout.
+            )),
+            state,
+        }
+    }
+
+    /// Retrieve the latest known runtime round.
+    async fn latest_round(&self) -> Result<u64> {
+        let cmdq = self
+            .cmdq
+            .upgrade()
+            .ok_or(anyhow!("processor has shut down"))?;
+        let (tx, rx) = oneshot::channel();
+        cmdq.send(processor::Command::GetLatestRound(tx)).await?;
+        let round = rx.await?;
+        Ok(self
+            .latest_round
+            .fetch_max(round, Ordering::SeqCst)
+            .max(round))
+    }
+
+    /// Retrieve the nonce for the given account.
+    async fn account_nonce(&self, round: u64, address: Address) -> Result<u64> {
+        self.query(round, "accounts.Nonce", NonceQuery { address })
+            .await
+    }
+
+    /// Retrieve the gas price in the given denomination.
+    async fn gas_price(&self, round: u64, denom: &token::Denomination) -> Result<u128> {
+        let mgp: BTreeMap<token::Denomination, u128> =
+            self.query(round, "core.MinGasPrice", ()).await?;
+        mgp.get(denom)
+            .ok_or(anyhow!("denomination not supported"))
+            .copied()
+    }
+
+    /// Securely query the on-chain runtime component.
+    async fn query<Rq, Rs>(&self, round: u64, method: &str, args: Rq) -> Result<Rs>
+    where
+        Rq: cbor::Encode,
+        Rs: cbor::Decode + Send + 'static,
+    {
+        // TODO: Consider using PolicyVerifier when it has the needed methods (and is async).
+        let state = self.state.consensus_verifier.latest_state().await?;
+        let runtime_id = self.state.host.get_runtime_id();
+        let tee = tokio::task::spawn_blocking(move || -> Result<_> {
+            let beacon = BeaconState::new(&state);
+            let epoch = beacon.epoch()?;
+            let registry = RegistryState::new(&state);
+            let runtime = registry
+                .runtime(&runtime_id)?
+                .ok_or(anyhow!("runtime not available"))?;
+            let ad = runtime
+                .active_deployment(epoch)
+                .ok_or(anyhow!("active runtime deployment not available"))?;
+
+            match runtime.tee_hardware {
+                TEEHardware::TEEHardwareIntelSGX => Ok(ad.try_decode_tee::<SGXConstraints>()?),
+                _ => Err(anyhow!("unsupported TEE platform")),
+            }
+        })
+        .await??;
+
+        let enclaves = HashSet::from_iter(tee.enclaves().clone());
+        let quote_policy = tee.policy();
+        self.rpc.update_enclaves(Some(enclaves)).await;
+        self.rpc.update_quote_policy(quote_policy).await;
+
+        let response: Vec<u8> = self
+            .rpc
+            .secure_call(
+                METHOD_QUERY,
+                QueryRequest {
+                    round,
+                    method: method.to_string(),
+                    args: cbor::to_vec(args),
+                },
+                vec![],
+            )
+            .await
+            .into_result()?;
+
+        Ok(cbor::from_slice(&response)?)
+    }
+
+    /// Securely perform gas estimation.
+    async fn estimate_gas(&self, req: EstimateGasQuery) -> Result<u64> {
+        let round = self.latest_round().await?;
+        self.query(round, "core.EstimateGas", req).await
+    }
+
+    /// Run a closure inside a `CurrentState` context with store for the given round.
+    async fn with_store_for_round<F, R>(&self, round: u64, f: F) -> Result<R>
+    where
+        F: FnOnce() -> Result<R> + Send + 'static,
+        R: Send + 'static,
+    {
+        let store = self.store_for_round(round).await?;
+
+        tokio::task::spawn_blocking(move || CurrentState::enter(store, f)).await?
+    }
+
+    /// Return a store corresponding to the given round.
+    async fn store_for_round(&self, round: u64) -> Result<HostStore> {
+        HostStore::new_for_round(
+            self.state.host.clone(),
+            &self.state.consensus_verifier,
+            self.state.host.get_runtime_id(),
+            round,
+        )
+        .await
+    }
+}
+
+impl<A> Clone for ClientImpl<A>
+where
+    A: App,
+{
+    fn clone(&self) -> Self {
+        Self {
+            state: self.state.clone(),
+            cmdq: self.cmdq.clone(),
+            latest_round: self.latest_round.clone(),
+            rpc: self.rpc.clone(),
+        }
+    }
+}
+
+enum Cmd {
+    SubmitTx(
+        Vec<Arc<dyn Signer>>,
+        transaction::Transaction,
+        SubmitTxOpts,
+        oneshot::Sender<Result<transaction::CallResult>>,
+    ),
+}
+
+/// Transaction submission manager for avoiding nonce conflicts.
+struct SubmissionManager<A: App> {
+    imp: Option<SubmissionManagerImpl<A>>,
+    cmdq_tx: mpsc::Sender<Cmd>,
+}
+
+impl<A> SubmissionManager<A>
+where
+    A: App,
+{
+    /// Create a new submission manager.
+    fn new(client: ClientImpl<A>) -> Self {
+        let (tx, rx) = mpsc::channel(CMDQ_BACKLOG);
+
+        Self {
+            imp: Some(SubmissionManagerImpl {
+                client,
+                cmdq_rx: rx,
+            }),
+            cmdq_tx: tx,
+        }
+    }
+
+    /// Start the submission manager task.
+    fn start(&mut self) {
+        if let Some(imp) = self.imp.take() {
+            imp.start();
+        }
+    }
+
+    /// Sign a given transaction, submit it and wait for block inclusion.
+    async fn multi_sign_and_submit_tx(
+        &self,
+        signers: &[Arc<dyn Signer>],
+        tx: transaction::Transaction,
+        opts: SubmitTxOpts,
+    ) -> Result<transaction::CallResult> {
+        let (ch, rx) = oneshot::channel();
+        self.cmdq_tx
+            .send(Cmd::SubmitTx(signers.to_vec(), tx, opts, ch))
+            .await?;
+        rx.await?
+    }
+}
+
+struct SubmissionManagerImpl<A: App> {
+    client: ClientImpl<A>,
+    cmdq_rx: mpsc::Receiver<Cmd>,
+}
+
+impl<A> SubmissionManagerImpl<A>
+where
+    A: App,
+{
+    /// Start the submission manager task.
+    fn start(self) {
+        tokio::task::spawn(self.run());
+    }
+
+    /// Run the submission manager task.
+    async fn run(mut self) {
+        let (notify_tx, mut notify_rx) = mpsc::channel::<HashSet<PublicKey>>(CMDQ_BACKLOG);
+        let mut queue: Vec<Cmd> = Vec::new();
+        let mut pending: HashSet<PublicKey> = HashSet::new();
+
+        loop {
+            tokio::select! {
+                // Process incoming commands.
+                Some(cmd) = self.cmdq_rx.recv() => queue.push(cmd),
+
+                // Process incoming completion notifications.
+                Some(signers) = notify_rx.recv() => {
+                    for pk in signers {
+                        pending.remove(&pk);
+                    }
+                },
+
+                else => break,
+            }
+
+            // Check if there is anything in the queue that can be executed without conflicts.
+            let mut new_queue = Vec::with_capacity(queue.len());
+            for cmd in queue {
+                match cmd {
+                    Cmd::SubmitTx(signers, tx, opts, ch) => {
+                        // Check if transaction can be executed (no conflicts with in-flight txs).
+                        let signer_set =
+                            HashSet::from_iter(signers.iter().map(|signer| signer.public_key()));
+                        if !signer_set.is_disjoint(&pending) {
+                            // Defer any non-executable commands.
+                            new_queue.push(Cmd::SubmitTx(signers, tx, opts, ch));
+                            continue;
+                        }
+                        // Include all signers in the pending set.
+                        pending.extend(signer_set.iter().cloned());
+
+                        // Execute in a separate task.
+                        let client = self.client.clone();
+                        let notify_tx = notify_tx.clone();
+
+                        tokio::spawn(async move {
+                            let result =
+                                Self::multi_sign_and_submit_tx(client, &signers, tx, opts).await;
+                            let _ = ch.send(result);
+
+                            // Notify the submission manager task that submission is done.
+                            let _ = notify_tx.send(signer_set).await;
+                        });
+                    }
+                }
+            }
+            queue = new_queue;
+        }
+    }
+
+    /// Sign a given transaction, submit it and wait for block inclusion.
+    async fn multi_sign_and_submit_tx(
+        client: ClientImpl<A>,
+        signers: &[Arc<dyn Signer>],
+        mut tx: transaction::Transaction,
+        opts: SubmitTxOpts,
+    ) -> Result<transaction::CallResult> {
+        if signers.is_empty() {
+            return Err(anyhow!("no signers specified"));
+        }
+
+        // Resolve signer addresses.
+        let addresses = signers
+            .iter()
+            .map(|signer| -> Result<_> {
+                let sigspec = SignatureAddressSpec::try_from_pk(&signer.public_key())
+                    .ok_or(anyhow!("signature scheme not supported"))?;
+                Ok((Address::from_sigspec(&sigspec), sigspec))
+            })
+            .collect::<Result<Vec<_>>>()?;
+
+        let round = client.latest_round().await?;
+
+        // Resolve account nonces.
+        for (address, sigspec) in &addresses {
+            let nonce = client.account_nonce(round, *address).await?;
+
+            tx.append_auth_signature(sigspec.clone(), nonce);
+        }
+
+        // Perform gas estimation after all signer infos have been added as otherwise we may
+        // underestimate the amount of gas needed.
+        if tx.fee_gas() == 0 {
+            let signer = &signers[0]; // Checked to have at least one signer above.
+            let gas = client
+                .estimate_gas(EstimateGasQuery {
+                    caller: if let PublicKey::Secp256k1(pk) = signer.public_key() {
+                        Some(CallerAddress::EthAddress(
+                            pk.to_eth_address().try_into().unwrap(),
+                        ))
+                    } else {
+                        Some(CallerAddress::Address(addresses[0].0)) // Checked above.
+                    },
+                    tx: tx.clone(),
+                    propagate_failures: false,
+                })
+                .await?;
+
+            // The estimate may be off due to current limitations in confidential gas estimation.
+            // Inflate the estimated gas by 20%.
+            let gas = gas.saturating_add(gas.saturating_mul(20).saturating_div(100));
+
+            tx.set_fee_gas(gas);
+        }
+
+        // Determine gas price. Currently we always use the native denomination.
+        let mgp = client
+            .gas_price(round, &token::Denomination::NATIVE)
+            .await?;
+        let fee = mgp.saturating_mul(tx.fee_gas().into());
+        tx.set_fee_amount(token::BaseUnits::new(fee, token::Denomination::NATIVE));
+
+        // Sign the transaction.
+        let mut tx = tx.prepare_for_signing();
+        for signer in signers {
+            tx.append_sign(signer)?;
+        }
+        let tx = tx.finalize();
+
+        // Submit the transaction.
+        let submit_tx_task = client.state.host.submit_tx(
+            cbor::to_vec(tx),
+            host::SubmitTxOpts {
+                wait: true,
+                ..Default::default()
+            },
+        );
+        let result = if let Some(timeout) = opts.timeout {
+            tokio::time::timeout(timeout, submit_tx_task).await?
+        } else {
+            submit_tx_task.await
+        };
+        let result = result?.ok_or(anyhow!("missing result"))?;
+
+        // Update latest known round.
+        client
+            .latest_round
+            .fetch_max(result.round, Ordering::SeqCst);
+
+        cbor::from_slice(&result.output).map_err(|_| anyhow!("malformed result"))
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/env.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/env.rs.html new file mode 100644 index 0000000000..d73e5407c8 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/env.rs.html @@ -0,0 +1,131 @@ +env.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
use std::sync::Arc;
+
+use anyhow::{anyhow, Result};
+use tokio::sync::mpsc;
+
+use crate::crypto::signature::Signer;
+
+use super::{client, processor, App};
+
+/// Application environment.
+pub struct Environment<A: App> {
+    client: client::Client<A>,
+    signer: Arc<dyn Signer>,
+    cmdq: mpsc::WeakSender<processor::Command>,
+}
+
+impl<A> Environment<A>
+where
+    A: App,
+{
+    /// Create a new environment talking to the given processor.
+    pub(super) fn new(
+        state: Arc<processor::State<A>>,
+        cmdq: mpsc::WeakSender<processor::Command>,
+    ) -> Self {
+        Self {
+            signer: state.signer.clone(),
+            client: client::Client::new(state, cmdq.clone()),
+            cmdq,
+        }
+    }
+
+    /// Runtime client.
+    pub fn client(&self) -> &client::Client<A> {
+        &self.client
+    }
+
+    /// Transaction signer.
+    pub fn signer(&self) -> Arc<dyn Signer> {
+        self.signer.clone()
+    }
+
+    /// Send a command to the processor.
+    pub(super) async fn send_command(&self, cmd: processor::Command) -> Result<()> {
+        let cmdq = self
+            .cmdq
+            .upgrade()
+            .ok_or(anyhow!("processor has shut down"))?;
+        cmdq.send(cmd).await?;
+        Ok(())
+    }
+}
+
+impl<A> Clone for Environment<A>
+where
+    A: App,
+{
+    fn clone(&self) -> Self {
+        Self {
+            signer: self.signer.clone(),
+            client: self.client.clone(),
+            cmdq: self.cmdq.clone(),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/mod.rs.html new file mode 100644 index 0000000000..00f0fd6cb2 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/mod.rs.html @@ -0,0 +1,265 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+
//! Wrapper to make development of ROFL components easier.
+use std::sync::Arc;
+
+use anyhow::Result;
+use async_trait::async_trait;
+use tokio::sync::mpsc;
+
+use crate::{
+    core::{
+        app,
+        common::version,
+        config::Config,
+        consensus::{roothash, verifier::TrustRoot},
+        dispatcher::{PostInitState, PreInitState},
+        start_runtime,
+    },
+    crypto,
+    types::transaction,
+};
+
+mod client;
+mod env;
+mod notifier;
+pub mod prelude;
+mod processor;
+mod registration;
+
+pub use crate::modules::rofl::app_id::AppId;
+pub use client::Client;
+pub use env::Environment;
+
+/// ROFL component application.
+#[allow(unused_variables)]
+#[async_trait]
+pub trait App: Send + Sync + 'static {
+    /// ROFL application version.
+    const VERSION: version::Version;
+
+    /// Identifier of the application (used for registrations).
+    fn id() -> AppId;
+
+    /// Return the consensus layer trust root for this runtime; if `None`, consensus layer integrity
+    /// verification will not be performed.
+    fn consensus_trust_root() -> Option<TrustRoot>;
+
+    /// Create a new unsigned transaction.
+    fn new_transaction<B>(&self, method: &str, body: B) -> transaction::Transaction
+    where
+        B: cbor::Encode,
+    {
+        let mut tx = transaction::Transaction::new(method, body);
+        // Make the ROFL module resolve the payer for all of our transactions.
+        tx.set_fee_proxy("rofl", Self::id().as_ref());
+        tx
+    }
+
+    /// Main application processing loop.
+    async fn run(self: Arc<Self>, env: Environment<Self>)
+    where
+        Self: Sized,
+    {
+        // Default implementation does nothing.
+    }
+
+    /// Logic that runs on each runtime block. Only one of these will run concurrently.
+    async fn on_runtime_block(self: Arc<Self>, env: Environment<Self>, round: u64)
+    where
+        Self: Sized,
+    {
+        // Default implementation does nothing.
+    }
+
+    /// Start the application.
+    fn start(self)
+    where
+        Self: Sized,
+    {
+        start_runtime(
+            Box::new(|state: PreInitState<'_>| -> PostInitState {
+                // Fetch host information and configure domain separation context.
+                let hi = state.protocol.get_host_info();
+                crypto::signature::context::set_chain_context(
+                    hi.runtime_id,
+                    &hi.consensus_chain_context,
+                );
+
+                PostInitState {
+                    app: Some(Box::new(AppWrapper::new(self, &state))),
+                    ..Default::default()
+                }
+            }),
+            Config {
+                version: Self::VERSION,
+                trust_root: Self::consensus_trust_root(),
+                ..Default::default()
+            },
+        );
+    }
+}
+
+struct AppWrapper {
+    cmdq: mpsc::Sender<processor::Command>,
+}
+
+impl AppWrapper {
+    fn new<A>(app: A, state: &PreInitState<'_>) -> Self
+    where
+        A: App,
+    {
+        Self {
+            cmdq: processor::Processor::start(app, state),
+        }
+    }
+}
+
+#[async_trait]
+impl app::App for AppWrapper {
+    async fn on_runtime_block(&self, blk: &roothash::AnnotatedBlock) -> Result<()> {
+        self.cmdq
+            .send(processor::Command::ProcessRuntimeBlock(blk.clone()))
+            .await?;
+        Ok(())
+    }
+
+    async fn on_runtime_event(
+        &self,
+        _blk: &roothash::AnnotatedBlock,
+        _tags: &[Vec<u8>],
+    ) -> Result<()> {
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/notifier.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/notifier.rs.html new file mode 100644 index 0000000000..84608685fa --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/notifier.rs.html @@ -0,0 +1,251 @@ +notifier.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+
use std::sync::Arc;
+
+use anyhow::Result;
+use tokio::sync::mpsc;
+
+use crate::core::common::logger::get_logger;
+
+use super::{processor, App, Environment};
+
+/// Notification to deliver to the application.
+pub(super) enum Notify {
+    RuntimeBlock(u64),
+    RuntimeBlockDone,
+    InitialRegistrationCompleted,
+}
+
+#[derive(Default)]
+struct NotifyState {
+    pending: bool,
+    running: bool,
+}
+
+/// Application notifier task.
+pub(super) struct Task<A: App> {
+    imp: Option<Impl<A>>,
+    tx: mpsc::Sender<Notify>,
+}
+
+impl<A> Task<A>
+where
+    A: App,
+{
+    /// Create an application notifier task.
+    pub(super) fn new(state: Arc<processor::State<A>>, env: Environment<A>) -> Self {
+        let (tx, rx) = mpsc::channel(16);
+
+        let imp = Impl {
+            state,
+            env,
+            logger: get_logger("modules/rofl/app/notifier"),
+            notify: rx,
+            notify_tx: tx.downgrade(),
+        };
+
+        Self { imp: Some(imp), tx }
+    }
+
+    /// Start the application notifier task.
+    pub(super) fn start(&mut self) {
+        if let Some(imp) = self.imp.take() {
+            imp.start();
+        }
+    }
+
+    /// Deliver a notification.
+    pub(super) async fn notify(&self, notification: Notify) -> Result<()> {
+        self.tx.send(notification).await?;
+        Ok(())
+    }
+}
+
+struct Impl<A: App> {
+    state: Arc<processor::State<A>>,
+    env: Environment<A>,
+    logger: slog::Logger,
+
+    notify: mpsc::Receiver<Notify>,
+    notify_tx: mpsc::WeakSender<Notify>,
+}
+
+impl<A> Impl<A>
+where
+    A: App,
+{
+    /// Start the application notifier task.
+    pub(super) fn start(self) {
+        tokio::task::spawn(self.run());
+    }
+
+    /// Run the application notifier task.
+    async fn run(mut self) {
+        slog::info!(self.logger, "starting notifier task");
+
+        // Pending notifications.
+        let mut registered = false;
+        let mut block = NotifyState::default();
+        let mut last_round = 0;
+
+        while let Some(notification) = self.notify.recv().await {
+            match notification {
+                Notify::RuntimeBlock(round) if registered => {
+                    block.pending = true;
+                    last_round = round;
+                }
+                Notify::RuntimeBlock(_) => continue, // Skip blocks before registration.
+                Notify::RuntimeBlockDone => block.running = false,
+                Notify::InitialRegistrationCompleted => registered = true,
+            }
+
+            // Don't do anything unless registered.
+            if !registered {
+                continue;
+            }
+
+            // Block notifications.
+            if block.pending && !block.running {
+                block.pending = false;
+                block.running = true;
+
+                let notify_tx = self.notify_tx.clone();
+                let app = self.state.app.clone();
+                let env = self.env.clone();
+
+                tokio::spawn(async move {
+                    app.on_runtime_block(env, last_round).await;
+                    if let Some(tx) = notify_tx.upgrade() {
+                        let _ = tx.send(Notify::RuntimeBlockDone).await;
+                    }
+                });
+            }
+        }
+
+        slog::info!(self.logger, "notifier task stopped");
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/prelude.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/prelude.rs.html new file mode 100644 index 0000000000..b1e0bb5ed2 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/prelude.rs.html @@ -0,0 +1,19 @@ +prelude.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+
//! Prelude for ROFL applications.
+pub use std::sync::Arc;
+
+pub use anyhow::Result;
+pub use async_trait::async_trait;
+
+pub use crate::{self as sdk, core::consensus::verifier::TrustRoot, Version};
+
+pub use super::{App, AppId, Environment};
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/processor.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/processor.rs.html new file mode 100644 index 0000000000..8bcdbbe0e2 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/processor.rs.html @@ -0,0 +1,387 @@ +processor.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+
use std::sync::Arc;
+
+use anyhow::{anyhow, Result};
+use tokio::sync::{mpsc, oneshot};
+
+use crate::{
+    core::{
+        common::logger::get_logger,
+        consensus::{roothash, verifier::Verifier},
+        dispatcher::PreInitState,
+        host::{self, Host as _},
+        identity::Identity,
+        protocol::Protocol,
+    },
+    crypto::signature::{secp256k1, Signer},
+};
+use rand::rngs::OsRng;
+
+use super::{notifier, registration, App, Environment};
+
+/// Size of the processor command queue.
+const CMDQ_BACKLOG: usize = 32;
+
+/// Command sent to the processor task.
+#[allow(clippy::large_enum_variant)]
+#[derive(Debug)]
+pub(super) enum Command {
+    /// Process a notification of a new runtime block.
+    ProcessRuntimeBlock(roothash::AnnotatedBlock),
+    /// Retrieve the latest known round.
+    GetLatestRound(oneshot::Sender<u64>),
+    /// Notification that initial registration has been completed.
+    InitialRegistrationCompleted,
+}
+
+/// Processor state.
+pub(super) struct State<A: App> {
+    pub(super) identity: Arc<Identity>,
+    pub(super) host: Arc<Protocol>,
+    pub(super) consensus_verifier: Arc<dyn Verifier>,
+    pub(super) signer: Arc<dyn Signer>,
+    pub(super) app: Arc<A>,
+}
+
+struct Tasks<A: App> {
+    registration: registration::Task<A>,
+    notifier: notifier::Task<A>,
+}
+
+/// Processor.
+pub(super) struct Processor<A: App> {
+    state: Arc<State<A>>,
+    env: Environment<A>,
+    tasks: Tasks<A>,
+    cmdq: mpsc::Receiver<Command>,
+    logger: slog::Logger,
+
+    latest_round: u64,
+}
+
+impl<A> Processor<A>
+where
+    A: App,
+{
+    /// Create and start a new processor.
+    pub(super) fn start(app: A, state: &PreInitState<'_>) -> mpsc::Sender<Command> {
+        // Create the command channel.
+        let (tx, rx) = mpsc::channel(CMDQ_BACKLOG);
+
+        // Provision keys. Currently we provision a random key for signing transactions to avoid
+        // using the RAK directly as the RAK is an Ed25519 key which cannot easily be used for EVM
+        // calls due to the limitations of the current implementation.
+        let signer = secp256k1::MemorySigner::random(&mut OsRng).unwrap();
+
+        // Prepare state.
+        let state = Arc::new(State {
+            identity: state.identity.clone(),
+            host: state.protocol.clone(),
+            consensus_verifier: state.consensus_verifier.clone(),
+            signer: Arc::new(signer),
+            app: Arc::new(app),
+        });
+
+        // Prepare application environment.
+        let env = Environment::new(state.clone(), tx.downgrade());
+
+        // Create the processor and start it.
+        let processor = Self {
+            tasks: Tasks {
+                registration: registration::Task::new(state.clone(), env.clone()),
+                notifier: notifier::Task::new(state.clone(), env.clone()),
+            },
+            state,
+            env,
+            cmdq: rx,
+            logger: get_logger("modules/rofl/app"),
+            latest_round: 0,
+        };
+        tokio::spawn(processor.run());
+
+        tx
+    }
+
+    /// Run the processor.
+    async fn run(mut self) {
+        slog::info!(self.logger, "starting processor";
+            "app_id" => A::id(),
+        );
+
+        // Register for notifications.
+        if let Err(err) = self
+            .state
+            .host
+            .register_notify(host::RegisterNotifyOpts {
+                runtime_block: true,
+                runtime_event: vec![],
+            })
+            .await
+        {
+            slog::error!(self.logger, "failed to register for notifications";
+                "err" => ?err,
+            );
+        }
+
+        // Start the tasks.
+        self.tasks.registration.start();
+        self.tasks.notifier.start();
+
+        slog::info!(self.logger, "entering processor loop");
+        while let Some(cmd) = self.cmdq.recv().await {
+            if let Err(err) = self.process(cmd).await {
+                slog::error!(self.logger, "failed to process command";
+                    "err" => ?err,
+                );
+            }
+        }
+
+        slog::info!(self.logger, "processor stopped");
+    }
+
+    /// Process a command.
+    async fn process(&mut self, cmd: Command) -> Result<()> {
+        match cmd {
+            Command::ProcessRuntimeBlock(blk) => self.cmd_process_runtime_block(blk).await,
+            Command::GetLatestRound(ch) => self.cmd_get_latest_round(ch).await,
+            Command::InitialRegistrationCompleted => {
+                self.cmd_initial_registration_completed().await
+            }
+        }
+    }
+
+    async fn cmd_process_runtime_block(&mut self, blk: roothash::AnnotatedBlock) -> Result<()> {
+        // Update latest known round.
+        if blk.block.header.round <= self.latest_round {
+            return Err(anyhow!("round seems to have moved backwards"));
+        }
+        self.latest_round = blk.block.header.round;
+
+        // Notify registration task.
+        self.tasks.registration.refresh();
+        // Notify notifier task.
+        let _ = self
+            .tasks
+            .notifier
+            .notify(notifier::Notify::RuntimeBlock(self.latest_round))
+            .await;
+
+        Ok(())
+    }
+
+    async fn cmd_get_latest_round(&self, ch: oneshot::Sender<u64>) -> Result<()> {
+        let _ = ch.send(self.latest_round);
+        Ok(())
+    }
+
+    async fn cmd_initial_registration_completed(&self) -> Result<()> {
+        slog::info!(
+            self.logger,
+            "initial registration completed, starting application"
+        );
+
+        // Start application after first registration.
+        tokio::spawn(self.state.app.clone().run(self.env.clone()));
+
+        // Notify notifier task.
+        self.tasks
+            .notifier
+            .notify(notifier::Notify::InitialRegistrationCompleted)
+            .await?;
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/registration.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/registration.rs.html new file mode 100644 index 0000000000..9afc8f21c9 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/registration.rs.html @@ -0,0 +1,289 @@ +registration.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+
use std::sync::Arc;
+
+use anyhow::{anyhow, Result};
+use tokio::sync::mpsc;
+
+use crate::{
+    core::{
+        common::logger::get_logger,
+        consensus::{
+            beacon::EpochTime, state::beacon::ImmutableState as BeaconState, verifier::Verifier,
+        },
+    },
+    modules::rofl::types::Register,
+};
+
+use super::{processor, App, Environment};
+
+/// Registration task.
+pub(super) struct Task<A: App> {
+    imp: Option<Impl<A>>,
+    tx: mpsc::Sender<()>,
+}
+
+impl<A> Task<A>
+where
+    A: App,
+{
+    /// Create a registration task.
+    pub(super) fn new(state: Arc<processor::State<A>>, env: Environment<A>) -> Self {
+        let (tx, rx) = mpsc::channel(1);
+
+        let imp = Impl {
+            state,
+            env,
+            logger: get_logger("modules/rofl/app/registration"),
+            notify: rx,
+            last_registration_epoch: None,
+        };
+
+        Self { imp: Some(imp), tx }
+    }
+
+    /// Start the registration task.
+    pub(super) fn start(&mut self) {
+        if let Some(imp) = self.imp.take() {
+            imp.start();
+        }
+    }
+
+    /// Ask the registration task to refresh the registration.
+    pub(super) fn refresh(&self) {
+        let _ = self.tx.try_send(());
+    }
+}
+
+struct Impl<A: App> {
+    state: Arc<processor::State<A>>,
+    env: Environment<A>,
+    logger: slog::Logger,
+
+    notify: mpsc::Receiver<()>,
+    last_registration_epoch: Option<EpochTime>,
+}
+
+impl<A> Impl<A>
+where
+    A: App,
+{
+    /// Start the registration task.
+    pub(super) fn start(self) {
+        tokio::task::spawn(self.run());
+    }
+
+    /// Run the registration task.
+    async fn run(mut self) {
+        slog::info!(self.logger, "starting registration task");
+
+        // TODO: Handle retries etc.
+        while self.notify.recv().await.is_some() {
+            if let Err(err) = self.refresh_registration().await {
+                slog::error!(self.logger, "failed to refresh registration";
+                    "err" => ?err,
+                );
+            }
+        }
+
+        slog::info!(self.logger, "registration task stopped");
+    }
+
+    /// Perform application registration refresh.
+    async fn refresh_registration(&mut self) -> Result<()> {
+        // Determine current epoch.
+        let state = self.state.consensus_verifier.latest_state().await?;
+        let epoch = tokio::task::spawn_blocking(move || {
+            let beacon = BeaconState::new(&state);
+            beacon.epoch()
+        })
+        .await??;
+
+        // Skip refresh in case epoch has not changed.
+        if self.last_registration_epoch == Some(epoch) {
+            return Ok(());
+        }
+
+        slog::info!(self.logger, "refreshing registration";
+            "last_registration_epoch" => self.last_registration_epoch,
+            "epoch" => epoch,
+        );
+
+        // Refresh registration.
+        let ect = self
+            .state
+            .identity
+            .endorsed_capability_tee()
+            .ok_or(anyhow!("endorsed TEE capability not available"))?;
+        let register = Register {
+            app: A::id(),
+            ect,
+            expiration: epoch + 2,
+            extra_keys: vec![self.env.signer().public_key()],
+        };
+
+        let tx = self.state.app.new_transaction("rofl.Register", register);
+        let result = self
+            .env
+            .client()
+            .multi_sign_and_submit_tx(&[self.state.identity.clone(), self.env.signer()], tx)
+            .await?
+            .ok()?;
+
+        slog::info!(self.logger, "refreshed registration"; "result" => ?result);
+
+        if self.last_registration_epoch.is_none() {
+            // If this is the first registration, notify processor that initial registration has
+            // been completed so it can do other stuff.
+            self.env
+                .send_command(processor::Command::InitialRegistrationCompleted)
+                .await?;
+        }
+        self.last_registration_epoch = Some(epoch);
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app_id.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app_id.rs.html new file mode 100644 index 0000000000..ecf343e203 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app_id.rs.html @@ -0,0 +1,533 @@ +app_id.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+
//! ROFL application identifier.
+use std::fmt;
+
+use bech32::{Bech32, Hrp};
+
+use crate::{core::common::crypto::hash::Hash, types::address::Address};
+
+const APP_ID_VERSION_SIZE: usize = 1;
+const APP_ID_DATA_SIZE: usize = 20;
+const APP_ID_SIZE: usize = APP_ID_VERSION_SIZE + APP_ID_DATA_SIZE;
+
+/// V0 identifier version.
+const APP_ID_V0_VERSION: u8 = 0;
+/// Creator/round/index identifier context.
+const APP_ID_CRI_CONTEXT: &[u8] = b"oasis-sdk/rofl: cri app id";
+/// Creator/nonce identifier context.
+const APP_ID_CN_CONTEXT: &[u8] = b"oasis-sdk/rofl: cn app id";
+/// Global name identifier context.
+const APP_ID_GLOBAL_NAME_CONTEXT: &[u8] = b"oasis-sdk/rofl: global name app id";
+
+/// Human readable part for Bech32-encoded application identifier.
+pub const APP_ID_BECH32_HRP: Hrp = Hrp::parse_unchecked("rofl");
+
+/// Error.
+#[derive(thiserror::Error, Debug)]
+pub enum Error {
+    #[error("malformed identifier")]
+    MalformedIdentifier,
+}
+
+/// ROFL application identifier.
+///
+/// The application identifier is similar to an address, but using its own separate namespace and
+/// derivation scheme as it is not meant to be used as an address.
+#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub struct AppId([u8; APP_ID_SIZE]);
+
+impl AppId {
+    /// Size of an application identifier in bytes.
+    pub const SIZE: usize = APP_ID_SIZE;
+
+    /// Creates a new application identifier from a context, version and data.
+    fn new(ctx: &'static [u8], version: u8, data: &[u8]) -> Self {
+        let h = Hash::digest_bytes_list(&[ctx, &[version], data]);
+
+        let mut a = [0; APP_ID_SIZE];
+        a[..APP_ID_VERSION_SIZE].copy_from_slice(&[version]);
+        a[APP_ID_VERSION_SIZE..].copy_from_slice(h.truncated(APP_ID_DATA_SIZE));
+
+        AppId(a)
+    }
+
+    /// Creates a new v0 application identifier from a global name.
+    pub fn from_global_name(name: &str) -> Self {
+        Self::new(
+            APP_ID_GLOBAL_NAME_CONTEXT,
+            APP_ID_V0_VERSION,
+            name.as_bytes(),
+        )
+    }
+
+    /// Creates a new v0 application identifier from creator/round/index tuple.
+    pub fn from_creator_round_index(creator: Address, round: u64, index: u32) -> Self {
+        Self::new(
+            APP_ID_CRI_CONTEXT,
+            APP_ID_V0_VERSION,
+            &[creator.as_ref(), &round.to_be_bytes(), &index.to_be_bytes()].concat(),
+        )
+    }
+
+    /// Creates a new v0 application identifier from creator/nonce tuple.
+    pub fn from_creator_nonce(creator: Address, nonce: u64) -> Self {
+        Self::new(
+            APP_ID_CN_CONTEXT,
+            APP_ID_V0_VERSION,
+            &[creator.as_ref(), &nonce.to_be_bytes()].concat(),
+        )
+    }
+
+    /// Tries to create a new identifier from raw bytes.
+    pub fn from_bytes(data: &[u8]) -> Result<Self, Error> {
+        if data.len() != APP_ID_SIZE {
+            return Err(Error::MalformedIdentifier);
+        }
+
+        let mut a = [0; APP_ID_SIZE];
+        a.copy_from_slice(data);
+
+        Ok(AppId(a))
+    }
+
+    /// Convert the identifier into raw bytes.
+    pub fn into_bytes(self) -> [u8; APP_ID_SIZE] {
+        self.0
+    }
+
+    /// Tries to create a new identifier from Bech32-encoded string.
+    pub fn from_bech32(data: &str) -> Result<Self, Error> {
+        let (hrp, data) = bech32::decode(data).map_err(|_| Error::MalformedIdentifier)?;
+        if hrp != APP_ID_BECH32_HRP {
+            return Err(Error::MalformedIdentifier);
+        }
+
+        Self::from_bytes(&data)
+    }
+
+    /// Converts an identifier to Bech32 representation.
+    pub fn to_bech32(self) -> String {
+        bech32::encode::<Bech32>(APP_ID_BECH32_HRP, &self.0).unwrap()
+    }
+}
+
+impl AsRef<[u8]> for AppId {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl TryFrom<&[u8]> for AppId {
+    type Error = Error;
+
+    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> {
+        Self::from_bytes(bytes)
+    }
+}
+
+impl From<&'static str> for AppId {
+    fn from(s: &'static str) -> AppId {
+        AppId::from_bech32(s).unwrap()
+    }
+}
+
+impl fmt::LowerHex for AppId {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        for i in &self.0[..] {
+            write!(f, "{i:02x}")?;
+        }
+        Ok(())
+    }
+}
+
+impl fmt::Debug for AppId {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "{}", self.to_bech32())?;
+        Ok(())
+    }
+}
+
+impl fmt::Display for AppId {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "{}", self.to_bech32())?;
+        Ok(())
+    }
+}
+
+impl cbor::Encode for AppId {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::Value::ByteString(self.as_ref().to_vec())
+    }
+}
+
+impl cbor::Decode for AppId {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Default::default())
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => {
+                Self::from_bytes(&data).map_err(|_| cbor::DecodeError::UnexpectedType)
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+impl slog::Value for AppId {
+    fn serialize(
+        &self,
+        _record: &slog::Record<'_>,
+        key: slog::Key,
+        serializer: &mut dyn slog::Serializer,
+    ) -> slog::Result {
+        serializer.emit_str(key, &self.to_bech32())
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::testing::keys;
+
+    #[test]
+    fn test_identifier_v0() {
+        let creator = keys::alice::address();
+        let app_id = AppId::from_creator_round_index(creator, 42, 0);
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qr98wz5t6q4x8ng6a5l5v7rqlx90j3kcnun5dwht"
+        );
+
+        let creator = keys::bob::address();
+        let app_id = AppId::from_creator_round_index(creator, 42, 0);
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qrd45eaj4tf6l7mjw5prcukz75wdmwg6kggt6pnp"
+        );
+
+        let creator = keys::bob::address();
+        let app_id = AppId::from_creator_round_index(creator, 1, 0);
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qzmuyfwygnmfralgtwrqx8kcm587kwex9y8hf9hf"
+        );
+
+        let creator = keys::bob::address();
+        let app_id = AppId::from_creator_round_index(creator, 42, 1);
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qzmh56f52yd0tcqh757fahzc7ec49s8kaguyylvu"
+        );
+
+        let creator = keys::alice::address();
+        let app_id = AppId::from_creator_nonce(creator, 0);
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qqxxv77j6qy3rh50ah9kxehsh26e2hf7p5r6kwsq"
+        );
+
+        let creator = keys::alice::address();
+        let app_id = AppId::from_creator_nonce(creator, 1);
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qqfuf7u556prwv0wkdt398prhrpat7r3rvr97khf"
+        );
+
+        let creator = keys::alice::address();
+        let app_id = AppId::from_creator_nonce(creator, 42);
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qr90w0m8j7h34c2hhpfmg2wgqmtu0q82vyaxv6e0"
+        );
+
+        let creator = keys::bob::address();
+        let app_id = AppId::from_creator_nonce(creator, 0);
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qqzuxsh8fkga366kxrze8vpltdjge3rc7qg6tlrg"
+        );
+
+        let app_id = AppId::from_global_name("test global app");
+
+        assert_eq!(
+            app_id.to_bech32(),
+            "rofl1qrev5wq76npkmcv5wxkdxxcu4dhmu704yyl30h43"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/config.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/config.rs.html new file mode 100644 index 0000000000..2c5811513e --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/config.rs.html @@ -0,0 +1,57 @@ +config.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
use crate::types::token;
+
+/// Module configuration.
+pub trait Config: 'static {
+    /// Gas cost of rofl.Create call.
+    const GAS_COST_CALL_CREATE: u64 = 100_000;
+    /// Gas cost of rofl.Update call.
+    const GAS_COST_CALL_UPDATE: u64 = 100_000;
+    /// Gas cost of rofl.Remove call.
+    const GAS_COST_CALL_REMOVE: u64 = 10_000;
+    /// Gas cost of rofl.Register call.
+    const GAS_COST_CALL_REGISTER: u64 = 100_000;
+    /// Gas cost of rofl.IsAuthorizedOrigin call.
+    const GAS_COST_CALL_IS_AUTHORIZED_ORIGIN: u64 = 1000;
+    /// Gas cost of rofl.AuthorizedOriginNode call.
+    const GAS_COST_CALL_AUTHORIZED_ORIGIN_NODE: u64 = 2000;
+    /// Gas cost of rofl.AuthorizedOriginEntity call.
+    const GAS_COST_CALL_AUTHORIZED_ORIGIN_ENTITY: u64 = 2000;
+    /// Gas cost of rofl.StakeThresholds call.
+    const GAS_COST_CALL_STAKE_THRESHOLDS: u64 = 10;
+
+    /// Amount of stake required for maintaining an application.
+    ///
+    /// The stake is held in escrow and is returned to the administrator when the application is
+    /// removed.
+    const STAKE_APP_CREATE: token::BaseUnits =
+        token::BaseUnits::new(0, token::Denomination::NATIVE);
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/error.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/error.rs.html new file mode 100644 index 0000000000..fad8915524 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/error.rs.html @@ -0,0 +1,127 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
use crate::modules;
+
+use super::MODULE_NAME;
+
+/// Errors emitted by the module.
+#[derive(thiserror::Error, Debug, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("invalid argument")]
+    #[sdk_error(code = 1)]
+    InvalidArgument,
+
+    #[error("unknown application")]
+    #[sdk_error(code = 2)]
+    UnknownApp,
+
+    #[error("tx not signed by RAK")]
+    #[sdk_error(code = 3)]
+    NotSignedByRAK,
+
+    #[error("tx not signed by extra key")]
+    #[sdk_error(code = 4)]
+    NotSignedByExtraKey,
+
+    #[error("unknown enclave")]
+    #[sdk_error(code = 5)]
+    UnknownEnclave,
+
+    #[error("unknown node")]
+    #[sdk_error(code = 6)]
+    UnknownNode,
+
+    #[error("endorsement from given node not allowed")]
+    #[sdk_error(code = 7)]
+    NodeNotAllowed,
+
+    #[error("registration expired")]
+    #[sdk_error(code = 8)]
+    RegistrationExpired,
+
+    #[error("extra key update not allowed")]
+    #[sdk_error(code = 9)]
+    ExtraKeyUpdateNotAllowed,
+
+    #[error("application already exists")]
+    #[sdk_error(code = 10)]
+    AppAlreadyExists,
+
+    #[error("forbidden")]
+    #[sdk_error(code = 11)]
+    Forbidden,
+
+    #[error("unknown instance")]
+    #[sdk_error(code = 12)]
+    UnknownInstance,
+
+    #[error("core: {0}")]
+    #[sdk_error(transparent)]
+    Core(#[from] modules::core::Error),
+
+    #[error("accounts: {0}")]
+    #[sdk_error(transparent)]
+    Accounts(#[from] modules::accounts::Error),
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/event.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/event.rs.html new file mode 100644 index 0000000000..7b551bb6c8 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/event.rs.html @@ -0,0 +1,31 @@ +event.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+
use super::{app_id::AppId, MODULE_NAME};
+
+/// Events emitted by the ROFL module.
+#[derive(Debug, cbor::Encode, oasis_runtime_sdk_macros::Event)]
+#[cbor(untagged)]
+pub enum Event {
+    #[sdk_event(code = 1)]
+    AppCreated { id: AppId },
+
+    #[sdk_event(code = 2)]
+    AppUpdated { id: AppId },
+
+    #[sdk_event(code = 3)]
+    AppRemoved { id: AppId },
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/mod.rs.html new file mode 100644 index 0000000000..bcdf78a94d --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/mod.rs.html @@ -0,0 +1,1237 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+
//! On-chain coordination for ROFL components.
+use std::collections::BTreeSet;
+
+use once_cell::sync::Lazy;
+
+use crate::{
+    context::Context,
+    core::{
+        common::crypto::signature::PublicKey as CorePublicKey,
+        consensus::{
+            registry::{Node, RolesMask, VerifiedEndorsedCapabilityTEE},
+            state::registry::ImmutableState as RegistryImmutableState,
+        },
+    },
+    crypto::signature::PublicKey,
+    handler, migration,
+    module::{self, Module as _, Parameters as _},
+    modules::{self, accounts::API as _, core::API as _},
+    sdk_derive,
+    state::CurrentState,
+    types::{address::Address, transaction::Transaction},
+    Runtime,
+};
+
+pub mod app;
+pub mod app_id;
+mod config;
+mod error;
+mod event;
+pub mod policy;
+pub mod state;
+#[cfg(test)]
+mod test;
+pub mod types;
+
+/// Unique module name.
+const MODULE_NAME: &str = "rofl";
+
+pub use config::Config;
+pub use error::Error;
+pub use event::Event;
+
+/// Parameters for the module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Parameters {}
+
+/// Errors emitted during parameter validation.
+#[derive(thiserror::Error, Debug)]
+pub enum ParameterValidationError {}
+
+impl module::Parameters for Parameters {
+    type Error = ParameterValidationError;
+
+    fn validate_basic(&self) -> Result<(), Self::Error> {
+        Ok(())
+    }
+}
+
+/// Genesis state for the module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Genesis {
+    pub parameters: Parameters,
+
+    /// Application configurations.
+    pub apps: Vec<types::AppConfig>,
+}
+
+/// Interface that can be called from other modules.
+pub trait API {
+    /// Get the Runtime Attestation Key of the ROFL app instance in case the origin transaction is
+    /// signed by a ROFL instance. Otherwise `None` is returned.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    fn get_origin_rak() -> Option<PublicKey>;
+
+    /// Get the registration descriptor of the ROFL app instance in case the origin transaction is
+    /// signed by a ROFL instance of the specified app. Otherwise `None` is returned.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    fn get_origin_registration(app: app_id::AppId) -> Option<types::Registration>;
+
+    /// Verify whether the origin transaction is signed by an authorized ROFL instance for the given
+    /// application.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    fn is_authorized_origin(app: app_id::AppId) -> bool;
+
+    /// Get a specific registered instance for an application.
+    fn get_registration(app: app_id::AppId, rak: PublicKey) -> Result<types::Registration, Error>;
+
+    /// Get an application's configuration.
+    fn get_app(id: app_id::AppId) -> Result<types::AppConfig, Error>;
+
+    /// Get all registered instances for an application.
+    fn get_instances(id: app_id::AppId) -> Result<Vec<types::Registration>, Error>;
+}
+
+/// Module's address that has the application stake pool.
+///
+/// oasis1qza6sddnalgzexk3ct30gqfvntgth5m4hsyywmff
+pub static ADDRESS_APP_STAKE_POOL: Lazy<Address> =
+    Lazy::new(|| Address::from_module(MODULE_NAME, "app-stake-pool"));
+
+pub struct Module<Cfg: Config> {
+    _cfg: std::marker::PhantomData<Cfg>,
+}
+
+impl<Cfg: Config> API for Module<Cfg> {
+    fn get_origin_rak() -> Option<PublicKey> {
+        let caller_pk = CurrentState::with_env_origin(|env| env.tx_caller_public_key())?;
+
+        // Resolve RAK as the call may be made by an extra key.
+        state::get_endorser(&caller_pk).map(|kei| match kei {
+            // It may point to a RAK.
+            state::KeyEndorsementInfo { rak: Some(rak), .. } => rak.into(),
+            // Or it points to itself.
+            _ => caller_pk,
+        })
+    }
+
+    fn get_origin_registration(app: app_id::AppId) -> Option<types::Registration> {
+        Self::get_origin_rak()
+            .and_then(|rak| state::get_registration(app, &rak.try_into().unwrap()))
+    }
+
+    fn is_authorized_origin(app: app_id::AppId) -> bool {
+        Self::get_origin_registration(app).is_some()
+    }
+
+    fn get_registration(app: app_id::AppId, rak: PublicKey) -> Result<types::Registration, Error> {
+        state::get_registration(app, &rak.try_into().map_err(|_| Error::InvalidArgument)?)
+            .ok_or(Error::UnknownInstance)
+    }
+
+    fn get_app(id: app_id::AppId) -> Result<types::AppConfig, Error> {
+        state::get_app(id).ok_or(Error::UnknownApp)
+    }
+
+    fn get_instances(id: app_id::AppId) -> Result<Vec<types::Registration>, Error> {
+        Ok(state::get_registrations_for_app(id))
+    }
+}
+
+#[sdk_derive(Module)]
+impl<Cfg: Config> Module<Cfg> {
+    const NAME: &'static str = MODULE_NAME;
+    type Error = Error;
+    type Event = Event;
+    type Parameters = Parameters;
+    type Genesis = Genesis;
+
+    #[migration(init)]
+    fn init(genesis: Genesis) {
+        genesis
+            .parameters
+            .validate_basic()
+            .expect("invalid genesis parameters");
+
+        // Set genesis parameters.
+        Self::set_params(genesis.parameters);
+
+        // Insert all applications.
+        for cfg in genesis.apps {
+            if state::get_app(cfg.id).is_some() {
+                panic!("duplicate application in genesis: {:?}", cfg.id);
+            }
+
+            state::set_app(cfg);
+        }
+    }
+
+    /// Create a new ROFL application.
+    #[handler(call = "rofl.Create")]
+    fn tx_create<C: Context>(ctx: &C, body: types::Create) -> Result<app_id::AppId, Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_CREATE)?;
+
+        if CurrentState::with_env(|env| env.is_check_only()) {
+            return Ok(Default::default());
+        }
+
+        let (creator, tx_index) =
+            CurrentState::with_env(|env| (env.tx_caller_address(), env.tx_index()));
+        let app_id = match body.scheme {
+            types::IdentifierScheme::CreatorRoundIndex => app_id::AppId::from_creator_round_index(
+                creator,
+                ctx.runtime_header().round,
+                tx_index.try_into().map_err(|_| Error::InvalidArgument)?,
+            ),
+            types::IdentifierScheme::CreatorNonce => {
+                let nonce = <C::Runtime as Runtime>::Accounts::get_nonce(creator)?;
+
+                app_id::AppId::from_creator_nonce(creator, nonce)
+            }
+        };
+
+        // Sanity check that the application doesn't already exist.
+        if state::get_app(app_id).is_some() {
+            return Err(Error::AppAlreadyExists);
+        }
+
+        // Transfer stake.
+        <C::Runtime as Runtime>::Accounts::transfer(
+            creator,
+            *ADDRESS_APP_STAKE_POOL,
+            &Cfg::STAKE_APP_CREATE,
+        )?;
+
+        // Register the application.
+        let cfg = types::AppConfig {
+            id: app_id,
+            policy: body.policy,
+            admin: Some(creator),
+            stake: Cfg::STAKE_APP_CREATE,
+        };
+        state::set_app(cfg);
+
+        CurrentState::with(|state| state.emit_event(Event::AppCreated { id: app_id }));
+
+        Ok(app_id)
+    }
+
+    /// Ensure caller is the current administrator, return an error otherwise.
+    fn ensure_caller_is_admin(cfg: &types::AppConfig) -> Result<(), Error> {
+        let caller = CurrentState::with_env(|env| env.tx_caller_address());
+        if cfg.admin != Some(caller) {
+            return Err(Error::Forbidden);
+        }
+        Ok(())
+    }
+
+    /// Update a ROFL application.
+    #[handler(call = "rofl.Update")]
+    fn tx_update<C: Context>(ctx: &C, body: types::Update) -> Result<(), Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_UPDATE)?;
+
+        let mut cfg = state::get_app(body.id).ok_or(Error::UnknownApp)?;
+
+        // Ensure caller is the admin and is allowed to update the configuration.
+        Self::ensure_caller_is_admin(&cfg)?;
+
+        if CurrentState::with_env(|env| env.is_check_only()) {
+            return Ok(());
+        }
+
+        // Return early if nothing has actually changed.
+        if cfg.policy == body.policy && cfg.admin == body.admin {
+            return Ok(());
+        }
+
+        cfg.policy = body.policy;
+        cfg.admin = body.admin;
+        state::set_app(cfg);
+
+        CurrentState::with(|state| state.emit_event(Event::AppUpdated { id: body.id }));
+
+        Ok(())
+    }
+
+    /// Remove a ROFL application.
+    #[handler(call = "rofl.Remove")]
+    fn tx_remove<C: Context>(ctx: &C, body: types::Remove) -> Result<(), Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_REMOVE)?;
+
+        let cfg = state::get_app(body.id).ok_or(Error::UnknownApp)?;
+
+        // Ensure caller is the admin and is allowed to update the configuration.
+        Self::ensure_caller_is_admin(&cfg)?;
+
+        if CurrentState::with_env(|env| env.is_check_only()) {
+            return Ok(());
+        }
+
+        state::remove_app(body.id);
+
+        // Return stake to the administrator account.
+        if let Some(admin) = cfg.admin {
+            <C::Runtime as Runtime>::Accounts::transfer(
+                *ADDRESS_APP_STAKE_POOL,
+                admin,
+                &cfg.stake,
+            )?;
+        }
+
+        CurrentState::with(|state| state.emit_event(Event::AppRemoved { id: body.id }));
+
+        Ok(())
+    }
+
+    /// Register a new ROFL instance.
+    #[handler(call = "rofl.Register")]
+    fn tx_register<C: Context>(ctx: &C, body: types::Register) -> Result<(), Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_REGISTER)?;
+
+        if body.expiration <= ctx.epoch() {
+            return Err(Error::RegistrationExpired);
+        }
+
+        let cfg = state::get_app(body.app).ok_or(Error::UnknownApp)?;
+
+        if body.expiration - ctx.epoch() > cfg.policy.max_expiration {
+            return Err(Error::InvalidArgument);
+        }
+
+        // Ensure that the transaction is signed by RAK (and co-signed by extra keys).
+        let signer_pks: BTreeSet<PublicKey> = CurrentState::with_env(|env| {
+            env.tx_auth_info()
+                .signer_info
+                .iter()
+                .filter_map(|si| si.address_spec.public_key())
+                .collect()
+        });
+        if !signer_pks.contains(&body.ect.capability_tee.rak.into()) {
+            return Err(Error::NotSignedByRAK);
+        }
+        for extra_pk in &body.extra_keys {
+            if !signer_pks.contains(extra_pk) {
+                return Err(Error::NotSignedByExtraKey);
+            }
+        }
+
+        if CurrentState::with_env(|env| env.is_check_only()) {
+            return Ok(());
+        }
+
+        // Verify policy.
+        let verified_ect = body
+            .ect
+            .verify(&cfg.policy.quotes)
+            .map_err(|_| Error::InvalidArgument)?;
+
+        // Verify enclave identity.
+        if !cfg
+            .policy
+            .enclaves
+            .contains(&verified_ect.verified_attestation.quote.identity)
+        {
+            return Err(Error::UnknownEnclave);
+        }
+
+        // Verify allowed endorsement.
+        let node = Self::verify_endorsement(ctx, &cfg.policy, &verified_ect)?;
+
+        // Update registration.
+        let registration = types::Registration {
+            app: body.app,
+            node_id: verified_ect.node_id.unwrap(), // Verified above.
+            entity_id: node.map(|n| n.entity_id),
+            rak: body.ect.capability_tee.rak,
+            rek: body.ect.capability_tee.rek.ok_or(Error::InvalidArgument)?, // REK required.
+            expiration: body.expiration,
+            extra_keys: body.extra_keys,
+        };
+        state::update_registration(registration)?;
+
+        Ok(())
+    }
+
+    /// Verify whether the given endorsement is allowed by the application policy.
+    ///
+    /// Returns an optional endorsing node descriptor when available.
+    fn verify_endorsement<C: Context>(
+        ctx: &C,
+        app_policy: &policy::AppAuthPolicy,
+        ect: &VerifiedEndorsedCapabilityTEE,
+    ) -> Result<Option<Node>, Error> {
+        use policy::AllowedEndorsement;
+
+        let endorsing_node_id = ect.node_id.ok_or(Error::UnknownNode)?;
+
+        // Attempt to resolve the node that endorsed the enclave. It may be that the node is not
+        // even registered in the consensus layer which may be acceptable for some policies.
+        let maybe_node = || -> Result<Option<Node>, Error> {
+            let registry = RegistryImmutableState::new(ctx.consensus_state());
+            let node = registry
+                .node(&endorsing_node_id)
+                .map_err(|_| Error::UnknownNode)?;
+            let node = if let Some(node) = node {
+                node
+            } else {
+                return Ok(None);
+            };
+            // Ensure node is not expired.
+            if node.expiration < ctx.epoch() {
+                return Ok(None);
+            }
+
+            Ok(Some(node))
+        }()?;
+
+        // Ensure node is registered for this runtime.
+        let has_runtime = |node: &Node| -> bool {
+            let version = &<C::Runtime as Runtime>::VERSION;
+            node.get_runtime(ctx.runtime_id(), version).is_some()
+        };
+
+        for allowed in &app_policy.endorsements {
+            match (allowed, &maybe_node) {
+                (AllowedEndorsement::Any, _) => {
+                    // Any node is allowed.
+                    return Ok(maybe_node);
+                }
+                (AllowedEndorsement::ComputeRole, Some(node)) => {
+                    if node.has_roles(RolesMask::ROLE_COMPUTE_WORKER) && has_runtime(node) {
+                        return Ok(maybe_node);
+                    }
+                }
+                (AllowedEndorsement::ObserverRole, Some(node)) => {
+                    if node.has_roles(RolesMask::ROLE_OBSERVER) && has_runtime(node) {
+                        return Ok(maybe_node);
+                    }
+                }
+                (AllowedEndorsement::Entity(entity_id), Some(node)) => {
+                    // If a specific entity is required, it may be registered for any runtime.
+                    if &node.entity_id == entity_id {
+                        return Ok(maybe_node);
+                    }
+                }
+                (AllowedEndorsement::Node(node_id), _) => {
+                    if endorsing_node_id == *node_id {
+                        return Ok(maybe_node);
+                    }
+                }
+                _ => continue,
+            }
+        }
+
+        // If nothing matched, this node is not allowed to register.
+        Err(Error::NodeNotAllowed)
+    }
+
+    /// Verify whether the origin transaction is signed by an authorized ROFL instance for the given
+    /// application.
+    #[handler(call = "rofl.IsAuthorizedOrigin", internal)]
+    fn internal_is_authorized_origin<C: Context>(
+        _ctx: &C,
+        app: app_id::AppId,
+    ) -> Result<bool, Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_IS_AUTHORIZED_ORIGIN)?;
+
+        Ok(Self::is_authorized_origin(app))
+    }
+
+    #[handler(call = "rofl.AuthorizedOriginNode", internal)]
+    fn internal_authorized_origin_node<C: Context>(
+        _ctx: &C,
+        app: app_id::AppId,
+    ) -> Result<CorePublicKey, Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_AUTHORIZED_ORIGIN_NODE)?;
+
+        let registration = Self::get_origin_registration(app).ok_or(Error::UnknownInstance)?;
+        Ok(registration.node_id)
+    }
+
+    #[handler(call = "rofl.AuthorizedOriginEntity", internal)]
+    fn internal_authorized_origin_entity<C: Context>(
+        _ctx: &C,
+        app: app_id::AppId,
+    ) -> Result<Option<CorePublicKey>, Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_AUTHORIZED_ORIGIN_ENTITY)?;
+
+        let registration = Self::get_origin_registration(app).ok_or(Error::UnknownInstance)?;
+        Ok(registration.entity_id)
+    }
+
+    /// Returns the configuration for the given ROFL application.
+    #[handler(query = "rofl.App")]
+    fn query_app<C: Context>(_ctx: &C, args: types::AppQuery) -> Result<types::AppConfig, Error> {
+        Self::get_app(args.id)
+    }
+
+    /// Returns a specific registered instance for the given ROFL application.
+    #[handler(query = "rofl.AppInstance")]
+    fn query_app_instance<C: Context>(
+        _ctx: &C,
+        args: types::AppInstanceQuery,
+    ) -> Result<types::Registration, Error> {
+        Self::get_registration(args.app, args.rak)
+    }
+
+    /// Returns a list of all registered instances for the given ROFL application.
+    #[handler(query = "rofl.AppInstances", expensive)]
+    fn query_app_instances<C: Context>(
+        _ctx: &C,
+        args: types::AppQuery,
+    ) -> Result<Vec<types::Registration>, Error> {
+        Self::get_instances(args.id)
+    }
+
+    /// Returns the minimum stake thresholds for managing ROFL.
+    #[handler(query = "rofl.StakeThresholds")]
+    fn query_stake_thresholds<C: Context>(
+        _ctx: &C,
+        _args: (),
+    ) -> Result<types::StakeThresholds, Error> {
+        Ok(types::StakeThresholds {
+            app_create: Cfg::STAKE_APP_CREATE,
+        })
+    }
+
+    /// Returns the minimum stake thresholds for managing ROFL.
+    #[handler(call = "rofl.StakeThresholds", internal)]
+    fn internal_query_stake_thresholds<C: Context>(
+        ctx: &C,
+        _args: (),
+    ) -> Result<types::StakeThresholds, Error> {
+        <C::Runtime as Runtime>::Core::use_tx_gas(Cfg::GAS_COST_CALL_STAKE_THRESHOLDS)?;
+        Ok(types::StakeThresholds {
+            app_create: Cfg::STAKE_APP_CREATE,
+        })
+    }
+
+    fn resolve_payer_from_tx<C: Context>(
+        ctx: &C,
+        tx: &Transaction,
+        app_policy: &policy::AppAuthPolicy,
+    ) -> Result<Option<Address>, anyhow::Error> {
+        let caller_pk = tx
+            .auth_info
+            .signer_info
+            .first()
+            .and_then(|si| si.address_spec.public_key());
+
+        match tx.call.method.as_str() {
+            "rofl.Register" => {
+                // For registration transactions, extract endorsing node.
+                let body: types::Register = cbor::from_value(tx.call.body.clone())?;
+                if body.expiration <= ctx.epoch() {
+                    return Err(Error::RegistrationExpired.into());
+                }
+
+                // Ensure that the transaction is signed by RAK.
+                let caller_pk = caller_pk.ok_or(Error::NotSignedByRAK)?;
+                if caller_pk != body.ect.capability_tee.rak {
+                    return Err(Error::NotSignedByRAK.into());
+                }
+
+                body.ect.verify_endorsement()?;
+
+                // Checking other details is not relevant for authorizing fee payments as if the
+                // node signed a TEE capability then it is authorizing fees to be spent on its
+                // behalf.
+
+                let node_id = body.ect.node_endorsement.public_key;
+                let payer = Address::from_consensus_pk(&node_id);
+
+                Ok(Some(payer))
+            }
+            _ => {
+                // For others, check if caller is one of the endorsed keys.
+                let caller_pk = match caller_pk {
+                    Some(pk) => pk,
+                    None => return Ok(None),
+                };
+
+                Ok(state::get_endorser(&caller_pk)
+                    .map(|ei| Address::from_consensus_pk(&ei.node_id)))
+            }
+        }
+    }
+}
+
+impl<Cfg: Config> module::FeeProxyHandler for Module<Cfg> {
+    fn resolve_payer<C: Context>(
+        ctx: &C,
+        tx: &Transaction,
+    ) -> Result<Option<Address>, modules::core::Error> {
+        use policy::FeePolicy;
+
+        let proxy = if let Some(ref proxy) = tx.auth_info.fee.proxy {
+            proxy
+        } else {
+            return Ok(None);
+        };
+
+        if proxy.module != MODULE_NAME {
+            return Ok(None);
+        }
+
+        // Look up the per-ROFL app policy.
+        let app_id = app_id::AppId::try_from(proxy.id.as_slice())
+            .map_err(|err| modules::core::Error::InvalidArgument(err.into()))?;
+        let app_policy = state::get_app(app_id).map(|cfg| cfg.policy).ok_or(
+            modules::core::Error::InvalidArgument(Error::UnknownApp.into()),
+        )?;
+
+        match app_policy.fees {
+            FeePolicy::InstancePays => {
+                // Application needs to figure out a way to pay, defer to regular handler.
+                Ok(None)
+            }
+            FeePolicy::EndorsingNodePays => Self::resolve_payer_from_tx(ctx, tx, &app_policy)
+                .map_err(modules::core::Error::InvalidArgument),
+        }
+    }
+}
+
+impl<Cfg: Config> module::TransactionHandler for Module<Cfg> {}
+
+impl<Cfg: Config> module::BlockHandler for Module<Cfg> {
+    fn end_block<C: Context>(ctx: &C) {
+        // Only do work in case the epoch has changed since the last processed block.
+        if !<C::Runtime as Runtime>::Core::has_epoch_changed() {
+            return;
+        }
+
+        // Process enclave expirations.
+        // TODO: Consider processing unprocessed in the next block(s) if there are too many.
+        state::expire_registrations(ctx.epoch(), 128);
+    }
+}
+
+impl<Cfg: Config> module::InvariantHandler for Module<Cfg> {}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/policy.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/policy.rs.html new file mode 100644 index 0000000000..d159b58c9f --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/policy.rs.html @@ -0,0 +1,109 @@ +policy.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
use crate::core::{
+    common::{
+        crypto::signature::PublicKey,
+        sgx::{EnclaveIdentity, QuotePolicy},
+    },
+    consensus::beacon::EpochTime,
+};
+
+/// Per-application ROFL policy.
+#[derive(Clone, Debug, PartialEq, Eq, Default, cbor::Encode, cbor::Decode)]
+pub struct AppAuthPolicy {
+    /// Quote policy.
+    pub quotes: QuotePolicy,
+    /// The set of allowed enclave identities.
+    pub enclaves: Vec<EnclaveIdentity>,
+    /// The set of allowed endorsements.
+    pub endorsements: Vec<AllowedEndorsement>,
+    /// Gas fee payment policy.
+    pub fees: FeePolicy,
+    /// Maximum number of future epochs for which one can register.
+    pub max_expiration: EpochTime,
+}
+
+/// An allowed endorsement policy.
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub enum AllowedEndorsement {
+    /// Any node can endorse the enclave.
+    #[cbor(rename = "any", as_struct)]
+    Any,
+    /// Compute node for the current runtime can endorse the enclave.
+    #[cbor(rename = "role_compute", as_struct)]
+    ComputeRole,
+    /// Observer node for the current runtime can endorse the enclave.
+    #[cbor(rename = "role_observer", as_struct)]
+    ObserverRole,
+    /// Registered node from a specific entity can endorse the enclave.
+    #[cbor(rename = "entity")]
+    Entity(PublicKey),
+    /// Specific node can endorse the enclave.
+    #[cbor(rename = "node")]
+    Node(PublicKey),
+}
+
+/// Gas fee payment policy.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum FeePolicy {
+    /// Application enclave pays the gas fees.
+    InstancePays = 1,
+    /// Endorsing node pays the gas fees.
+    #[default]
+    EndorsingNodePays = 2,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/state.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/state.rs.html new file mode 100644 index 0000000000..845d6c1a26 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/state.rs.html @@ -0,0 +1,693 @@ +state.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+
use crate::{
+    core::{
+        common::crypto::{hash::Hash, signature::PublicKey as CorePublicKey},
+        consensus::beacon::EpochTime,
+    },
+    crypto::signature::PublicKey,
+    state::CurrentState,
+    storage::{self, Store},
+};
+
+use super::{app_id::AppId, types, Error, MODULE_NAME};
+
+/// Map of application identifiers to their configs.
+const APPS: &[u8] = &[0x01];
+/// Map of (application identifier, H(RAK)) tuples to their registrations.
+const REGISTRATIONS: &[u8] = &[0x02];
+/// Map of H(pk)s to KeyEndorsementInfos. This is used when just the public key is needed to avoid
+/// fetching entire registrations from storage.
+const ENDORSERS: &[u8] = &[0x03];
+/// A queue of registration expirations.
+const EXPIRATION_QUEUE: &[u8] = &[0x04];
+
+/// Information about an endorsed key.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[cbor(as_array)]
+pub struct KeyEndorsementInfo {
+    /// Identifier of node that endorsed the enclave.
+    pub node_id: CorePublicKey,
+    /// RAK of the enclave that endorsed the key. This is only set for endorsements of extra keys.
+    pub rak: Option<CorePublicKey>,
+}
+
+impl KeyEndorsementInfo {
+    /// Create a new key endorsement information for RAK endorsed by given node directly.
+    pub fn for_rak(node_id: CorePublicKey) -> Self {
+        Self {
+            node_id,
+            ..Default::default()
+        }
+    }
+
+    /// Create a new key endorsement information for extra key endorsed by RAK.
+    pub fn for_extra_key(node_id: CorePublicKey, rak: CorePublicKey) -> Self {
+        Self {
+            node_id,
+            rak: Some(rak),
+        }
+    }
+}
+
+/// Retrieves an application configuration.
+pub fn get_app(app_id: AppId) -> Option<types::AppConfig> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let apps = storage::TypedStore::new(storage::PrefixStore::new(store, &APPS));
+        apps.get(app_id)
+    })
+}
+
+/// Updates an application configuration.
+pub fn set_app(cfg: types::AppConfig) {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let mut apps = storage::TypedStore::new(storage::PrefixStore::new(store, &APPS));
+        apps.insert(cfg.id, cfg);
+    })
+}
+
+/// Removes an application configuration.
+pub fn remove_app(app_id: AppId) {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let mut apps = storage::TypedStore::new(storage::PrefixStore::new(store, &APPS));
+        apps.remove(app_id);
+    })
+}
+
+/// Updates registration of the given ROFL enclave.
+pub fn update_registration(registration: types::Registration) -> Result<(), Error> {
+    let hrak = hash_rak(&registration.rak);
+
+    // Update expiration queue.
+    if let Some(existing) = get_registration_hrak(registration.app, hrak) {
+        // Disallow modification of extra keys.
+        if existing.extra_keys != registration.extra_keys {
+            return Err(Error::ExtraKeyUpdateNotAllowed);
+        }
+
+        remove_expiration_queue(existing.expiration, registration.app, hrak);
+    }
+    insert_expiration_queue(registration.expiration, registration.app, hrak);
+
+    // Update registration.
+    CurrentState::with_store(|mut root_store| {
+        let store = storage::PrefixStore::new(&mut root_store, &MODULE_NAME);
+        let mut endorsers = storage::TypedStore::new(storage::PrefixStore::new(store, &ENDORSERS));
+        endorsers.insert(hrak, KeyEndorsementInfo::for_rak(registration.node_id));
+
+        for pk in &registration.extra_keys {
+            endorsers.insert(
+                hash_pk(pk),
+                KeyEndorsementInfo::for_extra_key(registration.node_id, registration.rak),
+            );
+        }
+
+        let app_id = registration.app;
+        let store = storage::PrefixStore::new(&mut root_store, &MODULE_NAME);
+        let registrations = storage::PrefixStore::new(store, &REGISTRATIONS);
+        let mut app = storage::TypedStore::new(storage::PrefixStore::new(registrations, app_id));
+        app.insert(hrak, registration);
+    });
+
+    Ok(())
+}
+
+fn remove_registration_hrak(app_id: AppId, hrak: Hash) {
+    let registration = match get_registration_hrak(app_id, hrak) {
+        Some(registration) => registration,
+        None => return,
+    };
+
+    // Remove from expiration queue if present.
+    remove_expiration_queue(registration.expiration, registration.app, hrak);
+
+    // Remove registration.
+    CurrentState::with_store(|mut root_store| {
+        let store = storage::PrefixStore::new(&mut root_store, &MODULE_NAME);
+        let mut endorsers = storage::TypedStore::new(storage::PrefixStore::new(store, &ENDORSERS));
+        endorsers.remove(hrak);
+
+        for pk in &registration.extra_keys {
+            endorsers.remove(hash_pk(pk));
+        }
+
+        let store = storage::PrefixStore::new(&mut root_store, &MODULE_NAME);
+        let registrations = storage::PrefixStore::new(store, &REGISTRATIONS);
+        let mut app = storage::TypedStore::new(storage::PrefixStore::new(registrations, app_id));
+        app.remove(hrak);
+    });
+}
+
+/// Removes an existing registration of the given ROFL enclave.
+pub fn remove_registration(app_id: AppId, rak: &CorePublicKey) {
+    remove_registration_hrak(app_id, hash_rak(rak))
+}
+
+fn get_registration_hrak(app_id: AppId, hrak: Hash) -> Option<types::Registration> {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let registrations = storage::PrefixStore::new(store, &REGISTRATIONS);
+        let app = storage::TypedStore::new(storage::PrefixStore::new(registrations, app_id));
+        app.get(hrak)
+    })
+}
+
+/// Retrieves registration of the given ROFL enclave. In case enclave is not registered, returns
+/// `None`.
+pub fn get_registration(app_id: AppId, rak: &CorePublicKey) -> Option<types::Registration> {
+    get_registration_hrak(app_id, hash_rak(rak))
+}
+
+/// Retrieves all registrations for the given ROFL application.
+pub fn get_registrations_for_app(app_id: AppId) -> Vec<types::Registration> {
+    CurrentState::with_store(|mut root_store| {
+        let store = storage::PrefixStore::new(&mut root_store, &MODULE_NAME);
+        let registrations = storage::PrefixStore::new(store, &REGISTRATIONS);
+        let app = storage::TypedStore::new(storage::PrefixStore::new(registrations, app_id));
+
+        app.iter()
+            .map(|(_, registration): (Hash, types::Registration)| registration)
+            .collect()
+    })
+}
+
+/// Retrieves endorser of the given ROFL enclave. In case enclave is not registered, returns `None`.
+pub fn get_endorser(pk: &PublicKey) -> Option<KeyEndorsementInfo> {
+    let hpk = hash_pk(pk);
+
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let endorsers = storage::TypedStore::new(storage::PrefixStore::new(store, &ENDORSERS));
+        endorsers.get(hpk)
+    })
+}
+
+fn hash_rak(rak: &CorePublicKey) -> Hash {
+    hash_pk(&PublicKey::Ed25519(rak.into()))
+}
+
+fn hash_pk(pk: &PublicKey) -> Hash {
+    Hash::digest_bytes_list(&[pk.key_type().as_bytes(), pk.as_ref()])
+}
+
+fn queue_entry_key(epoch: EpochTime, app_id: AppId, hrak: Hash) -> Vec<u8> {
+    [&epoch.to_be_bytes(), app_id.as_ref(), hrak.as_ref()].concat()
+}
+
+fn insert_expiration_queue(epoch: EpochTime, app_id: AppId, hrak: Hash) {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let mut queue = storage::PrefixStore::new(store, &EXPIRATION_QUEUE);
+        queue.insert(&queue_entry_key(epoch, app_id, hrak), &[]);
+    })
+}
+
+fn remove_expiration_queue(epoch: EpochTime, app_id: AppId, hrak: Hash) {
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let mut queue = storage::PrefixStore::new(store, &EXPIRATION_QUEUE);
+        queue.remove(&queue_entry_key(epoch, app_id, hrak));
+    })
+}
+
+struct ExpirationQueueEntry {
+    epoch: EpochTime,
+    app_id: AppId,
+    hrak: Hash,
+}
+
+impl<'a> TryFrom<&'a [u8]> for ExpirationQueueEntry {
+    type Error = anyhow::Error;
+
+    fn try_from(value: &'a [u8]) -> Result<Self, Self::Error> {
+        // Decode a storage key of the format (epoch, hrak).
+        if value.len() != 8 + AppId::SIZE + Hash::len() {
+            anyhow::bail!("incorrect expiration queue key size");
+        }
+
+        Ok(Self {
+            epoch: EpochTime::from_be_bytes(value[..8].try_into()?),
+            app_id: value[8..8 + AppId::SIZE].try_into()?,
+            hrak: value[8 + AppId::SIZE..].into(),
+        })
+    }
+}
+
+/// Removes all expired registrations, e.g. those that expire in epochs earlier than or equal to the
+/// passed epoch.
+pub fn expire_registrations(epoch: EpochTime, limit: usize) {
+    let expired: Vec<_> = CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let queue = storage::TypedStore::new(storage::PrefixStore::new(store, &EXPIRATION_QUEUE));
+
+        queue
+            .iter()
+            .take_while(|(e, _): &(ExpirationQueueEntry, CorePublicKey)| e.epoch <= epoch)
+            .map(|(e, _)| (e.app_id, e.hrak))
+            .take(limit)
+            .collect()
+    });
+
+    for (app_id, hrak) in expired {
+        remove_registration_hrak(app_id, hrak);
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use crate::testing::{keys, mock};
+
+    #[test]
+    fn test_app_cfg() {
+        let _mock = mock::Mock::default();
+
+        let app_id = AppId::from_creator_round_index(keys::alice::address(), 0, 0);
+        let app = get_app(app_id);
+        assert!(app.is_none());
+
+        let cfg = types::AppConfig {
+            id: app_id,
+            policy: Default::default(),
+            admin: Some(keys::alice::address()),
+            stake: Default::default(),
+        };
+        set_app(cfg.clone());
+        let app = get_app(app_id).expect("application config should be created");
+        assert_eq!(app, cfg);
+
+        let cfg = types::AppConfig { admin: None, ..cfg };
+        set_app(cfg.clone());
+        let app = get_app(app_id).expect("application config should be updated");
+        assert_eq!(app, cfg);
+
+        remove_app(app_id);
+        let app = get_app(app_id);
+        assert!(app.is_none(), "application should have been removed");
+    }
+
+    #[test]
+    fn test_registration() {
+        let _mock = mock::Mock::default();
+        let app_id = Default::default();
+        let rak = keys::alice::pk().try_into().unwrap(); // Fake RAK.
+        let rak_pk = keys::alice::pk();
+
+        let registration = get_registration(app_id, &rak);
+        assert!(registration.is_none());
+        let endorser = get_endorser(&rak_pk);
+        assert!(endorser.is_none());
+        let endorser = get_endorser(&keys::dave::pk());
+        assert!(endorser.is_none());
+
+        let new_registration = types::Registration {
+            app: app_id,
+            rak,
+            expiration: 42,
+            extra_keys: vec![
+                keys::dave::pk(), // Add dave as an extra endorsed key.
+            ],
+            ..Default::default()
+        };
+        update_registration(new_registration.clone()).expect("registration update should work");
+
+        // Ensure extra endorsed keys cannot be updated later.
+        let bad_registration = types::Registration {
+            app: app_id,
+            extra_keys: vec![],
+            ..new_registration.clone()
+        };
+        update_registration(bad_registration.clone())
+            .expect_err("extra endorsed key update should not be allowed");
+
+        let registration = get_registration(app_id, &rak).expect("registration should be present");
+        assert_eq!(registration, new_registration);
+        let endorser = get_endorser(&rak_pk).expect("endorser should be present");
+        assert_eq!(endorser.node_id, new_registration.node_id);
+        assert!(endorser.rak.is_none());
+        let endorser = get_endorser(&keys::dave::pk()).expect("extra keys should be endorsed");
+        assert_eq!(endorser.node_id, new_registration.node_id);
+        assert_eq!(endorser.rak, Some(rak));
+        let registrations = get_registrations_for_app(new_registration.app);
+        assert_eq!(registrations.len(), 1);
+
+        expire_registrations(42, 128);
+
+        let registration = get_registration(app_id, &rak);
+        assert!(registration.is_none());
+        let endorser = get_endorser(&rak_pk);
+        assert!(endorser.is_none());
+        let endorser = get_endorser(&keys::dave::pk());
+        assert!(endorser.is_none());
+        let registrations = get_registrations_for_app(new_registration.app);
+        assert_eq!(registrations.len(), 0);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/types.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/types.rs.html new file mode 100644 index 0000000000..92f6b9eef3 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/types.rs.html @@ -0,0 +1,237 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+
use crate::{
+    core::{
+        common::crypto::{signature, x25519},
+        consensus::{beacon::EpochTime, registry},
+    },
+    crypto::signature::PublicKey,
+    types::{address::Address, token},
+};
+
+use super::{app_id::AppId, policy::AppAuthPolicy};
+
+/// Create new ROFL application call.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Create {
+    /// Application authentication policy.
+    pub policy: AppAuthPolicy,
+    /// Identifier generation scheme.
+    pub scheme: IdentifierScheme,
+}
+
+/// ROFL application identifier generation scheme.
+#[derive(Clone, Copy, Debug, Default, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum IdentifierScheme {
+    #[default]
+    CreatorRoundIndex = 0,
+    CreatorNonce = 1,
+}
+
+/// Update an existing ROFL application call.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Update {
+    /// ROFL application identifier.
+    pub id: AppId,
+    /// Authentication policy.
+    pub policy: AppAuthPolicy,
+    /// Application administrator address.
+    pub admin: Option<Address>,
+}
+
+/// Remove an existing ROFL application call.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Remove {
+    /// ROFL application identifier.
+    pub id: AppId,
+}
+
+/// ROFL application configuration.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+#[cfg_attr(test, derive(PartialEq, Eq))]
+pub struct AppConfig {
+    /// ROFL application identifier.
+    pub id: AppId,
+    /// Authentication policy.
+    pub policy: AppAuthPolicy,
+    /// Application administrator address.
+    pub admin: Option<Address>,
+    /// Staked amount.
+    pub stake: token::BaseUnits,
+}
+
+/// Register ROFL call.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Register {
+    /// ROFL application identifier.
+    pub app: AppId,
+    /// Endorsed TEE capability.
+    pub ect: registry::EndorsedCapabilityTEE,
+    /// Epoch when the ROFL registration expires if not renewed.
+    pub expiration: EpochTime,
+    /// Extra public keys to endorse (e.g. secp256k1 keys).
+    ///
+    /// All of these keys need to co-sign the registration transaction to prove ownership.
+    pub extra_keys: Vec<PublicKey>,
+}
+
+/// ROFL registration descriptor.
+#[derive(Clone, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub struct Registration {
+    /// Application this enclave is registered for.
+    pub app: AppId,
+    /// Identifier of the endorsing node.
+    pub node_id: signature::PublicKey,
+    /// Optional identifier of the endorsing entity.
+    pub entity_id: Option<signature::PublicKey>,
+    /// Runtime Attestation Key.
+    pub rak: signature::PublicKey,
+    /// Runtime Encryption Key.
+    pub rek: x25519::PublicKey,
+    /// Epoch when the ROFL registration expires if not renewed.
+    pub expiration: EpochTime,
+    /// Extra public keys to endorse (e.g. secp256k1 keys).
+    pub extra_keys: Vec<PublicKey>,
+}
+
+/// Application-related query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct AppQuery {
+    /// ROFL application identifier.
+    pub id: AppId,
+}
+
+/// Application instance query.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct AppInstanceQuery {
+    /// ROFL application identifier.
+    pub app: AppId,
+    /// Runtime Attestation Key.
+    pub rak: PublicKey,
+}
+
+/// Stake thresholds for managing ROFL.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct StakeThresholds {
+    /// Required stake for creating new ROFL application.
+    pub app_create: token::BaseUnits,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/runtime.rs.html b/rust/src/oasis_runtime_sdk/runtime.rs.html new file mode 100644 index 0000000000..a639941ce6 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/runtime.rs.html @@ -0,0 +1,471 @@ +runtime.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+
//! Runtime.
+use std::sync::Arc;
+
+use oasis_core_runtime::{
+    common::{sgx, version},
+    config::Config,
+    consensus::verifier::TrustRoot,
+    dispatcher::{PostInitState, PreInitState},
+    enclave_rpc::session,
+    start_runtime,
+    types::{FeatureScheduleControl, Features},
+};
+
+use crate::{
+    config,
+    context::Context,
+    crypto, dispatcher,
+    keymanager::{KeyManagerClient, TrustedSigners},
+    module::{
+        BlockHandler, FeeProxyHandler, InvariantHandler, MethodHandler, MigrationHandler,
+        ModuleInfoHandler, TransactionHandler,
+    },
+    modules,
+    state::CurrentState,
+    storage::{self},
+};
+
+/// A runtime.
+pub trait Runtime {
+    /// Runtime version.
+    const VERSION: version::Version;
+    /// State version.
+    const STATE_VERSION: u32 = 0;
+
+    /// Prefetch limit. To enable prefetch set it to a non-zero value.
+    const PREFETCH_LIMIT: u16 = 0;
+
+    /// Runtime schedule control configuration.
+    const SCHEDULE_CONTROL: config::ScheduleControl = config::ScheduleControl::default();
+
+    /// Module that provides the core API.
+    type Core: modules::core::API;
+    /// Module that provides the accounts API.
+    type Accounts: modules::accounts::API;
+    /// Handler for proxy fee payments.
+    type FeeProxy: FeeProxyHandler = ();
+
+    /// Supported modules.
+    type Modules: TransactionHandler
+        + MigrationHandler
+        + MethodHandler
+        + BlockHandler
+        + InvariantHandler
+        + ModuleInfoHandler;
+
+    /// Return the trusted signers for this runtime; if `None`, a key manager connection will not be
+    /// established on startup.
+    fn trusted_signers() -> Option<TrustedSigners> {
+        None
+    }
+
+    /// Return the consensus layer trust root for this runtime; if `None`, consensus layer integrity
+    /// verification will not be performed.
+    fn consensus_trust_root() -> Option<TrustRoot> {
+        None
+    }
+
+    /// Genesis state for the runtime.
+    fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis;
+
+    /// Perform runtime-specific state migration. This method is only called when the recorded
+    /// state version does not match `STATE_VERSION`.
+    fn migrate_state<C: Context>(_ctx: &C) {
+        // Default implementation doesn't perform any migration.
+    }
+
+    /// Whether a given query method is allowed to be invoked.
+    fn is_allowed_query(_method: &str) -> bool {
+        true
+    }
+
+    /// Whether a given query method is allowed to access private key manager state.
+    ///
+    /// Note that even if this returns `true` for a method, the method also needs to be tagged as
+    /// being allowed to access private key manager state (e.g. with `allow_private_km`).
+    fn is_allowed_private_km_query(_method: &str) -> bool {
+        true
+    }
+
+    /// Whether a given call is allowed to be invoked interactively.
+    ///
+    /// Note that even if this returns `true` for a method, the method also needs to be tagged as
+    /// being allowed to be executed interactively (e.g. with `allow_interactive`)
+    fn is_allowed_interactive_call(_method: &str) -> bool {
+        true
+    }
+
+    /// Perform state migrations if required.
+    fn migrate<C: Context>(ctx: &C) {
+        let mut metadata = CurrentState::with_store(|store| {
+            let store = storage::TypedStore::new(storage::PrefixStore::new(
+                store,
+                &modules::core::MODULE_NAME,
+            ));
+            let metadata: modules::core::types::Metadata = store
+                .get(modules::core::state::METADATA)
+                .unwrap_or_default();
+
+            metadata
+        });
+
+        // Perform state migrations/initialization on all modules.
+        let mut has_changes =
+            Self::Modules::init_or_migrate(ctx, &mut metadata, Self::genesis_state());
+
+        // Check if we need to also apply any global state updates.
+        let global_version = metadata
+            .versions
+            .get(modules::core::types::VERSION_GLOBAL_KEY)
+            .copied()
+            .unwrap_or_default();
+        if global_version != Self::STATE_VERSION
+            && !CurrentState::with_env(|env| env.is_check_only())
+        {
+            assert!(
+                // There should either be no state, or it should be the previous version.
+                global_version == 0 || global_version == Self::STATE_VERSION - 1,
+                "inconsistent existing state version (expected: {} got: {})",
+                Self::STATE_VERSION - 1,
+                global_version
+            );
+
+            Self::migrate_state(ctx);
+
+            // Update metadata.
+            metadata.versions.insert(
+                modules::core::types::VERSION_GLOBAL_KEY.to_string(),
+                Self::STATE_VERSION,
+            );
+            has_changes = true;
+        }
+
+        // If there are any changes, update metadata.
+        if has_changes {
+            CurrentState::with_store(|store| {
+                let mut store = storage::TypedStore::new(storage::PrefixStore::new(
+                    store,
+                    &modules::core::MODULE_NAME,
+                ));
+                store.insert(modules::core::state::METADATA, metadata);
+            });
+        }
+    }
+
+    /// Start the runtime.
+    fn start()
+    where
+        Self: Sized + Send + Sync + 'static,
+    {
+        // Initializer.
+        let init = |state: PreInitState<'_>| -> PostInitState {
+            // Fetch host information and configure domain separation context.
+            let hi = state.protocol.get_host_info();
+            crypto::signature::context::set_chain_context(
+                hi.runtime_id,
+                &hi.consensus_chain_context,
+            );
+
+            // Cobble together a keymanager client.
+            let key_manager = Self::trusted_signers().map(|signers| {
+                Arc::new(KeyManagerClient::new(
+                    hi.runtime_id,
+                    state.protocol.clone(),
+                    state.consensus_verifier.clone(),
+                    state.identity.clone(),
+                    state.rpc_dispatcher,
+                    4096,
+                    signers,
+                ))
+            });
+
+            // Create the transaction dispatcher.
+            let dispatcher = dispatcher::Dispatcher::<Self>::new(
+                state.protocol.clone(),
+                key_manager,
+                state.consensus_verifier.clone(),
+            );
+            // Register EnclaveRPC methods.
+            dispatcher.register_enclaverpc(state.rpc_dispatcher);
+            // Make sure we allow a wide amount of valid quotes for EnclaveRPC because our clients
+            // are other runtime components and we should accept them all.
+            let session_builder = session::Builder::default()
+                .local_identity(state.identity.clone())
+                .quote_policy(Some(Arc::new(sgx::QuotePolicy {
+                    ias: Some(sgx::ias::QuotePolicy {
+                        disabled: true, // Disable legacy EPID attestation.
+                        ..Default::default()
+                    }),
+                    pcs: Some(sgx::pcs::QuotePolicy {
+                        // Allow TDX since that is not part of the default policy.
+                        tdx: Some(sgx::pcs::TdxQuotePolicy {
+                            allowed_tdx_modules: vec![],
+                        }),
+                        ..Default::default()
+                    }),
+                })));
+            state.rpc_demux.set_session_builder(session_builder);
+
+            PostInitState {
+                txn_dispatcher: Some(Box::new(dispatcher)),
+                app: None,
+            }
+        };
+
+        // Configure the runtime features.
+        let features = Features {
+            schedule_control: Some(FeatureScheduleControl {
+                initial_batch_size: Self::SCHEDULE_CONTROL.initial_batch_size,
+            }),
+            ..Default::default()
+        };
+
+        // Start the runtime.
+        start_runtime(
+            Box::new(init),
+            Config {
+                version: Self::VERSION,
+                trust_root: Self::consensus_trust_root(),
+                features,
+                persist_check_tx_state: false,
+                ..Default::default()
+            },
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/schedule_control.rs.html b/rust/src/oasis_runtime_sdk/schedule_control.rs.html new file mode 100644 index 0000000000..524d3992fb --- /dev/null +++ b/rust/src/oasis_runtime_sdk/schedule_control.rs.html @@ -0,0 +1,69 @@ +schedule_control.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
//! Types related to schedule control.
+use oasis_core_runtime::{
+    common::crypto::hash::Hash, transaction::types::TxnBatch, types::Body, Protocol,
+};
+
+/// Unique module name.
+const MODULE_NAME: &str = "schedule_control";
+
+/// Schedule control errors.
+#[derive(Debug, thiserror::Error, oasis_runtime_sdk_macros::Error)]
+pub enum Error {
+    #[error("failed to fetch batch from host")]
+    #[sdk_error(code = 1)]
+    FailedToFetchBatch,
+}
+
+/// Interface to the runtime host that supports schedule control features.
+pub trait ScheduleControlHost: Send + Sync {
+    /// Fetch the specified set of transactions from the host's transaction queue.
+    ///
+    /// Offset specifies the transaction hash that should serve as an offset when returning
+    /// transactions from the pool. Transactions will be skipped until the given hash is encountered
+    /// and only following transactions will be returned.
+    fn fetch_tx_batch(&self, offset: Option<Hash>, limit: u32) -> Result<Option<TxnBatch>, Error>;
+}
+
+impl ScheduleControlHost for Protocol {
+    fn fetch_tx_batch(&self, offset: Option<Hash>, limit: u32) -> Result<Option<TxnBatch>, Error> {
+        match self.call_host(Body::HostFetchTxBatchRequest { offset, limit }) {
+            Ok(Body::HostFetchTxBatchResponse { batch }) => Ok(batch),
+            _ => Err(Error::FailedToFetchBatch),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/sender.rs.html b/rust/src/oasis_runtime_sdk/sender.rs.html new file mode 100644 index 0000000000..edaabc8ab5 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/sender.rs.html @@ -0,0 +1,53 @@ +sender.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+
//! Transaction sender metadata.
+use crate::types::address::Address;
+
+/// Transaction sender metadata.
+#[derive(Clone, Debug, Eq, PartialEq, Default)]
+pub struct SenderMeta {
+    /// Sender address.
+    pub address: Address,
+    /// Sender nonce contained in the transaction.
+    pub tx_nonce: u64,
+    /// Sender nonce contained in runtime state.
+    pub state_nonce: u64,
+}
+
+impl SenderMeta {
+    /// Unique identifier of the sender, currently derived from the sender address.
+    pub fn id(&self) -> Vec<u8> {
+        if self.address == Default::default() {
+            // Use an empty value for the default address as that signals to the host that the
+            // sender should be ignored.
+            vec![]
+        } else {
+            self.address.into_bytes().to_vec()
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/state.rs.html b/rust/src/oasis_runtime_sdk/state.rs.html new file mode 100644 index 0000000000..302fdbdbe3 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/state.rs.html @@ -0,0 +1,3363 @@ +state.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+
use std::{
+    any::Any,
+    cell::RefCell,
+    collections::btree_map::{BTreeMap, Entry},
+    fmt,
+    marker::PhantomData,
+    mem,
+};
+
+use oasis_core_runtime::{common::crypto::hash::Hash, consensus::roothash, storage::mkvs};
+
+use crate::{
+    context::Context,
+    crypto::{random::RootRng, signature::PublicKey},
+    event::{Event, EventTag, EventTags},
+    modules::core::Error,
+    storage::{MKVSStore, NestedStore, OverlayStore, Store},
+    types::{address::Address, message::MessageEventHookInvocation, transaction},
+};
+
+/// Execution mode.
+#[derive(Clone, Copy, Default, Debug, PartialEq, Eq)]
+#[repr(u8)]
+pub enum Mode {
+    /// Actually execute transactions during block production.
+    #[default]
+    Execute,
+    /// Check that transactions are valid for local acceptance into the transaction pool.
+    Check,
+    /// Simulate transaction outcomes (e.g. for gas estimation).
+    Simulate,
+    /// Check that transactions are still valid before scheduling.
+    PreSchedule,
+}
+
+const MODE_CHECK: &str = "check";
+const MODE_EXECUTE: &str = "execute";
+const MODE_SIMULATE: &str = "simulate";
+const MODE_PRE_SCHEDULE: &str = "pre_schedule";
+
+impl fmt::Display for Mode {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.write_str(self.into())
+    }
+}
+
+impl From<&Mode> for &'static str {
+    fn from(m: &Mode) -> Self {
+        match m {
+            Mode::Check => MODE_CHECK,
+            Mode::Execute => MODE_EXECUTE,
+            Mode::Simulate => MODE_SIMULATE,
+            Mode::PreSchedule => MODE_PRE_SCHEDULE,
+        }
+    }
+}
+
+/// Information about the execution environment.
+#[derive(Clone, Default, Debug)]
+pub struct Environment {
+    mode: Mode,
+    tx: Option<TransactionWithMeta>,
+    internal: bool,
+}
+
+impl Environment {
+    /// Execution mode.
+    pub fn mode(&self) -> Mode {
+        self.mode
+    }
+
+    /// Whether the execution mode is such that only checks should be performed.
+    pub fn is_check_only(&self) -> bool {
+        matches!(self.mode, Mode::Check | Mode::PreSchedule)
+    }
+
+    /// Whether the execution mode is `Mode::PreSchedule`.
+    pub fn is_pre_schedule(&self) -> bool {
+        matches!(self.mode, Mode::PreSchedule)
+    }
+
+    /// Whether the execution mode is `Mode::Simulate`.
+    pub fn is_simulation(&self) -> bool {
+        matches!(self.mode, Mode::Simulate)
+    }
+
+    /// Whether the execution mode is `Mode::Execute`.
+    pub fn is_execute(&self) -> bool {
+        matches!(self.mode, Mode::Execute)
+    }
+
+    /// Whether there is an active transaction in the current environment.
+    pub fn is_transaction(&self) -> bool {
+        self.tx.is_some()
+    }
+
+    /// An active transaction's index (order) within the block.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    pub fn tx_index(&self) -> usize {
+        self.tx
+            .as_ref()
+            .map(|tx| tx.index)
+            .expect("only in transaction environment")
+    }
+
+    /// An active transaction's size in bytes.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    pub fn tx_size(&self) -> u32 {
+        self.tx
+            .as_ref()
+            .map(|tx| tx.size)
+            .expect("only in transaction environment")
+    }
+
+    /// An active transaction's authentication information.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    pub fn tx_auth_info(&self) -> &transaction::AuthInfo {
+        self.tx
+            .as_ref()
+            .map(|tx| &tx.data.auth_info)
+            .expect("only in transaction environment")
+    }
+
+    /// An active transaction's call format.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    pub fn tx_call_format(&self) -> transaction::CallFormat {
+        self.tx
+            .as_ref()
+            .map(|tx| tx.data.call.format)
+            .expect("only in transaction environment")
+    }
+
+    /// An active transaction's read only flag.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    pub fn is_read_only(&self) -> bool {
+        self.tx
+            .as_ref()
+            .map(|tx| tx.data.call.read_only)
+            .expect("only in transaction environment")
+    }
+
+    /// Whether the current execution environment is part of an internal subcall.
+    pub fn is_internal(&self) -> bool {
+        self.internal
+    }
+
+    /// Authenticated address of the caller.
+    ///
+    /// In case there are multiple signers of a transaction, this will return the address
+    /// corresponding to the first signer. If there are no signers, it returns the default address.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    pub fn tx_caller_address(&self) -> Address {
+        self.tx_auth_info()
+            .signer_info
+            .first()
+            .map(|si| si.address_spec.address())
+            .unwrap_or_default()
+    }
+
+    /// Authenticated caller public key if available.
+    ///
+    /// In case there are multiple signers of a transaction, this will return the public key
+    /// corresponding to the first signer. If there are no signers or if the address specification
+    /// does not represent a single public key, it returns `None`.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside a transaction environment.
+    pub fn tx_caller_public_key(&self) -> Option<PublicKey> {
+        self.tx_auth_info()
+            .signer_info
+            .first()
+            .and_then(|si| si.address_spec.public_key())
+    }
+}
+
+/// Decoded transaction with additional metadata.
+#[derive(Clone, Debug)]
+pub struct TransactionWithMeta {
+    /// Decoded transaction.
+    pub data: transaction::Transaction,
+    /// Transaction size.
+    pub size: u32,
+    /// Transaction index within the batch.
+    pub index: usize,
+    /// Transaction hash.
+    pub hash: Hash,
+}
+
+impl TransactionWithMeta {
+    /// Create transaction with metadata for an internally generated transaction.
+    ///
+    /// Internally generated transactions have zero size, index and hash.
+    pub fn internal(tx: transaction::Transaction) -> Self {
+        Self {
+            data: tx,
+            size: 0,
+            index: 0,
+            hash: Default::default(),
+        }
+    }
+}
+
+#[cfg(any(test, feature = "test"))]
+impl From<transaction::Transaction> for TransactionWithMeta {
+    fn from(tx: transaction::Transaction) -> Self {
+        Self::internal(tx) // For use in tests.
+    }
+}
+
+/// Environment modification options.
+#[derive(Clone, Default, Debug)]
+pub struct Options {
+    pub mode: Option<Mode>,
+    pub tx: Option<TransactionWithMeta>,
+    pub internal: Option<bool>,
+    pub rng_local_entropy: bool,
+}
+
+impl Options {
+    /// Create options with default values.
+    pub fn new() -> Self {
+        Self::default()
+    }
+
+    /// Change the execution mode of the environment.
+    pub fn with_mode(self, mode: Mode) -> Self {
+        Self {
+            mode: Some(mode),
+            ..self
+        }
+    }
+
+    /// Change the active transaction of the environment.
+    pub fn with_tx(self, tx: TransactionWithMeta) -> Self {
+        Self {
+            tx: Some(tx),
+            ..self
+        }
+    }
+
+    /// Change the internal flag of the environment.
+    pub fn with_internal(self, internal: bool) -> Self {
+        Self {
+            internal: Some(internal),
+            ..self
+        }
+    }
+
+    /// Request for local entropy to be mixed into the current RNG.
+    ///
+    /// # Determinisim
+    ///
+    /// Using this method will result in non-deterministic behavior as the node's local entropy is
+    /// mixed into the RNG. As such, this method should only be used in cases where non-determinism
+    /// is not problematic (e.g. local queries).
+    pub fn with_rng_local_entropy(self) -> Self {
+        Self {
+            rng_local_entropy: true,
+            ..self
+        }
+    }
+}
+
+/// Mutable block state of a runtime.
+///
+/// The state includes storage, emitted events, messages to consensus layer, etc. States can be
+/// nested via `open`, `commit` and `rollback` methods which behave like transactions.
+pub struct State {
+    parent: Option<Box<State>>,
+    store: Option<OverlayStore<Box<dyn Store>>>,
+
+    events: EventTags,
+    unconditional_events: EventTags,
+    messages: Vec<(roothash::Message, MessageEventHookInvocation)>,
+
+    block_values: BTreeMap<&'static str, Box<dyn Any>>,
+    hidden_block_values: Option<BTreeMap<&'static str, Box<dyn Any>>>,
+    local_values: BTreeMap<&'static str, Box<dyn Any>>,
+
+    rng: Option<RootRng>,
+    hidden_rng: Option<RootRng>,
+    env: Environment,
+
+    always_rollback: bool,
+}
+
+impl State {
+    /// Initialize the state with the given options.
+    fn init(&mut self, opts: Options) {
+        if let Some(mode) = opts.mode {
+            // Change mode.
+            self.env.mode = mode;
+            // If we have enabled pre-schedule or simulation mode, always rollback state and hide
+            // block values to prevent leaking them.
+            if matches!(mode, Mode::PreSchedule | Mode::Simulate) {
+                self.always_rollback = true;
+                self.hide_block_values();
+            }
+        }
+
+        if let Some(tx) = opts.tx {
+            // Change RNG state.
+            self.rng.as_mut().unwrap().append_tx(tx.hash);
+            // Change tx metadata.
+            self.env.tx = Some(tx);
+        }
+
+        if let Some(internal) = opts.internal {
+            self.env.internal = internal;
+            if internal {
+                self.hide_block_values();
+            }
+        }
+
+        if opts.rng_local_entropy {
+            // Append local entropy to RNG state.
+            self.rng.as_mut().unwrap().append_local_entropy();
+        }
+
+        if !matches!(self.env.mode, Mode::PreSchedule) {
+            // Record opening a child state in the RNG.
+            self.rng.as_mut().unwrap().append_subcontext();
+        } else {
+            // Use an invalid RNG as its use is not allowed in pre-schedule context.
+            self.disable_rng();
+        }
+    }
+
+    /// Open a child state after which self will point to the child state.
+    pub fn open(&mut self) {
+        let mut parent = Self {
+            parent: None,
+            store: None,
+            events: EventTags::new(),
+            unconditional_events: EventTags::new(),
+            messages: Vec::new(),
+            block_values: BTreeMap::new(),
+            hidden_block_values: None,
+            local_values: BTreeMap::new(),
+            rng: None,
+            hidden_rng: None,
+            env: self.env.clone(),
+            always_rollback: false,
+        };
+        mem::swap(&mut parent, self);
+
+        // Wrap parent store to create an overlay child store.
+        self.store = parent
+            .store
+            .take()
+            .map(|pstore| OverlayStore::new(Box::new(pstore) as Box<dyn Store>));
+
+        // Take block values map. We will put it back after commit/rollback.
+        mem::swap(&mut parent.block_values, &mut self.block_values);
+        // Take RNG. We will put it back after commit/rollback.
+        mem::swap(&mut parent.rng, &mut self.rng);
+
+        self.parent = Some(Box::new(parent));
+    }
+
+    fn convert_store(store: Box<dyn Store>) -> OverlayStore<Box<dyn Store>> {
+        let raw = Box::into_raw(store);
+        unsafe {
+            // SAFETY: This is safe because we always wrap child stores into OverlayStore.
+            *Box::from_raw(raw as *mut OverlayStore<Box<dyn Store>>)
+        }
+    }
+
+    /// Commit the current state and return to its parent state.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic when attempting to commit the root state.
+    pub fn commit(&mut self) {
+        if self.always_rollback {
+            self.rollback();
+        } else {
+            self._commit();
+        }
+    }
+
+    fn _commit(&mut self) {
+        let mut child = *self.parent.take().expect("cannot commit on root state");
+        mem::swap(&mut child, self);
+
+        // Commit storage.
+        self.store = child
+            .store
+            .take()
+            .map(|cstore| Self::convert_store(cstore.commit()));
+
+        // Propagate messages.
+        self.messages.extend(child.messages);
+
+        // Propagate events.
+        for (key, event) in child.events {
+            let events = self.events.entry(key).or_default();
+            events.extend(event);
+        }
+        for (key, event) in child.unconditional_events {
+            let events = self.unconditional_events.entry(key).or_default();
+            events.extend(event);
+        }
+
+        // Put back per-block values.
+        if let Some(mut block_values) = child.hidden_block_values {
+            mem::swap(&mut block_values, &mut self.block_values); // Block values were hidden.
+        } else {
+            mem::swap(&mut child.block_values, &mut self.block_values);
+        }
+        // Always drop local values.
+
+        // Put back RNG.
+        if child.hidden_rng.is_some() {
+            mem::swap(&mut child.hidden_rng, &mut self.rng); // RNG was hidden.
+        } else {
+            mem::swap(&mut child.rng, &mut self.rng);
+        }
+    }
+
+    /// Rollback the current state and return to its parent state.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic when attempting to rollback the root state.
+    pub fn rollback(&mut self) {
+        let mut child = *self.parent.take().expect("cannot rollback on root state");
+        mem::swap(&mut child, self);
+
+        // Rollback storage.
+        self.store = child
+            .store
+            .take()
+            .map(|cstore| Self::convert_store(cstore.rollback()));
+
+        // Always put back per-block values.
+        if let Some(mut block_values) = child.hidden_block_values {
+            mem::swap(&mut block_values, &mut self.block_values); // Block values were hidden.
+        } else {
+            mem::swap(&mut child.block_values, &mut self.block_values);
+        }
+        // Always drop local values.
+
+        // Always put back RNG.
+        if child.hidden_rng.is_some() {
+            mem::swap(&mut child.hidden_rng, &mut self.rng); // RNG was hidden.
+        } else {
+            mem::swap(&mut child.rng, &mut self.rng);
+        }
+    }
+
+    /// Fetches a block state value entry.
+    ///
+    /// Block values live as long as the root `State` and are propagated to child states. They are
+    /// not affected by state rollbacks. If you need state-scoped values, use local values.
+    pub fn block_value<V: Any>(&mut self, key: &'static str) -> StateValue<'_, V> {
+        StateValue::new(self.block_values.entry(key))
+    }
+
+    /// Fetches a local state value entry.
+    ///
+    /// Local values only live as long as the current `State`, are dropped upon exiting to parent
+    /// state and child states start with an empty set. If you need longer-lived values, use block
+    /// values.
+    pub fn local_value<V: Any>(&mut self, key: &'static str) -> StateValue<'_, V> {
+        StateValue::new(self.local_values.entry(key))
+    }
+
+    /// Hides block values from the current state which will have an empty set of values after this
+    /// method returns. Hidden values will be restored upon exit to parent state.
+    pub fn hide_block_values(&mut self) {
+        if self.parent.is_none() {
+            // Allowing hiding on root state would prevent those values from ever being recovered.
+            panic!("cannot hide block values on root state");
+        }
+        if self.hidden_block_values.is_some() {
+            return; // Parent block values already hidden.
+        }
+
+        self.hidden_block_values = Some(mem::take(&mut self.block_values));
+    }
+
+    /// Emitted messages count returns the number of messages emitted so far across this and all
+    /// parent states.
+    pub fn emitted_messages_count(&self) -> usize {
+        self.messages.len()
+            + self
+                .parent
+                .as_ref()
+                .map(|p| p.emitted_messages_count())
+                .unwrap_or_default()
+    }
+
+    /// Emitted messages count returns the number of messages emitted so far in this state, not
+    /// counting any parent states.
+    pub fn emitted_messages_local_count(&self) -> usize {
+        self.messages.len()
+    }
+
+    /// Maximum number of messages that can be emitted.
+    pub fn emitted_messages_max<C: Context>(&self, ctx: &C) -> u32 {
+        if self.env.is_transaction() {
+            let limit = self.env.tx_auth_info().fee.consensus_messages;
+            if limit > 0 {
+                limit
+            } else {
+                ctx.max_messages() // Zero means an implicit limit by gas use.
+            }
+        } else {
+            ctx.max_messages()
+        }
+    }
+
+    /// Queue a message to be emitted by the runtime for consensus layer to process.
+    pub fn emit_message<C: Context>(
+        &mut self,
+        ctx: &C,
+        msg: roothash::Message,
+        hook: MessageEventHookInvocation,
+    ) -> Result<(), Error> {
+        // Check against maximum number of messages that can be emitted per round.
+        if self.emitted_messages_count() >= self.emitted_messages_max(ctx) as usize {
+            return Err(Error::OutOfMessageSlots);
+        }
+
+        self.messages.push((msg, hook));
+
+        Ok(())
+    }
+
+    /// Take all messages accumulated in the current state.
+    pub fn take_messages(&mut self) -> Vec<(roothash::Message, MessageEventHookInvocation)> {
+        mem::take(&mut self.messages)
+    }
+
+    /// Emit an event.
+    pub fn emit_event<E: Event>(&mut self, event: E) {
+        self.emit_event_raw(event.into_event_tag());
+    }
+
+    /// Emit a raw event.
+    pub fn emit_event_raw(&mut self, etag: EventTag) {
+        let events = self.events.entry(etag.key).or_default();
+        events.push(etag.value);
+    }
+
+    /// Emit an unconditional event.
+    ///
+    /// The only difference to regular events is that these are handled as a separate set.
+    pub fn emit_unconditional_event<E: Event>(&mut self, event: E) {
+        let etag = event.into_event_tag();
+        let events = self.unconditional_events.entry(etag.key).or_default();
+        events.push(etag.value);
+    }
+
+    /// Take all regular events accumulated in the current state.
+    pub fn take_events(&mut self) -> EventTags {
+        mem::take(&mut self.events)
+    }
+
+    /// Take all unconditional events accumulated in the current state.
+    pub fn take_unconditional_events(&mut self) -> EventTags {
+        mem::take(&mut self.unconditional_events)
+    }
+
+    /// Take all events accumulated in the current state and return the merged set.
+    pub fn take_all_events(&mut self) -> EventTags {
+        let mut events = self.take_events();
+        let unconditional_events = self.take_unconditional_events();
+
+        for (key, val) in unconditional_events {
+            let tag = events.entry(key).or_default();
+            tag.extend(val)
+        }
+
+        events
+    }
+
+    /// Store associated with the state.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if no store exists.
+    pub fn store(&mut self) -> &mut dyn Store {
+        self.store.as_mut().unwrap()
+    }
+
+    /// Whether the store associated with the state has any pending updates.
+    pub fn has_pending_store_updates(&self) -> bool {
+        self.store
+            .as_ref()
+            .map(|store| store.has_pending_updates())
+            .unwrap_or_default()
+    }
+
+    /// Size (in bytes) of any pending updates in the associated store.
+    pub fn pending_store_update_byte_size(&self) -> usize {
+        self.store
+            .as_ref()
+            .map(|store| store.pending_update_byte_size())
+            .unwrap_or_default()
+    }
+
+    /// Random number generator.
+    pub fn rng(&mut self) -> &mut RootRng {
+        self.rng.as_mut().unwrap()
+    }
+
+    /// Disables the RNG by replacing the instance with an invalid RNG.
+    fn disable_rng(&mut self) {
+        if self.parent.is_none() {
+            // Allowing hiding on root state would prevent the RNG from ever being recovered.
+            panic!("cannot hide the RNG on root state");
+        }
+        if self.hidden_rng.is_some() {
+            return; // Parent RNG already hidden.
+        }
+
+        self.hidden_rng = mem::replace(&mut self.rng, Some(RootRng::invalid()));
+    }
+
+    /// Environment information.
+    pub fn env(&self) -> &Environment {
+        &self.env
+    }
+
+    /// Origin environment information.
+    ///
+    /// The origin environment is the first non-internal environment in the hierarchy.
+    pub fn env_origin(&self) -> &Environment {
+        match self.parent {
+            Some(ref parent) if self.env.internal => parent.env_origin(),
+            _ => &self.env,
+        }
+    }
+
+    /// Returns the nesting level of the current state.
+    pub fn level(&self) -> usize {
+        if let Some(ref parent) = self.parent {
+            parent.level() + 1
+        } else {
+            0
+        }
+    }
+}
+
+thread_local! {
+    static CURRENT: RefCell<Vec<State>> = const { RefCell::new(Vec::new()) };
+}
+
+struct CurrentStateGuard;
+
+impl Drop for CurrentStateGuard {
+    fn drop(&mut self) {
+        CURRENT.with(|c| {
+            let root = c.borrow_mut().pop().expect("must have current state");
+            // Commit root state as it has been wrapped in an overlay.
+            let store = root
+                .store
+                .expect("must not have open child states after exiting root state");
+            store.commit();
+        });
+    }
+}
+
+struct TransactionGuard(usize);
+
+impl Drop for TransactionGuard {
+    fn drop(&mut self) {
+        let level = CurrentState::with(|state| state.level());
+
+        // If transaction hasn't been either committed or reverted, rollback.
+        if level == self.0 {
+            CurrentState::rollback_transaction();
+        }
+    }
+}
+
+/// Result of a transaction helper closure.
+pub enum TransactionResult<T> {
+    Commit(T),
+    Rollback(T),
+}
+
+impl From<()> for TransactionResult<()> {
+    fn from(_: ()) -> TransactionResult<()> {
+        TransactionResult::Commit(())
+    }
+}
+
+impl<R, E> From<Result<R, E>> for TransactionResult<Result<R, E>> {
+    fn from(v: Result<R, E>) -> TransactionResult<Result<R, E>> {
+        match v {
+            Ok(_) => TransactionResult::Commit(v),
+            Err(_) => TransactionResult::Rollback(v),
+        }
+    }
+}
+
+/// State attached to the current thread.
+pub struct CurrentState;
+
+impl CurrentState {
+    /// Attach a new state to the current thread and enter the state's context.
+    ///
+    /// The passed store is used as the root store.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called from within a `CurrentState::with` block.
+    pub fn enter<S, F, R>(root: S, f: F) -> R
+    where
+        S: Store,
+        F: FnOnce() -> R,
+    {
+        Self::enter_opts(
+            Options {
+                mode: Some(Default::default()), // Make sure there is a default mode.
+                ..Options::default()
+            },
+            root,
+            f,
+        )
+    }
+
+    /// Attach a new state to the current thread and enter the state's context.
+    ///
+    /// The passed store is used as the root store.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called from within a `CurrentState::with` block or if the mode
+    /// has not been explicitly set in `opts`.
+    pub fn enter_opts<S, F, R>(opts: Options, mut root: S, f: F) -> R
+    where
+        S: Store,
+        F: FnOnce() -> R,
+    {
+        let root = unsafe {
+            // SAFETY: Keeping the root store is safe as it can only be accessed from the current
+            // thread while we are running inside `CurrentState::enter` where we are holding a
+            // mutable reference on it.
+            std::mem::transmute::<&mut dyn Store, &mut (dyn Store + 'static)>(
+                &mut root as &mut dyn Store,
+            )
+        };
+        // Initialize the root state.
+        let mode = opts
+            .mode
+            .expect("mode must be explicitly set on root state");
+        let mut root = State {
+            parent: None,
+            store: Some(OverlayStore::new(Box::new(root) as Box<dyn Store>)),
+            events: EventTags::new(),
+            unconditional_events: EventTags::new(),
+            messages: Vec::new(),
+            block_values: BTreeMap::new(),
+            hidden_block_values: None,
+            local_values: BTreeMap::new(),
+            rng: Some(RootRng::new(mode)),
+            hidden_rng: None,
+            env: Default::default(),
+            always_rollback: false,
+        };
+        // Apply options to allow customization of the root state.
+        root.init(opts);
+
+        CURRENT.with(|c| {
+            c.try_borrow_mut()
+                .expect("must not re-enter from with block")
+                .push(root)
+        });
+        let _guard = CurrentStateGuard; // Ensure current state is popped once we return.
+
+        f()
+    }
+
+    /// Create an empty baseline state for the current thread.
+    ///
+    /// This should only be used in tests to have state always available.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if any states have been attached to the local thread or if called
+    /// within a `CurrentState::with` block.
+    #[doc(hidden)]
+    pub(crate) fn init_local_fallback() {
+        thread_local! {
+            static BASE_STATE_INIT: RefCell<bool> = const { RefCell::new(false) };
+        }
+
+        BASE_STATE_INIT.with(|initialized| {
+            // Initialize once per thread.
+            if *initialized.borrow() {
+                return;
+            }
+            *initialized.borrow_mut() = true;
+
+            let root = mkvs::OverlayTree::new(
+                mkvs::Tree::builder()
+                    .with_root_type(mkvs::RootType::State)
+                    .build(Box::new(mkvs::sync::NoopReadSyncer)),
+            );
+            let root = MKVSStore::new(root);
+
+            // Initialize the root state.
+            let root = State {
+                parent: None,
+                store: Some(OverlayStore::new(Box::new(root) as Box<dyn Store>)),
+                events: EventTags::new(),
+                unconditional_events: EventTags::new(),
+                messages: Vec::new(),
+                block_values: BTreeMap::new(),
+                hidden_block_values: None,
+                local_values: BTreeMap::new(),
+                rng: Some(RootRng::new(Default::default())),
+                hidden_rng: None,
+                env: Default::default(),
+                always_rollback: false,
+            };
+
+            CURRENT.with(|c| {
+                let mut current = c
+                    .try_borrow_mut()
+                    .expect("must not re-enter from with block");
+                assert!(
+                    current.is_empty(),
+                    "must have no prior states attached to local thread"
+                );
+
+                current.push(root);
+            });
+        });
+    }
+
+    /// Run a closure with the currently active state.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside `CurrentState::enter` or if any transaction methods
+    /// are called from the closure.
+    pub fn with<F, R>(f: F) -> R
+    where
+        F: FnOnce(&mut State) -> R,
+    {
+        CURRENT.with(|c| {
+            let mut current_ref = c.try_borrow_mut().expect("must not re-enter with");
+            let current = current_ref.last_mut().expect("must enter context");
+
+            f(current)
+        })
+    }
+
+    /// Run a closure with the store of the currently active state.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside `CurrentState::enter` or if any transaction methods
+    /// are called from the closure.
+    pub fn with_store<F, R>(f: F) -> R
+    where
+        F: FnOnce(&mut dyn Store) -> R,
+    {
+        Self::with(|state| f(state.store()))
+    }
+
+    /// Run a closure with the environment of the currently active state.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside `CurrentState::enter` or if any transaction methods
+    /// are called from the closure.
+    pub fn with_env<F, R>(f: F) -> R
+    where
+        F: FnOnce(&Environment) -> R,
+    {
+        Self::with(|state| f(state.env()))
+    }
+
+    /// Run a closure with the origin environment of the currently active state.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside `CurrentState::enter` or if any transaction methods
+    /// are called from the closure.
+    pub fn with_env_origin<F, R>(f: F) -> R
+    where
+        F: FnOnce(&Environment) -> R,
+    {
+        Self::with(|state| f(state.env_origin()))
+    }
+
+    /// Start a new transaction by opening a new child state.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside `CurrentState::enter` or if called within a
+    /// `CurrentState::with` block.
+    pub fn start_transaction() {
+        Self::with(|state| state.open());
+    }
+
+    /// Commit a previously started transaction.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside `CurrentState::enter`, if there is no currently
+    /// open transaction (started via `CurrentState::start_transaction`) or if called within a
+    /// `CurrentState::with` block.
+    pub fn commit_transaction() {
+        Self::with(|state| state.commit());
+    }
+
+    /// Rollback a previously started transaction.
+    ///
+    /// # Panics
+    ///
+    /// This method will panic if called outside `CurrentState::enter`, if there is no currently
+    /// open transaction (started via `CurrentState::start_transaction`) or if called within a
+    /// `CurrentState::with` block.
+    pub fn rollback_transaction() {
+        Self::with(|state| state.rollback());
+    }
+
+    /// Run a closure within a state transaction.
+    ///
+    /// If the closure returns `TransactionResult::Commit(R)` then the child state is committed,
+    /// otherwise the child state is rolled back.
+    pub fn with_transaction<F, R, Rs>(f: F) -> R
+    where
+        F: FnOnce() -> Rs,
+        Rs: Into<TransactionResult<R>>,
+    {
+        Self::with_transaction_opts(Options::default(), f)
+    }
+
+    /// Run a closure within a state transaction, allowing the caller to customize state.
+    ///
+    /// If the closure returns `TransactionResult::Commit(R)` then the child state is committed,
+    /// otherwise the child state is rolled back.
+    pub fn with_transaction_opts<F, R, Rs>(opts: Options, f: F) -> R
+    where
+        F: FnOnce() -> Rs,
+        Rs: Into<TransactionResult<R>>,
+    {
+        let level = Self::with(|state| {
+            state.open();
+            state.init(opts);
+            state.level()
+        });
+        let _guard = TransactionGuard(level); // Ensure transaction is always closed.
+
+        match f().into() {
+            TransactionResult::Commit(result) => {
+                Self::commit_transaction();
+                result
+            }
+            TransactionResult::Rollback(result) => {
+                Self::rollback_transaction();
+                result
+            }
+        }
+    }
+}
+
+/// A per-state arbitrary value.
+pub struct StateValue<'a, V> {
+    inner: Entry<'a, &'static str, Box<dyn Any>>,
+    _value: PhantomData<V>,
+}
+
+impl<'a, V: Any> StateValue<'a, V> {
+    fn new(inner: Entry<'a, &'static str, Box<dyn Any>>) -> Self {
+        Self {
+            inner,
+            _value: PhantomData,
+        }
+    }
+
+    /// Gets a reference to the specified per-state value.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the retrieved type is not the type that was stored.
+    pub fn get(self) -> Option<&'a V> {
+        match self.inner {
+            Entry::Occupied(oe) => Some(
+                oe.into_mut()
+                    .downcast_ref()
+                    .expect("type should stay the same"),
+            ),
+            _ => None,
+        }
+    }
+
+    /// Gets a mutable reference to the specified per-state value.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the retrieved type is not the type that was stored.
+    pub fn get_mut(&mut self) -> Option<&mut V> {
+        match &mut self.inner {
+            Entry::Occupied(oe) => Some(
+                oe.get_mut()
+                    .downcast_mut()
+                    .expect("type should stay the same"),
+            ),
+            _ => None,
+        }
+    }
+
+    /// Sets the context value, returning a mutable reference to the set value.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the retrieved type is not the type that was stored.
+    pub fn set(self, value: V) -> &'a mut V {
+        let value = Box::new(value);
+        match self.inner {
+            Entry::Occupied(mut oe) => {
+                oe.insert(value);
+                oe.into_mut()
+            }
+            Entry::Vacant(ve) => ve.insert(value),
+        }
+        .downcast_mut()
+        .expect("type should stay the same")
+    }
+
+    /// Takes the context value, if it exists.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the retrieved type is not the type that was stored.
+    pub fn take(self) -> Option<V> {
+        match self.inner {
+            Entry::Occupied(oe) => {
+                Some(*oe.remove().downcast().expect("type should stay the same"))
+            }
+            Entry::Vacant(_) => None,
+        }
+    }
+}
+
+impl<'a, V: Any + Default> StateValue<'a, V> {
+    /// Retrieves the existing value or inserts and returns the default.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the retrieved type is not the type that was stored.
+    pub fn or_default(self) -> &'a mut V {
+        match self.inner {
+            Entry::Occupied(oe) => oe.into_mut(),
+            Entry::Vacant(ve) => ve.insert(Box::<V>::default()),
+        }
+        .downcast_mut()
+        .expect("type should stay the same")
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use oasis_core_runtime::{
+        common::versioned::Versioned,
+        consensus::{roothash, staking},
+        storage::mkvs,
+    };
+
+    use super::{CurrentState, Mode, Options, TransactionResult, TransactionWithMeta};
+    use crate::{
+        modules::core::Event,
+        storage::{MKVSStore, Store},
+        testing::mock::{self, Mock},
+        types::message::MessageEventHookInvocation,
+    };
+
+    #[test]
+    fn test_value() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|state| {
+            let x = state.block_value::<u64>("module.TestKey").get();
+            assert_eq!(x, None);
+
+            state.block_value::<u64>("module.TestKey").set(42);
+
+            let y = state.block_value::<u64>("module.TestKey").get();
+            assert_eq!(y, Some(&42u64));
+
+            let z = state.block_value::<u64>("module.TestKey").take();
+            assert_eq!(z, Some(42u64));
+
+            let y = state.block_value::<u64>("module.TestKey").get();
+            assert_eq!(y, None);
+        });
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_value_type_change_block_value() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|state| {
+            state.block_value::<u64>("module.TestKey").or_default();
+            state.block_value::<u32>("module.TestKey").get();
+        });
+    }
+
+    #[test]
+    #[should_panic]
+    fn test_value_type_change_local_value() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|state| {
+            state.local_value::<u64>("module.TestKey").or_default();
+            state.local_value::<u32>("module.TestKey").get();
+        });
+    }
+
+    #[test]
+    fn test_value_hidden_block_values() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|state| {
+            state.block_value("module.TestKey").set(42u64);
+
+            state.open();
+            state.hide_block_values();
+
+            let v = state.block_value::<u64>("module.TestKey").get();
+            assert!(v.is_none(), "block values should not propagate when hidden");
+
+            state.block_value("module.TestKey").set(48u64);
+
+            state.commit();
+
+            let v = state.block_value::<u64>("module.TestKey").get();
+            assert_eq!(
+                v,
+                Some(&42u64),
+                "block values should not propagate when hidden"
+            );
+        });
+    }
+
+    #[test]
+    fn test_value_local() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|state| {
+            state.block_value("module.TestKey").set(42u64);
+
+            state.open();
+
+            let mut y = state.block_value::<u64>("module.TestKey");
+            let y = y.get_mut().unwrap();
+            assert_eq!(*y, 42);
+            *y = 48;
+
+            let a = state.local_value::<u64>("module.TestTxKey").get();
+            assert_eq!(a, None);
+            state.local_value::<u64>("module.TestTxKey").set(65);
+
+            let b = state.local_value::<u64>("module.TestTxKey").get();
+            assert_eq!(b, Some(&65));
+
+            let c = state
+                .local_value::<u64>("module.TestTakeTxKey")
+                .or_default();
+            *c = 67;
+            let d = state.local_value::<u64>("module.TestTakeTxKey").take();
+            assert_eq!(d, Some(67));
+            let e = state.local_value::<u64>("module.TestTakeTxKey").get();
+            assert_eq!(e, None);
+
+            state.rollback(); // Block values are always propagated.
+
+            let x = state.block_value::<u64>("module.TestKey").get();
+            assert_eq!(x, Some(&48));
+
+            state.open();
+
+            let z = state.block_value::<u64>("module.TestKey").take();
+            assert_eq!(z, Some(48));
+
+            let a = state.local_value::<u64>("module.TestTxKey").get();
+            assert_eq!(a, None, "local values should not be propagated");
+
+            state.rollback(); // Block values are always propagated.
+
+            let y = state.block_value::<u64>("module.TestKey").get();
+            assert_eq!(y, None);
+        });
+    }
+
+    #[test]
+    fn test_emit_messages() {
+        let mut mock = Mock::default(); // Also creates local fallback state.
+        let max_messages = mock.max_messages as usize;
+        let ctx = mock.create_ctx();
+
+        CurrentState::with(|state| {
+            state.open();
+
+            assert_eq!(state.emitted_messages_count(), 0);
+            assert_eq!(state.emitted_messages_local_count(), 0);
+
+            state
+                .emit_message(
+                    &ctx,
+                    roothash::Message::Staking(Versioned::new(
+                        0,
+                        roothash::StakingMessage::Transfer(staking::Transfer::default()),
+                    )),
+                    MessageEventHookInvocation::new("test".to_string(), ""),
+                )
+                .expect("message emission should succeed");
+            assert_eq!(state.emitted_messages_count(), 1);
+            assert_eq!(state.emitted_messages_local_count(), 1);
+            assert_eq!(state.emitted_messages_max(&ctx), max_messages as u32);
+
+            state.open(); // Start child state.
+
+            assert_eq!(state.emitted_messages_local_count(), 0);
+
+            state
+                .emit_message(
+                    &ctx,
+                    roothash::Message::Staking(Versioned::new(
+                        0,
+                        roothash::StakingMessage::Transfer(staking::Transfer::default()),
+                    )),
+                    MessageEventHookInvocation::new("test".to_string(), ""),
+                )
+                .expect("message emission should succeed");
+            assert_eq!(state.emitted_messages_count(), 2);
+            assert_eq!(state.emitted_messages_local_count(), 1);
+            assert_eq!(state.emitted_messages_max(&ctx), max_messages as u32);
+
+            state.rollback(); // Rollback.
+
+            assert_eq!(
+                state.emitted_messages_count(),
+                1,
+                "emitted message should have been rolled back"
+            );
+            assert_eq!(state.emitted_messages_local_count(), 1);
+
+            state.open(); // Start child state.
+
+            assert_eq!(state.emitted_messages_local_count(), 0);
+
+            state
+                .emit_message(
+                    &ctx,
+                    roothash::Message::Staking(Versioned::new(
+                        0,
+                        roothash::StakingMessage::Transfer(staking::Transfer::default()),
+                    )),
+                    MessageEventHookInvocation::new("test".to_string(), ""),
+                )
+                .expect("message emission should succeed");
+            assert_eq!(state.emitted_messages_count(), 2);
+            assert_eq!(state.emitted_messages_local_count(), 1);
+
+            state.commit(); // Commit.
+
+            assert_eq!(
+                state.emitted_messages_count(),
+                2,
+                "emitted message should have been committed"
+            );
+
+            // Emit some more messages.
+            for _ in 0..max_messages - 2 {
+                state
+                    .emit_message(
+                        &ctx,
+                        roothash::Message::Staking(Versioned::new(
+                            0,
+                            roothash::StakingMessage::Transfer(staking::Transfer::default()),
+                        )),
+                        MessageEventHookInvocation::new("test".to_string(), ""),
+                    )
+                    .expect("message emission should succeed");
+            }
+            assert_eq!(state.emitted_messages_count(), max_messages);
+
+            // Emitting one more message should be rejected.
+            state
+                .emit_message(
+                    &ctx,
+                    roothash::Message::Staking(Versioned::new(
+                        0,
+                        roothash::StakingMessage::Transfer(staking::Transfer::default()),
+                    )),
+                    MessageEventHookInvocation::new("test".to_string(), ""),
+                )
+                .expect_err("message emission should fail due to out of slots");
+            assert_eq!(state.emitted_messages_count(), max_messages);
+
+            state.rollback(); // Rollback.
+
+            assert_eq!(state.emitted_messages_count(), 0);
+        });
+
+        // Change the maximum amount of messages.
+        let mut tx = mock::transaction();
+        tx.auth_info.fee.consensus_messages = 1; // Limit amount of messages.
+        CurrentState::with_transaction_opts(Options::new().with_tx(tx.into()), || {
+            CurrentState::with(|state| {
+                assert_eq!(state.emitted_messages_max(&ctx), 1);
+            });
+        });
+
+        let mut tx = mock::transaction();
+        tx.auth_info.fee.consensus_messages = 0; // Zero means an implicit limit by gas use.
+        CurrentState::with_transaction_opts(Options::new().with_tx(tx.into()), || {
+            CurrentState::with(|state| {
+                assert_eq!(state.emitted_messages_max(&ctx), max_messages as u32);
+            });
+        });
+    }
+
+    #[test]
+    fn test_emit_events() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|state| {
+            state.open();
+
+            state.open();
+
+            state.emit_event(Event::GasUsed { amount: 41 });
+            state.emit_event(Event::GasUsed { amount: 42 });
+            state.emit_event(Event::GasUsed { amount: 43 });
+
+            state.emit_unconditional_event(Event::GasUsed { amount: 10 });
+
+            state.commit();
+
+            let events = state.take_events();
+            assert_eq!(events.len(), 1, "events should have been propagated");
+            let event_key = b"core\x00\x00\x00\x01".to_vec();
+            assert_eq!(events[&event_key].len(), 3);
+
+            let events = state.take_unconditional_events();
+            assert_eq!(
+                events.len(),
+                1,
+                "unconditional events should have been propagated"
+            );
+            let event_key = b"core\x00\x00\x00\x01".to_vec();
+            assert_eq!(events[&event_key].len(), 1);
+
+            state.emit_event(Event::GasUsed { amount: 41 });
+            state.emit_event(Event::GasUsed { amount: 42 });
+            state.emit_event(Event::GasUsed { amount: 43 });
+
+            state.emit_unconditional_event(Event::GasUsed { amount: 20 });
+
+            state.rollback();
+
+            let events = state.take_events();
+            assert_eq!(events.len(), 0, "events should not have been propagated");
+
+            let events = state.take_unconditional_events();
+            assert_eq!(
+                events.len(),
+                0,
+                "unconditional events should not have been propagated"
+            );
+        });
+    }
+
+    fn test_store_basic() {
+        CurrentState::start_transaction();
+
+        assert!(
+            !CurrentState::with(|state| state.has_pending_store_updates()),
+            "should not have pending updates"
+        );
+
+        CurrentState::with_store(|store| {
+            store.insert(b"test", b"value");
+        });
+
+        assert!(
+            CurrentState::with(|state| state.has_pending_store_updates()),
+            "should have pending updates after insert"
+        );
+
+        // Transaction helper.
+        CurrentState::with_transaction(|| {
+            assert!(
+                !CurrentState::with(|state| state.has_pending_store_updates()),
+                "should not have pending updates"
+            );
+
+            CurrentState::with_store(|store| {
+                store.insert(b"test", b"b0rken");
+            });
+
+            assert!(
+                CurrentState::with(|state| state.has_pending_store_updates()),
+                "should have pending updates after insert"
+            );
+
+            TransactionResult::Rollback(())
+        });
+
+        // Transaction helper with options.
+        CurrentState::with_transaction_opts(
+            Options::new()
+                .with_mode(Mode::Check)
+                .with_internal(true)
+                .with_tx(TransactionWithMeta {
+                    data: mock::transaction(),
+                    size: 888,
+                    index: 42,
+                    hash: Default::default(),
+                }),
+            || {
+                CurrentState::with_env(|env| {
+                    assert!(env.is_check_only(), "environment should be updated");
+                    assert!(env.is_internal(), "environment should be updated");
+                    assert!(env.is_transaction(), "environment should be updated");
+                    assert_eq!(env.tx_index(), 42, "environment should be updated");
+                    assert_eq!(env.tx_size(), 888, "environment should be updated");
+                });
+
+                CurrentState::with_env_origin(|env_origin| {
+                    assert!(
+                        !env_origin.is_check_only(),
+                        "origin environment should be correct"
+                    );
+                    assert!(
+                        !env_origin.is_transaction(),
+                        "origin environment should be correct"
+                    );
+                });
+
+                CurrentState::with_transaction(|| {
+                    // Check environment propagation.
+                    CurrentState::with_env(|env| {
+                        assert!(env.is_check_only(), "environment should propagate");
+                        assert!(env.is_internal(), "environment should propagate");
+                        assert!(env.is_transaction(), "environment should propagate");
+                        assert_eq!(env.tx_index(), 42, "environment should propagate");
+                        assert_eq!(env.tx_size(), 888, "environment should propagate");
+                    });
+
+                    TransactionResult::Rollback(())
+                });
+
+                TransactionResult::Rollback(())
+            },
+        );
+
+        CurrentState::with_env(|env| {
+            assert!(!env.is_transaction(), "environment should not leak");
+        });
+
+        // Nested entering, but with a different store.
+        let unrelated = mkvs::OverlayTree::new(
+            mkvs::Tree::builder()
+                .with_root_type(mkvs::RootType::State)
+                .build(Box::new(mkvs::sync::NoopReadSyncer)),
+        );
+        let mut unrelated = MKVSStore::new(unrelated);
+
+        CurrentState::enter(&mut unrelated, || {
+            CurrentState::start_transaction();
+
+            CurrentState::with_store(|store| {
+                store.insert(b"test", b"should not touch the original root");
+            });
+
+            CurrentState::commit_transaction();
+        });
+
+        CurrentState::with_store(|store| {
+            store.insert(b"another", b"value 2");
+        });
+
+        CurrentState::commit_transaction();
+    }
+
+    #[test]
+    fn test_basic() {
+        let root = mkvs::OverlayTree::new(
+            mkvs::Tree::builder()
+                .with_root_type(mkvs::RootType::State)
+                .build(Box::new(mkvs::sync::NoopReadSyncer)),
+        );
+        let mut root = MKVSStore::new(root);
+
+        CurrentState::enter(&mut root, || {
+            test_store_basic();
+        });
+
+        let value = root.get(b"test").unwrap();
+        assert_eq!(value, b"value");
+    }
+
+    #[test]
+    fn test_local_fallback() {
+        // Initialize the local fallback store.
+        CurrentState::init_local_fallback();
+        CurrentState::init_local_fallback(); // Should be no-op.
+
+        // Test the basic store -- note, no need to enter as fallback current store is available.
+        test_store_basic();
+
+        CurrentState::with_store(|store| {
+            let value = store.get(b"test").unwrap();
+            assert_eq!(value, b"value");
+        });
+
+        // It should be possible to override the fallback by entering explicitly.
+        let root = mkvs::OverlayTree::new(
+            mkvs::Tree::builder()
+                .with_root_type(mkvs::RootType::State)
+                .build(Box::new(mkvs::sync::NoopReadSyncer)),
+        );
+        let mut root = MKVSStore::new(root);
+
+        CurrentState::enter(&mut root, || {
+            CurrentState::with_store(|store| {
+                assert!(store.get(b"test").is_none(), "store should be empty");
+                store.insert(b"unrelated", b"unrelated");
+            });
+
+            test_store_basic();
+        });
+
+        let value = root.get(b"test").unwrap();
+        assert_eq!(value, b"value");
+        let value = root.get(b"unrelated").unwrap();
+        assert_eq!(value, b"unrelated");
+
+        // Changes should not leak to fallback store.
+        CurrentState::with_store(|store| {
+            assert!(store.get(b"unrelated").is_none(), "changes should not leak");
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "must enter context")]
+    fn test_fail_not_entered() {
+        test_store_basic(); // Should panic due to no current store being available.
+    }
+
+    #[test]
+    #[should_panic(expected = "must not re-enter with")]
+    fn test_fail_reenter_with() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|_| {
+            CurrentState::with(|_| {
+                // Should panic.
+            });
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "must not re-enter with")]
+    fn test_fail_reenter_with_start_transaction() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|_| {
+            CurrentState::start_transaction(); // Should panic.
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "must not re-enter with")]
+    fn test_fail_reenter_with_commit_transaction() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|_| {
+            CurrentState::commit_transaction(); // Should panic.
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "must not re-enter with")]
+    fn test_fail_reenter_with_rollback_transaction() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|_| {
+            CurrentState::rollback_transaction(); // Should panic.
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "must not re-enter from with block")]
+    fn test_fail_reenter_with_enter() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::with(|_| {
+            let unrelated = mkvs::OverlayTree::new(
+                mkvs::Tree::builder()
+                    .with_root_type(mkvs::RootType::State)
+                    .build(Box::new(mkvs::sync::NoopReadSyncer)),
+            );
+            let mut unrelated = MKVSStore::new(unrelated);
+
+            CurrentState::enter(&mut unrelated, || {
+                // Should panic.
+            });
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "must not re-enter from with block")]
+    fn test_fail_local_fallback_within_with() {
+        let root = mkvs::OverlayTree::new(
+            mkvs::Tree::builder()
+                .with_root_type(mkvs::RootType::State)
+                .build(Box::new(mkvs::sync::NoopReadSyncer)),
+        );
+        let mut root = MKVSStore::new(root);
+
+        CurrentState::enter(&mut root, || {
+            CurrentState::with(|_| {
+                CurrentState::init_local_fallback(); // Should panic.
+            })
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "must have no prior states attached to local thread")]
+    fn test_fail_local_fallback_within_enter() {
+        let root = mkvs::OverlayTree::new(
+            mkvs::Tree::builder()
+                .with_root_type(mkvs::RootType::State)
+                .build(Box::new(mkvs::sync::NoopReadSyncer)),
+        );
+        let mut root = MKVSStore::new(root);
+
+        CurrentState::enter(&mut root, || {
+            CurrentState::init_local_fallback(); // Should panic.
+        });
+    }
+
+    #[test]
+    #[should_panic(expected = "cannot commit on root state")]
+    fn test_fail_commit_transaction_must_exist() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::commit_transaction(); // Should panic.
+    }
+
+    #[test]
+    #[should_panic(expected = "cannot rollback on root state")]
+    fn test_fail_rollback_transaction_must_exist() {
+        CurrentState::init_local_fallback();
+
+        CurrentState::rollback_transaction(); // Should panic.
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/storage/confidential.rs.html b/rust/src/oasis_runtime_sdk/storage/confidential.rs.html new file mode 100644 index 0000000000..9800eff55c --- /dev/null +++ b/rust/src/oasis_runtime_sdk/storage/confidential.rs.html @@ -0,0 +1,1217 @@ +confidential.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+
use std::convert::TryInto as _;
+
+use anyhow;
+use hmac::{Hmac, Mac as _};
+use sha2::Sha512_256;
+use slog::error;
+use thiserror::Error;
+use zeroize::{Zeroize, Zeroizing};
+
+pub use crate::core::common::crypto::mrae::deoxysii::KEY_SIZE;
+use crate::{
+    core::{
+        common::crypto::{
+            hash::Hash,
+            mrae::deoxysii::{self, NONCE_SIZE},
+        },
+        storage::mkvs,
+    },
+    storage::Store,
+};
+
+type Nonce = [u8; NONCE_SIZE];
+type Kdf = Hmac<Sha512_256>;
+
+/// Unpack the concatenation of (nonce || byte_slice) into (Nonce, &[u8]).
+fn unpack_nonce_slice<'a>(packed: &'a [u8]) -> Option<(&'a Nonce, &'a [u8])> {
+    if packed.len() <= NONCE_SIZE {
+        return None;
+    }
+    let nonce_ref: &'a Nonce = packed[..NONCE_SIZE]
+        .try_into()
+        .expect("nonce size mismatch");
+    Some((nonce_ref, &packed[NONCE_SIZE..]))
+}
+
+/// Errors emitted by the confidential store.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("corrupt key")]
+    CorruptKey,
+
+    #[error("corrupt value")]
+    CorruptValue,
+
+    #[error("decryption failure: {0}")]
+    DecryptionFailure(anyhow::Error),
+}
+
+/// A key-value store that encrypts all content with DeoxysII.
+pub struct ConfidentialStore<S: Store> {
+    inner: S,
+    deoxys: deoxysii::DeoxysII,
+    base_value_prefix: Vec<u8>,
+    nonce_counter: usize,
+    nonce_key: Zeroizing<Vec<u8>>,
+}
+
+impl<S: Store> ConfidentialStore<S> {
+    /// Create a new confidential store with the given keypair.
+    pub fn new_with_key(inner: S, key: [u8; KEY_SIZE], value_context: &[&[u8]]) -> Self {
+        let actual_key = Zeroizing::new(key);
+
+        // Derive a nonce key for nonces used to encrypt storage keys in the store:
+        // nonce_key = KDF(key)
+        let mut kdf = Kdf::new_from_slice(b"oasis-runtime-sdk/confidential-store: nonce key")
+            .expect("Hmac::new_from_slice");
+        kdf.update(&key);
+        let mut derived = kdf.finalize().into_bytes();
+        // Try to destroy as much of the bytes as possible; there's
+        // no neat way to get from kdf output to a Vec<u8> without copying a lot.
+        let derived = Zeroizing::new(derived.iter_mut());
+
+        ConfidentialStore {
+            inner,
+            deoxys: deoxysii::DeoxysII::new(&actual_key),
+            base_value_prefix: value_context.concat(),
+            nonce_counter: 0,
+            nonce_key: Zeroizing::new(derived.as_slice().to_vec()),
+        }
+    }
+
+    fn pack_nonce_slice(&self, nonce: &Nonce, slice: &[u8]) -> Vec<u8> {
+        let mut ret = Vec::with_capacity(nonce.len() + slice.len());
+        ret.extend_from_slice(nonce);
+        ret.extend_from_slice(slice);
+        ret
+    }
+
+    fn make_key(&self, plain_key: &[u8]) -> (Nonce, Vec<u8>) {
+        // The nonce used to encrypt storage keys is derived from a combination
+        // of a base nonce key (derived from the encryption key) and the
+        // incoming plaintext storage key:
+        // nonce = Trunc(NONCE_SIZE, H(nonce_key || plain_key))
+        let mut nonce = [0u8; NONCE_SIZE];
+
+        let mut nonce_src = self.nonce_key.clone();
+        nonce_src.extend_from_slice(plain_key);
+
+        let hash = Hash::digest_bytes(&nonce_src);
+        nonce.copy_from_slice(hash.truncated(NONCE_SIZE));
+
+        let enc_key = self.deoxys.seal(&nonce, plain_key, vec![]);
+        let key = self.pack_nonce_slice(&nonce, &enc_key);
+        (nonce, key)
+    }
+
+    fn make_value(&mut self, plain_value: &[u8]) -> (Nonce, Vec<u8>) {
+        // Nonces for value encryption are derived from deterministic
+        // environmental data which hopefully changes a lot. In particular,
+        // the base_value_prefix should change every time the store is
+        // instantiated, and the nonce_counter changes during the store's lifetime.
+        // nonce = Trunc(NONCE_SIZE, H(base_prefix || nonce_counter))
+        let mut nonce = [0u8; NONCE_SIZE];
+
+        self.nonce_counter += 1;
+        let hash = Hash::digest_bytes_list(&[
+            self.base_value_prefix.as_slice(),
+            self.nonce_counter.to_le_bytes().as_slice(),
+        ]);
+        nonce.copy_from_slice(hash.truncated(NONCE_SIZE));
+
+        let enc_value = self.deoxys.seal(&nonce, plain_value, vec![]);
+        let value = self.pack_nonce_slice(&nonce, &enc_value);
+        (nonce, value)
+    }
+
+    fn get_item(&self, raw: &[u8]) -> Result<(Nonce, Vec<u8>), Error> {
+        match unpack_nonce_slice(raw) {
+            Some((nonce, enc_ref)) => {
+                let enc = Vec::from(enc_ref);
+                let plain = self
+                    .deoxys
+                    .open(nonce, enc, vec![])
+                    .map_err(|err| Error::DecryptionFailure(err.into()))?;
+                Ok((*nonce, plain))
+            }
+            None => Err(Error::CorruptKey),
+        }
+    }
+}
+
+impl<S: Store> Zeroize for ConfidentialStore<S> {
+    fn zeroize(&mut self) {
+        self.deoxys.zeroize();
+        self.nonce_key.zeroize();
+    }
+}
+
+impl<S: Store> Store for ConfidentialStore<S> {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        let (_, inner_key) = self.make_key(key);
+        self.inner.get(&inner_key).map(|inner_value| {
+            self.get_item(&inner_value)
+                .expect("error decrypting value")
+                .1
+        })
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        let (_, inner_key) = self.make_key(key);
+        let (_, inner_value) = self.make_value(value);
+        self.inner.insert(&inner_key, &inner_value)
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        let (_, inner_key) = self.make_key(key);
+        self.inner.remove(&inner_key)
+    }
+
+    fn iter(&self) -> Box<dyn mkvs::Iterator + '_> {
+        Box::new(ConfidentialStoreIterator::new(self))
+    }
+
+    fn prefetch_prefixes(&mut self, prefixes: Vec<mkvs::Prefix>, limit: u16) {
+        self.inner.prefetch_prefixes(prefixes, limit);
+    }
+}
+
+struct ConfidentialStoreIterator<'store, S: Store> {
+    inner: Box<dyn mkvs::Iterator + 'store>,
+    store: &'store ConfidentialStore<S>,
+
+    key: Option<mkvs::Key>,
+    value: Option<Vec<u8>>,
+    error: Option<anyhow::Error>,
+}
+
+impl<'store, S: Store> ConfidentialStoreIterator<'store, S> {
+    fn new(store: &'store ConfidentialStore<S>) -> ConfidentialStoreIterator<'_, S> {
+        ConfidentialStoreIterator {
+            inner: store.inner.iter(),
+            store,
+            key: None,
+            value: None,
+            error: None,
+        }
+    }
+
+    fn reset(&mut self) {
+        self.key = None;
+        self.value = None;
+        self.error = None;
+    }
+
+    fn load(&mut self, inner_key: &[u8], inner_value: &[u8]) {
+        if !mkvs::Iterator::is_valid(self) {
+            return;
+        }
+
+        match self.store.get_item(inner_key) {
+            Ok((_, key)) => match self.store.get_item(inner_value) {
+                Ok((_, value)) => {
+                    self.key = Some(key);
+                    self.value = Some(value);
+                }
+                Err(err) => {
+                    self.error = Some(err.into());
+                }
+            },
+            Err(err) => {
+                self.error = Some(err.into());
+            }
+        }
+    }
+
+    fn reset_and_load(&mut self) {
+        self.reset();
+        if self.inner.is_valid() {
+            if let Some(ref inner_key) = self.inner.get_key().clone() {
+                if let Some(ref inner_value) = self.inner.get_value().clone() {
+                    self.load(inner_key, inner_value);
+                } else {
+                    self.error = Some(anyhow::anyhow!("no value in valid inner iterator"));
+                }
+            } else {
+                self.error = Some(anyhow::anyhow!("no key in valid inner iterator"));
+            }
+        }
+    }
+}
+
+impl<'store, S: Store> Iterator for ConfidentialStoreIterator<'store, S> {
+    type Item = (Vec<u8>, Vec<u8>);
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.reset_and_load();
+        if !mkvs::Iterator::is_valid(self) {
+            return None;
+        }
+        mkvs::Iterator::next(&mut *self.inner);
+        Some((self.key.clone().unwrap(), self.value.clone().unwrap()))
+    }
+}
+
+impl<'store, S: Store> mkvs::Iterator for ConfidentialStoreIterator<'store, S> {
+    fn set_prefetch(&mut self, prefetch: usize) {
+        self.inner.set_prefetch(prefetch)
+    }
+
+    fn is_valid(&self) -> bool {
+        self.error.is_none() && self.inner.is_valid()
+    }
+
+    fn error(&self) -> &Option<anyhow::Error> {
+        match self.error {
+            Some(_) => &self.error,
+            None => self.inner.error(),
+        }
+    }
+
+    fn rewind(&mut self) {
+        self.inner.rewind();
+        self.reset_and_load();
+    }
+
+    fn seek(&mut self, key: &[u8]) {
+        let (_, inner_key) = self.store.make_key(key);
+        self.inner.seek(&inner_key);
+        self.reset_and_load();
+    }
+
+    fn get_key(&self) -> &Option<mkvs::Key> {
+        &self.key
+    }
+
+    fn get_value(&self) -> &Option<Vec<u8>> {
+        &self.value
+    }
+
+    fn next(&mut self) {
+        mkvs::Iterator::next(&mut *self.inner);
+        self.reset_and_load();
+    }
+}
+
+#[cfg(test)]
+mod test {
+    extern crate test;
+    use super::*;
+    use crate::{keymanager::KeyPair, storage, testing::mock::empty_store};
+    use test::Bencher;
+
+    const ITEM_COUNT: usize = 10_000;
+
+    fn confidential<'ctx, S: Store + 'ctx>(inner: S, consistent: bool) -> Box<dyn Store + 'ctx> {
+        let state_key = if consistent {
+            [0xaau8; 32]
+        } else {
+            KeyPair::generate_mock().state_key.0
+        };
+        Box::new(ConfidentialStore::new_with_key(
+            inner,
+            state_key,
+            &[b"confidential store unit tests"],
+        ))
+    }
+
+    fn make_inner<'ctx, S: Store + 'ctx>(
+        store: S,
+        make_confidential: bool,
+    ) -> Box<dyn Store + 'ctx> {
+        let inner = storage::PrefixStore::new(
+            storage::PrefixStore::new(
+                storage::PrefixStore::new(store, "test module"),
+                "instance prefix",
+            ),
+            "type prefix",
+        );
+
+        // Replicate the stack as constructed in modules/contracts.
+        if make_confidential {
+            confidential(inner, false)
+        } else {
+            Box::new(storage::HashedStore::<_, blake3::Hasher>::new(inner))
+        }
+    }
+
+    fn make_items(mut num: usize) -> Vec<(Vec<u8>, Vec<u8>)> {
+        let mut items = Vec::new();
+        if num == 0 {
+            num = ITEM_COUNT;
+        }
+        for i in 0..num {
+            items.push((
+                format!("key{}", i).into_bytes(),
+                format!("value{}", i).into_bytes(),
+            ));
+        }
+        items
+    }
+
+    #[test]
+    fn basic_operations() {
+        let mut store = confidential(empty_store(), true);
+        let items = make_items(10);
+
+        // Nothing should exist at the beginning.
+        for (k, _) in items.iter() {
+            assert!(store.get(k).is_none());
+        }
+        let mut iter = store.iter();
+        iter.rewind();
+        assert!(iter.next().is_none());
+        drop(iter);
+
+        // Insert even items, then verify they're
+        // exactly the ones that exist.
+        for (k, v) in items.iter().step_by(2) {
+            store.insert(k, v);
+        }
+        for (i, (k, v)) in items.iter().enumerate() {
+            if i % 2 == 0 {
+                assert_eq!(&store.get(k).expect("item should exist"), v);
+            } else {
+                assert!(store.get(k).is_none());
+            }
+        }
+        let mut iter = store.iter();
+        iter.rewind();
+        assert_eq!(iter.count(), items.len() / 2);
+
+        // Remove some items that exist and some that don't.
+        // The stepper should remove key0 and key6, and also
+        // try removing key3 and key9.
+        for (k, _) in items.iter().step_by(3) {
+            store.remove(k);
+        }
+        for (i, (k, v)) in items.iter().enumerate() {
+            if i % 2 == 0 && i % 3 != 0 {
+                assert_eq!(&store.get(k).expect("item should exist"), v);
+            } else {
+                assert!(store.get(k).is_none());
+            }
+        }
+        let mut iter = store.iter();
+        iter.rewind();
+        assert_eq!(iter.count(), 3);
+    }
+
+    #[test]
+    fn base_corruption() {
+        let mut plain_store = empty_store();
+        let mut store = confidential(&mut plain_store, true);
+
+        // Insert something, try corrupting its bytes, then see
+        // what the confidential store does with it.
+        const KEY: &[u8] = b"key";
+        const VALUE: &[u8] = b"value";
+
+        // Insert the key and then try getting it out again, because we don't
+        // know the actual bytes in the underlying store.
+        store.insert(KEY, VALUE);
+        drop(store);
+        let mut iter = plain_store.iter();
+        iter.rewind();
+        let (key, value) = Iterator::next(&mut iter).expect("should have one item");
+        drop(iter);
+
+        // Actually encrypted?
+        let (_, enc_key) = unpack_nonce_slice(&key).expect("unpacking encrypted key should work");
+        assert_ne!(enc_key, b"key");
+
+        // Corrupt nonce part of the key.
+        let mut corrupt_key_nonce = key.clone();
+        corrupt_key_nonce[4] ^= 0xaau8;
+        plain_store.insert(&corrupt_key_nonce, &value);
+        plain_store.remove(&key);
+        let store = confidential(&mut plain_store, true);
+        assert!(store.get(KEY).is_none());
+        drop(store);
+        plain_store.remove(&corrupt_key_nonce);
+
+        // Corrupt key part of the key.
+        let mut corrupt_key_key = key.clone();
+        *corrupt_key_key.last_mut().unwrap() ^= 0xaau8;
+        plain_store.insert(&corrupt_key_key, &value);
+        let store = confidential(&mut plain_store, true);
+        assert!(store.get(KEY).is_none());
+        drop(store);
+        plain_store.remove(&corrupt_key_key);
+
+        // Validate inserting into underlying store.
+        plain_store.insert(&key, &value);
+        let store = confidential(&mut plain_store, true);
+        assert_eq!(store.get(KEY).expect("key should exist"), VALUE);
+    }
+
+    #[test]
+    #[should_panic]
+    fn corruption_value_nonce() {
+        let mut plain_store = empty_store();
+        let mut store = confidential(&mut plain_store, true);
+
+        // Insert something, try corrupting its bytes, then see
+        // what the confidential store does with it.
+        const KEY: &[u8] = b"key";
+        const VALUE: &[u8] = b"value";
+
+        // Insert the key and then try getting it out again, because we don't
+        // know the actual bytes in the underlying store.
+        store.insert(KEY, VALUE);
+        assert!(store.get(KEY).is_some());
+        drop(store);
+        let mut iter = plain_store.iter();
+        iter.rewind();
+        let (key, value) = Iterator::next(&mut iter).expect("should have one item");
+        drop(iter);
+
+        // Corrupt the nonce part of the value.
+        let mut corrupt_value_nonce = value;
+        corrupt_value_nonce[4] ^= 0xaau8;
+        plain_store.remove(&key);
+        plain_store.insert(&key, &corrupt_value_nonce);
+        let store = confidential(&mut plain_store, true);
+        store.get(KEY);
+        drop(store);
+        plain_store.remove(&key);
+    }
+
+    #[test]
+    #[should_panic]
+    fn corruption_value_value() {
+        let mut plain_store = empty_store();
+        let mut store = confidential(&mut plain_store, true);
+
+        // Insert something, try corrupting its bytes, then see
+        // what the confidential store does with it.
+        const KEY: &[u8] = b"key";
+        const VALUE: &[u8] = b"value";
+
+        // Insert the key and then try getting it out again, because we don't
+        // know the actual bytes in the underlying store.
+        store.insert(KEY, VALUE);
+        assert!(store.get(KEY).is_some());
+        drop(store);
+        let mut iter = plain_store.iter();
+        iter.rewind();
+        let (key, value) = Iterator::next(&mut iter).expect("should have one item");
+        drop(iter);
+
+        // Corrupt the nonce part of the value.
+        let mut corrupt_value_value = value;
+        *corrupt_value_value.last_mut().unwrap() ^= 0xaau8;
+        plain_store.remove(&key);
+        plain_store.insert(&key, &corrupt_value_value);
+        let store = confidential(&mut plain_store, true);
+        store.get(KEY);
+        drop(store);
+        plain_store.remove(&key);
+    }
+
+    fn run<F>(confidential: bool, inserts: usize, mut cb: F)
+    where
+        F: FnMut(&mut Box<dyn Store + '_>, &Vec<(Vec<u8>, Vec<u8>)>),
+    {
+        let mut store = make_inner(empty_store(), confidential);
+
+        let items = make_items(0);
+        for i in 0..inserts {
+            let item = &items[i % items.len()];
+            store.insert(&item.0, &item.1);
+        }
+
+        cb(&mut store, &items);
+    }
+
+    #[bench]
+    fn plain_insert(b: &mut Bencher) {
+        run(false, 0, |store, items| {
+            let mut i = 0;
+            b.iter(|| {
+                let item = &items[i % items.len()];
+                store.insert(&item.0, &item.1);
+                i += 1;
+            });
+        });
+    }
+
+    #[bench]
+    fn plain_get(b: &mut Bencher) {
+        run(false, ITEM_COUNT / 2, |store, items| {
+            let mut i = 0;
+            b.iter(|| {
+                let j =
+                    (2 * i + ((items.len() + 1) % 2) * ((i / (items.len() / 2)) % 2)) % items.len();
+                let item = &items[j % items.len()];
+                store.get(&item.0);
+                i += 1;
+            });
+        });
+    }
+
+    #[bench]
+    fn plain_scan(b: &mut Bencher) {
+        run(false, ITEM_COUNT, |store, _| {
+            let mut it = store.iter();
+            b.iter(|| {
+                match it.next() {
+                    Some(_) => {}
+                    None => {
+                        it = store.iter();
+                    }
+                };
+            });
+        });
+    }
+
+    #[bench]
+    fn confidential_insert(b: &mut Bencher) {
+        run(true, 0, |store, items| {
+            let mut i = 0;
+            b.iter(|| {
+                let item = &items[i % items.len()];
+                store.insert(&item.0, &item.1);
+                i += 1;
+            });
+        });
+    }
+
+    #[bench]
+    fn confidential_get(b: &mut Bencher) {
+        run(true, ITEM_COUNT / 2, |store, items| {
+            let mut i = 0;
+            b.iter(|| {
+                let j =
+                    (2 * i + ((items.len() + 1) % 2) * ((i / (items.len() / 2)) % 2)) % items.len();
+                let item = &items[j % items.len()];
+                store.get(&item.0);
+                i += 1;
+            });
+        });
+    }
+
+    #[bench]
+    fn confidential_scan(b: &mut Bencher) {
+        run(true, ITEM_COUNT, |store, _| {
+            let mut it = store.iter();
+            b.iter(|| {
+                match it.next() {
+                    Some(_) => {}
+                    None => {
+                        it = store.iter();
+                    }
+                };
+            });
+        });
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/storage/hashed.rs.html b/rust/src/oasis_runtime_sdk/storage/hashed.rs.html new file mode 100644 index 0000000000..d58b76bf84 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/storage/hashed.rs.html @@ -0,0 +1,87 @@ +hashed.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+
use std::marker::PhantomData;
+
+use oasis_core_runtime::storage::mkvs;
+
+use super::Store;
+
+/// A key-value store that hashes all keys and stores them as `H(k) || k`.
+pub struct HashedStore<S: Store, D: digest::Digest> {
+    parent: S,
+    _digest: PhantomData<D>,
+}
+
+impl<S: Store, D: digest::Digest> HashedStore<S, D> {
+    /// Create a new hashed store.
+    pub fn new(parent: S) -> Self {
+        Self {
+            parent,
+            _digest: PhantomData,
+        }
+    }
+}
+
+impl<S: Store, D: digest::Digest> Store for HashedStore<S, D> {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        self.parent.get(&[&D::digest(key), key].concat())
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        self.parent.insert(&[&D::digest(key), key].concat(), value);
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        self.parent.remove(&[&D::digest(key), key].concat());
+    }
+
+    fn iter(&self) -> Box<dyn mkvs::Iterator + '_> {
+        self.parent.iter()
+    }
+
+    fn prefetch_prefixes(&mut self, prefixes: Vec<mkvs::Prefix>, limit: u16) {
+        self.parent.prefetch_prefixes(prefixes, limit);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/storage/host.rs.html b/rust/src/oasis_runtime_sdk/storage/host.rs.html new file mode 100644 index 0000000000..e5570f227e --- /dev/null +++ b/rust/src/oasis_runtime_sdk/storage/host.rs.html @@ -0,0 +1,171 @@ +host.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+
use std::sync::Arc;
+
+use anyhow::{anyhow, Result};
+
+use crate::{
+    core::{
+        common::namespace::Namespace,
+        consensus::{state::roothash::ImmutableState as RoothashState, verifier::Verifier},
+        protocol::Protocol,
+        storage::mkvs,
+        types::HostStorageEndpoint,
+    },
+    storage,
+};
+
+/// A store for a specific state root that talks to the runtime host.
+pub struct HostStore {
+    tree: mkvs::Tree,
+}
+
+impl HostStore {
+    /// Create a new host store for the given host and root.
+    pub fn new(host: Arc<Protocol>, root: mkvs::Root) -> Self {
+        let read_syncer = mkvs::sync::HostReadSyncer::new(host, HostStorageEndpoint::Runtime);
+        let tree = mkvs::Tree::builder()
+            .with_capacity(10_000, 1024 * 1024)
+            .with_root(root)
+            .build(Box::new(read_syncer));
+
+        Self { tree }
+    }
+
+    /// Create a new host store for the given host and root at the given round.
+    ///
+    /// The corresponding root hash is fetched by looking it up in consensus layer state, verified
+    /// by the passed verifier to be correct.
+    pub async fn new_for_round(
+        host: Arc<Protocol>,
+        consensus_verifier: &Arc<dyn Verifier>,
+        id: Namespace,
+        round: u64,
+    ) -> Result<Self> {
+        // Fetch latest consensus layer state.
+        let state = consensus_verifier.latest_state().await?;
+        // Fetch latest state root for the given namespace.
+        let roots = tokio::task::spawn_blocking(move || {
+            let roothash = RoothashState::new(&state);
+            roothash.round_roots(id, round)
+        })
+        .await??
+        .ok_or(anyhow!("root not found"))?;
+
+        Ok(Self::new(
+            host,
+            mkvs::Root {
+                namespace: id,
+                version: round,
+                root_type: mkvs::RootType::State,
+                hash: roots.state_root,
+            },
+        ))
+    }
+}
+
+impl storage::Store for HostStore {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        self.tree.get(key).unwrap()
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        self.tree.insert(key, value).unwrap();
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        self.tree.remove(key).unwrap();
+    }
+
+    fn iter(&self) -> Box<dyn mkvs::Iterator + '_> {
+        Box::new(self.tree.iter())
+    }
+
+    fn prefetch_prefixes(&mut self, prefixes: Vec<mkvs::Prefix>, limit: u16) {
+        self.tree.prefetch_prefixes(&prefixes, limit).unwrap();
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/storage/mkvs.rs.html b/rust/src/oasis_runtime_sdk/storage/mkvs.rs.html new file mode 100644 index 0000000000..1fd0c990b1 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/storage/mkvs.rs.html @@ -0,0 +1,115 @@ +mkvs.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+
use oasis_core_runtime::storage::mkvs;
+
+use super::{NestedStore, Store};
+
+/// A key-value store backed by MKVS.
+pub struct MKVSStore<M: mkvs::MKVS> {
+    parent: M,
+}
+
+impl<M: mkvs::MKVS> MKVSStore<M> {
+    pub fn new(parent: M) -> Self {
+        Self { parent }
+    }
+}
+
+impl<M: mkvs::MKVS> Store for MKVSStore<M> {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        self.parent.get(key)
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        self.parent.insert(key, value);
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        self.parent.remove(key);
+    }
+
+    fn iter(&self) -> Box<dyn mkvs::Iterator + '_> {
+        self.parent.iter()
+    }
+
+    fn prefetch_prefixes(&mut self, prefixes: Vec<mkvs::Prefix>, limit: u16) {
+        self.parent.prefetch_prefixes(&prefixes, limit);
+    }
+}
+
+impl<M: mkvs::MKVS> NestedStore for MKVSStore<M> {
+    type Inner = M;
+
+    fn commit(self) -> Self::Inner {
+        // Commit is not needed.
+        self.parent
+    }
+
+    fn rollback(self) -> Self::Inner {
+        panic!("attempted to rollback a non-transactional store");
+    }
+
+    fn has_pending_updates(&self) -> bool {
+        true
+    }
+
+    fn pending_update_byte_size(&self) -> usize {
+        0
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/storage/mod.rs.html b/rust/src/oasis_runtime_sdk/storage/mod.rs.html new file mode 100644 index 0000000000..ec7cdbd211 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/storage/mod.rs.html @@ -0,0 +1,207 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+
//! Storage.
+use oasis_core_runtime::storage::mkvs::Iterator;
+
+pub mod confidential;
+mod hashed;
+mod host;
+mod mkvs;
+mod overlay;
+mod prefix;
+mod typed;
+
+/// A key-value store.
+pub trait Store {
+    /// Fetch entry with given key.
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>>;
+
+    /// Update entry with given key to the given value.
+    fn insert(&mut self, key: &[u8], value: &[u8]);
+
+    /// Remove entry with given key.
+    fn remove(&mut self, key: &[u8]);
+
+    /// Returns an iterator over the tree.
+    fn iter(&self) -> Box<dyn Iterator + '_>;
+
+    /// Populate the in-memory tree with nodes for keys starting with given prefixes.
+    fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16);
+}
+
+/// A key-value store that supports the commit operation.
+pub trait NestedStore: Store {
+    /// Type of the inner store.
+    type Inner;
+
+    /// Commit any changes to the underlying store.
+    ///
+    /// If this method is not called the changes may be discarded by the store.
+    fn commit(self) -> Self::Inner;
+
+    /// Rollback any changes.
+    fn rollback(self) -> Self::Inner;
+
+    /// Whether there are any store updates pending to be committed.
+    fn has_pending_updates(&self) -> bool;
+
+    /// Size (in bytes) of any pending updates.
+    fn pending_update_byte_size(&self) -> usize;
+}
+
+impl<S: Store + ?Sized> Store for &mut S {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        S::get(self, key)
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        S::insert(self, key, value)
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        S::remove(self, key)
+    }
+
+    fn iter(&self) -> Box<dyn Iterator + '_> {
+        S::iter(self)
+    }
+
+    fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16) {
+        S::prefetch_prefixes(self, prefixes, limit)
+    }
+}
+
+impl<S: Store + ?Sized> Store for Box<S> {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        S::get(self, key)
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        S::insert(self, key, value)
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        S::remove(self, key)
+    }
+
+    fn iter(&self) -> Box<dyn Iterator + '_> {
+        S::iter(self)
+    }
+
+    fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16) {
+        S::prefetch_prefixes(self, prefixes, limit)
+    }
+}
+
+pub use confidential::{ConfidentialStore, Error as ConfidentialStoreError};
+pub use hashed::HashedStore;
+pub use host::HostStore;
+pub use mkvs::MKVSStore;
+pub use overlay::OverlayStore;
+pub use prefix::PrefixStore;
+pub use typed::TypedStore;
+
+// Re-export the mkvs storage prefix.
+pub use oasis_core_runtime::storage::mkvs::Prefix;
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/storage/overlay.rs.html b/rust/src/oasis_runtime_sdk/storage/overlay.rs.html new file mode 100644 index 0000000000..d6c9cc2cdc --- /dev/null +++ b/rust/src/oasis_runtime_sdk/storage/overlay.rs.html @@ -0,0 +1,487 @@ +overlay.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+
use std::{
+    collections::{btree_map, BTreeMap, HashSet},
+    iter::{Iterator, Peekable},
+};
+
+use oasis_core_runtime::storage::mkvs;
+
+use super::{NestedStore, Prefix, Store};
+
+/// An overlay store which keeps values locally until explicitly committed.
+pub struct OverlayStore<S: Store> {
+    parent: S,
+    overlay: BTreeMap<Vec<u8>, Vec<u8>>,
+    dirty: HashSet<Vec<u8>>,
+}
+
+impl<S: Store> OverlayStore<S> {
+    /// Create a new overlay store.
+    pub fn new(parent: S) -> Self {
+        Self {
+            parent,
+            overlay: BTreeMap::new(),
+            dirty: HashSet::new(),
+        }
+    }
+}
+
+impl<S: Store> NestedStore for OverlayStore<S> {
+    type Inner = S;
+
+    fn commit(mut self) -> Self::Inner {
+        // Insert all items present in the overlay.
+        for (key, value) in self.overlay {
+            self.dirty.remove(&key);
+            self.parent.insert(&key, &value);
+        }
+
+        // Any remaining dirty items must have been removed.
+        for key in self.dirty {
+            self.parent.remove(&key);
+        }
+
+        self.parent
+    }
+
+    fn rollback(self) -> Self::Inner {
+        self.parent
+    }
+
+    fn has_pending_updates(&self) -> bool {
+        !self.dirty.is_empty()
+    }
+
+    fn pending_update_byte_size(&self) -> usize {
+        let updated_size = self
+            .overlay
+            .iter()
+            .map(|(key, value)| key.len() + value.len())
+            .reduce(|acc, bytes| acc + bytes)
+            .unwrap_or_default();
+
+        let removed_size = self
+            .dirty
+            .iter()
+            .filter(|key| !self.overlay.contains_key(key.as_slice()))
+            .map(|key| key.len())
+            .reduce(|acc, bytes| acc + bytes)
+            .unwrap_or_default();
+
+        updated_size.saturating_add(removed_size)
+    }
+}
+
+impl<S: Store> Store for OverlayStore<S> {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        // For dirty values, check the overlay.
+        if self.dirty.contains(key) {
+            return self.overlay.get(key).cloned();
+        }
+
+        // Otherwise fetch from parent store.
+        self.parent.get(key)
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        self.overlay.insert(key.to_owned(), value.to_owned());
+        self.dirty.insert(key.to_owned());
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        // For dirty values, remove from the overlay.
+        if self.dirty.contains(key) {
+            self.overlay.remove(key);
+            return;
+        }
+
+        // Since we don't care about the previous value, we can just record an update.
+        self.dirty.insert(key.to_owned());
+    }
+
+    fn iter(&self) -> Box<dyn mkvs::Iterator + '_> {
+        Box::new(OverlayStoreIterator::new(self))
+    }
+
+    fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16) {
+        self.parent.prefetch_prefixes(prefixes, limit);
+    }
+}
+
+/// An iterator over the `OverlayStore`.
+pub(crate) struct OverlayStoreIterator<'store, S: Store> {
+    store: &'store OverlayStore<S>,
+
+    parent: Box<dyn mkvs::Iterator + 'store>,
+
+    overlay: Peekable<btree_map::Range<'store, Vec<u8>, Vec<u8>>>,
+    overlay_valid: bool,
+
+    key: Option<Vec<u8>>,
+    value: Option<Vec<u8>>,
+}
+
+impl<'store, S: Store> OverlayStoreIterator<'store, S> {
+    fn new(store: &'store OverlayStore<S>) -> Self {
+        Self {
+            store,
+            parent: store.parent.iter(),
+            overlay: store.overlay.range(vec![]..).peekable(),
+            overlay_valid: true,
+            key: None,
+            value: None,
+        }
+    }
+
+    fn update_iterator_position(&mut self) {
+        // Skip over any dirty entries from the parent iterator.
+        loop {
+            if !self.parent.is_valid()
+                || !self
+                    .store
+                    .dirty
+                    .contains(self.parent.get_key().as_ref().expect("parent.is_valid"))
+            {
+                break;
+            }
+            self.parent.next();
+        }
+
+        let i_key = self.parent.get_key();
+        let o_item = self.overlay.peek();
+        self.overlay_valid = o_item.is_some();
+
+        if self.parent.is_valid()
+            && (!self.overlay_valid
+                || i_key.as_ref().expect("parent.is_valid") < o_item.expect("overlay_valid").0)
+        {
+            // Key of parent iterator is smaller than the key of the overlay iterator.
+            self.key = i_key.clone();
+            self.value = self.parent.get_value().clone();
+        } else if self.overlay_valid {
+            // Key of overlay iterator is smaller than or equal to the key of the parent iterator.
+            let (o_key, o_value) = o_item.expect("overlay_valid");
+            self.key = Some(o_key.to_vec());
+            self.value = Some(o_value.to_vec());
+        } else {
+            // Both iterators are invalid.
+            self.key = None;
+            self.value = None;
+        }
+    }
+
+    fn next(&mut self) {
+        if !self.overlay_valid
+            || (self.parent.is_valid()
+                && self.parent.get_key().as_ref().expect("parent.is_valid")
+                    <= self.overlay.peek().expect("overlay_valid").0)
+        {
+            // Key of parent iterator is smaller or equal than the key of the overlay iterator.
+            self.parent.next();
+        } else {
+            // Key of parent iterator is greater than the key of the overlay iterator.
+            self.overlay.next();
+        }
+
+        self.update_iterator_position();
+    }
+}
+
+impl<'store, S: Store> Iterator for OverlayStoreIterator<'store, S> {
+    type Item = (Vec<u8>, Vec<u8>);
+
+    fn next(&mut self) -> Option<Self::Item> {
+        use mkvs::Iterator;
+
+        if !self.is_valid() {
+            return None;
+        }
+
+        let key = self.key.as_ref().expect("iterator is valid").clone();
+        let value = self.value.as_ref().expect("iterator is valid").clone();
+        OverlayStoreIterator::next(self);
+
+        Some((key, value))
+    }
+}
+
+impl<'store, S: Store> mkvs::Iterator for OverlayStoreIterator<'store, S> {
+    fn set_prefetch(&mut self, prefetch: usize) {
+        self.parent.set_prefetch(prefetch)
+    }
+
+    fn is_valid(&self) -> bool {
+        // If either iterator is valid, the merged iterator is valid.
+        self.parent.is_valid() || self.overlay_valid
+    }
+
+    fn error(&self) -> &Option<anyhow::Error> {
+        self.parent.error()
+    }
+
+    fn rewind(&mut self) {
+        self.seek(&[]);
+    }
+
+    fn seek(&mut self, key: &[u8]) {
+        self.parent.seek(key);
+        self.overlay = self.store.overlay.range(key.to_vec()..).peekable();
+
+        self.update_iterator_position();
+    }
+
+    fn get_key(&self) -> &Option<mkvs::Key> {
+        &self.key
+    }
+
+    fn get_value(&self) -> &Option<Vec<u8>> {
+        &self.value
+    }
+
+    fn next(&mut self) {
+        OverlayStoreIterator::next(self)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/storage/prefix.rs.html b/rust/src/oasis_runtime_sdk/storage/prefix.rs.html new file mode 100644 index 0000000000..7dac10f6c6 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/storage/prefix.rs.html @@ -0,0 +1,233 @@ +prefix.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+
use oasis_core_runtime::storage::mkvs;
+
+use super::{Prefix, Store};
+
+/// A key-value store that prefixes all keys with the given prefix.
+pub struct PrefixStore<S: Store, P: AsRef<[u8]>> {
+    parent: S,
+    prefix: P,
+}
+
+impl<S: Store, P: AsRef<[u8]>> PrefixStore<S, P> {
+    /// Create a new prefix store with the given prefix.
+    pub fn new(parent: S, prefix: P) -> Self {
+        Self { parent, prefix }
+    }
+}
+
+impl<S: Store, P: AsRef<[u8]>> Store for PrefixStore<S, P> {
+    fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
+        self.parent.get(&[self.prefix.as_ref(), key].concat())
+    }
+
+    fn insert(&mut self, key: &[u8], value: &[u8]) {
+        self.parent
+            .insert(&[self.prefix.as_ref(), key].concat(), value);
+    }
+
+    fn remove(&mut self, key: &[u8]) {
+        self.parent.remove(&[self.prefix.as_ref(), key].concat());
+    }
+
+    fn iter(&self) -> Box<dyn mkvs::Iterator + '_> {
+        Box::new(PrefixStoreIterator::new(
+            self.parent.iter(),
+            self.prefix.as_ref(),
+        ))
+    }
+
+    fn prefetch_prefixes(&mut self, prefixes: Vec<Prefix>, limit: u16) {
+        self.parent.prefetch_prefixes(prefixes, limit);
+    }
+}
+
+/// An iterator over the `PrefixStore`.
+pub(crate) struct PrefixStoreIterator<'store> {
+    inner: Box<dyn mkvs::Iterator + 'store>,
+    prefix: &'store [u8],
+}
+
+impl<'store> PrefixStoreIterator<'store> {
+    fn new(mut inner: Box<dyn mkvs::Iterator + 'store>, prefix: &'store [u8]) -> Self {
+        inner.seek(prefix);
+        Self { inner, prefix }
+    }
+}
+
+impl<'store> Iterator for PrefixStoreIterator<'store> {
+    type Item = (Vec<u8>, Vec<u8>);
+
+    fn next(&mut self) -> Option<Self::Item> {
+        Iterator::next(&mut self.inner).and_then(|(mut k, v)| {
+            if k.starts_with(self.prefix) {
+                Some((k.split_off(self.prefix.len()), v))
+            } else {
+                None
+            }
+        })
+    }
+}
+
+impl<'store> mkvs::Iterator for PrefixStoreIterator<'store> {
+    fn set_prefetch(&mut self, prefetch: usize) {
+        self.inner.set_prefetch(prefetch)
+    }
+
+    fn is_valid(&self) -> bool {
+        if !self
+            .inner
+            .get_key()
+            .as_ref()
+            .unwrap_or(&vec![])
+            .starts_with(self.prefix)
+        {
+            return false;
+        }
+        self.inner.is_valid()
+    }
+
+    fn error(&self) -> &Option<anyhow::Error> {
+        self.inner.error()
+    }
+
+    fn rewind(&mut self) {
+        self.inner.seek(self.prefix);
+    }
+
+    fn seek(&mut self, key: &[u8]) {
+        self.inner.seek(&[self.prefix, key].concat());
+    }
+
+    fn get_key(&self) -> &Option<mkvs::Key> {
+        self.inner.get_key()
+    }
+
+    fn get_value(&self) -> &Option<Vec<u8>> {
+        self.inner.get_value()
+    }
+
+    fn next(&mut self) {
+        if !self.is_valid() {
+            // Could be invalid due to prefix mismatch.
+            return;
+        }
+        mkvs::Iterator::next(&mut *self.inner)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/storage/typed.rs.html b/rust/src/oasis_runtime_sdk/storage/typed.rs.html new file mode 100644 index 0000000000..103946cd9a --- /dev/null +++ b/rust/src/oasis_runtime_sdk/storage/typed.rs.html @@ -0,0 +1,181 @@ +typed.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+
use std::{convert::TryFrom, marker::PhantomData};
+
+use oasis_core_runtime::storage::mkvs;
+
+use super::Store;
+
+/// A key-value store that transparently handles serialization/deserialization.
+pub struct TypedStore<S: Store> {
+    parent: S,
+}
+
+impl<S: Store> TypedStore<S> {
+    /// Create a new typed store.
+    pub fn new(parent: S) -> Self {
+        Self { parent }
+    }
+
+    /// Fetch entry with given key.
+    pub fn get<K: AsRef<[u8]>, T: cbor::Decode>(&self, key: K) -> Option<T> {
+        self.parent
+            .get(key.as_ref())
+            .map(|data| cbor::from_slice(&data).unwrap())
+    }
+
+    /// Update entry with given key to the given value.
+    pub fn insert<K: AsRef<[u8]>, T: cbor::Encode>(&mut self, key: K, value: T) {
+        self.parent.insert(key.as_ref(), &cbor::to_vec(value))
+    }
+
+    /// Remove entry with given key.
+    pub fn remove<K: AsRef<[u8]>>(&mut self, key: K) {
+        self.parent.remove(key.as_ref())
+    }
+
+    pub fn iter<'store, K, V>(&'store self) -> TypedStoreIterator<'store, K, V>
+    where
+        K: for<'k> TryFrom<&'k [u8]>,
+        V: cbor::Decode + Default,
+    {
+        TypedStoreIterator::new(self.parent.iter())
+    }
+}
+
+/// An iterator over the `TypedStore`.
+pub struct TypedStoreIterator<'store, K, V>
+where
+    K: for<'k> TryFrom<&'k [u8]>,
+    V: Default + cbor::Decode,
+{
+    inner: Box<dyn mkvs::Iterator + 'store>,
+
+    _key: PhantomData<K>,
+    _value: PhantomData<V>,
+}
+
+impl<'store, K, V> TypedStoreIterator<'store, K, V>
+where
+    K: for<'k> TryFrom<&'k [u8]>,
+    V: cbor::Decode + Default,
+{
+    fn new(inner: Box<dyn mkvs::Iterator + 'store>) -> Self {
+        Self {
+            inner,
+            _key: PhantomData,
+            _value: PhantomData,
+        }
+    }
+}
+
+impl<'store, K, V, E> Iterator for TypedStoreIterator<'store, K, V>
+where
+    K: for<'k> TryFrom<&'k [u8], Error = E>,
+    E: std::fmt::Display,
+    V: cbor::Decode + Default,
+{
+    type Item = (K, V);
+
+    fn next(&mut self) -> Option<Self::Item> {
+        Iterator::next(&mut self.inner).map(|(k, v)| {
+            let key = K::try_from(&k).unwrap_or_else(|e| panic!("corrupted storage key: {e}"));
+            let value = if v.is_empty() {
+                // Ignore empty values as those would fail CBOR decoding.
+                Default::default()
+            } else {
+                cbor::from_slice(&v).unwrap()
+            };
+            (key, value)
+        })
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/subcall.rs.html b/rust/src/oasis_runtime_sdk/subcall.rs.html new file mode 100644 index 0000000000..dddc22356a --- /dev/null +++ b/rust/src/oasis_runtime_sdk/subcall.rs.html @@ -0,0 +1,395 @@ +subcall.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+
//! Subcall dispatch.
+use std::cell::RefCell;
+
+use crate::{
+    context::Context,
+    dispatcher,
+    module::CallResult,
+    modules::core::{Error, API as _},
+    runtime::Runtime,
+    state::{CurrentState, Options, TransactionResult, TransactionWithMeta},
+    types::{token, transaction, transaction::CallerAddress},
+};
+
+thread_local! {
+    /// The subcall stack for tracking depth and other metadata.
+    static SUBCALL_STACK: RefCell<SubcallStack> = RefCell::new(SubcallStack::new());
+}
+
+/// Subcall validator.
+pub trait Validator {
+    /// Validate a subcall before it is performed.
+    fn validate(&self, info: &SubcallInfo) -> Result<(), Error>;
+}
+
+/// A validator which allows everything.
+pub struct AllowAllValidator;
+
+impl Validator for AllowAllValidator {
+    fn validate(&self, _info: &SubcallInfo) -> Result<(), Error> {
+        Ok(())
+    }
+}
+
+/// Information about a subcall to be dispatched.
+#[derive(Clone, Debug)]
+pub struct SubcallInfo {
+    /// Address of the caller.
+    pub caller: CallerAddress,
+    /// Method to call.
+    pub method: String,
+    /// Subcall body.
+    pub body: cbor::Value,
+    /// Maximum subcall depth.
+    pub max_depth: u16,
+    /// Maximum gas amount that can be consumed.
+    pub max_gas: u64,
+}
+
+/// Result of dispatching a subcall.
+#[derive(Debug)]
+pub struct SubcallResult {
+    /// Result of the subcall.
+    pub call_result: CallResult,
+    /// Gas used by the subcall.
+    pub gas_used: u64,
+}
+
+struct SubcallStackEntry {
+    validator: Box<dyn Validator>,
+}
+
+struct SubcallStack {
+    stack: Vec<SubcallStackEntry>,
+}
+
+impl SubcallStack {
+    fn new() -> Self {
+        Self { stack: Vec::new() }
+    }
+
+    fn depth(&self) -> u16 {
+        self.stack.len() as u16
+    }
+
+    fn push(&mut self, entry: SubcallStackEntry) {
+        self.stack.push(entry);
+    }
+
+    fn pop(&mut self) {
+        self.stack.pop();
+    }
+
+    fn run_validators(&self, info: &SubcallInfo) -> Result<(), Error> {
+        for entry in &self.stack {
+            entry.validator.validate(info)?;
+        }
+        Ok(())
+    }
+}
+
+struct SubcallStackGuard;
+
+impl Drop for SubcallStackGuard {
+    fn drop(&mut self) {
+        SUBCALL_STACK.with(|ss| {
+            ss.borrow_mut().pop();
+        });
+    }
+}
+
+/// The current subcall depth.
+pub fn get_current_subcall_depth<C: Context>(_ctx: &C) -> u16 {
+    SUBCALL_STACK.with(|ss| ss.borrow().depth())
+}
+
+/// Perform a subcall.
+pub fn call<C: Context, V: Validator + 'static>(
+    ctx: &C,
+    info: SubcallInfo,
+    validator: V,
+) -> Result<SubcallResult, Error> {
+    // Run validator first.
+    validator.validate(&info)?;
+
+    // Update the subcall stack after doing validation.
+    SUBCALL_STACK.with(|ss| {
+        let mut stack = ss.borrow_mut();
+
+        // Ensure the call depth is not too large.
+        if stack.depth() >= info.max_depth {
+            return Err(Error::CallDepthExceeded(stack.depth() + 1, info.max_depth));
+        }
+
+        // Run existing validators.
+        stack.run_validators(&info)?;
+
+        // Push subcall to stack.
+        stack.push(SubcallStackEntry {
+            validator: Box::new(validator) as Box<dyn Validator>,
+        });
+
+        Ok(())
+    })?;
+    let _guard = SubcallStackGuard; // Ensure subcall is popped from stack.
+
+    // Generate an internal transaction.
+    let tx = transaction::Transaction {
+        version: transaction::LATEST_TRANSACTION_VERSION,
+        call: transaction::Call {
+            format: transaction::CallFormat::Plain,
+            method: info.method,
+            body: info.body,
+            ..Default::default()
+        },
+        auth_info: transaction::AuthInfo {
+            signer_info: vec![transaction::SignerInfo {
+                // The call is being performed on the caller's behalf.
+                address_spec: transaction::AddressSpec::Internal(info.caller),
+                nonce: 0,
+            }],
+            fee: transaction::Fee {
+                amount: token::BaseUnits::new(0, token::Denomination::NATIVE),
+                // Limit gas usage inside the child context to the allocated maximum.
+                gas: info.max_gas,
+                // Propagate consensus message limit.
+                consensus_messages: CurrentState::with(|state| state.emitted_messages_max(ctx)),
+                proxy: None,
+            },
+            ..Default::default()
+        },
+    };
+    let call = tx.call.clone(); // TODO: Avoid clone.
+
+    // Execute a transaction in a child context.
+    let (call_result, gas) = CurrentState::with_transaction_opts(
+        Options::new()
+            .with_internal(true)
+            .with_tx(TransactionWithMeta::internal(tx)),
+        || {
+            // Dispatch the call.
+            let (result, _) = dispatcher::Dispatcher::<C::Runtime>::dispatch_tx_call(
+                &ctx.clone(), // Must clone to avoid infinite type.
+                call,
+                &Default::default(),
+            );
+            // Retrieve remaining gas.
+            let gas = <C::Runtime as Runtime>::Core::remaining_tx_gas();
+
+            // Commit store and return emitted tags and messages on successful dispatch,
+            // otherwise revert state and ignore any emitted events/messages.
+            if result.is_success() {
+                TransactionResult::Commit((result, gas))
+            } else {
+                // Ignore tags/messages on failure.
+                TransactionResult::Rollback((result, gas))
+            }
+        },
+    );
+
+    // Compute the amount of gas used.
+    let gas_used = info.max_gas.saturating_sub(gas);
+
+    Ok(SubcallResult {
+        call_result,
+        gas_used,
+    })
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/testing/keymanager.rs.html b/rust/src/oasis_runtime_sdk/testing/keymanager.rs.html new file mode 100644 index 0000000000..9bd02aaf48 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/testing/keymanager.rs.html @@ -0,0 +1,191 @@ +keymanager.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+
//! Mock key manager implementation.
+
+use std::{collections::HashMap, sync::Mutex};
+
+pub use crate::keymanager::{
+    KeyManagerError, KeyPair, KeyPairId, SignedPublicKey, StateKey, TrustedSigners,
+};
+use crate::{
+    core::{
+        common::{crypto::signature::PublicKey, namespace::Namespace},
+        consensus::beacon::EpochTime,
+    },
+    keymanager::KeyManager,
+};
+
+#[derive(Default)]
+pub struct MockKeyManagerClient {
+    keys: Mutex<HashMap<KeyPairId, KeyPair>>,
+    ephemeral_keys: Mutex<HashMap<KeyPairId, KeyPair>>,
+}
+
+impl Clone for MockKeyManagerClient {
+    fn clone(&self) -> Self {
+        let keys = self.keys.lock().unwrap();
+        let ephemeral_keys = self.ephemeral_keys.lock().unwrap();
+        Self {
+            keys: Mutex::new(keys.clone()),
+            ephemeral_keys: Mutex::new(ephemeral_keys.clone()),
+        }
+    }
+}
+
+impl MockKeyManagerClient {
+    pub fn new() -> Self {
+        Default::default()
+    }
+}
+
+impl KeyManager for MockKeyManagerClient {
+    fn runtime_id(&self) -> Option<Namespace> {
+        None
+    }
+
+    fn runtime_signing_key(&self) -> Option<PublicKey> {
+        None
+    }
+
+    fn clear_cache(&self) {
+        // Nothing to do here, no cache.
+    }
+
+    fn get_or_create_keys(&self, key_pair_id: KeyPairId) -> Result<KeyPair, KeyManagerError> {
+        let mut keys = self.keys.lock().unwrap();
+        Ok(keys
+            .entry(key_pair_id)
+            .or_insert_with(|| {
+                let mut kp = KeyPair::generate_mock();
+                kp.state_key.0.fill(0x33);
+                kp
+            })
+            .clone())
+    }
+
+    fn get_public_key(&self, _key_pair_id: KeyPairId) -> Result<SignedPublicKey, KeyManagerError> {
+        Err(KeyManagerError::NotInitialized)
+    }
+
+    fn get_or_create_ephemeral_keys(
+        &self,
+        key_pair_id: KeyPairId,
+        _epoch: EpochTime,
+    ) -> Result<KeyPair, KeyManagerError> {
+        let mut ephemeral_keys = self.ephemeral_keys.lock().unwrap();
+        Ok(ephemeral_keys
+            .entry(key_pair_id)
+            .or_insert_with(|| {
+                let mut kp = KeyPair::generate_mock();
+                kp.state_key.0.fill(0x33);
+                kp
+            })
+            .clone())
+    }
+
+    fn get_public_ephemeral_key(
+        &self,
+        _key_pair_id: KeyPairId,
+        _epoch: EpochTime,
+    ) -> Result<SignedPublicKey, KeyManagerError> {
+        Err(KeyManagerError::NotInitialized)
+    }
+
+    fn box_clone(&self) -> Box<dyn KeyManager> {
+        Box::new(self.clone())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/testing/keys.rs.html b/rust/src/oasis_runtime_sdk/testing/keys.rs.html new file mode 100644 index 0000000000..72f4fad14b --- /dev/null +++ b/rust/src/oasis_runtime_sdk/testing/keys.rs.html @@ -0,0 +1,281 @@ +keys.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+
//! Module that contains known test keys.
+
+// TODO: Should be derived from seeds once implemented in the Rust version.
+
+/// Define an ed25519 test key.
+macro_rules! test_key_ed25519 {
+    ($doc:expr, $name:ident, $pk:expr) => {
+        #[doc = " Test key "]
+        #[doc=$doc]
+        #[doc = "."]
+        pub mod $name {
+            use crate::{
+                crypto::signature::{ed25519, PublicKey},
+                types::address::{Address, SignatureAddressSpec},
+            };
+
+            #[doc = " Test public key "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn pk() -> PublicKey {
+                PublicKey::Ed25519(pk_ed25519())
+            }
+
+            #[doc = " Test Ed25519 public key "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn pk_ed25519() -> ed25519::PublicKey {
+                $pk.into()
+            }
+
+            #[doc = " Test address derivation information "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn sigspec() -> SignatureAddressSpec {
+                SignatureAddressSpec::Ed25519(pk_ed25519())
+            }
+
+            #[doc = " Test address "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn address() -> Address {
+                Address::from_sigspec(&sigspec())
+            }
+        }
+    };
+}
+
+/// Define a secp256k1 test key.
+macro_rules! test_key_secp256k1 {
+    ($doc:expr, $name:ident, $pk:expr) => {
+        #[doc = " Test key "]
+        #[doc=$doc]
+        #[doc = "."]
+        pub mod $name {
+            use crate::{
+                crypto::signature::{secp256k1, PublicKey},
+                types::address::{Address, SignatureAddressSpec},
+            };
+
+            #[doc = " Test public key "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn pk() -> PublicKey {
+                PublicKey::Secp256k1(pk_secp256k1())
+            }
+
+            #[doc = " Test Secp256k1 public key "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn pk_secp256k1() -> secp256k1::PublicKey {
+                $pk.into()
+            }
+
+            #[doc = " Test address derivation information "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn sigspec() -> SignatureAddressSpec {
+                SignatureAddressSpec::Secp256k1Eth(pk_secp256k1())
+            }
+
+            #[doc = " Test address "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn address() -> Address {
+                Address::from_sigspec(&sigspec())
+            }
+        }
+    };
+}
+
+/// Define an sr25519 test key.
+macro_rules! test_key_sr25519 {
+    ($doc:expr, $name:ident, $pk:expr) => {
+        #[doc = " Test key "]
+        #[doc=$doc]
+        #[doc = "."]
+        pub mod $name {
+            use crate::{
+                crypto::signature::{sr25519, PublicKey},
+                types::address::{Address, SignatureAddressSpec},
+            };
+
+            #[doc = " Test public key "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn pk() -> PublicKey {
+                PublicKey::Sr25519(pk_sr25519())
+            }
+
+            #[doc = " Test Sr25519 public key "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn pk_sr25519() -> sr25519::PublicKey {
+                $pk.into()
+            }
+
+            #[doc = " Test address derivation information "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn sigspec() -> SignatureAddressSpec {
+                SignatureAddressSpec::Sr25519(pk_sr25519())
+            }
+
+            #[doc = " Test address "]
+            #[doc=$doc]
+            #[doc = "."]
+            pub fn address() -> Address {
+                Address::from_sigspec(&sigspec())
+            }
+        }
+    };
+}
+
+test_key_ed25519!("A", alice, "NcPzNW3YU2T+ugNUtUWtoQnRvbOL9dYSaBfbjHLP1pE=");
+test_key_ed25519!("B", bob, "YgkEiVSR4SMQdfXw+ppuFYlqH0seutnCKk8KG8PyAx0=");
+test_key_ed25519!("C", charlie, "8l1AQE+ETOPLckiNJ7NOD+AfZdaPw6wguir/vSF11YI=");
+test_key_secp256k1!("D", dave, "AwF6GNjbybMzhi3XRj5R1oTiMMkO1nAwB7NZAlH1X4BE");
+test_key_secp256k1!("E", erin, "A9i0oSK+5sLSONbMYGmaFUA+Fb8zzqYEMUMspacIgO09");
+test_key_sr25519!("F", frank, "ljm9ZwdAldhlyWM2B4C+3gQZis+ceaxnt6QA4rOcP0k=");
+test_key_sr25519!("G", grace, "0MHrNhjVTOFWmsOgpWcC3L8jIX3ZatKr0/yxMPtwckc=");
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/testing/mock.rs.html b/rust/src/oasis_runtime_sdk/testing/mock.rs.html new file mode 100644 index 0000000000..515794a186 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/testing/mock.rs.html @@ -0,0 +1,633 @@ +mock.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+
//! Mock dispatch context for use in tests.
+use std::collections::BTreeMap;
+
+use oasis_core_runtime::{
+    common::{crypto::mrae::deoxysii, namespace::Namespace, version::Version},
+    consensus::{beacon, roothash, state::ConsensusState, Event},
+    protocol::HostInfo,
+    storage::mkvs,
+    types::EventKind,
+};
+
+use crate::{
+    callformat,
+    context::{Context, RuntimeBatchContext},
+    dispatcher,
+    error::RuntimeError,
+    history,
+    keymanager::KeyManager,
+    module::MigrationHandler,
+    modules,
+    runtime::Runtime,
+    state::{self, CurrentState, TransactionResult},
+    storage::MKVSStore,
+    testing::{configmap, keymanager::MockKeyManagerClient},
+    types::{self, address::SignatureAddressSpec, transaction},
+};
+
+pub struct Config;
+
+impl modules::core::Config for Config {}
+
+/// A mock runtime that only has the core module.
+pub struct EmptyRuntime;
+
+impl Runtime for EmptyRuntime {
+    const VERSION: Version = Version::new(0, 0, 0);
+
+    type Core = modules::core::Module<Config>;
+
+    type Accounts = modules::accounts::Module;
+
+    type Modules = modules::core::Module<Config>;
+
+    fn genesis_state() -> <Self::Modules as MigrationHandler>::Genesis {
+        Default::default()
+    }
+}
+
+struct EmptyHistory;
+
+impl history::HistoryHost for EmptyHistory {
+    fn consensus_state_at(&self, _height: u64) -> Result<ConsensusState, history::Error> {
+        Err(history::Error::FailedToFetchBlock)
+    }
+
+    fn consensus_events_at(
+        &self,
+        _height: u64,
+        _kind: EventKind,
+    ) -> Result<Vec<Event>, history::Error> {
+        Err(history::Error::FailedToFetchEvents)
+    }
+}
+
+/// Mock dispatch context factory.
+pub struct Mock {
+    pub host_info: HostInfo,
+    pub runtime_header: roothash::Header,
+    pub runtime_round_results: roothash::RoundResults,
+    pub consensus_state: ConsensusState,
+    pub history: Box<dyn history::HistoryHost>,
+    pub epoch: beacon::EpochTime,
+
+    pub max_messages: u32,
+}
+
+impl Mock {
+    /// Create a new mock dispatch context.
+    pub fn create_ctx(&mut self) -> RuntimeBatchContext<'_, EmptyRuntime> {
+        self.create_ctx_for_runtime(false)
+    }
+
+    /// Create a new mock dispatch context.
+    pub fn create_ctx_for_runtime<R: Runtime>(
+        &mut self,
+        confidential: bool,
+    ) -> RuntimeBatchContext<'_, R> {
+        RuntimeBatchContext::new(
+            &self.host_info,
+            if confidential {
+                Some(Box::new(MockKeyManagerClient::new()) as Box<dyn KeyManager>)
+            } else {
+                None
+            },
+            &self.runtime_header,
+            &self.runtime_round_results,
+            &self.consensus_state,
+            &self.history,
+            self.epoch,
+            self.max_messages,
+        )
+    }
+
+    /// Create an instance with the given local configuration.
+    pub fn with_local_config(local_config: BTreeMap<String, cbor::Value>) -> Self {
+        // Ensure a current state is always available during tests. Note that one can always use a
+        // different store by calling `CurrentState::enter` explicitly.
+        CurrentState::init_local_fallback();
+
+        let consensus_tree = mkvs::Tree::builder()
+            .with_root_type(mkvs::RootType::State)
+            .build(Box::new(mkvs::sync::NoopReadSyncer));
+
+        Self {
+            host_info: HostInfo {
+                runtime_id: Namespace::default(),
+                consensus_backend: "mock".to_string(),
+                consensus_protocol_version: Version::default(),
+                consensus_chain_context: "test".to_string(),
+                local_config,
+            },
+            runtime_header: roothash::Header::default(),
+            runtime_round_results: roothash::RoundResults::default(),
+            consensus_state: ConsensusState::new(1, consensus_tree),
+            history: Box::new(EmptyHistory),
+            epoch: 1,
+            max_messages: 32,
+        }
+    }
+}
+
+impl Default for Mock {
+    fn default() -> Self {
+        let local_config_for_tests = configmap! {
+            // Allow expensive gas estimation and expensive queries so they can be tested.
+            "estimate_gas_by_simulating_contracts" => true,
+            "allowed_queries" => vec![
+                configmap! {"all_expensive" => true}
+            ],
+        };
+        Self::with_local_config(local_config_for_tests)
+    }
+}
+
+/// Create an empty MKVS store.
+pub fn empty_store() -> MKVSStore<mkvs::OverlayTree<mkvs::Tree>> {
+    let root = mkvs::OverlayTree::new(
+        mkvs::Tree::builder()
+            .with_root_type(mkvs::RootType::State)
+            .build(Box::new(mkvs::sync::NoopReadSyncer)),
+    );
+    MKVSStore::new(root)
+}
+
+/// Create a new mock transaction.
+pub fn transaction() -> transaction::Transaction {
+    transaction::Transaction {
+        version: 1,
+        call: transaction::Call {
+            format: transaction::CallFormat::Plain,
+            method: "mock".to_owned(),
+            body: cbor::Value::Simple(cbor::SimpleValue::NullValue),
+            ..Default::default()
+        },
+        auth_info: transaction::AuthInfo {
+            signer_info: vec![],
+            fee: transaction::Fee {
+                amount: Default::default(),
+                gas: 1_000_000,
+                consensus_messages: 32,
+                ..Default::default()
+            },
+            ..Default::default()
+        },
+    }
+}
+
+/// Options that can be used during mock signer calls.
+#[derive(Clone, Debug)]
+pub struct CallOptions {
+    /// Transaction fee.
+    pub fee: transaction::Fee,
+    /// Should the call be encrypted.
+    pub encrypted: bool,
+}
+
+impl Default for CallOptions {
+    fn default() -> Self {
+        Self {
+            fee: transaction::Fee {
+                amount: Default::default(),
+                gas: 1_000_000,
+                consensus_messages: 0,
+                ..Default::default()
+            },
+            encrypted: false,
+        }
+    }
+}
+
+/// A mock signer for use during tests.
+pub struct Signer {
+    nonce: u64,
+    sigspec: SignatureAddressSpec,
+}
+
+impl Signer {
+    /// Create a new mock signer using the given nonce and signature spec.
+    pub fn new(nonce: u64, sigspec: SignatureAddressSpec) -> Self {
+        Self { nonce, sigspec }
+    }
+
+    /// Address specification for this signer.
+    pub fn sigspec(&self) -> &SignatureAddressSpec {
+        &self.sigspec
+    }
+
+    /// Dispatch a call to the given method.
+    pub fn call<C, B>(&mut self, ctx: &C, method: &str, body: B) -> dispatcher::DispatchResult
+    where
+        C: Context,
+        B: cbor::Encode,
+    {
+        self.call_opts(ctx, method, body, Default::default())
+    }
+
+    /// Dispatch a call to the given method with the given options.
+    pub fn call_opts<C, B>(
+        &mut self,
+        ctx: &C,
+        method: &str,
+        body: B,
+        opts: CallOptions,
+    ) -> dispatcher::DispatchResult
+    where
+        C: Context,
+        B: cbor::Encode,
+    {
+        let mut call = transaction::Call {
+            format: transaction::CallFormat::Plain,
+            method: method.to_owned(),
+            body: cbor::to_value(body),
+            ..Default::default()
+        };
+        if opts.encrypted {
+            let key_pair = deoxysii::generate_key_pair();
+            let nonce = [0u8; deoxysii::NONCE_SIZE];
+            let km = ctx.key_manager().unwrap();
+            let epoch = ctx.epoch();
+            let runtime_keypair = km
+                .get_or_create_ephemeral_keys(callformat::get_key_pair_id(epoch), epoch)
+                .unwrap();
+            let runtime_pk = runtime_keypair.input_keypair.pk;
+            call = transaction::Call {
+                format: transaction::CallFormat::EncryptedX25519DeoxysII,
+                method: "".to_owned(),
+                body: cbor::to_value(types::callformat::CallEnvelopeX25519DeoxysII {
+                    pk: key_pair.0.into(),
+                    nonce,
+                    epoch,
+                    data: deoxysii::box_seal(
+                        &nonce,
+                        cbor::to_vec(call),
+                        vec![],
+                        &runtime_pk.0,
+                        &key_pair.1,
+                    )
+                    .unwrap(),
+                }),
+                ..Default::default()
+            }
+        };
+        let tx = transaction::Transaction {
+            version: 1,
+            call,
+            auth_info: transaction::AuthInfo {
+                signer_info: vec![transaction::SignerInfo::new_sigspec(
+                    self.sigspec.clone(),
+                    self.nonce,
+                )],
+                fee: opts.fee,
+                ..Default::default()
+            },
+        };
+
+        let result = dispatcher::Dispatcher::<C::Runtime>::dispatch_tx(ctx, 1024, tx, 0)
+            .expect("dispatch should work");
+
+        // Increment the nonce.
+        self.nonce += 1;
+
+        result
+    }
+
+    /// Dispatch a query to the given method.
+    pub fn query<C, A, R>(&self, ctx: &C, method: &str, args: A) -> Result<R, RuntimeError>
+    where
+        C: Context,
+        A: cbor::Encode,
+        R: cbor::Decode,
+    {
+        let result = CurrentState::with_transaction_opts(
+            state::Options::new().with_mode(state::Mode::Check),
+            || {
+                let result = dispatcher::Dispatcher::<C::Runtime>::dispatch_query(
+                    ctx,
+                    method,
+                    cbor::to_vec(args),
+                );
+
+                TransactionResult::Rollback(result)
+            },
+        )?;
+        Ok(cbor::from_slice(&result).expect("result should decode correctly"))
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/testing/mod.rs.html b/rust/src/oasis_runtime_sdk/testing/mod.rs.html new file mode 100644 index 0000000000..18f00db22d --- /dev/null +++ b/rust/src/oasis_runtime_sdk/testing/mod.rs.html @@ -0,0 +1,41 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+
//! Module which contains utilities useful for testing and development.
+
+pub mod keymanager;
+pub mod keys;
+pub mod mock;
+
+/// Constructs a BTreeMap where keys are coerced to strings, and values to cbor::Value.
+/// Syntax: `configmap! { "key" => value, ... }`.
+macro_rules! configmap {
+    // allow trailing comma
+    ( $($key:expr => $value:expr,)+ ) => (configmap!($($key => $value),+));
+    ( $($key:expr => $value:expr),* ) => {
+        {
+            let mut m = BTreeMap::new();
+            $( m.insert($key.to_string(), cbor::to_value($value)); )*
+            m
+        }
+    };
+}
+pub(crate) use configmap;
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/types/address.rs.html b/rust/src/oasis_runtime_sdk/types/address.rs.html new file mode 100644 index 0000000000..59e84e1649 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/types/address.rs.html @@ -0,0 +1,913 @@ +address.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+
//! Account address type.
+use std::{convert::TryFrom, fmt};
+
+use bech32::{Bech32, Hrp};
+use thiserror::Error;
+
+use oasis_core_runtime::{
+    common::{
+        crypto::{hash::Hash, signature::PublicKey as ConsensusPublicKey},
+        namespace::Namespace,
+    },
+    consensus::address::Address as ConsensusAddress,
+};
+
+use crate::crypto::{
+    multisig,
+    signature::{ed25519, secp256k1, sr25519, PublicKey},
+};
+
+const ADDRESS_VERSION_SIZE: usize = 1;
+const ADDRESS_DATA_SIZE: usize = 20;
+const ADDRESS_SIZE: usize = ADDRESS_VERSION_SIZE + ADDRESS_DATA_SIZE;
+
+/// V0 address version.
+pub const ADDRESS_V0_VERSION: u8 = 0;
+/// V0 Ed25519 addres context (shared with consensus layer).
+pub const ADDRESS_V0_ED25519_CONTEXT: &[u8] = b"oasis-core/address: staking";
+/// V0 Secp256k1 address context.
+pub const ADDRESS_V0_SECP256K1ETH_CONTEXT: &[u8] = b"oasis-runtime-sdk/address: secp256k1eth";
+/// V0 Sr25519 address context.
+pub const ADDRESS_V0_SR25519_CONTEXT: &[u8] = b"oasis-runtime-sdk/address: sr25519";
+
+/// V0 module address context.
+pub const ADDRESS_V0_MODULE_CONTEXT: &[u8] = b"oasis-runtime-sdk/address: module";
+
+/// V0 runtime address context.
+pub const ADDRESS_RUNTIME_V0_CONTEXT: &[u8] = b"oasis-core/address: runtime";
+/// V0 runtime address version.
+pub const ADDRESS_RUNTIME_V0_VERSION: u8 = 0;
+
+/// V0 multisig address context.
+pub const ADDRESS_V0_MULTISIG_CONTEXT: &[u8] = b"oasis-runtime-sdk/address: multisig";
+
+/// Human readable part for Bech32-encoded addresses.
+pub const ADDRESS_BECH32_HRP: Hrp = Hrp::parse_unchecked("oasis");
+
+/// Information for signature-based authentication and public key-based address derivation.
+#[derive(Clone, Debug, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+pub enum SignatureAddressSpec {
+    /// Ed25519 address derivation compatible with the consensus layer.
+    #[cbor(rename = "ed25519")]
+    Ed25519(ed25519::PublicKey),
+
+    /// Ethereum-compatible address derivation from Secp256k1 public keys.
+    #[cbor(rename = "secp256k1eth")]
+    Secp256k1Eth(secp256k1::PublicKey),
+
+    /// Sr25519 address derivation.
+    #[cbor(rename = "sr25519")]
+    Sr25519(sr25519::PublicKey),
+}
+
+impl SignatureAddressSpec {
+    /// Try to construct an authentication/address derivation specification from the given public
+    /// key. In case the given scheme is not supported, it returns `None`.
+    pub fn try_from_pk(pk: &PublicKey) -> Option<Self> {
+        match pk {
+            PublicKey::Ed25519(pk) => Some(Self::Ed25519(pk.clone())),
+            PublicKey::Secp256k1(pk) => Some(Self::Secp256k1Eth(pk.clone())),
+            PublicKey::Sr25519(pk) => Some(Self::Sr25519(pk.clone())),
+            _ => None,
+        }
+    }
+
+    /// Public key of the authentication/address derivation specification.
+    pub fn public_key(&self) -> PublicKey {
+        match self {
+            Self::Ed25519(pk) => PublicKey::Ed25519(pk.clone()),
+            Self::Secp256k1Eth(pk) => PublicKey::Secp256k1(pk.clone()),
+            Self::Sr25519(pk) => PublicKey::Sr25519(pk.clone()),
+        }
+    }
+}
+
+/// Error.
+#[derive(Error, Debug)]
+pub enum Error {
+    #[error("malformed address")]
+    MalformedAddress,
+}
+
+/// An account address.
+#[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub struct Address([u8; ADDRESS_SIZE]);
+
+impl Address {
+    /// Size of an address in bytes.
+    pub const SIZE: usize = ADDRESS_SIZE;
+
+    /// Creates a new address from a context, version and data.
+    pub fn new(ctx: &'static [u8], version: u8, data: &[u8]) -> Self {
+        let h = Hash::digest_bytes_list(&[ctx, &[version], data]);
+
+        let mut a = [0; ADDRESS_SIZE];
+        a[..ADDRESS_VERSION_SIZE].copy_from_slice(&[version]);
+        a[ADDRESS_VERSION_SIZE..].copy_from_slice(h.truncated(ADDRESS_DATA_SIZE));
+
+        Self(a)
+    }
+
+    /// Tries to create a new address from raw bytes.
+    pub fn from_bytes(data: &[u8]) -> Result<Self, Error> {
+        if data.len() != ADDRESS_SIZE {
+            return Err(Error::MalformedAddress);
+        }
+
+        let mut a = [0; ADDRESS_SIZE];
+        a.copy_from_slice(data);
+
+        Ok(Self(a))
+    }
+
+    /// Convert the address into raw bytes.
+    pub fn into_bytes(self) -> [u8; ADDRESS_SIZE] {
+        self.0
+    }
+
+    /// Creates a new address for a specific module and kind.
+    pub fn from_module(module: &str, kind: &str) -> Self {
+        Self::from_module_raw(module, kind.as_bytes())
+    }
+
+    /// Creates a new address for a specific module and raw kind.
+    pub fn from_module_raw(module: &str, kind: &[u8]) -> Self {
+        Self::new(
+            ADDRESS_V0_MODULE_CONTEXT,
+            ADDRESS_V0_VERSION,
+            &[module.as_bytes(), b".", kind].concat(),
+        )
+    }
+
+    /// Creates a new runtime address.
+    pub fn from_runtime_id(id: &Namespace) -> Self {
+        Self::new(
+            ADDRESS_RUNTIME_V0_CONTEXT,
+            ADDRESS_RUNTIME_V0_VERSION,
+            id.as_ref(),
+        )
+    }
+
+    /// Creates a new address from a public key.
+    pub fn from_sigspec(spec: &SignatureAddressSpec) -> Self {
+        match spec {
+            SignatureAddressSpec::Ed25519(pk) => Self::new(
+                ADDRESS_V0_ED25519_CONTEXT,
+                ADDRESS_V0_VERSION,
+                pk.as_bytes(),
+            ),
+            SignatureAddressSpec::Secp256k1Eth(pk) => Self::new(
+                ADDRESS_V0_SECP256K1ETH_CONTEXT,
+                ADDRESS_V0_VERSION,
+                // Use a scheme such that we can compute Secp256k1 addresses from Ethereum
+                // addresses as this makes things more interoperable.
+                &pk.to_eth_address(),
+            ),
+            SignatureAddressSpec::Sr25519(pk) => Self::new(
+                ADDRESS_V0_SR25519_CONTEXT,
+                ADDRESS_V0_VERSION,
+                pk.as_bytes(),
+            ),
+        }
+    }
+
+    /// Creates a new address from a multisig configuration.
+    pub fn from_multisig(config: multisig::Config) -> Self {
+        let config_vec = cbor::to_vec(config);
+        Self::new(ADDRESS_V0_MULTISIG_CONTEXT, ADDRESS_V0_VERSION, &config_vec)
+    }
+
+    /// Creates a new address from an Ethereum-compatible address.
+    pub fn from_eth(eth_address: &[u8]) -> Self {
+        Self::new(
+            ADDRESS_V0_SECP256K1ETH_CONTEXT,
+            ADDRESS_V0_VERSION,
+            eth_address,
+        )
+    }
+
+    /// Creates a new address from a consensus-layer Ed25519 public key.
+    ///
+    /// This is a convenience wrapper and the same result can be obtained by going via the
+    /// `from_sigspec` method using the same Ed25519 public key.
+    pub fn from_consensus_pk(pk: &ConsensusPublicKey) -> Self {
+        Self::from_bytes(ConsensusAddress::from_pk(pk).as_ref()).unwrap()
+    }
+
+    /// Tries to create a new address from Bech32-encoded string.
+    pub fn from_bech32(data: &str) -> Result<Self, Error> {
+        let (hrp, data) = bech32::decode(data).map_err(|_| Error::MalformedAddress)?;
+        if hrp != ADDRESS_BECH32_HRP {
+            return Err(Error::MalformedAddress);
+        }
+
+        Self::from_bytes(&data)
+    }
+
+    /// Converts an address to Bech32 representation.
+    pub fn to_bech32(self) -> String {
+        bech32::encode::<Bech32>(ADDRESS_BECH32_HRP, &self.0).unwrap()
+    }
+}
+
+impl AsRef<[u8]> for Address {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl TryFrom<&[u8]> for Address {
+    type Error = Error;
+
+    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> {
+        Self::from_bytes(bytes)
+    }
+}
+
+impl From<&'static str> for Address {
+    fn from(s: &'static str) -> Self {
+        Self::from_bech32(s).unwrap()
+    }
+}
+
+impl fmt::LowerHex for Address {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        for i in &self.0[..] {
+            write!(f, "{i:02x}")?;
+        }
+        Ok(())
+    }
+}
+
+impl fmt::Debug for Address {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "{}", self.to_bech32())?;
+        Ok(())
+    }
+}
+
+impl fmt::Display for Address {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "{}", self.to_bech32())?;
+        Ok(())
+    }
+}
+
+impl cbor::Encode for Address {
+    fn into_cbor_value(self) -> cbor::Value {
+        cbor::Value::ByteString(self.as_ref().to_vec())
+    }
+}
+
+impl cbor::Decode for Address {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Default::default())
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => {
+                Self::from_bytes(&data).map_err(|_| cbor::DecodeError::UnexpectedType)
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+impl slog::Value for Address {
+    fn serialize(
+        &self,
+        _record: &slog::Record<'_>,
+        key: slog::Key,
+        serializer: &mut dyn slog::Serializer,
+    ) -> slog::Result {
+        serializer.emit_str(key, &self.to_bech32())
+    }
+}
+
+impl From<Address> for ConsensusAddress {
+    fn from(addr: Address) -> ConsensusAddress {
+        ConsensusAddress::from(&addr.0)
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use base64::prelude::*;
+    use bech32::Bech32m;
+
+    use super::*;
+    use crate::testing::keys;
+
+    #[test]
+    fn test_address_ed25519() {
+        let spec =
+            SignatureAddressSpec::Ed25519("utrdHlX///////////////////////////////////8=".into());
+
+        let addr = Address::from_sigspec(&spec);
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qryqqccycvckcxp453tflalujvlf78xymcdqw4vz"
+        );
+    }
+
+    #[test]
+    fn test_address_secp256k1eth() {
+        let spec = SignatureAddressSpec::Secp256k1Eth(
+            "Arra3R5V////////////////////////////////////".into(),
+        );
+
+        let addr = Address::from_sigspec(&spec);
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qzd7akz24n6fxfhdhtk977s5857h3c6gf5583mcg"
+        );
+    }
+
+    #[test]
+    fn test_address_multisig() {
+        let config = multisig::Config {
+            signers: vec![
+                multisig::Signer {
+                    public_key: keys::alice::pk(),
+                    weight: 1,
+                },
+                multisig::Signer {
+                    public_key: keys::bob::pk(),
+                    weight: 1,
+                },
+            ],
+            threshold: 2,
+        };
+        let addr = Address::from_multisig(config);
+        assert_eq!(
+            addr,
+            Address::from_bech32("oasis1qpcprk8jxpsjxw9fadxvzrv9ln7td69yus8rmtux").unwrap(),
+        );
+    }
+
+    #[test]
+    fn test_address_try_from_bytes() {
+        let bytes_fixture = vec![42u8; ADDRESS_SIZE + 1];
+        assert_eq!(
+            Address::try_from(&bytes_fixture[0..ADDRESS_SIZE]).unwrap(),
+            Address::from_bytes(&bytes_fixture[0..ADDRESS_SIZE]).unwrap()
+        );
+        assert!(matches!(
+            Address::try_from(bytes_fixture.as_slice()).unwrap_err(),
+            Error::MalformedAddress
+        ));
+    }
+
+    #[test]
+    fn test_address_from_bech32_invalid_hrp() {
+        assert!(matches!(
+            Address::from_bech32("sisoa1qpcprk8jxpsjxw9fadxvzrv9ln7td69yus8rmtux").unwrap_err(),
+            Error::MalformedAddress,
+        ));
+    }
+
+    #[test]
+    fn test_address_from_bech32_variants() {
+        let b = vec![42u8; ADDRESS_SIZE];
+        let bech32_addr = bech32::encode::<Bech32>(ADDRESS_BECH32_HRP, &b).unwrap();
+        let bech32m_addr = bech32::encode::<Bech32m>(ADDRESS_BECH32_HRP, &b).unwrap();
+
+        assert!(
+            Address::from_bech32(&bech32_addr).is_ok(),
+            "bech32 address should be ok"
+        );
+        assert!(
+            Address::from_bech32(&bech32m_addr).is_ok(),
+            "bech32m address should be ok",
+        );
+    }
+
+    #[test]
+    fn test_address_into_consensus_address() {
+        let spec =
+            SignatureAddressSpec::Ed25519("utrdHlX///////////////////////////////////8=".into());
+        let addr = Address::from_sigspec(&spec);
+
+        let consensus_addr: ConsensusAddress = addr.into();
+        assert_eq!(addr.to_bech32(), consensus_addr.to_bech32())
+    }
+
+    #[test]
+    fn test_address_from_runtime_id() {
+        let runtime_id =
+            Namespace::from("80000000000000002aff7f6dfb62720cfd735f2b037b81572fad1b7937d826b3");
+        let addr = Address::from_runtime_id(&runtime_id);
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qpllh99nhwzrd56px4txvl26atzgg4f3a58jzzad"
+        );
+    }
+
+    #[test]
+    fn test_address_from_module() {
+        let id: u64 = 42;
+        let addr = Address::from_module_raw("contracts", &id.to_be_bytes());
+
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qq398yyk4wt2zxhtt8c66raynelgt6ngh5yq87xg"
+        );
+    }
+
+    #[test]
+    fn test_address_from_eth() {
+        let eth_address = hex::decode("dce075e1c39b1ae0b75d554558b6451a226ffe00").unwrap();
+        let addr = Address::from_eth(&eth_address);
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qrk58a6j2qn065m6p06jgjyt032f7qucy5wqeqpt"
+        );
+    }
+
+    #[test]
+    fn test_address_from_consensus_pk() {
+        // Same test vector as in `test_address_ed25519`.
+        let pk: ConsensusPublicKey = BASE64_STANDARD
+            .decode("utrdHlX///////////////////////////////////8=")
+            .unwrap()
+            .into();
+
+        let addr = Address::from_consensus_pk(&pk);
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qryqqccycvckcxp453tflalujvlf78xymcdqw4vz"
+        );
+    }
+
+    #[test]
+    fn test_address_raw() {
+        let eth_address = hex::decode("dce075e1c39b1ae0b75d554558b6451a226ffe00").unwrap();
+        let addr = Address::new(
+            ADDRESS_V0_SECP256K1ETH_CONTEXT,
+            ADDRESS_V0_VERSION,
+            &eth_address,
+        );
+        assert_eq!(
+            addr.to_bech32(),
+            "oasis1qrk58a6j2qn065m6p06jgjyt032f7qucy5wqeqpt"
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/types/callformat.rs.html b/rust/src/oasis_runtime_sdk/types/callformat.rs.html new file mode 100644 index 0000000000..c0069b1a83 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/types/callformat.rs.html @@ -0,0 +1,57 @@ +callformat.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+
//! Types related to call formats.
+use crate::core::common::crypto::{mrae::deoxysii, x25519};
+
+/// Call data key pair ID domain separation context base.
+pub const CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE: &[u8] = b"oasis-runtime-sdk/private: tx";
+
+/// A call envelope when using the EncryptedX25519DeoxysII format.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct CallEnvelopeX25519DeoxysII {
+    /// Caller's ephemeral public key used for X25519.
+    pub pk: x25519::PublicKey,
+    /// Nonce.
+    pub nonce: [u8; deoxysii::NONCE_SIZE],
+    /// Epoch of the ephemeral runtime key.
+    #[cbor(optional)]
+    pub epoch: u64,
+    /// Encrypted call data.
+    pub data: Vec<u8>,
+}
+
+/// A result envelope when using the EncryptedX25519DeoxysII format.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ResultEnvelopeX25519DeoxysII {
+    /// Nonce.
+    pub nonce: [u8; deoxysii::NONCE_SIZE],
+    /// Encrypted call data.
+    pub data: Vec<u8>,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/types/message.rs.html b/rust/src/oasis_runtime_sdk/types/message.rs.html new file mode 100644 index 0000000000..f1421ecc7a --- /dev/null +++ b/rust/src/oasis_runtime_sdk/types/message.rs.html @@ -0,0 +1,65 @@ +message.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+
use std::fmt::Debug;
+
+use oasis_core_runtime::consensus;
+
+/// Result of a message being processed by the consensus layer.
+pub type MessageEvent = consensus::roothash::MessageEvent;
+
+/// Handler name and context to be called after message is executed.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct MessageEventHookInvocation {
+    pub hook_name: String,
+    pub payload: cbor::Value,
+}
+
+impl MessageEventHookInvocation {
+    /// Constructs a new message hook invocation.
+    pub fn new<S: cbor::Encode>(name: String, payload: S) -> Self {
+        Self {
+            hook_name: name,
+            payload: cbor::to_value(payload),
+        }
+    }
+}
+
+/// Result of a message being processed by the consensus layer combined with the context for the
+/// result handler.
+#[derive(Clone, Debug)]
+pub struct MessageResult {
+    pub event: MessageEvent,
+    pub context: cbor::Value,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/types/mod.rs.html b/rust/src/oasis_runtime_sdk/types/mod.rs.html new file mode 100644 index 0000000000..7b945dbb49 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/types/mod.rs.html @@ -0,0 +1,15 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+
//! Types defined by the SDK.
+
+pub mod address;
+pub mod callformat;
+pub mod message;
+pub mod token;
+pub mod transaction;
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/types/token.rs.html b/rust/src/oasis_runtime_sdk/types/token.rs.html new file mode 100644 index 0000000000..1901586090 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/types/token.rs.html @@ -0,0 +1,329 @@ +token.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+
//! Token types.
+use std::{convert::TryFrom, fmt};
+
+/// Name/type of the token.
+#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, cbor::Encode)]
+#[cbor(transparent)]
+pub struct Denomination(Vec<u8>);
+
+impl Denomination {
+    /// Maximum length of a denomination.
+    pub const MAX_LENGTH: usize = 32;
+    /// Denomination in native token.
+    pub const NATIVE: Denomination = Denomination(Vec::new());
+
+    /// Whether the denomination represents the native token.
+    pub fn is_native(&self) -> bool {
+        self.0.is_empty()
+    }
+
+    /// Raw representation of a denomination.
+    pub fn into_vec(self) -> Vec<u8> {
+        self.0
+    }
+}
+
+impl AsRef<[u8]> for Denomination {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl fmt::Display for Denomination {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        if self.is_native() {
+            write!(f, "<native>")?;
+        } else {
+            write!(f, "{}", String::from_utf8_lossy(&self.0))?;
+        }
+        Ok(())
+    }
+}
+
+impl std::str::FromStr for Denomination {
+    type Err = Error;
+
+    fn from_str(v: &str) -> Result<Self, Self::Err> {
+        Self::try_from(v.as_bytes())
+    }
+}
+
+impl TryFrom<&[u8]> for Denomination {
+    type Error = Error;
+
+    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> {
+        if bytes.len() > Self::MAX_LENGTH {
+            return Err(Error::NameTooLong {
+                length: bytes.len(),
+            });
+        }
+        Ok(Self(bytes.to_vec()))
+    }
+}
+
+impl cbor::Decode for Denomination {
+    fn try_default() -> Result<Self, cbor::DecodeError> {
+        Ok(Default::default())
+    }
+
+    fn try_from_cbor_value(value: cbor::Value) -> Result<Self, cbor::DecodeError> {
+        match value {
+            cbor::Value::ByteString(data) => {
+                Self::try_from(data.as_ref()).map_err(|_| cbor::DecodeError::UnexpectedType)
+            }
+            _ => Err(cbor::DecodeError::UnexpectedType),
+        }
+    }
+}
+
+#[derive(Debug, thiserror::Error)]
+pub enum Error {
+    #[error(
+        "denomination name too long. received length {length} exceeded maximum of {}",
+        Denomination::MAX_LENGTH
+    )]
+    NameTooLong { length: usize },
+}
+
+/// Token amount of given denomination in base units.
+#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, cbor::Encode, cbor::Decode)]
+pub struct BaseUnits(pub u128, pub Denomination);
+
+impl BaseUnits {
+    /// Creates a new token amount of the given denomination.
+    pub const fn new(amount: u128, denomination: Denomination) -> Self {
+        BaseUnits(amount, denomination)
+    }
+
+    /// Token amount in base units.
+    pub fn amount(&self) -> u128 {
+        self.0
+    }
+
+    /// Denomination of the token amount.
+    pub fn denomination(&self) -> &Denomination {
+        &self.1
+    }
+}
+
+impl fmt::Display for BaseUnits {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        write!(f, "{} {}", self.0, self.1)?;
+        Ok(())
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn test_basic() {
+        let cases = vec![
+            // Native denomination.
+            (0, Denomination::NATIVE, "824040"),
+            (1, Denomination::NATIVE, "82410140"),
+            (1000, Denomination::NATIVE, "824203e840"),
+            // Custom denomination.
+            (0, "test".parse().unwrap(), "82404474657374"),
+            (1, "test".parse().unwrap(), "8241014474657374"),
+            (1000, "test".parse().unwrap(), "824203e84474657374"),
+        ];
+
+        for tc in cases {
+            let token = BaseUnits::new(tc.0, tc.1);
+            let enc = cbor::to_vec(token.clone());
+            assert_eq!(hex::encode(&enc), tc.2, "serialization should match");
+
+            let dec: BaseUnits = cbor::from_slice(&enc).expect("deserialization should succeed");
+            assert_eq!(dec, token, "serialization should round-trip");
+        }
+    }
+
+    #[test]
+    fn test_decoding_denomination() {
+        macro_rules! assert_rountrip_ok {
+            ($bytes:expr) => {
+                let enc = cbor::to_vec($bytes.to_vec());
+                let dec: Denomination = cbor::from_slice(&enc).unwrap();
+                assert_eq!(dec, Denomination::try_from($bytes).unwrap());
+                assert_eq!(dec.0, $bytes);
+            };
+        }
+
+        let bytes_fixture = vec![42u8; Denomination::MAX_LENGTH + 1];
+
+        assert_rountrip_ok!(&bytes_fixture[0..0]);
+        assert_rountrip_ok!(&bytes_fixture[0..1]);
+        assert_rountrip_ok!(&bytes_fixture[0..Denomination::MAX_LENGTH]);
+
+        // Too long denomination:
+        let dec_result: Result<Denomination, _> = cbor::from_slice(&cbor::to_vec(bytes_fixture));
+        assert!(dec_result.is_err());
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/types/transaction.rs.html b/rust/src/oasis_runtime_sdk/types/transaction.rs.html new file mode 100644 index 0000000000..629002a020 --- /dev/null +++ b/rust/src/oasis_runtime_sdk/types/transaction.rs.html @@ -0,0 +1,1279 @@ +transaction.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+
//! Transaction types.
+use anyhow::anyhow;
+use thiserror::Error;
+
+use crate::{
+    crypto::{
+        multisig,
+        signature::{self, PublicKey, Signature, Signer},
+    },
+    types::{
+        address,
+        address::{Address, SignatureAddressSpec},
+        token,
+    },
+};
+
+/// Transaction signature domain separation context base.
+pub const SIGNATURE_CONTEXT_BASE: &[u8] = b"oasis-runtime-sdk/tx: v0";
+/// The latest transaction format version.
+pub const LATEST_TRANSACTION_VERSION: u16 = 1;
+
+/// Error.
+#[derive(Debug, Error)]
+pub enum Error {
+    #[error("unsupported version")]
+    UnsupportedVersion,
+    #[error("malformed transaction: {0}")]
+    MalformedTransaction(anyhow::Error),
+    #[error("signer not found in transaction")]
+    SignerNotFound,
+    #[error("failed to sign: {0}")]
+    FailedToSign(#[from] signature::Error),
+}
+
+/// A container for data that authenticates a transaction.
+#[derive(Clone, Default, Debug, cbor::Encode, cbor::Decode)]
+pub enum AuthProof {
+    /// For _signature_ authentication.
+    #[cbor(rename = "signature")]
+    Signature(Signature),
+    /// For _multisig_ authentication.
+    #[cbor(rename = "multisig")]
+    Multisig(multisig::SignatureSetOwned),
+    /// A flag to use module-controlled decoding. The string is an encoding scheme name that a
+    /// module must handle. The scheme name must not be empty.
+    #[cbor(rename = "module")]
+    Module(String),
+
+    /// A non-serializable placeholder value.
+    #[cbor(skip)]
+    #[default]
+    Invalid,
+}
+
+/// An unverified signed transaction.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct UnverifiedTransaction(pub Vec<u8>, pub Vec<AuthProof>);
+
+impl UnverifiedTransaction {
+    /// Verify and deserialize the unverified transaction.
+    pub fn verify(self) -> Result<Transaction, Error> {
+        // Deserialize the inner body.
+        let body: Transaction =
+            cbor::from_slice(&self.0).map_err(|e| Error::MalformedTransaction(e.into()))?;
+        body.validate_basic()?;
+
+        // Basic structure validation.
+        if self.1.len() != body.auth_info.signer_info.len() {
+            return Err(Error::MalformedTransaction(anyhow!(
+                "unexpected number of auth proofs. expected {} but found {}",
+                body.auth_info.signer_info.len(),
+                self.1.len()
+            )));
+        }
+
+        // Verify all signatures.
+        let ctx = signature::context::get_chain_context_for(SIGNATURE_CONTEXT_BASE);
+        let mut public_keys = vec![];
+        let mut signatures = vec![];
+        for (si, auth_proof) in body.auth_info.signer_info.iter().zip(self.1.iter()) {
+            let (mut batch_pks, mut batch_sigs) = si.address_spec.batch(auth_proof)?;
+            public_keys.append(&mut batch_pks);
+            signatures.append(&mut batch_sigs);
+        }
+        PublicKey::verify_batch_multisig(&ctx, &self.0, &public_keys, &signatures)
+            .map_err(|e| Error::MalformedTransaction(e.into()))?;
+
+        Ok(body)
+    }
+}
+
+/// Transaction signer.
+pub struct TransactionSigner {
+    auth_info: AuthInfo,
+    ut: UnverifiedTransaction,
+}
+
+impl TransactionSigner {
+    /// Construct a new transaction signer for the given transaction.
+    pub fn new(tx: Transaction) -> Self {
+        let mut ts = Self {
+            auth_info: tx.auth_info.clone(),
+            ut: UnverifiedTransaction(cbor::to_vec(tx), vec![]),
+        };
+        ts.allocate_proofs();
+
+        ts
+    }
+
+    /// Allocate proof structures based on the specified authentication info in the transaction.
+    fn allocate_proofs(&mut self) {
+        if !self.ut.1.is_empty() {
+            return;
+        }
+
+        // Allocate proof slots.
+        self.ut
+            .1
+            .resize_with(self.auth_info.signer_info.len(), Default::default);
+
+        for (si, ap) in self.auth_info.signer_info.iter().zip(self.ut.1.iter_mut()) {
+            match (&si.address_spec, ap) {
+                (AddressSpec::Multisig(cfg), ap) => {
+                    // Allocate multisig slots.
+                    *ap = AuthProof::Multisig(vec![None; cfg.signers.len()]);
+                }
+                _ => continue,
+            }
+        }
+    }
+
+    /// Sign the transaction and append the signature.
+    ///
+    /// The signer must be specified in the `auth_info` field.
+    pub fn append_sign<S>(&mut self, signer: &S) -> Result<(), Error>
+    where
+        S: Signer + ?Sized,
+    {
+        let ctx = signature::context::get_chain_context_for(SIGNATURE_CONTEXT_BASE);
+        let signature = signer.sign(&ctx, &self.ut.0)?;
+
+        let mut matched = false;
+        for (si, ap) in self.auth_info.signer_info.iter().zip(self.ut.1.iter_mut()) {
+            match (&si.address_spec, ap) {
+                (AddressSpec::Signature(spec), ap) => {
+                    if spec.public_key() != signer.public_key() {
+                        continue;
+                    }
+
+                    matched = true;
+                    *ap = AuthProof::Signature(signature.clone());
+                }
+                (AddressSpec::Multisig(cfg), AuthProof::Multisig(ref mut sigs)) => {
+                    for (i, mss) in cfg.signers.iter().enumerate() {
+                        if mss.public_key != signer.public_key() {
+                            continue;
+                        }
+
+                        matched = true;
+                        sigs[i] = Some(signature.clone());
+                    }
+                }
+                _ => {
+                    return Err(Error::MalformedTransaction(anyhow!(
+                        "malformed address_spec"
+                    )))
+                }
+            }
+        }
+        if !matched {
+            return Err(Error::SignerNotFound);
+        }
+        Ok(())
+    }
+
+    /// Finalize the signing process and return the (signed) unverified transaction.
+    pub fn finalize(self) -> UnverifiedTransaction {
+        self.ut
+    }
+}
+
+/// Transaction.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Transaction {
+    #[cbor(rename = "v")]
+    pub version: u16,
+
+    pub call: Call,
+
+    #[cbor(rename = "ai")]
+    pub auth_info: AuthInfo,
+}
+
+impl Transaction {
+    /// Create a new (unsigned) transaction.
+    pub fn new<B>(method: &str, body: B) -> Self
+    where
+        B: cbor::Encode,
+    {
+        Self {
+            version: LATEST_TRANSACTION_VERSION,
+            call: Call {
+                format: CallFormat::Plain,
+                method: method.to_string(),
+                body: cbor::to_value(body),
+                ..Default::default()
+            },
+            auth_info: Default::default(),
+        }
+    }
+
+    /// Prepare this transaction for signing.
+    pub fn prepare_for_signing(self) -> TransactionSigner {
+        TransactionSigner::new(self)
+    }
+
+    /// Maximum amount of gas that the transaction can use.
+    pub fn fee_gas(&self) -> u64 {
+        self.auth_info.fee.gas
+    }
+
+    /// Set maximum amount of gas that the transaction can use.
+    pub fn set_fee_gas(&mut self, gas: u64) {
+        self.auth_info.fee.gas = gas;
+    }
+
+    /// Amount of fee to pay for transaction execution.
+    pub fn fee_amount(&self) -> &token::BaseUnits {
+        &self.auth_info.fee.amount
+    }
+
+    /// Set amount of fee to pay for transaction execution.
+    pub fn set_fee_amount(&mut self, amount: token::BaseUnits) {
+        self.auth_info.fee.amount = amount;
+    }
+
+    /// Set a proxy for paying the transaction fee.
+    pub fn set_fee_proxy(&mut self, module: &str, id: &[u8]) {
+        self.auth_info.fee.proxy = Some(FeeProxy {
+            module: module.to_string(),
+            id: id.to_vec(),
+        });
+    }
+
+    /// Append a new transaction signer information to the transaction.
+    pub fn append_signer_info(&mut self, address_spec: AddressSpec, nonce: u64) {
+        self.auth_info.signer_info.push(SignerInfo {
+            address_spec,
+            nonce,
+        })
+    }
+
+    /// Append a new transaction signer information with a signature address specification to the
+    /// transaction.
+    pub fn append_auth_signature(&mut self, spec: SignatureAddressSpec, nonce: u64) {
+        self.append_signer_info(AddressSpec::Signature(spec), nonce);
+    }
+
+    /// Append a new transaction signer information with a multisig address specification to the
+    /// transaction.
+    pub fn append_auth_multisig(&mut self, cfg: multisig::Config, nonce: u64) {
+        self.append_signer_info(AddressSpec::Multisig(cfg), nonce);
+    }
+
+    /// Perform basic validation on the transaction.
+    pub fn validate_basic(&self) -> Result<(), Error> {
+        if self.version != LATEST_TRANSACTION_VERSION {
+            return Err(Error::UnsupportedVersion);
+        }
+        if self.auth_info.signer_info.is_empty() {
+            return Err(Error::MalformedTransaction(anyhow!(
+                "transaction has no signers"
+            )));
+        }
+        Ok(())
+    }
+}
+
+/// Format used for encoding the call (and output) information.
+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+#[cbor(with_default)]
+pub enum CallFormat {
+    /// Plain text call data.
+    #[default]
+    Plain = 0,
+    /// Encrypted call data using X25519 for key exchange and Deoxys-II for symmetric encryption.
+    EncryptedX25519DeoxysII = 1,
+}
+
+/// Method call.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub struct Call {
+    /// Call format.
+    #[cbor(optional)]
+    pub format: CallFormat,
+    /// Method name.
+    #[cbor(optional)]
+    pub method: String,
+    /// Method body.
+    pub body: cbor::Value,
+    /// Read-only flag.
+    ///
+    /// A read-only call cannot make any changes to runtime state. Any attempt at modifying state
+    /// will result in the call failing.
+    #[cbor(optional, rename = "ro")]
+    pub read_only: bool,
+}
+
+impl Default for Call {
+    fn default() -> Self {
+        Self {
+            format: Default::default(),
+            method: Default::default(),
+            body: cbor::Value::Simple(cbor::SimpleValue::NullValue),
+            read_only: false,
+        }
+    }
+}
+
+/// Transaction authentication information.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct AuthInfo {
+    /// Transaction signer information.
+    #[cbor(rename = "si")]
+    pub signer_info: Vec<SignerInfo>,
+    /// Fee payment information.
+    pub fee: Fee,
+    /// Earliest round when the transaction is valid.
+    #[cbor(optional)]
+    pub not_before: Option<u64>,
+    /// Latest round when the transaction is valid.
+    #[cbor(optional)]
+    pub not_after: Option<u64>,
+}
+
+/// Transaction fee.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Fee {
+    /// Amount of base units paid as fee for transaction processing.
+    pub amount: token::BaseUnits,
+    /// Maximum amount of gas paid for.
+    #[cbor(optional)]
+    pub gas: u64,
+    /// Maximum amount of emitted consensus messages paid for. Zero means that up to the maximum
+    /// number of per-batch messages can be emitted.
+    #[cbor(optional)]
+    pub consensus_messages: u32,
+    /// Proxy which has authorized the fees to be paid.
+    #[cbor(optional)]
+    pub proxy: Option<FeeProxy>,
+}
+
+impl Fee {
+    /// Calculates gas price from fee amount and gas.
+    pub fn gas_price(&self) -> u128 {
+        self.amount
+            .amount()
+            .checked_div(self.gas.into())
+            .unwrap_or_default()
+    }
+}
+
+/// Information about a fee proxy.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct FeeProxy {
+    /// Module that will handle the proxy payment.
+    pub module: String,
+    /// Module-specific identifier that will handle fee payments for the transaction signer.
+    pub id: Vec<u8>,
+}
+
+/// A caller address.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum CallerAddress {
+    #[cbor(rename = "address")]
+    Address(Address),
+    #[cbor(rename = "eth_address")]
+    EthAddress([u8; 20]),
+}
+
+impl CallerAddress {
+    /// Derives the address.
+    pub fn address(&self) -> Address {
+        match self {
+            CallerAddress::Address(address) => *address,
+            CallerAddress::EthAddress(address) => Address::new(
+                address::ADDRESS_V0_SECP256K1ETH_CONTEXT,
+                address::ADDRESS_V0_VERSION,
+                address.as_ref(),
+            ),
+        }
+    }
+
+    /// Maps the caller address to one of the same type but with an all-zero address.
+    pub fn zeroized(&self) -> Self {
+        match self {
+            CallerAddress::Address(_) => CallerAddress::Address(Default::default()),
+            CallerAddress::EthAddress(_) => CallerAddress::EthAddress(Default::default()),
+        }
+    }
+}
+
+/// Common information that specifies an address as well as how to authenticate.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum AddressSpec {
+    /// For _signature_ authentication.
+    #[cbor(rename = "signature")]
+    Signature(SignatureAddressSpec),
+    /// For _multisig_ authentication.
+    #[cbor(rename = "multisig")]
+    Multisig(multisig::Config),
+
+    /// For internal child calls (cannot be serialized/deserialized).
+    #[cbor(skip)]
+    Internal(CallerAddress),
+}
+
+impl AddressSpec {
+    /// Returns the public key when the address spec represents a single public key.
+    pub fn public_key(&self) -> Option<PublicKey> {
+        match self {
+            AddressSpec::Signature(spec) => Some(spec.public_key()),
+            _ => None,
+        }
+    }
+
+    /// Derives the address.
+    pub fn address(&self) -> Address {
+        match self {
+            AddressSpec::Signature(spec) => Address::from_sigspec(spec),
+            AddressSpec::Multisig(config) => Address::from_multisig(config.clone()),
+            AddressSpec::Internal(caller) => caller.address(),
+        }
+    }
+
+    /// Derives the caller address.
+    pub fn caller_address(&self) -> CallerAddress {
+        match self {
+            AddressSpec::Signature(SignatureAddressSpec::Secp256k1Eth(pk)) => {
+                CallerAddress::EthAddress(pk.to_eth_address().try_into().unwrap())
+            }
+            AddressSpec::Internal(caller) => caller.clone(),
+            _ => CallerAddress::Address(self.address()),
+        }
+    }
+
+    /// Checks that the address specification and the authentication proof are acceptable.
+    /// Returns vectors of public keys and signatures for batch verification of included signatures.
+    pub fn batch(&self, auth_proof: &AuthProof) -> Result<(Vec<PublicKey>, Vec<Signature>), Error> {
+        match (self, auth_proof) {
+            (AddressSpec::Signature(spec), AuthProof::Signature(signature)) => {
+                Ok((vec![spec.public_key()], vec![signature.clone()]))
+            }
+            (AddressSpec::Multisig(config), AuthProof::Multisig(signature_set)) => Ok(config
+                .batch(signature_set)
+                .map_err(|e| Error::MalformedTransaction(e.into()))?),
+            (AddressSpec::Signature(_), AuthProof::Multisig(_)) => {
+                Err(Error::MalformedTransaction(anyhow!(
+                    "transaction signer used a single signature, but auth proof was multisig"
+                )))
+            }
+            (AddressSpec::Multisig(_), AuthProof::Signature(_)) => {
+                Err(Error::MalformedTransaction(anyhow!(
+                    "transaction signer used multisig, but auth proof was a single signature"
+                )))
+            }
+            (AddressSpec::Internal(_), _) => Err(Error::MalformedTransaction(anyhow!(
+                "transaction signer used internal address spec"
+            ))),
+            (_, AuthProof::Module(_)) => Err(Error::MalformedTransaction(anyhow!(
+                "module-controlled decoding flag in auth proof list"
+            ))),
+            (_, AuthProof::Invalid) => Err(Error::MalformedTransaction(anyhow!(
+                "invalid auth proof in list"
+            ))),
+        }
+    }
+}
+
+/// Transaction signer information.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct SignerInfo {
+    pub address_spec: AddressSpec,
+    pub nonce: u64,
+}
+
+impl SignerInfo {
+    /// Create a new signer info from a signature address specification and nonce.
+    pub fn new_sigspec(spec: SignatureAddressSpec, nonce: u64) -> Self {
+        Self {
+            address_spec: AddressSpec::Signature(spec),
+            nonce,
+        }
+    }
+
+    /// Create a new signer info from a multisig configuration and a nonce.
+    pub fn new_multisig(config: multisig::Config, nonce: u64) -> Self {
+        Self {
+            address_spec: AddressSpec::Multisig(config),
+            nonce,
+        }
+    }
+}
+
+/// Call result.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub enum CallResult {
+    #[cbor(rename = "ok")]
+    Ok(cbor::Value),
+
+    #[cbor(rename = "fail")]
+    Failed {
+        module: String,
+        code: u32,
+
+        #[cbor(optional)]
+        message: String,
+    },
+
+    #[cbor(rename = "unknown")]
+    Unknown(cbor::Value),
+}
+
+impl Default for CallResult {
+    fn default() -> Self {
+        Self::Unknown(cbor::Value::Simple(cbor::SimpleValue::NullValue))
+    }
+}
+
+impl CallResult {
+    /// Check whether the call result indicates a successful operation or not.
+    pub fn is_success(&self) -> bool {
+        !matches!(self, CallResult::Failed { .. })
+    }
+
+    /// Transforms `CallResult` into `anyhow::Result<cbor::Value>`, mapping `Ok(v)` and `Unknown(v)`
+    /// to `Ok(v)` and `Failed` to `Err`.
+    pub fn ok(self) -> anyhow::Result<cbor::Value> {
+        match self {
+            Self::Ok(v) | Self::Unknown(v) => Ok(v),
+            Self::Failed {
+                module,
+                code,
+                message,
+            } => Err(anyhow!(
+                "call failed: module={module} code={code}: {message}"
+            )),
+        }
+    }
+}
+
+#[cfg(any(test, feature = "test"))]
+impl CallResult {
+    pub fn unwrap(self) -> cbor::Value {
+        match self {
+            Self::Ok(v) | Self::Unknown(v) => v,
+            Self::Failed {
+                module,
+                code,
+                message,
+            } => panic!("{module} reported failure with code {code}: {message}"),
+        }
+    }
+
+    pub fn unwrap_failed(self) -> (String, u32) {
+        match self {
+            Self::Ok(_) | Self::Unknown(_) => panic!("call result indicates success"),
+            Self::Failed { module, code, .. } => (module, code),
+        }
+    }
+
+    pub fn into_call_result(self) -> Option<crate::module::CallResult> {
+        Some(match self {
+            Self::Ok(v) => crate::module::CallResult::Ok(v),
+            Self::Failed {
+                module,
+                code,
+                message,
+            } => crate::module::CallResult::Failed {
+                module,
+                code,
+                message,
+            },
+            Self::Unknown(_) => return None,
+        })
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use crate::types::token::{BaseUnits, Denomination};
+
+    use super::*;
+
+    #[test]
+    fn test_fee_gas_price() {
+        let fee = Fee::default();
+        assert_eq!(0, fee.gas_price(), "empty fee - gas price should be zero",);
+
+        let fee = Fee {
+            gas: 100,
+            ..Default::default()
+        };
+        assert_eq!(
+            0,
+            fee.gas_price(),
+            "empty fee amount - gas price should be zero",
+        );
+
+        let fee = Fee {
+            amount: BaseUnits::new(1_000, Denomination::NATIVE),
+            gas: 0,
+            ..Default::default()
+        };
+        assert_eq!(0, fee.gas_price(), "empty fee 0 - gas price should be zero",);
+
+        let fee = Fee {
+            amount: BaseUnits::new(1_000, Denomination::NATIVE),
+            gas: 10_000,
+            ..Default::default()
+        };
+        assert_eq!(
+            0,
+            fee.gas_price(),
+            "non empty fee - gas price should be zero"
+        );
+
+        let fee = Fee {
+            amount: BaseUnits::new(1_000, Denomination::NATIVE),
+            gas: 500,
+            ..Default::default()
+        };
+        assert_eq!(2, fee.gas_price(), "non empty fee - gas price should match");
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/abi/gas.rs.html b/rust/src/oasis_runtime_sdk_contracts/abi/gas.rs.html new file mode 100644 index 0000000000..7961ab3a95 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/abi/gas.rs.html @@ -0,0 +1,1305 @@ +gas.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+
//! Gas metering instrumentation.
+use std::collections::BTreeMap;
+
+use walrus::{ir::*, FunctionBuilder, GlobalId, LocalFunction, Module};
+
+use crate::Error;
+
+/// Name of the exported global that holds the gas limit.
+pub const EXPORT_GAS_LIMIT: &str = "gas_limit";
+/// Name of the exported global that holds the gas limit exhausted flag.
+pub const EXPORT_GAS_LIMIT_EXHAUSTED: &str = "gas_limit_exhausted";
+
+/// Configures the gas limit on the given instance.
+pub fn set_gas_limit<C>(
+    instance: &wasm3::Instance<'_, '_, C>,
+    gas_limit: u64,
+) -> Result<(), Error> {
+    instance
+        .set_global(EXPORT_GAS_LIMIT, gas_limit)
+        .map_err(|err| Error::ExecutionFailed(err.into()))
+}
+
+/// Returns the remaining gas.
+pub fn get_remaining_gas<C>(instance: &wasm3::Instance<'_, '_, C>) -> u64 {
+    instance.get_global(EXPORT_GAS_LIMIT).unwrap_or_default()
+}
+
+/// Returns the amount of gas requested that was over the limit.
+pub fn get_exhausted_amount<C>(instance: &wasm3::Instance<'_, '_, C>) -> u64 {
+    instance
+        .get_global(EXPORT_GAS_LIMIT_EXHAUSTED)
+        .unwrap_or_default()
+}
+
+/// Attempts to use the given amount of gas.
+pub fn use_gas<C>(instance: &wasm3::Instance<'_, '_, C>, amount: u64) -> Result<(), wasm3::Trap> {
+    let gas_limit: u64 = instance
+        .get_global(EXPORT_GAS_LIMIT)
+        .map_err(|_| wasm3::Trap::Abort)?;
+    if gas_limit < amount {
+        let _ = instance.set_global(EXPORT_GAS_LIMIT_EXHAUSTED, amount);
+        return Err(wasm3::Trap::Abort);
+    }
+    instance
+        .set_global(EXPORT_GAS_LIMIT, gas_limit - amount)
+        .map_err(|_| wasm3::Trap::Abort)?;
+    Ok(())
+}
+
+/// Inject gas metering instrumentation into the module.
+pub fn transform(module: &mut Module) {
+    let gas_limit_global = module.globals.add_local(
+        walrus::ValType::I64,
+        true,
+        walrus::InitExpr::Value(Value::I64(0)),
+    );
+    let gas_limit_exhausted_global = module.globals.add_local(
+        walrus::ValType::I64,
+        true,
+        walrus::InitExpr::Value(Value::I64(0)),
+    );
+    module.exports.add(EXPORT_GAS_LIMIT, gas_limit_global);
+    module
+        .exports
+        .add(EXPORT_GAS_LIMIT_EXHAUSTED, gas_limit_exhausted_global);
+
+    for (_, func) in module.funcs.iter_local_mut() {
+        transform_function(func, gas_limit_global, gas_limit_exhausted_global);
+    }
+}
+
+/// Instruction cost function.
+fn instruction_cost(instr: &Instr) -> u64 {
+    match instr {
+        Instr::Loop(_) | Instr::Block(_) => 2,
+
+        Instr::LocalGet(_)
+        | Instr::LocalSet(_)
+        | Instr::LocalTee(_)
+        | Instr::GlobalGet(_)
+        | Instr::GlobalSet(_)
+        | Instr::Const(_) => 1,
+
+        Instr::Call(_) => 15,
+
+        Instr::CallIndirect(_) => 20,
+
+        Instr::Br(_) | Instr::BrIf(_) => 3,
+        Instr::BrTable(_) => 4,
+
+        Instr::Binop(op) => match op.op {
+            BinaryOp::I32Eq
+            | BinaryOp::I32Ne
+            | BinaryOp::I32LtS
+            | BinaryOp::I32LtU
+            | BinaryOp::I32GtS
+            | BinaryOp::I32GtU
+            | BinaryOp::I32LeS
+            | BinaryOp::I32LeU
+            | BinaryOp::I32GeS
+            | BinaryOp::I32GeU
+            | BinaryOp::I64Eq
+            | BinaryOp::I64Ne
+            | BinaryOp::I64LtS
+            | BinaryOp::I64LtU
+            | BinaryOp::I64GtS
+            | BinaryOp::I64GtU
+            | BinaryOp::I64LeS
+            | BinaryOp::I64LeU
+            | BinaryOp::I64GeS
+            | BinaryOp::I64GeU
+            | BinaryOp::I32Add
+            | BinaryOp::I32Sub
+            | BinaryOp::I32Mul
+            | BinaryOp::I32And
+            | BinaryOp::I32Or
+            | BinaryOp::I32Xor
+            | BinaryOp::I32Shl
+            | BinaryOp::I32ShrS
+            | BinaryOp::I32ShrU
+            | BinaryOp::I32Rotl
+            | BinaryOp::I32Rotr
+            | BinaryOp::I64Add
+            | BinaryOp::I64Sub
+            | BinaryOp::I64Mul
+            | BinaryOp::I64And
+            | BinaryOp::I64Or
+            | BinaryOp::I64Xor
+            | BinaryOp::I64Shl
+            | BinaryOp::I64ShrS
+            | BinaryOp::I64ShrU
+            | BinaryOp::I64Rotl
+            | BinaryOp::I64Rotr => 1,
+            BinaryOp::I32DivS
+            | BinaryOp::I32DivU
+            | BinaryOp::I32RemS
+            | BinaryOp::I32RemU
+            | BinaryOp::I64DivS
+            | BinaryOp::I64DivU
+            | BinaryOp::I64RemS
+            | BinaryOp::I64RemU => 4,
+            _ => 3,
+        },
+
+        Instr::Unop(op) => match op.op {
+            UnaryOp::I32Eqz
+            | UnaryOp::I32Clz
+            | UnaryOp::I32Ctz
+            | UnaryOp::I32Popcnt
+            | UnaryOp::I64Eqz
+            | UnaryOp::I64Clz
+            | UnaryOp::I64Ctz
+            | UnaryOp::I64Popcnt => 1,
+
+            _ => 3,
+        },
+
+        _ => 10,
+    }
+}
+
+/// A block of instructions which is metered.
+#[derive(Debug)]
+struct MeteredBlock {
+    /// Instruction sequence where metering code should be injected.
+    seq_id: InstrSeqId,
+    /// Start index of instruction within the instruction sequence before which the metering code
+    /// should be injected.
+    start_index: usize,
+    /// Instruction cost.
+    cost: u64,
+    /// Indication of whether the metered block can be merged in case instruction sequence and start
+    /// index match. In case the block cannot be merged this contains the index
+    merge_index: Option<usize>,
+}
+
+impl MeteredBlock {
+    fn new(seq_id: InstrSeqId, start_index: usize) -> Self {
+        Self {
+            seq_id,
+            start_index,
+            cost: 0,
+            merge_index: None,
+        }
+    }
+
+    /// Create a mergable version of this metered block with the given start index.
+    fn mergable(&self, start_index: usize) -> Self {
+        Self {
+            seq_id: self.seq_id,
+            start_index,
+            cost: 0,
+            merge_index: Some(self.start_index),
+        }
+    }
+}
+
+/// A map of finalized metered blocks.
+#[derive(Default)]
+struct MeteredBlocks {
+    blocks: BTreeMap<InstrSeqId, Vec<MeteredBlock>>,
+}
+
+impl MeteredBlocks {
+    /// Finalize the given metered block. This means that the cost associated with the block cannot
+    /// change anymore.
+    fn finalize(&mut self, block: MeteredBlock) {
+        if block.cost > 0 {
+            self.blocks.entry(block.seq_id).or_default().push(block);
+        }
+    }
+}
+
+fn determine_metered_blocks(func: &LocalFunction) -> BTreeMap<InstrSeqId, Vec<MeteredBlock>> {
+    // NOTE: This is based on walrus::ir::dfs_in_order but we need more information.
+
+    let mut blocks = MeteredBlocks::default();
+    let mut stack: Vec<(InstrSeqId, usize, MeteredBlock)> = vec![(
+        func.entry_block(),                       // Initial instruction sequence to visit.
+        0,                                        // Instruction offset within the sequence.
+        MeteredBlock::new(func.entry_block(), 0), // Initial metered block.
+    )];
+
+    'traversing_blocks: while let Some((seq_id, index, mut metered_block)) = stack.pop() {
+        let seq = func.block(seq_id);
+
+        'traversing_instrs: for (index, (instr, _)) in seq.instrs.iter().enumerate().skip(index) {
+            // NOTE: Current instruction is always included in the current metered block.
+            metered_block.cost += instruction_cost(instr);
+
+            // Determine whether we need to end/start a metered block.
+            match instr {
+                Instr::Block(Block { seq }) => {
+                    // Do not start a new metered block as blocks are unconditional and metered
+                    // blocks can encompass many of them to avoid injecting unnecessary
+                    // instructions.
+                    stack.push((seq_id, index + 1, metered_block.mergable(index + 1)));
+                    stack.push((*seq, 0, metered_block));
+                    continue 'traversing_blocks;
+                }
+
+                Instr::Loop(Loop { seq }) => {
+                    // Finalize current metered block.
+                    blocks.finalize(metered_block);
+                    // Start a new metered block for remainder of block.
+                    stack.push((seq_id, index + 1, MeteredBlock::new(seq_id, index + 1)));
+                    // Start a new metered block for loop body.
+                    stack.push((*seq, 0, MeteredBlock::new(*seq, 0)));
+                    continue 'traversing_blocks;
+                }
+
+                Instr::IfElse(IfElse {
+                    consequent,
+                    alternative,
+                }) => {
+                    // Finalize current metered block.
+                    blocks.finalize(metered_block);
+
+                    // Start a new metered block for remainder of block.
+                    stack.push((seq_id, index + 1, MeteredBlock::new(seq_id, index + 1)));
+                    // Start new metered blocks for alternative and consequent blocks.
+                    stack.push((*alternative, 0, MeteredBlock::new(*alternative, 0)));
+                    stack.push((*consequent, 0, MeteredBlock::new(*consequent, 0)));
+                    continue 'traversing_blocks;
+                }
+
+                Instr::Call(_)
+                | Instr::CallIndirect(_)
+                | Instr::Br(_)
+                | Instr::BrIf(_)
+                | Instr::BrTable(_)
+                | Instr::Return(_) => {
+                    // Finalize current metered block and start a new one for the remainder.
+                    blocks.finalize(std::mem::replace(
+                        &mut metered_block,
+                        MeteredBlock::new(seq_id, index + 1),
+                    ));
+                    continue 'traversing_instrs;
+                }
+
+                _ => continue 'traversing_instrs,
+            }
+        }
+
+        // Check if we can merge the blocks.
+        if let Some((_, _, upper)) = stack.last_mut() {
+            match upper.merge_index {
+                Some(index)
+                    if upper.seq_id == metered_block.seq_id
+                        && index == metered_block.start_index =>
+                {
+                    // Blocks can be merged, so overwrite upper.
+                    *upper = metered_block;
+                    continue 'traversing_blocks;
+                }
+                _ => {
+                    // Blocks cannot be merged so treat as new block.
+                }
+            }
+        }
+
+        blocks.finalize(metered_block);
+    }
+
+    blocks.blocks
+}
+
+fn transform_function(
+    func: &mut LocalFunction,
+    gas_limit_global: GlobalId,
+    gas_limit_exhausted_global: GlobalId,
+) {
+    // First pass: determine where metering instructions should be injected.
+    let blocks = determine_metered_blocks(func);
+
+    // Second pass: actually emit metering instructions in correct positions.
+    let builder = func.builder_mut();
+    for (seq_id, blocks) in blocks {
+        let mut seq = builder.instr_seq(seq_id);
+        let instrs = seq.instrs_mut();
+
+        let original_instrs = std::mem::take(instrs);
+        let new_instrs_len = instrs.len() + METERING_INSTRUCTION_COUNT * blocks.len();
+        let mut new_instrs = Vec::with_capacity(new_instrs_len);
+
+        let mut block_iter = blocks.into_iter().peekable();
+        for (index, (instr, loc)) in original_instrs.into_iter().enumerate() {
+            match block_iter.peek() {
+                Some(block) if block.start_index == index => {
+                    inject_metering(
+                        builder,
+                        &mut new_instrs,
+                        block_iter.next().unwrap(),
+                        gas_limit_global,
+                        gas_limit_exhausted_global,
+                    );
+                }
+                _ => {}
+            }
+
+            // Push original instruction.
+            new_instrs.push((instr, loc));
+        }
+
+        let mut seq = builder.instr_seq(seq_id);
+        let instrs = seq.instrs_mut();
+        *instrs = new_instrs;
+    }
+}
+
+/// Number of injected metering instructions (needed to calculate final instruction size).
+const METERING_INSTRUCTION_COUNT: usize = 8;
+
+fn inject_metering(
+    builder: &mut FunctionBuilder,
+    instrs: &mut Vec<(Instr, InstrLocId)>,
+    block: MeteredBlock,
+    gas_limit_global: GlobalId,
+    gas_limit_exhausted_global: GlobalId,
+) {
+    let mut builder = builder.dangling_instr_seq(None);
+    let seq = builder
+        // if unsigned(globals[gas_limit]) < unsigned(block.cost) { throw(); }
+        .global_get(gas_limit_global)
+        .i64_const(block.cost as i64)
+        .binop(BinaryOp::I64LtU)
+        .if_else(
+            None,
+            |then| {
+                then.i64_const(block.cost as i64)
+                    .global_set(gas_limit_exhausted_global)
+                    .unreachable();
+            },
+            |_else| {},
+        )
+        // globals[gas_limit] -= block.cost;
+        .global_get(gas_limit_global)
+        .i64_const(block.cost as i64)
+        .binop(BinaryOp::I64Sub)
+        .global_set(gas_limit_global);
+
+    instrs.append(seq.instrs_mut());
+}
+
+#[cfg(test)]
+mod test {
+    use pretty_assertions::assert_eq;
+
+    macro_rules! test_transform {
+        (name = $name:ident, source = $src:expr, expected = $expected:expr) => {
+            #[test]
+            fn $name() {
+                let src = wat::parse_str($src).unwrap();
+                let expected = wat::parse_str($expected).unwrap();
+
+                let mut result_module = walrus::ModuleConfig::new()
+                    .generate_producers_section(false)
+                    .parse(&src)
+                    .unwrap();
+
+                super::transform(&mut result_module);
+
+                let mut expected_module = walrus::ModuleConfig::new()
+                    .generate_producers_section(false)
+                    .parse(&expected)
+                    .unwrap();
+
+                let result_wasm = result_module.emit_wasm();
+                let expected_wasm = expected_module.emit_wasm();
+                let result = wasmprinter::print_bytes(&result_wasm).unwrap();
+                let expected = wasmprinter::print_bytes(&expected_wasm).unwrap();
+
+                assert_eq!(result, expected);
+            }
+        };
+    }
+
+    test_transform! {
+        name = simple,
+        source = r#"
+        (module
+            (func (result i32)
+                (i32.const 1)))
+        "#,
+        expected = r#"
+        (module
+            (func (result i32)
+                (if
+                    (i64.lt_u
+                        (global.get 0)
+                        (i64.const 1))
+                    (then
+                        (global.set 1
+                            (i64.const 1))
+                        (unreachable)))
+                (global.set 0
+                    (i64.sub
+                        (global.get 0)
+                        (i64.const 1)))
+                (i32.const 1))
+            (global (;0;) (mut i64) (i64.const 0))
+            (global (;1;) (mut i64) (i64.const 0))
+            (export "gas_limit" (global 0))
+            (export "gas_limit_exhausted" (global 1)))
+        "#
+    }
+
+    test_transform! {
+        name = nested_blocks,
+        source = r#"
+        (module
+            (func (result i32)
+                (block
+                    (block
+                        (block
+                            (i32.const 1)
+                            (drop))))
+                (i32.const 1)))
+        "#,
+        expected = r#"
+        (module
+            (func (result i32)
+                (if
+                    (i64.lt_u
+                        (global.get 0)
+                        (i64.const 18))
+                    (then
+                        (global.set 1
+                            (i64.const 18))
+                        (unreachable)))
+                (global.set 0
+                    (i64.sub
+                        (global.get 0)
+                        (i64.const 18)))
+                (block
+                    (block
+                        (block
+                            (i32.const 1)
+                            (drop))))
+                (i32.const 1))
+            (global (;0;) (mut i64) (i64.const 0))
+            (global (;1;) (mut i64) (i64.const 0))
+            (export "gas_limit" (global 0))
+            (export "gas_limit_exhausted" (global 1)))
+        "#
+    }
+
+    test_transform! {
+        name = nested_blocks_with_loop,
+        source = r#"
+        (module
+            (func (result i32)
+                (block
+                    (block
+                        (block
+                            (i32.const 1)
+                            (drop))
+                        (loop
+                            (i32.const 1)
+                            (drop)
+                            (i32.const 1)
+                            (drop)
+                            (br 0))))
+                (i32.const 1)))
+        "#,
+        expected = r#"
+        (module
+            (func (result i32)
+                (if
+                    (i64.lt_u
+                        (global.get 0)
+                        (i64.const 19))
+                    (then
+                        (global.set 1
+                            (i64.const 19))
+                        (unreachable)))
+                (global.set 0
+                    (i64.sub
+                        (global.get 0)
+                        (i64.const 19)))
+                (block
+                    (block
+                        (block
+                            (i32.const 1)
+                            (drop))
+                        (loop
+                            (if
+                                (i64.lt_u
+                                    (global.get 0)
+                                    (i64.const 25))
+                                (then
+                                    (global.set 1
+                                        (i64.const 25))
+                                    (unreachable)))
+                            (global.set 0
+                                (i64.sub
+                                    (global.get 0)
+                                    (i64.const 25)))
+                            (i32.const 1)
+                            (drop)
+                            (i32.const 1)
+                            (drop)
+                            (br 0))))
+                (if
+                    (i64.lt_u
+                        (global.get 0)
+                        (i64.const 1))
+                    (then
+                        (global.set 1
+                            (i64.const 1))
+                        (unreachable)))
+                (global.set 0
+                    (i64.sub
+                        (global.get 0)
+                        (i64.const 1)))
+                (i32.const 1))
+            (global (;0;) (mut i64) (i64.const 0))
+            (global (;1;) (mut i64) (i64.const 0))
+            (export "gas_limit" (global 0))
+            (export "gas_limit_exhausted" (global 1)))
+        "#
+    }
+
+    test_transform! {
+        name = if_else,
+        source = r#"
+        (module
+            (func (result i32)
+                (i32.const 1)
+                (if
+                    (then
+                        (i32.const 1)
+                        (drop)
+                        (i32.const 1)
+                        (drop))
+                    (else
+                        (i32.const 1)
+                        (drop)))
+                (i32.const 1)))
+        "#,
+        expected = r#"
+        (module
+            (func (result i32)
+                (if
+                    (i64.lt_u
+                        (global.get 0)
+                        (i64.const 11))
+                    (then
+                        (global.set 1
+                            (i64.const 11))
+                        (unreachable)))
+                (global.set 0
+                    (i64.sub
+                        (global.get 0)
+                        (i64.const 11)))
+                (i32.const 1)
+                (if
+                    (then
+                        (if
+                            (i64.lt_u
+                                (global.get 0)
+                                (i64.const 22))
+                            (then
+                                (global.set 1
+                                    (i64.const 22))
+                                (unreachable)))
+                        (global.set 0
+                            (i64.sub
+                                (global.get 0)
+                                (i64.const 22)))
+                        (i32.const 1)
+                        (drop)
+                        (i32.const 1)
+                        (drop)
+                    )
+                    (else
+                        (if
+                            (i64.lt_u
+                                (global.get 0)
+                                (i64.const 11))
+                            (then
+                                (global.set 1
+                                    (i64.const 11))
+                                (unreachable)))
+                        (global.set 0
+                            (i64.sub
+                                (global.get 0)
+                                (i64.const 11)))
+                        (i32.const 1)
+                        (drop)
+                    )
+                )
+                (if
+                    (i64.lt_u
+                        (global.get 0)
+                        (i64.const 1))
+                    (then
+                        (global.set 1
+                            (i64.const 1))
+                        (unreachable)))
+                (global.set 0
+                    (i64.sub
+                        (global.get 0)
+                        (i64.const 1)))
+                (i32.const 1))
+            (global (;0;) (mut i64) (i64.const 0))
+            (global (;1;) (mut i64) (i64.const 0))
+            (export "gas_limit" (global 0))
+            (export "gas_limit_exhausted" (global 1)))
+        "#
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/abi/mod.rs.html b/rust/src/oasis_runtime_sdk_contracts/abi/mod.rs.html new file mode 100644 index 0000000000..3dd5a1a682 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/abi/mod.rs.html @@ -0,0 +1,307 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+
//! WASM ABI supported by the contracts module.
+use oasis_contract_sdk_types::{message::Reply, ExecutionOk};
+use oasis_runtime_sdk::{
+    context::Context,
+    types::{address::Address, token, transaction::CallFormat},
+};
+
+use super::{types, Error, Parameters};
+
+pub mod gas;
+pub mod oasis;
+
+/// Trait for any WASM ABI to implement.
+pub trait Abi<C: Context> {
+    /// Validate that the given WASM module conforms to the ABI.
+    fn validate(&self, module: &mut walrus::Module, params: &Parameters) -> Result<Info, Error>;
+
+    /// Link required functions into the WASM module instance.
+    fn link(
+        &self,
+        instance: &mut wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+    ) -> Result<(), Error>;
+
+    /// Set the gas limit for any following executions.
+    ///
+    /// The specified gas limit should be in regular SDK gas units, not in WASM gas units. The ABI
+    /// should perform any necessary conversions if required.
+    fn set_gas_limit(
+        &self,
+        instance: &mut wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+        gas_limit: u64,
+    ) -> Result<(), Error>;
+
+    /// Instantiate a contract.
+    fn instantiate<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+    ) -> ExecutionResult;
+
+    /// Call a contract.
+    fn call<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+    ) -> ExecutionResult;
+
+    /// Invoke the contract's reply handler.
+    fn handle_reply<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        reply: Reply,
+    ) -> ExecutionResult;
+
+    /// Invoke the contract's pre-upgrade handler.
+    fn pre_upgrade<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+    ) -> ExecutionResult;
+
+    /// Invoke the contract's post-upgrade handler.
+    fn post_upgrade<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+    ) -> ExecutionResult;
+
+    /// Query a contract.
+    fn query<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+    ) -> ExecutionResult;
+}
+
+/// Additional information related to the ABI instance.
+pub struct Info {
+    /// ABI sub-version number.
+    pub abi_sv: u32,
+}
+
+/// Execution context.
+pub struct ExecutionContext<'ctx, C: Context> {
+    /// Transaction context.
+    pub tx_context: &'ctx C,
+    /// Contracts module parameters.
+    pub params: &'ctx Parameters,
+
+    /// Code information.
+    pub code_info: &'ctx types::Code,
+    /// Contract instance information.
+    pub instance_info: &'ctx types::Instance,
+    /// Gas limit for this contract execution.
+    pub gas_limit: u64,
+
+    /// Address of the caller.
+    pub caller_address: Address,
+    /// Whether the call is read-only and must not make any storage modifications.
+    pub read_only: bool,
+    /// Call format.
+    pub call_format: CallFormat,
+
+    /// Whether the execution has aborted with an error that should be propagated instead of just
+    /// using the generic "execution failed" error.
+    pub aborted: Option<Error>,
+}
+
+impl<'ctx, C: Context> ExecutionContext<'ctx, C> {
+    /// Create a new execution context.
+    #[allow(clippy::too_many_arguments)]
+    pub fn new(
+        params: &'ctx Parameters,
+        code_info: &'ctx types::Code,
+        instance_info: &'ctx types::Instance,
+        gas_limit: u64,
+        caller_address: Address,
+        read_only: bool,
+        call_format: CallFormat,
+        tx_context: &'ctx C,
+    ) -> Self {
+        Self {
+            tx_context,
+            params,
+            code_info,
+            instance_info,
+            gas_limit,
+            caller_address,
+            read_only,
+            call_format,
+            aborted: None,
+        }
+    }
+}
+
+/// Result of an execution that contains additional metadata like gas used.
+#[must_use]
+pub struct ExecutionResult {
+    /// Actual execution result.
+    pub inner: Result<ExecutionOk, Error>,
+    /// Amount of gas used by the execution.
+    pub gas_used: u64,
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/abi/oasis/crypto.rs.html b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/crypto.rs.html new file mode 100644 index 0000000000..207430c01b --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/crypto.rs.html @@ -0,0 +1,1071 @@ +crypto.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+
//! Crypto function imports.
+use std::convert::TryInto;
+
+use oasis_contract_sdk_crypto as crypto;
+use oasis_contract_sdk_types::crypto::SignatureKind;
+use oasis_runtime_sdk::{context::Context, crypto::signature, state::CurrentState};
+
+use super::{memory::Region, OasisV1};
+use crate::{
+    abi::{gas, ExecutionContext},
+    Config, Error,
+};
+
+impl<Cfg: Config> OasisV1<Cfg> {
+    /// Link crypto helper functions.
+    pub fn link_crypto<C: Context>(
+        instance: &mut wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+    ) -> Result<(), Error> {
+        // crypto.ecdsa_recover(input) -> response
+        let _ = instance.link_function(
+            "crypto",
+            "ecdsa_recover",
+            |ctx, request: ((u32, u32), (u32, u32))| -> Result<(), wasm3::Trap> {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+
+                // Charge gas.
+                gas::use_gas(ctx.instance, ec.params.gas_costs.wasm_crypto_ecdsa_recover)?;
+
+                let rt = ctx.instance.runtime();
+                rt.try_with_memory(|mut memory| -> Result<_, wasm3::Trap> {
+                    let input = Region::from_arg(request.0)
+                        .as_slice(&memory)
+                        .map_err(|_| wasm3::Trap::Abort)?
+                        .to_vec();
+
+                    let output: &mut [u8; 65] = Region::from_arg(request.1)
+                        .as_slice_mut(&mut memory)
+                        .map_err(|_| wasm3::Trap::Abort)?
+                        .try_into()
+                        .map_err(|_| wasm3::Trap::Abort)?;
+
+                    match crypto::ecdsa::recover(&input) {
+                        Ok(key) => output.copy_from_slice(&key),
+                        Err(_) => output.iter_mut().for_each(|b| *b = 0),
+                    }
+
+                    Ok(())
+                })?
+            },
+        );
+
+        // crypto.signature_verify(public_key, context, message, signature) -> response
+        #[allow(clippy::type_complexity)]
+        let _ = instance.link_function(
+            "crypto",
+            "signature_verify",
+            |ctx,
+             (kind, key, context, message, signature): (
+                u32,
+                (u32, u32),
+                (u32, u32),
+                (u32, u32),
+                (u32, u32),
+            )|
+             -> Result<u32, wasm3::Trap> {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+
+                // Validate message length.
+                if message.1 > ec.params.max_crypto_signature_verify_message_size_bytes {
+                    ec.aborted = Some(Error::CryptoMsgTooLarge(
+                        message.1,
+                        ec.params.max_crypto_signature_verify_message_size_bytes,
+                    ));
+                    return Err(wasm3::Trap::Abort);
+                }
+
+                let kind: SignatureKind = kind.try_into().map_err(|_| wasm3::Trap::Abort)?;
+
+                // Charge gas.
+                let cost = match kind {
+                    SignatureKind::Ed25519 => {
+                        ec.params.gas_costs.wasm_crypto_signature_verify_ed25519
+                    }
+                    SignatureKind::Secp256k1 => {
+                        ec.params.gas_costs.wasm_crypto_signature_verify_secp256k1
+                    }
+                    SignatureKind::Sr25519 => {
+                        ec.params.gas_costs.wasm_crypto_signature_verify_sr25519
+                    }
+                };
+                gas::use_gas(ctx.instance, cost)?;
+
+                let rt = ctx.instance.runtime();
+                rt.try_with_memory(|memory| -> Result<_, wasm3::Trap> {
+                    let key = get_key(kind, key, &memory).inspect_err(|_| {
+                        ec.aborted = Some(Error::CryptoMalformedPublicKey);
+                    })?;
+                    let message = Region::from_arg(message)
+                        .as_slice(&memory)
+                        .map_err(|_| wasm3::Trap::Abort)?;
+                    let signature: signature::Signature = Region::from_arg(signature)
+                        .as_slice(&memory)
+                        .map_err(|_| wasm3::Trap::Abort)?
+                        .to_vec()
+                        .into();
+                    if context.0 != 0 && context.1 != 0 && matches!(kind, SignatureKind::Sr25519) {
+                        let context = Region::from_arg(context)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?;
+                        Ok(1 - key.verify(context, message, &signature).is_ok() as u32)
+                    } else {
+                        Ok(1 - key.verify_raw(message, &signature).is_ok() as u32)
+                    }
+                })?
+            },
+        );
+
+        // crypto.random_bytes(dst) -> bytes_written
+        let _ = instance.link_function(
+            "crypto",
+            "random_bytes",
+            |ctx,
+             ((pers_ptr, pers_len, dst_ptr, dst_len),): ((u32, u32, u32, u32),)|
+             -> Result<u32, wasm3::Trap> {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+
+                let num_bytes = dst_len.min(1024 /* 1 KiB */);
+
+                // Charge gas.
+                let cost = ec
+                    .params
+                    .gas_costs
+                    .wasm_crypto_random_bytes_byte
+                    .checked_mul(num_bytes as u64 + pers_len as u64)
+                    .and_then(|g| g.checked_add(ec.params.gas_costs.wasm_crypto_random_bytes_base))
+                    .unwrap_or(u64::MAX); // This will certainly exhaust the gas limit.
+                gas::use_gas(ctx.instance, cost)?;
+
+                let rt = ctx.instance.runtime();
+                rt.try_with_memory(|mut memory| -> Result<_, wasm3::Trap> {
+                    let pers = Region::from_arg((pers_ptr, pers_len))
+                        .as_slice(&memory)
+                        .map_err(|_| wasm3::Trap::Abort)?;
+                    let mut rng = CurrentState::with(|state| state.rng().fork(ec.tx_context, pers))
+                        .map_err(|e| {
+                            ec.aborted = Some(Error::ExecutionFailed(e.into()));
+                            wasm3::Trap::Abort
+                        })?;
+
+                    let output = Region::from_arg((dst_ptr, num_bytes))
+                        .as_slice_mut(&mut memory)
+                        .map_err(|_| wasm3::Trap::Abort)?;
+                    rand_core::RngCore::try_fill_bytes(&mut rng, output).map_err(|e| {
+                        ec.aborted = Some(Error::ExecutionFailed(e.into()));
+                        wasm3::Trap::Abort
+                    })?;
+                    Ok(num_bytes)
+                })?
+            },
+        );
+
+        // crypto.x25519_derive_symmetric(public_key, private_key) -> symmetric_key
+        #[allow(clippy::type_complexity)]
+        let _ = instance.link_function(
+            "crypto",
+            "x25519_derive_symmetric",
+            |ctx,
+             (public_key, private_key, output_key): ((u32, u32), (u32, u32), (u32, u32))|
+             -> Result<u32, wasm3::Trap> {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+
+                gas::use_gas(
+                    ctx.instance,
+                    ec.params.gas_costs.wasm_crypto_x25519_derive_symmetric,
+                )?;
+
+                ctx.instance
+                    .runtime()
+                    .try_with_memory(|mut memory| -> Result<_, wasm3::Trap> {
+                        let public = Region::from_arg(public_key)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?
+                            .to_vec();
+                        let private = Region::from_arg(private_key)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?
+                            .to_vec();
+                        let output: &mut [u8; crypto::x25519::KEY_SIZE] =
+                            Region::from_arg(output_key)
+                                .as_slice_mut(&mut memory)
+                                .map_err(|_| wasm3::Trap::Abort)?
+                                .try_into()
+                                .map_err(|_| wasm3::Trap::Abort)?;
+                        let derived =
+                            crypto::x25519::derive_symmetric(&public, &private).map_err(|e| {
+                                let err = match e {
+                                    crypto::x25519::Error::MalformedPublicKey => {
+                                        Error::CryptoMalformedPublicKey
+                                    }
+                                    crypto::x25519::Error::MalformedPrivateKey => {
+                                        Error::CryptoMalformedPrivateKey
+                                    }
+                                    crypto::x25519::Error::KeyDerivationFunctionFailure => {
+                                        Error::CryptoKeyDerivationFunctionFailure
+                                    }
+                                };
+                                ec.aborted = Some(err);
+                                wasm3::Trap::Abort
+                            })?;
+                        if output.len() != derived.len() {
+                            return Err(wasm3::Trap::Abort);
+                        }
+                        output.copy_from_slice(&derived);
+                        Ok(0)
+                    })?
+            },
+        );
+
+        #[allow(clippy::type_complexity)]
+        let deoxysii_factory =
+            |func: fn(&[u8], &[u8], &[u8], &[u8]) -> Result<Vec<u8>, crypto::deoxysii::Error>| {
+                move |ctx: wasm3::CallContext<'_, ExecutionContext<'_, C>>,
+                      (key, nonce, message, additional_data): (
+                    (u32, u32),
+                    (u32, u32),
+                    (u32, u32),
+                    (u32, u32),
+                )|
+                      -> Result<u32, wasm3::Trap> {
+                    // Make sure function was called in valid context.
+                    let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+
+                    gas::use_gas(
+                        ctx.instance,
+                        ec.params.gas_costs.wasm_crypto_deoxysii_base
+                            + ec.params.gas_costs.wasm_crypto_deoxysii_byte
+                                * (message.1 as u64 + additional_data.1 as u64),
+                    )?;
+
+                    let output = ctx.instance.runtime().try_with_memory(
+                        |memory| -> Result<Option<Vec<u8>>, wasm3::Trap> {
+                            let key = Region::from_arg(key)
+                                .as_slice(&memory)
+                                .map_err(|_| wasm3::Trap::Abort)?;
+                            let nonce = Region::from_arg(nonce)
+                                .as_slice(&memory)
+                                .map_err(|_| wasm3::Trap::Abort)?;
+                            let message = Region::from_arg(message)
+                                .as_slice(&memory)
+                                .map_err(|_| wasm3::Trap::Abort)?;
+                            let additional_data = Region::from_arg(additional_data)
+                                .as_slice(&memory)
+                                .map_err(|_| wasm3::Trap::Abort)?;
+                            func(key, nonce, message, additional_data)
+                                .map(Some)
+                                .or_else(|e| {
+                                    let err = match e {
+                                        crypto::deoxysii::Error::MalformedKey => {
+                                            Error::CryptoMalformedKey
+                                        }
+                                        crypto::deoxysii::Error::MalformedNonce => {
+                                            Error::CryptoMalformedNonce
+                                        }
+                                        crypto::deoxysii::Error::DecryptionFailed => {
+                                            return Ok(None);
+                                        }
+                                    };
+                                    ec.aborted = Some(err);
+                                    Err(wasm3::Trap::Abort)
+                                })
+                        },
+                    )??;
+
+                    if let Some(output) = output {
+                        let output_region = Self::allocate_and_copy(ctx.instance, &output)?;
+                        Self::allocate_region(ctx.instance, output_region).map_err(|e| e.into())
+                    } else {
+                        Ok(0)
+                    }
+                }
+            };
+
+        // crypto.deoxysii_seal(key, nonce, plaintext_message, additional_data) -> encrypted_message
+        let _ = instance.link_function(
+            "crypto",
+            "deoxysii_seal",
+            deoxysii_factory(crypto::deoxysii::seal),
+        );
+
+        // crypto.deoxysii_open(key, nonce, encrypted_message, additional_data) -> plaintext_message
+        let _ = instance.link_function(
+            "crypto",
+            "deoxysii_open",
+            deoxysii_factory(crypto::deoxysii::open),
+        );
+
+        Ok(())
+    }
+}
+
+fn get_key(
+    kind: SignatureKind,
+    key: (u32, u32),
+    memory: &wasm3::Memory<'_>,
+) -> Result<signature::PublicKey, wasm3::Trap> {
+    let region = Region::from_arg(key)
+        .as_slice(memory)
+        .map_err(|_| wasm3::Trap::Abort)?;
+
+    match kind {
+        SignatureKind::Ed25519 => {
+            let ed25519 = signature::ed25519::PublicKey::from_bytes(region)
+                .map_err(|_| wasm3::Trap::Abort)?;
+            Ok(signature::PublicKey::Ed25519(ed25519))
+        }
+        SignatureKind::Secp256k1 => {
+            let secp256k1 = signature::secp256k1::PublicKey::from_bytes(region)
+                .map_err(|_| wasm3::Trap::Abort)?;
+            Ok(signature::PublicKey::Secp256k1(secp256k1))
+        }
+        SignatureKind::Sr25519 => {
+            let sr25519 = signature::sr25519::PublicKey::from_bytes(region)
+                .map_err(|_| wasm3::Trap::Abort)?;
+            Ok(signature::PublicKey::Sr25519(sr25519))
+        }
+    }
+}
+
+#[cfg(all(feature = "benchmarks", test))]
+mod test {
+    extern crate test;
+    use super::*;
+    use test::Bencher;
+
+    use k256::{
+        self,
+        ecdsa::{self, signature::Verifier as _},
+    };
+
+    // cargo build --target wasm32-unknown-unknown --release
+    const BENCH_CODE: &[u8] = include_bytes!(
+        "../../../../../../tests/contracts/bench/target/wasm32-unknown-unknown/release/bench.wasm"
+    );
+    const MESSAGE: &[u8] =
+        include_bytes!("../../../../../../tests/contracts/bench/data/message.txt");
+    const SIGNATURE: &[u8] =
+        include_bytes!("../../../../../../tests/contracts/bench/data/signature.bin");
+    const KEY: &[u8] = include_bytes!("../../../../../../tests/contracts/bench/data/key.bin");
+
+    fn verify_signature(message: &[u8], signature: &[u8], key: &[u8]) -> Result<(), ()> {
+        let key = k256::EncodedPoint::from_bytes(key).map_err(|_| ())?;
+        let sig = ecdsa::Signature::from_der(signature).map_err(|_| ())?;
+        let verifying_key = ecdsa::VerifyingKey::from_encoded_point(&key).map_err(|_| ())?;
+        verifying_key.verify(message, &sig).map_err(|_| ())?;
+        Ok(())
+    }
+
+    #[bench]
+    fn bench_crypto_nonwasm_verify(b: &mut Bencher) {
+        b.iter(|| {
+            verify_signature(MESSAGE, SIGNATURE, KEY).unwrap();
+        });
+    }
+
+    #[bench]
+    fn bench_crypto_nonwasm_recover(b: &mut Bencher) {
+        let input = hex::decode("ce0677bb30baa8cf067c88db9811f4333d131bf8bcf12fe7065d211dce97100890f27b8b488db00b00606796d2987f6a5f59ae62ea05effe84fef5b8b0e549984a691139ad57a3f0b906637673aa2f63d1f55cb1a69199d4009eea23ceaddc9301").unwrap();
+        b.iter(|| {
+            assert!(crypto::ecdsa::recover(&input).is_ok());
+        });
+    }
+
+    #[bench]
+    fn bench_crypto_nonwasm_x25519_derive(b: &mut Bencher) {
+        let public = <[u8; 32] as hex::FromHex>::from_hex(
+            "3046db3fa70ce605457dc47c48837ebd8bd0a26abfde5994d033e1ced68e2576",
+        )
+        .unwrap();
+        let private = <[u8; 32] as hex::FromHex>::from_hex(
+            "c07b151fbc1e7a11dff926111188f8d872f62eba0396da97c0a24adb75161750",
+        )
+        .unwrap();
+        b.iter(|| {
+            assert!(crypto::x25519::derive_symmetric(&public, &private).is_ok());
+        });
+    }
+
+    #[bench]
+    fn bench_crypto_nonwasm_deoxysii_seal_tiny(b: &mut Bencher) {
+        let key = <[u8; 32] as hex::FromHex>::from_hex(
+            "e69ac21066a8c2284e8fdc690e579af4513547b9b31dd144792c1904b45cf586",
+        )
+        .unwrap();
+        b.iter(|| {
+            assert!(crypto::deoxysii::seal(&key, b"0123456789abcde", b"b", b"").is_ok());
+        });
+    }
+
+    #[bench]
+    fn bench_crypto_nonwasm_deoxysii_seal_size1(b: &mut Bencher) {
+        let key = <[u8; 32] as hex::FromHex>::from_hex(
+            "e69ac21066a8c2284e8fdc690e579af4513547b9b31dd144792c1904b45cf586",
+        )
+        .unwrap();
+        b.iter(|| {
+            assert!(crypto::deoxysii::seal(&key, b"0123456789abcde", MESSAGE, b"").is_ok());
+        });
+    }
+
+    #[bench]
+    fn bench_crypto_nonwasm_deoxysii_seal_size2(b: &mut Bencher) {
+        let key = <[u8; 32] as hex::FromHex>::from_hex(
+            "e69ac21066a8c2284e8fdc690e579af4513547b9b31dd144792c1904b45cf586",
+        )
+        .unwrap();
+        let mut message = MESSAGE.to_vec();
+        message.extend_from_slice(MESSAGE);
+        b.iter(|| {
+            assert!(crypto::deoxysii::seal(&key, b"0123456789abcde", &message, b"").is_ok());
+        });
+    }
+
+    #[bench]
+    fn bench_crypto_called_from_wasm_included(b: &mut Bencher) {
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(BENCH_CODE)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, wasm3::CallContext<'_, ()>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let mut instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        let _ = instance.link_function(
+            "bench",
+            "verify_signature",
+            |ctx,
+             (message, signature, key): ((u32, u32), (u32, u32), (u32, u32))|
+             -> Result<(), wasm3::Trap> {
+                ctx.instance
+                    .runtime()
+                    .try_with_memory(|memory| -> Result<_, wasm3::Trap> {
+                        let message = Region::from_arg(message)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?;
+                        let signature = Region::from_arg(signature)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?;
+                        let key = Region::from_arg(key)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?;
+                        verify_signature(message, signature, key)
+                            .map_err(|_| wasm3::Trap::Abort)?;
+                        Ok(())
+                    })?
+            },
+        );
+        let func = instance
+            .find_function::<(), ()>("call_verification_included")
+            .expect("finding the entrypoint function should succeed");
+        b.iter(|| {
+            func.call(()).expect("function call should succeed");
+        });
+    }
+
+    #[bench]
+    fn bench_crypto_computed_in_wasm(b: &mut Bencher) {
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(BENCH_CODE)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, wasm3::CallContext<'_, ()>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        let func = instance
+            .find_function::<(), ()>("call_verification_internal")
+            .expect("finding the entrypoint function should succeed");
+        b.iter(|| {
+            func.call(()).expect("function call should succeed");
+        });
+    }
+
+    #[bench]
+    fn bench_crypto_computed_in_wasm_instrumented(_b: &mut Bencher) {
+        let mut module = walrus::ModuleConfig::new()
+            .generate_producers_section(false)
+            .parse(&BENCH_CODE)
+            .unwrap();
+        gas::transform(&mut module);
+        let new_code = module.emit_wasm();
+
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(&new_code)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, wasm3::CallContext<'_, ()>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        let initial_gas = 1_000_000_000_000u64;
+        instance
+            .set_global(gas::EXPORT_GAS_LIMIT, initial_gas)
+            .expect("setting gas limit should succeed");
+        let func = instance
+            .find_function::<(), ()>("call_verification_internal")
+            .expect("finding the entrypoint function should succeed");
+        func.call(()).expect("function call should succeed");
+
+        let gas_limit: u64 = instance
+            .get_global(gas::EXPORT_GAS_LIMIT)
+            .expect("getting gas limit global should succeed");
+        let gas_limit_exhausted: u64 = instance
+            .get_global(gas::EXPORT_GAS_LIMIT_EXHAUSTED)
+            .expect("getting gas limit exhausted global should succeed");
+        println!(
+            "  signature verification done, gas remaining {} [used: {}, exhausted flag: {}]",
+            gas_limit,
+            initial_gas - gas_limit,
+            gas_limit_exhausted
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/abi/oasis/env.rs.html b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/env.rs.html new file mode 100644 index 0000000000..00010e7f29 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/env.rs.html @@ -0,0 +1,291 @@ +env.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+
//! Environment query imports.
+use oasis_contract_sdk_types::{
+    env::{AccountsQuery, AccountsResponse, QueryRequest, QueryResponse},
+    InstanceId,
+};
+use oasis_runtime_sdk::{context::Context, modules::accounts::API as _, Runtime};
+
+use super::{memory::Region, OasisV1};
+use crate::{
+    abi::{gas, ExecutionContext},
+    types::Instance,
+    Config, Error,
+};
+
+impl<Cfg: Config> OasisV1<Cfg> {
+    /// Link environment query functions.
+    pub fn link_env<C: Context>(
+        instance: &mut wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+    ) -> Result<(), Error> {
+        // env.query(request) -> response
+        let _ = instance.link_function(
+            "env",
+            "query",
+            |ctx, query: (u32, u32)| -> Result<u32, wasm3::Trap> {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+
+                // Charge base gas amount.
+                gas::use_gas(ctx.instance, ec.params.gas_costs.wasm_env_query_base)?;
+
+                // Decode query argument.
+                let request: QueryRequest = ctx.instance.runtime().try_with_memory(
+                    |memory| -> Result<_, wasm3::Trap> {
+                        let query = Region::from_arg(query).as_slice(&memory)?;
+                        if query.len() > ec.params.max_query_size_bytes as usize {
+                            // TODO: Consider returning a nicer error message.
+                            return Err(wasm3::Trap::Abort);
+                        }
+
+                        cbor::from_slice(query).map_err(|_| wasm3::Trap::Abort)
+                    },
+                )??;
+
+                // Dispatch query.
+                let result = dispatch_query::<C>(ec.tx_context, request);
+
+                // Create new region by calling `allocate`.
+                //
+                // This makes sure that the call context is unset to avoid any potential issues
+                // with reentrancy as attempting to re-enter one of the linked function will fail.
+                Self::serialize_and_allocate_as_ptr(ctx.instance, result).map_err(|err| err.into())
+            },
+        );
+
+        // env.address_for_instance(instance_id, dst_region)
+        let _ = instance.link_function(
+            "env",
+            "address_for_instance",
+            |ctx, request: (u64, (u32, u32))| -> Result<(), wasm3::Trap> {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+
+                // Charge base gas amount.
+                // TODO: probably separate gas cost.
+                gas::use_gas(ctx.instance, ec.params.gas_costs.wasm_env_query_base)?;
+
+                ctx.instance
+                    .runtime()
+                    .try_with_memory(|mut memory| -> Result<_, wasm3::Trap> {
+                        let instance_id: InstanceId = request.0.into();
+                        let dst = Region::from_arg(request.1).as_slice_mut(&mut memory)?;
+
+                        let address = Instance::address_for(instance_id);
+
+                        dst.copy_from_slice(address.as_ref());
+
+                        Ok(())
+                    })?
+            },
+        );
+
+        // env.debug_print(messsage, len)
+        #[cfg(feature = "debug-utils")]
+        let _ = instance.link_function(
+            "env",
+            "debug_print",
+            |ctx, request: (u32, u32)| -> Result<(), wasm3::Trap> {
+                ctx.instance
+                    .runtime()
+                    .try_with_memory(|memory| -> Result<_, wasm3::Trap> {
+                        let msg_bytes = Region::from_arg(request).as_slice(&memory)?;
+                        if let Ok(msg) = std::str::from_utf8(msg_bytes) {
+                            eprintln!("{msg}");
+                        }
+                        Ok(())
+                    })?
+            },
+        );
+
+        Ok(())
+    }
+}
+
+/// Perform environment query dispatch.
+fn dispatch_query<C: Context>(ctx: &C, query: QueryRequest) -> QueryResponse {
+    match query {
+        // Information about the current runtime block.
+        QueryRequest::BlockInfo => QueryResponse::BlockInfo {
+            round: ctx.runtime_header().round,
+            epoch: ctx.epoch(),
+            timestamp: ctx.runtime_header().timestamp,
+        },
+
+        // Accounts API queries.
+        QueryRequest::Accounts(query) => dispatch_accounts_query::<C>(ctx, query),
+
+        _ => QueryResponse::Error {
+            module: "".to_string(),
+            code: 1,
+            message: "query not supported".to_string(),
+        },
+    }
+}
+
+/// Perform accounts API query dispatch.
+fn dispatch_accounts_query<C: Context>(_ctx: &C, query: AccountsQuery) -> QueryResponse {
+    match query {
+        AccountsQuery::Balance {
+            address,
+            denomination,
+        } => {
+            let balance =
+                <C::Runtime as Runtime>::Accounts::get_balance(address.into(), denomination.into())
+                    .unwrap_or_default();
+
+            AccountsResponse::Balance { balance }.into()
+        }
+
+        _ => QueryResponse::Error {
+            module: "".to_string(),
+            code: 1,
+            message: "query not supported".to_string(),
+        },
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/abi/oasis/memory.rs.html b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/memory.rs.html new file mode 100644 index 0000000000..075f230d86 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/memory.rs.html @@ -0,0 +1,515 @@ +memory.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+
//! Host-guest memory management.
+use std::convert::TryInto;
+
+use oasis_runtime_sdk::context::Context;
+
+use super::OasisV1;
+use crate::{abi::ExecutionContext, Config};
+
+/// Name of the memory allocation export.
+pub const EXPORT_ALLOCATE: &str = "allocate";
+/// Name of the memory deallocation export.
+pub const EXPORT_DEALLOCATE: &str = "deallocate";
+
+/// Memory region allocated inside the WASM instance, owned by the host.
+#[derive(Debug)]
+pub struct Region {
+    pub offset: usize,
+    pub length: usize,
+}
+
+#[derive(Debug, thiserror::Error)]
+pub enum RegionError {
+    #[error("region too big")]
+    RegionTooBig,
+    #[error("bad allocation function: {0}")]
+    BadAllocationFunction(#[source] anyhow::Error),
+    #[error("region allocation failed: {0}")]
+    AllocationFailed(#[source] anyhow::Error),
+    #[error("region size mismatch")]
+    SizeMismatch,
+    #[error("bad region pointer")]
+    BadPointer,
+}
+
+impl Region {
+    /// Converts a region to WASM function arguments.
+    pub fn to_arg(&self) -> (u32, u32) {
+        (self.offset as u32, self.length as u32)
+    }
+
+    /// Converts WASM arguments to a region.
+    pub fn from_arg(arg: (u32, u32)) -> Self {
+        Region {
+            offset: arg.0 as usize,
+            length: arg.1 as usize,
+        }
+    }
+
+    /// Dereferences a pointer to the region.
+    pub fn deref(memory: &wasm3::Memory<'_>, arg: u32) -> Result<Self, RegionError> {
+        let arg = arg as usize;
+
+        // Make sure the pointer is within WASM memory.
+        if arg + 8 > memory.size() {
+            return Err(RegionError::BadPointer);
+        }
+
+        // WASM uses little-endian encoding.
+        let dst = memory.as_slice();
+        let offset = u32::from_le_bytes(dst[arg..arg + 4].try_into().unwrap()) as usize;
+        let length = u32::from_le_bytes(dst[arg + 4..arg + 8].try_into().unwrap()) as usize;
+
+        // Ensure that the dereferenced region fits in WASM memory.
+        if offset + length > memory.size() {
+            return Err(RegionError::BadPointer);
+        }
+
+        Ok(Region { offset, length })
+    }
+
+    /// Copies slice content into a previously allocated WASM memory region.
+    pub fn copy_from_slice(
+        &self,
+        memory: &mut wasm3::Memory<'_>,
+        src: &[u8],
+    ) -> Result<(), RegionError> {
+        // Make sure the region is the right size.
+        if src.len() != self.length {
+            return Err(RegionError::SizeMismatch);
+        }
+
+        // Make sure the region fits in WASM memory.
+        if (self.offset + self.length) > memory.size() {
+            return Err(RegionError::BadPointer);
+        }
+
+        let dst = &mut memory.as_slice_mut()[self.offset..self.offset + self.length];
+        dst.copy_from_slice(src);
+
+        Ok(())
+    }
+
+    /// Returns the memory region as a slice.
+    pub fn as_slice<'mem>(
+        &self,
+        memory: &'mem wasm3::Memory<'_>,
+    ) -> Result<&'mem [u8], RegionError> {
+        // Make sure the region fits in WASM memory.
+        if (self.offset + self.length) > memory.size() {
+            return Err(RegionError::BadPointer);
+        }
+
+        Ok(&memory.as_slice()[self.offset..self.offset + self.length])
+    }
+
+    /// Returns the memory region as a mutable slice.
+    pub fn as_slice_mut<'mem>(
+        &self,
+        memory: &'mem mut wasm3::Memory<'_>,
+    ) -> Result<&'mem mut [u8], RegionError> {
+        // Make sure the region fits in WASM memory.
+        if (self.offset + self.length) > memory.size() {
+            return Err(RegionError::BadPointer);
+        }
+
+        Ok(&mut memory.as_slice_mut()[self.offset..self.offset + self.length])
+    }
+
+    /// Returns the serialized region.
+    pub fn serialize(&self) -> [u8; 8] {
+        let mut data = [0u8; 8];
+        data[..4].copy_from_slice(&(self.offset as u32).to_le_bytes());
+        data[4..].copy_from_slice(&(self.length as u32).to_le_bytes());
+        data
+    }
+}
+
+impl<Cfg: Config> OasisV1<Cfg> {
+    /// Allocates a chunk of memory inside the WASM instance.
+    pub fn allocate<C: Context>(
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+        length: usize,
+    ) -> Result<Region, RegionError> {
+        let length: u32 = length.try_into().map_err(|_| RegionError::RegionTooBig)?;
+
+        // Call the allocation function inside the WASM contract.
+        let func = instance
+            .find_function::<u32, u32>(EXPORT_ALLOCATE)
+            .map_err(|err| RegionError::BadAllocationFunction(err.into()))?;
+        let offset = func
+            .call(length) // Must be called without context.
+            .map_err(|err| RegionError::AllocationFailed(err.into()))?;
+
+        // Generate a region based on the returned value.
+        let region = Region {
+            offset: offset as usize,
+            length: length as usize,
+        };
+
+        // Validate returned region.
+        instance
+            .runtime()
+            .try_with_memory(|memory| -> Result<(), RegionError> {
+                // Make sure the region fits in WASM memory.
+                if (region.offset + region.length) > memory.size() {
+                    return Err(RegionError::BadPointer);
+                }
+                Ok(())
+            })
+            .unwrap()?;
+
+        Ok(region)
+    }
+
+    /// Allocates a chunk of memory inside the WASM instance and copies the given slice into it.
+    pub fn allocate_and_copy<C: Context>(
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+        data: &[u8],
+    ) -> Result<Region, RegionError> {
+        // Allocate memory for the destination buffer.
+        let dst = Self::allocate(instance, data.len())?;
+        // Copy over data.
+        instance
+            .runtime()
+            .try_with_memory(|mut memory| -> Result<(), RegionError> {
+                dst.copy_from_slice(&mut memory, data)?;
+                Ok(())
+            })
+            .unwrap()?;
+
+        Ok(dst)
+    }
+
+    /// Serializes the given type into CBOR, allocates a chunk of memory inside the WASM instance
+    /// and copies the serialized data into it.
+    pub fn serialize_and_allocate<C, T>(
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+        data: T,
+    ) -> Result<Region, RegionError>
+    where
+        C: Context,
+        T: cbor::Encode,
+    {
+        let data = cbor::to_vec(data);
+        Self::allocate_and_copy(instance, &data)
+    }
+
+    /// Serializes the given type into CBOR, allocates a chunk of memory inside the WASM instance
+    /// and copies the region and serialized data into it. Returns a pointer to the serialized region.
+    ///
+    /// This method is useful when you need to a pointer to the region of the serialized data,
+    /// since it avoids an additional allocation for the region itself as it pre-allocates it with the data.
+    /// This is an optimized version of calling `serialize_and_allocate` followed by `allocate_region`
+    /// which does two separate allocations.
+    pub fn serialize_and_allocate_as_ptr<C, T>(
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+        data: T,
+    ) -> Result<u32, RegionError>
+    where
+        C: Context,
+        T: cbor::Encode,
+    {
+        let data = cbor::to_vec(data);
+        // Allocate enough for the data and the serialized region.
+        let outer = Self::allocate(instance, data.len() + 8)?;
+        // First 8 bytes are reserved for the region itself. Inner is the region
+        // for the actual data.
+        let inner = Region {
+            offset: outer.offset + 8,
+            length: outer.length - 8,
+        };
+
+        instance
+            .runtime()
+            .try_with_memory(|mut memory| -> Result<(), RegionError> {
+                inner.copy_from_slice(&mut memory, &data)?;
+
+                let dst = &mut memory.as_slice_mut()[outer.offset..outer.offset + 8];
+                dst.copy_from_slice(&inner.serialize());
+
+                Ok(())
+            })
+            .unwrap()?;
+
+        Ok(outer.offset as u32)
+    }
+
+    /// Allocates a region in WASM memory and returns a pointer to it.
+    pub fn allocate_region<C: Context>(
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+        region: Region,
+    ) -> Result<u32, RegionError> {
+        let data = region.serialize();
+
+        // Allocate memory for the destination buffer.
+        let dst = Self::allocate(instance, data.len())?;
+        instance
+            .runtime()
+            .try_with_memory(|mut memory| -> Result<(), RegionError> {
+                dst.copy_from_slice(&mut memory, &data)?;
+                Ok(())
+            })
+            .unwrap()?;
+
+        Ok(dst.offset as u32)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/abi/oasis/mod.rs.html b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/mod.rs.html new file mode 100644 index 0000000000..959e028c8f --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/mod.rs.html @@ -0,0 +1,581 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+
//! The Oasis ABIs.
+use oasis_contract_sdk_types as contract_sdk;
+use oasis_runtime_sdk::{context::Context, modules::core, runtime::Runtime, types::token};
+
+use super::{gas, Abi, ExecutionContext, ExecutionResult, Info};
+use crate::{wasm::ContractError, Config, Error, Parameters};
+
+mod crypto;
+mod env;
+mod memory;
+mod storage;
+#[cfg(test)]
+mod test;
+mod validation;
+
+const EXPORT_INSTANTIATE: &str = "instantiate";
+const EXPORT_CALL: &str = "call";
+const EXPORT_HANDLE_REPLY: &str = "handle_reply";
+const EXPORT_PRE_UPGRADE: &str = "pre_upgrade";
+const EXPORT_POST_UPGRADE: &str = "post_upgrade";
+const EXPORT_QUERY: &str = "query";
+
+const GAS_SCALING_FACTOR: u64 = 1;
+
+/// The Oasis V1 ABI.
+pub struct OasisV1<Cfg: Config> {
+    _cfg: std::marker::PhantomData<Cfg>,
+}
+
+impl<Cfg: Config> OasisV1<Cfg> {
+    /// The set of required exports.
+    const REQUIRED_EXPORTS: &'static [&'static str] = &[
+        memory::EXPORT_ALLOCATE,
+        memory::EXPORT_DEALLOCATE,
+        EXPORT_INSTANTIATE,
+        EXPORT_CALL,
+    ];
+
+    /// The set of reserved exports.
+    const RESERVED_EXPORTS: &'static [&'static str] =
+        &[gas::EXPORT_GAS_LIMIT, gas::EXPORT_GAS_LIMIT_EXHAUSTED];
+
+    /// Create a new instance of the ABI.
+    pub fn new() -> Self {
+        Self {
+            _cfg: std::marker::PhantomData,
+        }
+    }
+
+    fn raw_call_with_request_context<'ctx, C: Context>(
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+        function_name: &str,
+    ) -> Result<contract_sdk::ExecutionOk, Error> {
+        // Allocate memory for context and request, copy serialized data into the region.
+        let mut ec = contract_sdk::ExecutionContext {
+            instance_id: ctx.instance_info.id,
+            instance_address: ctx.instance_info.address().into(),
+            caller_address: ctx.caller_address.into(),
+            deposited_tokens: deposited_tokens.iter().map(|b| b.into()).collect(),
+            ..Default::default()
+        };
+        if ctx.code_info.abi_sv >= 1 {
+            // Supports read only and call format flags.
+            ec.read_only = ctx.read_only;
+            ec.call_format = ctx.call_format.into();
+        }
+        let context_dst = Self::serialize_and_allocate(instance, ec)
+            .map_err(|err| Error::ExecutionFailed(err.into()))?;
+        let request_dst = Self::allocate_and_copy(instance, request)
+            .map_err(|err| Error::ExecutionFailed(err.into()))?;
+
+        // Call the corresponding function in the smart contract.
+        let result = {
+            // The high-level function signature of the WASM export is as follows:
+            //
+            //   fn(ctx: &contract_sdk::ExecutionContext, request: &[u8]) -> contract_sdk::ExecutionResult
+            //
+            let func = instance
+                .find_function::<((u32, u32), (u32, u32)), u32>(function_name)
+                .map_err(|err| Error::ExecutionFailed(err.into()))?;
+            let result = func
+                .call_with_context(ctx, (context_dst.to_arg(), request_dst.to_arg()))
+                .map_err(|err| Error::ExecutionFailed(err.into()))?;
+            instance
+                .runtime()
+                .try_with_memory(|memory| -> Result<_, Error> {
+                    memory::Region::deref(&memory, result)
+                        .map_err(|err| Error::ExecutionFailed(err.into()))
+                })
+                .unwrap()?
+        };
+
+        // Enforce maximum result size limit before attempting to deserialize it.
+        if result.length as u32 > ctx.params.max_result_size_bytes {
+            return Err(Error::ResultTooLarge(
+                result.length as u32,
+                ctx.params.max_result_size_bytes,
+            ));
+        }
+
+        // Deserialize region into result structure.
+        let result: contract_sdk::ExecutionResult = instance
+            .runtime()
+            .try_with_memory(|memory| -> Result<_, Error> {
+                let data = result
+                    .as_slice(&memory)
+                    .map_err(|err| Error::ExecutionFailed(err.into()))?;
+
+                cbor::from_slice(data).map_err(|err| Error::ExecutionFailed(err.into()))
+            })
+            .unwrap()?;
+
+        match result {
+            contract_sdk::ExecutionResult::Ok(ok) => Ok(ok),
+            contract_sdk::ExecutionResult::Failed {
+                module,
+                code,
+                message,
+            } => Err(ContractError::new(ctx.instance_info.code_id, &module, code, &message).into()),
+        }
+    }
+
+    fn call_with_request_context<'ctx, C: Context>(
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+        function_name: &str,
+    ) -> ExecutionResult {
+        // Fetch initial gas counter value so we can determine how much gas was used.
+        let initial_gas = gas::get_remaining_gas(instance);
+
+        let inner = Self::raw_call_with_request_context(
+            ctx,
+            instance,
+            request,
+            deposited_tokens,
+            function_name,
+        )
+        .map_err(|err| {
+            // Check if an abort flag has been set and propagate the error.
+            if let Some(aborted) = ctx.aborted.take() {
+                return aborted;
+            }
+
+            // Check if call failed due to gas being exhausted and return a proper error.
+            let exhausted_gas = gas::get_exhausted_amount(instance);
+            if exhausted_gas != 0 {
+                // Compute how much gas was wanted.
+                let final_gas = gas::get_remaining_gas(instance);
+                let wanted_gas = initial_gas + exhausted_gas.saturating_sub(final_gas);
+                core::Error::out_of_gas::<<<C::Runtime as Runtime>::Core as core::API>::Config>(
+                    initial_gas,
+                    wanted_gas,
+                )
+                .into()
+            } else {
+                err
+            }
+        });
+
+        // Compute how much gas (in SDK units) was actually used.
+        let final_gas = gas::get_remaining_gas(instance);
+        let gas_used = initial_gas.saturating_sub(final_gas) / GAS_SCALING_FACTOR;
+
+        ExecutionResult { inner, gas_used }
+    }
+}
+
+impl<Cfg: Config, C: Context> Abi<C> for OasisV1<Cfg> {
+    fn validate(&self, module: &mut walrus::Module, params: &Parameters) -> Result<Info, Error> {
+        let info = self.validate_module(module, params)?;
+
+        // Add gas metering instrumentation.
+        gas::transform(module);
+
+        Ok(info)
+    }
+
+    fn link(
+        &self,
+        instance: &mut wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+    ) -> Result<(), Error> {
+        // Storage imports.
+        Self::link_storage(instance)?;
+        // Environment imports.
+        Self::link_env(instance)?;
+        // Crypto imports.
+        Self::link_crypto(instance)?;
+
+        Ok(())
+    }
+
+    fn set_gas_limit(
+        &self,
+        instance: &mut wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+        gas_limit: u64,
+    ) -> Result<(), Error> {
+        // Derive gas limit from remaining transaction gas based on a scaling factor.
+        let gas_limit = gas_limit.saturating_mul(GAS_SCALING_FACTOR);
+        gas::set_gas_limit(instance, gas_limit)?;
+
+        Ok(())
+    }
+
+    fn instantiate<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+    ) -> ExecutionResult {
+        Self::call_with_request_context(
+            ctx,
+            instance,
+            request,
+            deposited_tokens,
+            EXPORT_INSTANTIATE,
+        )
+    }
+
+    fn call<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+    ) -> ExecutionResult {
+        Self::call_with_request_context(ctx, instance, request, deposited_tokens, EXPORT_CALL)
+    }
+
+    fn handle_reply<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        reply: contract_sdk::message::Reply,
+    ) -> ExecutionResult {
+        Self::call_with_request_context(
+            ctx,
+            instance,
+            &cbor::to_vec(reply),
+            &[],
+            EXPORT_HANDLE_REPLY,
+        )
+    }
+
+    fn pre_upgrade<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+    ) -> ExecutionResult {
+        Self::call_with_request_context(
+            ctx,
+            instance,
+            request,
+            deposited_tokens,
+            EXPORT_PRE_UPGRADE,
+        )
+    }
+
+    fn post_upgrade<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+        deposited_tokens: &[token::BaseUnits],
+    ) -> ExecutionResult {
+        Self::call_with_request_context(
+            ctx,
+            instance,
+            request,
+            deposited_tokens,
+            EXPORT_POST_UPGRADE,
+        )
+    }
+
+    fn query<'ctx>(
+        &self,
+        ctx: &mut ExecutionContext<'ctx, C>,
+        instance: &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+        request: &[u8],
+    ) -> ExecutionResult {
+        Self::call_with_request_context(ctx, instance, request, &[], EXPORT_QUERY)
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/abi/oasis/storage.rs.html b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/storage.rs.html new file mode 100644 index 0000000000..67d76a7f5b --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/storage.rs.html @@ -0,0 +1,1219 @@ +storage.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+
//! Storage imports.
+use std::convert::TryInto;
+
+use oasis_contract_sdk_types::storage::StoreKind;
+use oasis_runtime_sdk::{context::Context, storage::Store};
+
+use super::{memory::Region, OasisV1};
+use crate::{
+    abi::{gas, ExecutionContext},
+    store, Config, Error,
+};
+
+impl<Cfg: Config> OasisV1<Cfg> {
+    /// Link storage functions.
+    pub fn link_storage<C: Context>(
+        instance: &mut wasm3::Instance<'_, '_, ExecutionContext<'_, C>>,
+    ) -> Result<(), Error> {
+        // storage.get(store, key) -> value
+        let _ = instance.link_function(
+            "storage",
+            "get",
+            |ctx, (store, key): (u32, (u32, u32))| -> Result<u32, wasm3::Trap> {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+                let store_kind: StoreKind = store.try_into().map_err(|_| wasm3::Trap::Abort)?;
+
+                ensure_key_size(ec, key.1)?;
+
+                // Charge base gas amount plus size-dependent gas.
+                let total_gas = (|| {
+                    let (base, key_base) = match store_kind {
+                        StoreKind::Public => (
+                            ec.params.gas_costs.wasm_public_storage_get_base,
+                            ec.params.gas_costs.wasm_public_storage_key_byte,
+                        ),
+                        StoreKind::Confidential => (
+                            ec.params.gas_costs.wasm_confidential_storage_get_base,
+                            ec.params.gas_costs.wasm_confidential_storage_key_byte,
+                        ),
+                    };
+                    let key = key_base.checked_mul(key.1.into())?;
+                    let total = base.checked_add(key)?;
+                    Some(total)
+                })()
+                .ok_or(wasm3::Trap::Abort)?;
+                gas::use_gas(ctx.instance, total_gas)?;
+
+                // Read from contract state.
+                let value = ctx.instance.runtime().try_with_memory(
+                    |memory| -> Result<_, wasm3::Trap> {
+                        let key = Region::from_arg(key).as_slice(&memory)?;
+                        with_instance_store(ec, store_kind, |store| store.get(key))
+                    },
+                )??;
+
+                let value = match value {
+                    Some(value) => value,
+                    None => return Ok(0),
+                };
+
+                // Charge gas for size of value.
+                let value_byte_cost = match store_kind {
+                    StoreKind::Public => ec.params.gas_costs.wasm_public_storage_value_byte,
+                    StoreKind::Confidential => {
+                        ec.params.gas_costs.wasm_confidential_storage_value_byte
+                    }
+                };
+                gas::use_gas(
+                    ctx.instance,
+                    value_byte_cost
+                        .checked_mul(value.len().try_into()?)
+                        .ok_or(wasm3::Trap::Abort)?,
+                )?;
+
+                // Create new region by calling `allocate`.
+                //
+                // This makes sure that the call context is unset to avoid any potential issues
+                // with reentrancy as attempting to re-enter one of the linked functions will fail.
+                let value_region = Self::allocate_and_copy(ctx.instance, &value)?;
+
+                // Return a pointer to the region.
+                Self::allocate_region(ctx.instance, value_region).map_err(|e| e.into())
+            },
+        );
+
+        // storage.insert(store, key, value)
+        let _ = instance.link_function(
+            "storage",
+            "insert",
+            |ctx, (store, key, value): (u32, (u32, u32), (u32, u32))| {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+                let store_kind: StoreKind = store.try_into().map_err(|_| wasm3::Trap::Abort)?;
+
+                ensure_key_size(ec, key.1)?;
+                ensure_value_size(ec, value.1)?;
+
+                // Charge base gas amount plus size-dependent gas.
+                let total_gas = (|| {
+                    let (base, key_base, value_base) = match store_kind {
+                        StoreKind::Public => (
+                            ec.params.gas_costs.wasm_public_storage_insert_base,
+                            ec.params.gas_costs.wasm_public_storage_key_byte,
+                            ec.params.gas_costs.wasm_public_storage_value_byte,
+                        ),
+                        StoreKind::Confidential => (
+                            ec.params.gas_costs.wasm_confidential_storage_insert_base,
+                            ec.params.gas_costs.wasm_confidential_storage_key_byte,
+                            ec.params.gas_costs.wasm_confidential_storage_value_byte,
+                        ),
+                    };
+                    let key = key_base.checked_mul(key.1.into())?;
+                    let value = value_base.checked_mul(value.1.into())?;
+                    let total = base.checked_add(key)?.checked_add(value)?;
+                    Some(total)
+                })()
+                .ok_or(wasm3::Trap::Abort)?;
+                gas::use_gas(ctx.instance, total_gas)?;
+
+                // Insert into contract state.
+                ctx.instance
+                    .runtime()
+                    .try_with_memory(|memory| -> Result<(), wasm3::Trap> {
+                        let key = Region::from_arg(key).as_slice(&memory)?;
+                        let value = Region::from_arg(value).as_slice(&memory)?;
+                        with_instance_store(ec, store_kind, |store| store.insert(key, value))
+                    })??;
+
+                Ok(())
+            },
+        );
+
+        // storage.remove(store, key)
+        let _ = instance.link_function(
+            "storage",
+            "remove",
+            |ctx, (store, key): (u32, (u32, u32))| {
+                // Make sure function was called in valid context.
+                let ec = ctx.context.ok_or(wasm3::Trap::Abort)?;
+                let store_kind: StoreKind = store.try_into().map_err(|_| wasm3::Trap::Abort)?;
+
+                ensure_key_size(ec, key.1)?;
+
+                // Charge base gas amount plus size-dependent gas.
+                let total_gas = (|| {
+                    let (base, key_base) = match store_kind {
+                        StoreKind::Public => (
+                            ec.params.gas_costs.wasm_public_storage_remove_base,
+                            ec.params.gas_costs.wasm_public_storage_key_byte,
+                        ),
+                        StoreKind::Confidential => (
+                            ec.params.gas_costs.wasm_confidential_storage_remove_base,
+                            ec.params.gas_costs.wasm_confidential_storage_key_byte,
+                        ),
+                    };
+                    let key = key_base.checked_mul(key.1.into())?;
+                    let total = base.checked_add(key)?;
+                    Some(total)
+                })()
+                .ok_or(wasm3::Trap::Abort)?;
+                gas::use_gas(ctx.instance, total_gas)?;
+
+                // Remove from contract state.
+                ctx.instance
+                    .runtime()
+                    .try_with_memory(|memory| -> Result<(), wasm3::Trap> {
+                        let key = Region::from_arg(key).as_slice(&memory)?;
+                        with_instance_store(ec, store_kind, |store| store.remove(key))
+                    })??;
+
+                Ok(())
+            },
+        );
+
+        Ok(())
+    }
+}
+
+/// Run a closure with the contract instance store.
+fn with_instance_store<C, F, R>(
+    ec: &mut ExecutionContext<'_, C>,
+    store_kind: StoreKind,
+    f: F,
+) -> Result<R, wasm3::Trap>
+where
+    C: Context,
+    F: FnOnce(&mut dyn Store) -> R,
+{
+    store::with_instance_store(ec.tx_context, ec.instance_info, store_kind, |store| {
+        f(store)
+    })
+    .map_err(|err| {
+        // Propagate the underlying error.
+        ec.aborted = Some(err);
+        wasm3::Trap::Abort
+    })
+}
+
+/// Make sure that the key size is within the range specified in module parameters.
+fn ensure_key_size<C: Context>(
+    ec: &mut ExecutionContext<'_, C>,
+    size: u32,
+) -> Result<(), wasm3::Trap> {
+    if size > ec.params.max_storage_key_size_bytes {
+        ec.aborted = Some(Error::StorageKeyTooLarge(
+            size,
+            ec.params.max_storage_key_size_bytes,
+        ));
+        return Err(wasm3::Trap::Abort);
+    }
+    Ok(())
+}
+
+/// Make sure that the value size is within the range specified in module parameters.
+fn ensure_value_size<C: Context>(
+    ec: &mut ExecutionContext<'_, C>,
+    size: u32,
+) -> Result<(), wasm3::Trap> {
+    if size > ec.params.max_storage_value_size_bytes {
+        ec.aborted = Some(Error::StorageValueTooLarge(
+            size,
+            ec.params.max_storage_value_size_bytes,
+        ));
+        return Err(wasm3::Trap::Abort);
+    }
+    Ok(())
+}
+
+#[cfg(all(feature = "benchmarks", test))]
+mod bench {
+    extern crate test;
+    use super::*;
+    use std::{cell::RefCell, rc::Rc};
+    use test::Bencher;
+
+    use oasis_runtime_sdk::{context::Context, storage, testing::mock::Mock};
+
+    // cargo build --target wasm32-unknown-unknown --release
+    const BENCH_CODE: &[u8] = include_bytes!(
+        "../../../../../../tests/contracts/bench/target/wasm32-unknown-unknown/release/bench.wasm"
+    );
+
+    fn make_items(num: usize) -> Vec<(Vec<u8>, Vec<u8>)> {
+        let mut items = Vec::new();
+        for i in 0..num {
+            items.push((
+                format!("key{}", i).into_bytes(),
+                format!("value{}", i).into_bytes(),
+            ));
+        }
+        items
+    }
+
+    struct StoreContext<'a> {
+        store: Box<dyn storage::Store + 'a>,
+    }
+
+    #[bench]
+    fn bench_wasm_plain_get(b: &mut Bencher) {
+        // Set up storage stack and insert some items into it.
+        let mut mock = Mock::default();
+        let mut ctx = mock.create_ctx();
+        let inner = storage::PrefixStore::new(
+            storage::PrefixStore::new(
+                storage::PrefixStore::new(ctx.runtime_state(), "test module"),
+                "instance prefix",
+            ),
+            "type prefix",
+        );
+        let mut store_ctx = StoreContext {
+            store: Box::new(storage::HashedStore::<_, blake3::Hasher>::new(inner)),
+        };
+
+        let items = make_items(10_000);
+        for i in 0..10_000 {
+            let item = &items[i % items.len()];
+            store_ctx.store.insert(&item.0, &item.1);
+        }
+
+        // Set up wasm runtime.
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(BENCH_CODE)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, StoreContext<'_>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let mut instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        let _ = instance.link_function(
+            "bench",
+            "plain_get",
+            |ctx, key: (u32, u32)| -> Result<u32, wasm3::Trap> {
+                let key = ctx.instance.runtime().try_with_memory(
+                    |memory| -> Result<Vec<u8>, wasm3::Trap> {
+                        Ok(Region::from_arg(key)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?
+                            .into())
+                    },
+                )??;
+                let store_ctx = ctx.context.ok_or(wasm3::Trap::Abort)?;
+                match store_ctx.store.get(&key) {
+                    None => Ok(0),
+                    Some(value) => {
+                        let alloc = ctx
+                            .instance
+                            .find_function::<u32, u32>("alloc")
+                            .expect("finding alloc function should succeed");
+                        let val_len = value.len() as u32;
+                        let target_offset = alloc
+                            .call(val_len + std::mem::size_of::<u32>() as u32)
+                            .expect("alloc should succeed")
+                            as usize;
+
+                        ctx.instance.runtime().try_with_memory(
+                            |mut memory| -> Result<_, wasm3::Trap> {
+                                let len_bytes = &mut memory.as_slice_mut()
+                                    [target_offset..target_offset + std::mem::size_of::<u32>()];
+                                len_bytes.copy_from_slice(&val_len.to_le_bytes());
+
+                                let val_start = target_offset + std::mem::size_of::<u32>();
+                                let target =
+                                    &mut memory.as_slice_mut()[val_start..val_start + value.len()];
+                                target.copy_from_slice(&value);
+                                Ok(target_offset as u32)
+                            },
+                        )?
+                    }
+                }
+            },
+        );
+        let func = instance
+            .find_function::<(), ()>("bench_storage_get")
+            .expect("finding the entrypoint function should succeed");
+        b.iter(|| {
+            func.call_with_context(&mut store_ctx, ())
+                .expect("function call should succeed");
+        });
+    }
+
+    #[bench]
+    fn bench_wasm_plain_insert(b: &mut Bencher) {
+        // Set up storage stack and insert some items into it.
+        let mut mock = Mock::default();
+        let mut ctx = mock.create_ctx();
+        let inner = storage::PrefixStore::new(
+            storage::PrefixStore::new(
+                storage::PrefixStore::new(ctx.runtime_state(), "test module"),
+                "instance prefix",
+            ),
+            "type prefix",
+        );
+        let mut store_ctx = StoreContext {
+            store: Box::new(storage::HashedStore::<_, blake3::Hasher>::new(inner)),
+        };
+
+        // Set up wasm runtime.
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(BENCH_CODE)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, StoreContext<'_>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let mut instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        let _ = instance.link_function(
+            "bench",
+            "plain_insert",
+            |ctx, (key, value): ((u32, u32), (u32, u32))| -> Result<u32, wasm3::Trap> {
+                let key = ctx.instance.runtime().try_with_memory(
+                    |memory| -> Result<Vec<u8>, wasm3::Trap> {
+                        Ok(Region::from_arg(key)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?
+                            .into())
+                    },
+                )??;
+                let value = ctx.instance.runtime().try_with_memory(
+                    |memory| -> Result<Vec<u8>, wasm3::Trap> {
+                        Ok(Region::from_arg(value)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?
+                            .into())
+                    },
+                )??;
+                let store_ctx = ctx.context.ok_or(wasm3::Trap::Abort)?;
+                store_ctx.store.insert(&key, &value);
+                Ok(0)
+            },
+        );
+        let func = instance
+            .find_function::<u32, u32>("bench_storage_insert")
+            .expect("finding the entrypoint function should succeed");
+        let mut counter_base: u32 = 0;
+        b.iter(|| {
+            counter_base += func
+                .call_with_context(&mut store_ctx, counter_base)
+                .expect("function call should succeed");
+        });
+    }
+
+    #[bench]
+    fn bench_wasm_plain_remove(b: &mut Bencher) {
+        // Set up storage stack and insert some items into it.
+        let mut mock = Mock::default();
+        let mut ctx = mock.create_ctx();
+        let inner = storage::PrefixStore::new(
+            storage::PrefixStore::new(
+                storage::PrefixStore::new(ctx.runtime_state(), "test module"),
+                "instance prefix",
+            ),
+            "type prefix",
+        );
+        let mut store_ctx = StoreContext {
+            store: Box::new(storage::HashedStore::<_, blake3::Hasher>::new(inner)),
+        };
+
+        for i in 0..2_000_000 {
+            store_ctx.store.insert(
+                format!("key{}", i).as_bytes(),
+                format!("value{}", i).as_bytes(),
+            );
+        }
+
+        // Set up wasm runtime.
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(BENCH_CODE)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, StoreContext<'_>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let mut instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        let _ = instance.link_function(
+            "bench",
+            "plain_remove",
+            |ctx, key: (u32, u32)| -> Result<u32, wasm3::Trap> {
+                let key = ctx.instance.runtime().try_with_memory(
+                    |memory| -> Result<Vec<u8>, wasm3::Trap> {
+                        Ok(Region::from_arg(key)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?
+                            .into())
+                    },
+                )??;
+                let store_ctx = ctx.context.ok_or(wasm3::Trap::Abort)?;
+                store_ctx.store.remove(&key);
+                Ok(0)
+            },
+        );
+        let func = instance
+            .find_function::<u32, u32>("bench_storage_remove")
+            .expect("finding the entrypoint function should succeed");
+        let mut counter_base: u32 = 0;
+        b.iter(|| {
+            counter_base += func
+                .call_with_context(&mut store_ctx, counter_base)
+                .expect("function call should succeed");
+        });
+    }
+
+    #[bench]
+    fn bench_nowasm_get(b: &mut Bencher) {
+        // Set up storage stack and insert some items into it.
+        let mut mock = Mock::default();
+        let mut ctx = mock.create_ctx();
+        let inner = storage::PrefixStore::new(
+            storage::PrefixStore::new(
+                storage::PrefixStore::new(ctx.runtime_state(), "test module"),
+                "instance prefix",
+            ),
+            "type prefix",
+        );
+        let mut store = Box::new(storage::HashedStore::<_, blake3::Hasher>::new(inner));
+
+        let items = make_items(10_000);
+        for i in 0..10_000 {
+            let item = &items[i % items.len()];
+            store.insert(&item.0, &item.1);
+        }
+        b.iter(move || {
+            for i in 0..5_000 {
+                let key = format!("key{}", i);
+                let exp_value = format!("value{}", i);
+                let value = store.get(key.as_bytes()).unwrap();
+                assert_eq!(exp_value.as_bytes(), value.as_slice());
+            }
+        });
+    }
+
+    #[bench]
+    fn bench_wasm_reach_gas_limit(_b: &mut Bencher) {
+        // Set up storage stack and insert some items into it.
+        let mut mock = Mock::default();
+        let mut ctx = mock.create_ctx();
+        let inner = storage::PrefixStore::new(
+            storage::PrefixStore::new(
+                storage::PrefixStore::new(ctx.runtime_state(), "test module"),
+                "instance prefix",
+            ),
+            "type prefix",
+        );
+        let mut store_ctx = StoreContext {
+            store: Box::new(storage::HashedStore::<_, blake3::Hasher>::new(inner)),
+        };
+
+        let params = crate::Parameters::default();
+        let params_cb = params.clone();
+
+        // Set up wasm runtime.
+        let mut module = walrus::ModuleConfig::new()
+            .generate_producers_section(false)
+            .parse(&BENCH_CODE)
+            .unwrap();
+        gas::transform(&mut module);
+        let instrumented_code = module.emit_wasm();
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(&instrumented_code)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, StoreContext<'_>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let mut instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        let initial_gas: u64 = 1_000_000_000;
+        instance
+            .set_global(gas::EXPORT_GAS_LIMIT, initial_gas)
+            .expect("setting gas limit should succeed");
+
+        let bytes_written: Rc<RefCell<usize>> = Rc::new(RefCell::new(0));
+        let bytes_written_cb = bytes_written.clone();
+
+        let _ = instance.link_function(
+            "bench",
+            "plain_insert",
+            move |ctx, (key, value): ((u32, u32), (u32, u32))| -> Result<u32, wasm3::Trap> {
+                let key = ctx.instance.runtime().try_with_memory(
+                    |memory| -> Result<Vec<u8>, wasm3::Trap> {
+                        Ok(Region::from_arg(key)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?
+                            .into())
+                    },
+                )??;
+                let value = ctx.instance.runtime().try_with_memory(
+                    |memory| -> Result<Vec<u8>, wasm3::Trap> {
+                        Ok(Region::from_arg(value)
+                            .as_slice(&memory)
+                            .map_err(|_| wasm3::Trap::Abort)?
+                            .into())
+                    },
+                )??;
+
+                let total_gas = (|| {
+                    let key_cost = params_cb
+                        .gas_costs
+                        .wasm_public_storage_key_byte
+                        .checked_mul(key.len() as u64)?;
+                    let value_cost = params_cb
+                        .gas_costs
+                        .wasm_public_storage_value_byte
+                        .checked_mul(value.len() as u64)?;
+                    let total = params_cb
+                        .gas_costs
+                        .wasm_public_storage_insert_base
+                        .checked_add(key_cost)?
+                        .checked_add(value_cost)?;
+                    Some(total)
+                })()
+                .ok_or(wasm3::Trap::Abort)?;
+                gas::use_gas(ctx.instance, total_gas)?;
+
+                *bytes_written_cb.borrow_mut() += value.len();
+                let store_ctx = ctx.context.ok_or(wasm3::Trap::Abort)?;
+                store_ctx.store.insert(&key, &value);
+                Ok(0)
+            },
+        );
+        let func = instance
+            .find_function::<u32, u32>("bench_storage_gas_consumer")
+            .expect("finding the entrypoint function should succeed");
+        let _ = func.call_with_context(&mut store_ctx, params.max_storage_value_size_bytes as u32);
+        let gas_limit: u64 = instance
+            .get_global(gas::EXPORT_GAS_LIMIT)
+            .expect("getting gas limit global should succeed");
+        let gas_limit_exhausted: u64 = instance
+            .get_global(gas::EXPORT_GAS_LIMIT_EXHAUSTED)
+            .expect("getting gas limit exhausted global should succeed");
+        println!(
+            "  storage waster: gas remaining {} [used: {}, exhausted flag: {}], value bytes written: {}",
+            gas_limit,
+            initial_gas - gas_limit,
+            gas_limit_exhausted,
+            *bytes_written.borrow()
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/abi/oasis/validation.rs.html b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/validation.rs.html new file mode 100644 index 0000000000..497ad76f9b --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/abi/oasis/validation.rs.html @@ -0,0 +1,1031 @@ +validation.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+
use std::collections::BTreeSet;
+
+use walrus::{
+    ir::{self, dfs_in_order, Value, Visitor},
+    Module, ValType,
+};
+
+use crate::{
+    abi::oasis::{Info, OasisV1},
+    Config, Error, Parameters,
+};
+
+const EXPORT_SUB_VERSION_PREFIX: &str = "__oasis_sv_";
+
+fn check_valtype_acceptable(ty: ValType) -> Result<(), Error> {
+    match ty {
+        ValType::F32 | ValType::F64 => Err(Error::ModuleUsesFloatingPoint),
+        _ => Ok(()),
+    }
+}
+
+struct FloatScanner(bool);
+
+impl<'instr> Visitor<'instr> for FloatScanner {
+    fn visit_const(&mut self, instr: &ir::Const) {
+        match instr.value {
+            Value::F32(_) | Value::F64(_) => self.0 = true,
+            _ => {}
+        }
+    }
+
+    fn visit_binop(&mut self, instr: &ir::Binop) {
+        use ir::BinaryOp::*;
+        match instr.op {
+            F32Eq
+            | F32Ne
+            | F32Lt
+            | F32Gt
+            | F32Le
+            | F32Ge
+            | F64Eq
+            | F64Ne
+            | F64Lt
+            | F64Gt
+            | F64Le
+            | F64Ge
+            | F32Add
+            | F32Sub
+            | F32Mul
+            | F32Div
+            | F32Min
+            | F32Max
+            | F32Copysign
+            | F64Add
+            | F64Sub
+            | F64Mul
+            | F64Div
+            | F64Min
+            | F64Max
+            | F64Copysign
+            | F32x4ReplaceLane { .. }
+            | F64x2ReplaceLane { .. }
+            | F32x4Eq
+            | F32x4Ne
+            | F32x4Lt
+            | F32x4Gt
+            | F32x4Le
+            | F32x4Ge
+            | F64x2Eq
+            | F64x2Ne
+            | F64x2Lt
+            | F64x2Gt
+            | F64x2Le
+            | F64x2Ge
+            | F32x4Add
+            | F32x4Sub
+            | F32x4Mul
+            | F32x4Div
+            | F32x4Min
+            | F32x4Max
+            | F32x4PMin
+            | F32x4PMax
+            | F64x2Add
+            | F64x2Sub
+            | F64x2Mul
+            | F64x2Div
+            | F64x2Min
+            | F64x2Max
+            | F64x2PMin
+            | F64x2PMax => self.0 = true,
+            I32Eq
+            | I32Ne
+            | I32LtS
+            | I32LtU
+            | I32GtS
+            | I32GtU
+            | I32LeS
+            | I32LeU
+            | I32GeS
+            | I32GeU
+            | I64Eq
+            | I64Ne
+            | I64LtS
+            | I64LtU
+            | I64GtS
+            | I64GtU
+            | I64LeS
+            | I64LeU
+            | I64GeS
+            | I64GeU
+            | I32Add
+            | I32Sub
+            | I32Mul
+            | I32DivS
+            | I32DivU
+            | I32RemS
+            | I32RemU
+            | I32And
+            | I32Or
+            | I32Xor
+            | I32Shl
+            | I32ShrS
+            | I32ShrU
+            | I32Rotl
+            | I32Rotr
+            | I64Add
+            | I64Sub
+            | I64Mul
+            | I64DivS
+            | I64DivU
+            | I64RemS
+            | I64RemU
+            | I64And
+            | I64Or
+            | I64Xor
+            | I64Shl
+            | I64ShrS
+            | I64ShrU
+            | I64Rotl
+            | I64Rotr
+            | I8x16ReplaceLane { .. }
+            | I16x8ReplaceLane { .. }
+            | I32x4ReplaceLane { .. }
+            | I64x2ReplaceLane { .. }
+            | I8x16Eq
+            | I8x16Ne
+            | I8x16LtS
+            | I8x16LtU
+            | I8x16GtS
+            | I8x16GtU
+            | I8x16LeS
+            | I8x16LeU
+            | I8x16GeS
+            | I8x16GeU
+            | I16x8Eq
+            | I16x8Ne
+            | I16x8LtS
+            | I16x8LtU
+            | I16x8GtS
+            | I16x8GtU
+            | I16x8LeS
+            | I16x8LeU
+            | I16x8GeS
+            | I16x8GeU
+            | I32x4Eq
+            | I32x4Ne
+            | I32x4LtS
+            | I32x4LtU
+            | I32x4GtS
+            | I32x4GtU
+            | I32x4LeS
+            | I32x4LeU
+            | I32x4GeS
+            | I32x4GeU
+            | I64x2Eq
+            | I64x2Ne
+            | I64x2LtS
+            | I64x2GtS
+            | I64x2LeS
+            | I64x2GeS
+            | V128And
+            | V128Or
+            | V128Xor
+            | V128AndNot
+            | I8x16Shl
+            | I8x16ShrS
+            | I8x16ShrU
+            | I8x16Add
+            | I8x16AddSatS
+            | I8x16AddSatU
+            | I8x16Sub
+            | I8x16SubSatS
+            | I8x16SubSatU
+            | I16x8Shl
+            | I16x8ShrS
+            | I16x8ShrU
+            | I16x8Add
+            | I16x8AddSatS
+            | I16x8AddSatU
+            | I16x8Sub
+            | I16x8SubSatS
+            | I16x8SubSatU
+            | I16x8Mul
+            | I32x4Shl
+            | I32x4ShrS
+            | I32x4ShrU
+            | I32x4Add
+            | I32x4Sub
+            | I32x4Mul
+            | I64x2Shl
+            | I64x2ShrS
+            | I64x2ShrU
+            | I64x2Add
+            | I64x2Sub
+            | I64x2Mul
+            | I8x16NarrowI16x8S
+            | I8x16NarrowI16x8U
+            | I16x8NarrowI32x4S
+            | I16x8NarrowI32x4U
+            | I8x16RoundingAverageU
+            | I16x8RoundingAverageU
+            | I8x16MinS
+            | I8x16MinU
+            | I8x16MaxS
+            | I8x16MaxU
+            | I16x8MinS
+            | I16x8MinU
+            | I16x8MaxS
+            | I16x8MaxU
+            | I32x4MinS
+            | I32x4MinU
+            | I32x4MaxS
+            | I32x4MaxU
+            | I32x4DotI16x8S
+            | I16x8Q15MulrSatS
+            | I16x8ExtMulLowI8x16S
+            | I16x8ExtMulHighI8x16S
+            | I16x8ExtMulLowI8x16U
+            | I16x8ExtMulHighI8x16U
+            | I32x4ExtMulLowI16x8S
+            | I32x4ExtMulHighI16x8S
+            | I32x4ExtMulLowI16x8U
+            | I32x4ExtMulHighI16x8U
+            | I64x2ExtMulLowI32x4S
+            | I64x2ExtMulHighI32x4S
+            | I64x2ExtMulLowI32x4U
+            | I64x2ExtMulHighI32x4U => {
+                // Ignore these. They're all listed so we don't need to use
+                // the catch-all arm and miss any future additions.
+            }
+        }
+    }
+
+    fn visit_unop(&mut self, instr: &ir::Unop) {
+        use ir::UnaryOp::*;
+        match instr.op {
+            F32Abs
+            | F32Neg
+            | F32Ceil
+            | F32Floor
+            | F32Trunc
+            | F32Nearest
+            | F32Sqrt
+            | F64Abs
+            | F64Neg
+            | F64Ceil
+            | F64Floor
+            | F64Trunc
+            | F64Nearest
+            | F64Sqrt
+            | I32TruncSF32
+            | I32TruncUF32
+            | I32TruncSF64
+            | I32TruncUF64
+            | I64TruncSF32
+            | I64TruncUF32
+            | I64TruncSF64
+            | I64TruncUF64
+            | F32ConvertSI32
+            | F32ConvertUI32
+            | F32ConvertSI64
+            | F32ConvertUI64
+            | F32DemoteF64
+            | F64ConvertSI32
+            | F64ConvertUI32
+            | F64ConvertSI64
+            | F64ConvertUI64
+            | F64PromoteF32
+            | I32ReinterpretF32
+            | I64ReinterpretF64
+            | F32ReinterpretI32
+            | F64ReinterpretI64
+            | F32x4Splat
+            | F32x4ExtractLane { .. }
+            | F64x2Splat
+            | F64x2ExtractLane { .. }
+            | F32x4Abs
+            | F32x4Neg
+            | F32x4Sqrt
+            | F32x4Ceil
+            | F32x4Floor
+            | F32x4Trunc
+            | F32x4Nearest
+            | F64x2Abs
+            | F64x2Neg
+            | F64x2Sqrt
+            | F64x2Ceil
+            | F64x2Floor
+            | F64x2Trunc
+            | F64x2Nearest
+            | I32x4TruncSatF64x2SZero
+            | I32x4TruncSatF64x2UZero
+            | F64x2ConvertLowI32x4S
+            | F64x2ConvertLowI32x4U
+            | F32x4DemoteF64x2Zero
+            | F64x2PromoteLowF32x4
+            | I32x4TruncSatF32x4S
+            | I32x4TruncSatF32x4U
+            | F32x4ConvertI32x4S
+            | F32x4ConvertI32x4U
+            | I32TruncSSatF32
+            | I32TruncUSatF32
+            | I32TruncSSatF64
+            | I32TruncUSatF64
+            | I64TruncSSatF32
+            | I64TruncUSatF32
+            | I64TruncSSatF64
+            | I64TruncUSatF64 => self.0 = true,
+            I32Eqz
+            | I32Clz
+            | I32Ctz
+            | I32Popcnt
+            | I64Eqz
+            | I64Clz
+            | I64Ctz
+            | I64Popcnt
+            | I32WrapI64
+            | I64ExtendSI32
+            | I64ExtendUI32
+            | I32Extend8S
+            | I32Extend16S
+            | I64Extend8S
+            | I64Extend16S
+            | I64Extend32S
+            | I8x16Splat
+            | I8x16ExtractLaneS { .. }
+            | I8x16ExtractLaneU { .. }
+            | I16x8Splat
+            | I16x8ExtractLaneS { .. }
+            | I16x8ExtractLaneU { .. }
+            | I32x4Splat
+            | I32x4ExtractLane { .. }
+            | I64x2Splat
+            | I64x2ExtractLane { .. }
+            | V128Not
+            | V128AnyTrue
+            | I8x16Abs
+            | I8x16Popcnt
+            | I8x16Neg
+            | I8x16AllTrue
+            | I8x16Bitmask
+            | I16x8Abs
+            | I16x8Neg
+            | I16x8AllTrue
+            | I16x8Bitmask
+            | I32x4Abs
+            | I32x4Neg
+            | I32x4AllTrue
+            | I32x4Bitmask
+            | I64x2Abs
+            | I64x2Neg
+            | I64x2AllTrue
+            | I64x2Bitmask
+            | I16x8ExtAddPairwiseI8x16S
+            | I16x8ExtAddPairwiseI8x16U
+            | I32x4ExtAddPairwiseI16x8S
+            | I32x4ExtAddPairwiseI16x8U
+            | I64x2ExtendLowI32x4S
+            | I64x2ExtendHighI32x4S
+            | I64x2ExtendLowI32x4U
+            | I64x2ExtendHighI32x4U
+            | I16x8WidenLowI8x16S
+            | I16x8WidenLowI8x16U
+            | I16x8WidenHighI8x16S
+            | I16x8WidenHighI8x16U
+            | I32x4WidenLowI16x8S
+            | I32x4WidenLowI16x8U
+            | I32x4WidenHighI16x8S
+            | I32x4WidenHighI16x8U => {
+                // Ignore these. They're all listed so we don't need to use
+                // the catch-all arm and miss any future additions.
+            }
+        }
+    }
+
+    fn visit_load(&mut self, instr: &ir::Load) {
+        match instr.kind {
+            ir::LoadKind::F32 | ir::LoadKind::F64 => self.0 = true,
+            _ => {}
+        }
+    }
+
+    fn visit_store(&mut self, instr: &ir::Store) {
+        match instr.kind {
+            ir::StoreKind::F32 | ir::StoreKind::F64 => self.0 = true,
+            _ => {}
+        }
+    }
+}
+
+impl<Cfg: Config> OasisV1<Cfg> {
+    pub(super) fn validate_module(
+        &self,
+        module: &Module,
+        params: &Parameters,
+    ) -> Result<Info, Error> {
+        // Verify that all required exports are there.
+        let exports: BTreeSet<&str> = module
+            .exports
+            .iter()
+            .map(|export| export.name.as_str())
+            .collect();
+        for required in Self::REQUIRED_EXPORTS {
+            if !exports.contains(required) {
+                return Err(Error::CodeMissingRequiredExport(required.to_string()));
+            }
+        }
+
+        for reserved in Self::RESERVED_EXPORTS {
+            if exports.contains(reserved) {
+                return Err(Error::CodeDeclaresReservedExport(reserved.to_string()));
+            }
+        }
+
+        // Determine supported ABI sub-version.
+        let sv_exports: Vec<_> = exports
+            .iter()
+            .filter(|export| export.starts_with(EXPORT_SUB_VERSION_PREFIX))
+            .collect();
+        let abi_sv = match sv_exports[..] {
+            [] => {
+                // No versions, this is v0.
+                0
+            }
+            [sv] => {
+                // A single version, parse which one.
+                sv.strip_prefix(EXPORT_SUB_VERSION_PREFIX)
+                    .ok_or(Error::CodeMalformed)?
+                    .parse::<u32>()
+                    .map_err(|_| Error::CodeMalformed)?
+            }
+            _ => {
+                // Multiple versions.
+                return Err(Error::CodeDeclaresMultipleSubVersions);
+            }
+        };
+
+        // Verify that there is no start function defined.
+        if module.start.is_some() {
+            return Err(Error::CodeDeclaresStartFunction);
+        }
+
+        // Verify that there is at most one memory defined.
+        if module.memories.iter().count() > 1 {
+            return Err(Error::CodeDeclaresTooManyMemories);
+        }
+
+        // Verify that the code doesn't use any floating point instructions.
+        let mut function_count = 0u32;
+        for func in module.functions() {
+            let func_type = module.types.get(func.ty());
+            for val_type in func_type.params().iter().chain(func_type.results().iter()) {
+                check_valtype_acceptable(*val_type)?;
+            }
+            if let walrus::FunctionKind::Local(local) = &func.kind {
+                function_count += 1;
+                if function_count > params.max_wasm_functions {
+                    return Err(Error::CodeDeclaresTooManyFunctions);
+                }
+                let mut scanner = FloatScanner(false);
+                dfs_in_order(&mut scanner, local, local.entry_block());
+                if scanner.0 {
+                    return Err(Error::ModuleUsesFloatingPoint);
+                }
+            }
+        }
+
+        // ... or tables with floating point elements.
+        for table in module.tables.iter() {
+            check_valtype_acceptable(table.element_ty)?;
+        }
+
+        // ... or floating point elements.
+        for element in module.elements.iter() {
+            check_valtype_acceptable(element.ty)?;
+        }
+
+        // ... or floating point globals.
+        for global in module.globals.iter() {
+            check_valtype_acceptable(global.ty)?;
+        }
+
+        // ... just don't think about floats in any way.
+        let mut local_count = 0u32;
+        for local in module.locals.iter() {
+            local_count += 1;
+            if local_count > params.max_wasm_locals {
+                return Err(Error::CodeDeclaresTooManyLocals);
+            }
+            check_valtype_acceptable(local.ty())?;
+        }
+
+        Ok(Info { abi_sv })
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/code.rs.html b/rust/src/oasis_runtime_sdk_contracts/code.rs.html new file mode 100644 index 0000000000..2e585fac9e --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/code.rs.html @@ -0,0 +1,145 @@ +code.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+
//! Code caching and storage.
+use std::{
+    io::{Read, Write},
+    num::NonZeroUsize,
+    sync::Mutex,
+};
+
+use once_cell::sync::Lazy;
+
+use oasis_runtime_sdk::{
+    core::common::crypto::hash::Hash,
+    state::CurrentState,
+    storage::{self, Store},
+};
+
+use crate::{state, types, Config, Error, Module, MODULE_NAME};
+
+/// A global in-memory LRU cache of code instances.
+static CODE_CACHE: Lazy<Mutex<lru::LruCache<Hash, Vec<u8>>>> =
+    Lazy::new(|| Mutex::new(lru::LruCache::new(NonZeroUsize::new(128).unwrap())));
+
+impl<Cfg: Config> Module<Cfg> {
+    /// Loads code with the specified code identifier.
+    pub fn load_code(code_info: &types::Code) -> Result<Vec<u8>, Error> {
+        let mut cache = CODE_CACHE.lock().unwrap();
+        if let Some(code) = cache.get(&code_info.hash) {
+            return Ok(code.clone());
+        }
+
+        // TODO: Support local untrusted cache to avoid storage queries.
+        let code = CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let code_store = storage::PrefixStore::new(&mut store, &state::CODE);
+            code_store
+                .get(&code_info.id.to_storage_key())
+                .ok_or_else(|| Error::CodeNotFound(code_info.id.as_u64()))
+        })?;
+
+        // Decompress code.
+        let mut output = Vec::with_capacity(code.len());
+        let mut decoder = snap::read::FrameDecoder::new(code.as_slice());
+        decoder.read_to_end(&mut output).unwrap();
+
+        // Cache uncompressed code for later use.
+        cache.put(code_info.hash, output.clone());
+
+        Ok(output)
+    }
+
+    /// Stores code with the specified code identifier.
+    pub fn store_code(code_info: &types::Code, code: &[u8]) -> Result<(), Error> {
+        // If the code is currently cached replace it, otherwise don't do anything.
+        let mut cache = CODE_CACHE.lock().unwrap();
+        if cache.contains(&code_info.hash) {
+            cache.put(code_info.hash, code.to_vec());
+        }
+
+        // Compress code before storing it in storage.
+        let mut output = Vec::with_capacity(code.len() << 3);
+        let mut encoder = snap::write::FrameEncoder::new(&mut output);
+        encoder.write_all(code).unwrap();
+        drop(encoder); // Make sure data is flushed.
+
+        CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut code_store = storage::PrefixStore::new(&mut store, &state::CODE);
+            code_store.insert(&code_info.id.to_storage_key(), &output);
+        });
+
+        Ok(())
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/lib.rs.html b/rust/src/oasis_runtime_sdk_contracts/lib.rs.html new file mode 100644 index 0000000000..2193a1f53f --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/lib.rs.html @@ -0,0 +1,1729 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+
//! Smart contracts module.
+#![deny(rust_2018_idioms)]
+#![forbid(unsafe_code)]
+#![cfg_attr(all(feature = "benchmarks", test), feature(test))]
+
+#[cfg(test)]
+extern crate alloc;
+
+use std::{convert::TryInto, io::Read};
+
+use thiserror::Error;
+
+use oasis_contract_sdk_types::storage::StoreKind;
+use oasis_runtime_sdk::{
+    self as sdk,
+    context::Context,
+    core::common::crypto::hash::Hash,
+    handler, migration, module,
+    module::Module as _,
+    modules,
+    modules::{accounts::API as _, core::API as _},
+    runtime::Runtime,
+    sdk_derive,
+    state::CurrentState,
+    storage,
+    storage::Store,
+    types::transaction::CallFormat,
+};
+
+use crate::store::with_instance_raw_store;
+
+mod abi;
+mod code;
+mod results;
+mod store;
+#[cfg(test)]
+mod test;
+pub mod types;
+mod wasm;
+
+/// Unique module name.
+const MODULE_NAME: &str = "contracts";
+
+/// Errors emitted by the contracts module.
+#[derive(Error, Debug, sdk::Error)]
+pub enum Error {
+    #[error("invalid argument")]
+    #[sdk_error(code = 1)]
+    InvalidArgument,
+
+    #[error("code too large (size: {0} max: {1})")]
+    #[sdk_error(code = 2)]
+    CodeTooLarge(u32, u32),
+
+    #[error("code is malformed")]
+    #[sdk_error(code = 3)]
+    CodeMalformed,
+
+    #[error("specified ABI is not supported")]
+    #[sdk_error(code = 4)]
+    UnsupportedABI,
+
+    #[error("code is missing required ABI export: {0}")]
+    #[sdk_error(code = 5)]
+    CodeMissingRequiredExport(String),
+
+    #[error("code declares reserved ABI export: {0}")]
+    #[sdk_error(code = 6)]
+    CodeDeclaresReservedExport(String),
+
+    #[error("code declares start function")]
+    #[sdk_error(code = 7)]
+    CodeDeclaresStartFunction,
+
+    #[error("code declares too many memories")]
+    #[sdk_error(code = 8)]
+    CodeDeclaresTooManyMemories,
+
+    #[error("code {0} not found")]
+    #[sdk_error(code = 9)]
+    CodeNotFound(u64),
+
+    #[error("instance {0} not found")]
+    #[sdk_error(code = 10)]
+    InstanceNotFound(u64),
+
+    #[error("module loading failed")]
+    #[sdk_error(code = 11)]
+    ModuleLoadingFailed,
+
+    #[error("execution failed: {0}")]
+    #[sdk_error(code = 12)]
+    ExecutionFailed(#[source] anyhow::Error),
+
+    #[error("forbidden by policy")]
+    #[sdk_error(code = 13)]
+    Forbidden,
+
+    #[error("function not supported")]
+    #[sdk_error(code = 14)]
+    Unsupported,
+
+    #[error("insufficient balance in caller account")]
+    #[sdk_error(code = 15)]
+    InsufficientCallerBalance,
+
+    // Error code 16 is reserved.
+    #[error("result size exceeded (size: {0} max: {1})")]
+    #[sdk_error(code = 17)]
+    ResultTooLarge(u32, u32),
+
+    #[error("too many subcalls (count: {0} max: {1})")]
+    #[sdk_error(code = 18)]
+    TooManySubcalls(u16, u16),
+
+    #[error("instance is already using code {0}")]
+    #[sdk_error(code = 19)]
+    CodeAlreadyUpgraded(u64),
+
+    #[error("abort: {0}")]
+    #[sdk_error(code = 20, abort)]
+    Abort(#[from] sdk::dispatcher::Error),
+
+    #[error("storage: key too large (size: {0} max: {1})")]
+    #[sdk_error(code = 21)]
+    StorageKeyTooLarge(u32, u32),
+
+    #[error("storage: value too large (size: {0} max: {1})")]
+    #[sdk_error(code = 22)]
+    StorageValueTooLarge(u32, u32),
+
+    #[error("crypto: msg too large (size: {0} max: {1})")]
+    #[sdk_error(code = 23)]
+    CryptoMsgTooLarge(u32, u32),
+
+    #[error("crypto: malformed public key")]
+    #[sdk_error(code = 24)]
+    CryptoMalformedPublicKey,
+
+    #[error("code declares multiple sub-versions")]
+    #[sdk_error(code = 25)]
+    CodeDeclaresMultipleSubVersions,
+
+    #[error("crypto: malformed private key")]
+    #[sdk_error(code = 26)]
+    CryptoMalformedPrivateKey,
+
+    #[error("crypto: malformed encryption key")]
+    #[sdk_error(code = 27)]
+    CryptoMalformedKey,
+
+    #[error("crypto: malformed nonce")]
+    #[sdk_error(code = 28)]
+    CryptoMalformedNonce,
+
+    #[error("crypto: key derivation function failure")]
+    #[sdk_error(code = 29)]
+    CryptoKeyDerivationFunctionFailure,
+
+    #[error("module uses floating point data or operations")]
+    #[sdk_error(code = 30)]
+    ModuleUsesFloatingPoint,
+
+    #[error("code declares too many functions")]
+    #[sdk_error(code = 31)]
+    CodeDeclaresTooManyFunctions,
+
+    #[error("code declares too many locals")]
+    #[sdk_error(code = 32)]
+    CodeDeclaresTooManyLocals,
+
+    #[error("core: {0}")]
+    #[sdk_error(transparent)]
+    Core(#[from] modules::core::Error),
+
+    #[error("contract error: {0}")]
+    #[sdk_error(transparent)]
+    Contract(#[from] wasm::ContractError),
+}
+
+/// Events emitted by the contracts module.
+#[derive(Debug, cbor::Encode, sdk::Event)]
+#[cbor(untagged)]
+pub enum Event {}
+
+/// Gas costs.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub struct GasCosts {
+    pub tx_upload: u64,
+    pub tx_upload_per_byte: u64,
+    pub tx_instantiate: u64,
+    pub tx_call: u64,
+    pub tx_upgrade: u64,
+    pub tx_change_upgrade_policy: u64,
+
+    // Subcalls.
+    pub subcall_dispatch: u64,
+
+    // Storage operations.
+    pub wasm_public_storage_get_base: u64,
+    pub wasm_public_storage_insert_base: u64,
+    pub wasm_public_storage_remove_base: u64,
+    pub wasm_public_storage_key_byte: u64,
+    pub wasm_public_storage_value_byte: u64,
+    pub wasm_confidential_storage_get_base: u64,
+    pub wasm_confidential_storage_insert_base: u64,
+    pub wasm_confidential_storage_remove_base: u64,
+    pub wasm_confidential_storage_key_byte: u64,
+    pub wasm_confidential_storage_value_byte: u64,
+    pub wasm_env_query_base: u64,
+
+    // Crypto operations.
+    pub wasm_crypto_ecdsa_recover: u64,
+    pub wasm_crypto_signature_verify_ed25519: u64,
+    pub wasm_crypto_signature_verify_secp256k1: u64,
+    pub wasm_crypto_signature_verify_sr25519: u64,
+    pub wasm_crypto_x25519_derive_symmetric: u64,
+    pub wasm_crypto_deoxysii_base: u64,
+    pub wasm_crypto_deoxysii_byte: u64,
+    pub wasm_crypto_random_bytes_base: u64,
+    pub wasm_crypto_random_bytes_byte: u64,
+}
+
+impl Default for GasCosts {
+    fn default() -> Self {
+        // The below assume a batch gas limit of 1_000_000_000 ~ 1s.
+        GasCosts {
+            tx_upload: 30_000_000,
+            tx_upload_per_byte: 400,
+            tx_instantiate: 100_000,
+            tx_call: 50_000,
+            tx_upgrade: 50_000,
+            tx_change_upgrade_policy: 30_000,
+
+            subcall_dispatch: 1_000,
+
+            wasm_public_storage_get_base: 5_000,
+            wasm_public_storage_insert_base: 8_400,
+            wasm_public_storage_remove_base: 6_400,
+            wasm_public_storage_key_byte: 3_000,
+            wasm_public_storage_value_byte: 300,
+            wasm_confidential_storage_get_base: 10_000,
+            wasm_confidential_storage_insert_base: 16_800,
+            wasm_confidential_storage_remove_base: 12_800,
+            wasm_confidential_storage_key_byte: 3_500,
+            wasm_confidential_storage_value_byte: 400,
+            wasm_env_query_base: 100,
+
+            wasm_crypto_ecdsa_recover: 500_000,
+            wasm_crypto_signature_verify_ed25519: 500_000,
+            wasm_crypto_signature_verify_secp256k1: 500_000,
+            wasm_crypto_signature_verify_sr25519: 500_000,
+            wasm_crypto_x25519_derive_symmetric: 250_000,
+            wasm_crypto_deoxysii_base: 1_000,
+            wasm_crypto_deoxysii_byte: 3,
+            wasm_crypto_random_bytes_base: 1_000,
+            wasm_crypto_random_bytes_byte: 3,
+        }
+    }
+}
+
+/// Parameters for the contracts module.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub struct Parameters {
+    pub max_code_size: u32,
+    pub max_stack_size: u32,
+    pub max_memory_pages: u32,
+
+    pub max_wasm_functions: u32,
+    pub max_wasm_locals: u32,
+
+    pub max_subcall_depth: u16,
+    pub max_subcall_count: u16,
+
+    pub max_result_size_bytes: u32,
+    pub max_query_size_bytes: u32,
+    pub max_storage_key_size_bytes: u32,
+    pub max_storage_value_size_bytes: u32,
+    pub max_crypto_signature_verify_message_size_bytes: u32,
+
+    pub gas_costs: GasCosts,
+}
+
+impl Default for Parameters {
+    fn default() -> Self {
+        Parameters {
+            max_code_size: 1024 * 1024, // 1 MiB
+            max_stack_size: 60 * 1024,  // 60 KiB
+            max_memory_pages: 160,      // 10 MiB
+
+            max_wasm_functions: 10_000,
+            max_wasm_locals: 256_000,
+
+            max_subcall_depth: 8,
+            max_subcall_count: 16,
+
+            max_result_size_bytes: 1024, // 1 KiB
+            max_query_size_bytes: 1024,  // 1 KiB
+            max_storage_key_size_bytes: 64,
+            max_storage_value_size_bytes: 16 * 1024, // 16 KiB
+            max_crypto_signature_verify_message_size_bytes: 16 * 1024, // 16KiB
+
+            gas_costs: Default::default(),
+        }
+    }
+}
+
+impl module::Parameters for Parameters {
+    type Error = std::convert::Infallible;
+}
+
+/// Genesis state for the contracts module.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct Genesis {
+    pub parameters: Parameters,
+}
+
+/// Local configuration that can be provided by the node operator.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+pub struct LocalConfig {
+    /// Gas limit for custom queries that invoke smart contracts.
+    #[cbor(optional)]
+    pub query_custom_max_gas: u64,
+
+    /// Maximum number of items per page in InstanceRawStorage query result.
+    #[cbor(optional)]
+    pub max_instance_raw_storage_query_items: u64,
+}
+
+impl Default for LocalConfig {
+    fn default() -> Self {
+        Self {
+            query_custom_max_gas: 10_000_000,
+            max_instance_raw_storage_query_items: 100,
+        }
+    }
+}
+
+/// State schema constants.
+pub mod state {
+    /// Next code identifier (u64).
+    pub const NEXT_CODE_IDENTIFIER: &[u8] = &[0x01];
+    /// Next instance identifier (u64).
+    pub const NEXT_INSTANCE_IDENTIFIER: &[u8] = &[0x02];
+    /// Information about uploaded code.
+    pub const CODE_INFO: &[u8] = &[0x03];
+    /// Information about the deployed contract instance.
+    pub const INSTANCE_INFO: &[u8] = &[0x04];
+    /// Per-instance key/value store.
+    pub const INSTANCE_STATE: &[u8] = &[0x05];
+
+    /// Uploaded code.
+    pub const CODE: &[u8] = &[0xFF];
+}
+
+/// Module configuration.
+pub trait Config: 'static {}
+
+pub struct Module<Cfg: Config> {
+    _cfg: std::marker::PhantomData<Cfg>,
+}
+
+impl<Cfg: Config> Module<Cfg> {
+    /// Loads code information for the specified code identifier.
+    fn load_code_info(code_id: types::CodeId) -> Result<types::Code, Error> {
+        CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let code_info_store =
+                storage::TypedStore::new(storage::PrefixStore::new(&mut store, &state::CODE_INFO));
+            let code_info = code_info_store
+                .get(code_id.to_storage_key())
+                .ok_or_else(|| Error::CodeNotFound(code_id.as_u64()))?;
+
+            Ok(code_info)
+        })
+    }
+
+    /// Stores specified code information.
+    fn store_code_info(code_info: types::Code) -> Result<(), Error> {
+        CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut code_info_store =
+                storage::TypedStore::new(storage::PrefixStore::new(&mut store, &state::CODE_INFO));
+            code_info_store.insert(code_info.id.to_storage_key(), code_info);
+
+            Ok(())
+        })
+    }
+
+    /// Loads specified instance information.
+    fn load_instance_info(instance_id: types::InstanceId) -> Result<types::Instance, Error> {
+        CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let instance_info_store = storage::TypedStore::new(storage::PrefixStore::new(
+                &mut store,
+                &state::INSTANCE_INFO,
+            ));
+            let instance_info = instance_info_store
+                .get(instance_id.to_storage_key())
+                .ok_or_else(|| Error::InstanceNotFound(instance_id.as_u64()))?;
+
+            Ok(instance_info)
+        })
+    }
+
+    /// Stores specified instance information.
+    fn store_instance_info(instance_info: types::Instance) -> Result<(), Error> {
+        CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut instance_info_store = storage::TypedStore::new(storage::PrefixStore::new(
+                &mut store,
+                &state::INSTANCE_INFO,
+            ));
+            instance_info_store.insert(instance_info.id.to_storage_key(), instance_info);
+
+            Ok(())
+        })
+    }
+}
+
+#[sdk_derive(Module)]
+impl<Cfg: Config> Module<Cfg> {
+    const NAME: &'static str = MODULE_NAME;
+    type Error = Error;
+    type Event = Event;
+    type Parameters = Parameters;
+    type Genesis = Genesis;
+
+    #[migration(init)]
+    fn init(genesis: Genesis) {
+        // Set genesis parameters.
+        Self::set_params(genesis.parameters);
+    }
+
+    #[handler(call = "contracts.Upload")]
+    pub fn tx_upload<C: Context>(
+        ctx: &C,
+        body: types::Upload,
+    ) -> Result<types::UploadResult, Error> {
+        let params = Self::params();
+        let uploader = CurrentState::with_env(|env| env.tx_caller_address());
+
+        // Validate code size.
+        let code_size: u32 = body
+            .code
+            .len()
+            .try_into()
+            .map_err(|_| Error::CodeTooLarge(u32::MAX, params.max_code_size))?;
+        if code_size > params.max_code_size {
+            return Err(Error::CodeTooLarge(code_size, params.max_code_size));
+        }
+
+        // Account for base gas.
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_upload)?;
+        <C::Runtime as Runtime>::Core::use_tx_gas(
+            params
+                .gas_costs
+                .tx_upload_per_byte
+                .saturating_mul(body.code.len() as u64),
+        )?;
+
+        // Decompress code.
+        let mut code = Vec::with_capacity(body.code.len());
+        let decoder = snap::read::FrameDecoder::new(body.code.as_slice());
+        decoder
+            .take(params.max_code_size.into())
+            .read_to_end(&mut code)
+            .map_err(|_| Error::CodeMalformed)?;
+
+        // Account for extra gas needed after decompression.
+        let plain_code_size: u32 = code.len().try_into().unwrap();
+        <C::Runtime as Runtime>::Core::use_tx_gas(
+            params
+                .gas_costs
+                .tx_upload_per_byte
+                .saturating_mul(plain_code_size.saturating_sub(code_size) as u64),
+        )?;
+
+        if !ctx.should_execute_contracts() {
+            // Only fast checks are allowed.
+            return Ok(types::UploadResult::default());
+        }
+
+        // Validate and transform the code.
+        let (code, abi_info) = wasm::validate_and_transform::<Cfg, C>(&code, body.abi, &params)?;
+        let hash = Hash::digest_bytes(&code);
+
+        // Validate code size again and account for any instrumentation. This is here to avoid any
+        // incentives in generating code that gets maximally inflated after instrumentation.
+        let inst_code_size: u32 = code
+            .len()
+            .try_into()
+            .map_err(|_| Error::CodeTooLarge(u32::MAX, params.max_code_size))?;
+        if inst_code_size > params.max_code_size {
+            return Err(Error::CodeTooLarge(inst_code_size, params.max_code_size));
+        }
+        <C::Runtime as Runtime>::Core::use_tx_gas(
+            params
+                .gas_costs
+                .tx_upload_per_byte
+                .saturating_mul(inst_code_size.saturating_sub(plain_code_size) as u64),
+        )?;
+
+        // Assign next identifier.
+        let id = CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut tstore = storage::TypedStore::new(&mut store);
+            let id: types::CodeId = tstore.get(state::NEXT_CODE_IDENTIFIER).unwrap_or_default();
+            tstore.insert(state::NEXT_CODE_IDENTIFIER, id.increment());
+            id
+        });
+
+        // Store information about uploaded code.
+        let code_info = types::Code {
+            id,
+            hash,
+            abi: body.abi,
+            abi_sv: abi_info.abi_sv,
+            uploader,
+            instantiate_policy: body.instantiate_policy,
+        };
+        Self::store_code(&code_info, &code)?;
+        Self::store_code_info(code_info)?;
+
+        Ok(types::UploadResult { id })
+    }
+
+    #[handler(call = "contracts.Instantiate")]
+    pub fn tx_instantiate<C: Context>(
+        ctx: &C,
+        body: types::Instantiate,
+    ) -> Result<types::InstantiateResult, Error> {
+        let params = Self::params();
+        let creator = CurrentState::with_env(|env| env.tx_caller_address());
+
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_instantiate)?;
+
+        if !ctx.should_execute_contracts() {
+            // Only fast checks are allowed.
+            return Ok(types::InstantiateResult::default());
+        }
+
+        // Load code information, enforce instantiation policy and load the code.
+        let code_info = Self::load_code_info(body.code_id)?;
+        code_info.instantiate_policy.enforce(&creator)?;
+        let code = Self::load_code(&code_info)?;
+
+        // Assign next identifier.
+        let id = CurrentState::with_store(|store| {
+            let mut store = storage::PrefixStore::new(store, &MODULE_NAME);
+            let mut tstore = storage::TypedStore::new(&mut store);
+            let id: types::InstanceId = tstore
+                .get(state::NEXT_INSTANCE_IDENTIFIER)
+                .unwrap_or_default();
+            tstore.insert(state::NEXT_INSTANCE_IDENTIFIER, id.increment());
+            id
+        });
+
+        // Store instance information.
+        let instance_info = types::Instance {
+            id,
+            code_id: body.code_id,
+            creator,
+            upgrades_policy: body.upgrades_policy,
+        };
+        Self::store_instance_info(instance_info.clone())?;
+
+        // Transfer any attached tokens.
+        for tokens in &body.tokens {
+            <C::Runtime as Runtime>::Accounts::transfer(creator, instance_info.address(), tokens)
+                .map_err(|_| Error::InsufficientCallerBalance)?
+        }
+        // Run instantiation function.
+        let contract = wasm::Contract {
+            code_info: &code_info,
+            code: &code,
+            instance_info: &instance_info,
+        };
+        let mut exec_ctx = abi::ExecutionContext::new(
+            &params,
+            &code_info,
+            &instance_info,
+            <C::Runtime as Runtime>::Core::remaining_tx_gas(),
+            creator,
+            CurrentState::with_env(|env| env.is_read_only()),
+            CurrentState::with_env(|env| env.tx_call_format()),
+            ctx,
+        );
+        let result = wasm::instantiate::<Cfg, C>(&mut exec_ctx, &contract, &body);
+
+        let result = results::process_execution_result(ctx, result)?;
+        results::process_execution_success::<Cfg, C>(ctx, &params, &contract, result)?;
+        Ok(types::InstantiateResult { id })
+    }
+
+    #[handler(call = "contracts.Call", allow_interactive)]
+    pub fn tx_call<C: Context>(ctx: &C, body: types::Call) -> Result<types::CallResult, Error> {
+        let params = Self::params();
+        let caller = CurrentState::with_env(|env| env.tx_caller_address());
+
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_call)?;
+
+        if !ctx.should_execute_contracts() {
+            // Only fast checks are allowed.
+            return Ok(types::CallResult::default());
+        }
+
+        // Load instance information and code.
+        let instance_info = Self::load_instance_info(body.id)?;
+        let code_info = Self::load_code_info(instance_info.code_id)?;
+        let code = Self::load_code(&code_info)?;
+
+        // Transfer any attached tokens.
+        for tokens in &body.tokens {
+            <C::Runtime as Runtime>::Accounts::transfer(caller, instance_info.address(), tokens)
+                .map_err(|_| Error::InsufficientCallerBalance)?
+        }
+        // Run call function.
+        let contract = wasm::Contract {
+            code_info: &code_info,
+            code: &code,
+            instance_info: &instance_info,
+        };
+        let mut exec_ctx = abi::ExecutionContext::new(
+            &params,
+            &code_info,
+            &instance_info,
+            <C::Runtime as Runtime>::Core::remaining_tx_gas(),
+            caller,
+            CurrentState::with_env(|env| env.is_read_only()),
+            CurrentState::with_env(|env| env.tx_call_format()),
+            ctx,
+        );
+        let result = wasm::call::<Cfg, C>(&mut exec_ctx, &contract, &body);
+
+        let result = results::process_execution_result(ctx, result)?;
+        let data = results::process_execution_success::<Cfg, C>(ctx, &params, &contract, result)?;
+        Ok(types::CallResult(data))
+    }
+
+    #[handler(call = "contracts.ChangeUpgradePolicy")]
+    pub fn tx_change_upgrade_policy<C: Context>(
+        ctx: &C,
+        body: types::ChangeUpgradePolicy,
+    ) -> Result<(), Error> {
+        let params = Self::params();
+        let caller = CurrentState::with_env(|env| env.tx_caller_address());
+
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_change_upgrade_policy)?;
+
+        if CurrentState::with_env(|env| env.is_check_only()) {
+            return Ok(());
+        }
+
+        // Load instance information.
+        let mut instance_info = Self::load_instance_info(body.id)?;
+        instance_info.upgrades_policy.enforce(&caller)?;
+
+        // Change upgrade policy.
+        instance_info.upgrades_policy = body.upgrades_policy;
+        Self::store_instance_info(instance_info.clone())?;
+
+        Ok(())
+    }
+
+    #[handler(call = "contracts.Upgrade")]
+    pub fn tx_upgrade<C: Context>(ctx: &C, body: types::Upgrade) -> Result<(), Error> {
+        let params = Self::params();
+        let caller = CurrentState::with_env(|env| env.tx_caller_address());
+
+        <C::Runtime as Runtime>::Core::use_tx_gas(params.gas_costs.tx_upgrade)?;
+
+        if !ctx.should_execute_contracts() {
+            // Only fast checks are allowed.
+            return Ok(());
+        }
+
+        // Load instance information and code.
+        let mut instance_info = Self::load_instance_info(body.id)?;
+        instance_info.upgrades_policy.enforce(&caller)?;
+        if instance_info.code_id == body.code_id {
+            return Err(Error::CodeAlreadyUpgraded(body.code_id.as_u64()));
+        }
+        let code_info = Self::load_code_info(instance_info.code_id)?;
+        let code = Self::load_code(&code_info)?;
+
+        // Transfer any attached tokens.
+        for tokens in &body.tokens {
+            <C::Runtime as Runtime>::Accounts::transfer(caller, instance_info.address(), tokens)
+                .map_err(|_| Error::InsufficientCallerBalance)?
+        }
+        // Run pre-upgrade function on the previous contract.
+        let contract = wasm::Contract {
+            code_info: &code_info,
+            code: &code,
+            instance_info: &instance_info,
+        };
+        let mut exec_ctx = abi::ExecutionContext::new(
+            &params,
+            &code_info,
+            &instance_info,
+            <C::Runtime as Runtime>::Core::remaining_tx_gas(),
+            caller,
+            CurrentState::with_env(|env| env.is_read_only()),
+            CurrentState::with_env(|env| env.tx_call_format()),
+            ctx,
+        );
+        // Pre-upgrade invocation must succeed for the upgrade to proceed.
+        let result = wasm::pre_upgrade::<Cfg, C>(&mut exec_ctx, &contract, &body);
+
+        results::process_execution_result(ctx, result)?;
+
+        // Update the contract code.
+        instance_info.code_id = body.code_id;
+        let code_info = Self::load_code_info(instance_info.code_id)?;
+        let code = Self::load_code(&code_info)?;
+        Self::store_instance_info(instance_info.clone())?;
+
+        let contract = wasm::Contract {
+            code_info: &code_info,
+            code: &code,
+            instance_info: &instance_info,
+        };
+        let mut exec_ctx = abi::ExecutionContext::new(
+            &params,
+            &code_info,
+            &instance_info,
+            <C::Runtime as Runtime>::Core::remaining_tx_gas(),
+            caller,
+            CurrentState::with_env(|env| env.is_read_only()),
+            CurrentState::with_env(|env| env.tx_call_format()),
+            ctx,
+        );
+
+        // Run post-upgrade function on the new contract.
+        let result = wasm::post_upgrade::<Cfg, C>(&mut exec_ctx, &contract, &body);
+        results::process_execution_result(ctx, result)?;
+        Ok(())
+    }
+
+    #[handler(query = "contracts.Code")]
+    pub fn query_code<C: Context>(_ctx: &C, args: types::CodeQuery) -> Result<types::Code, Error> {
+        Self::load_code_info(args.id)
+    }
+
+    #[handler(query = "contracts.CodeStorage")]
+    pub fn query_code_storage<C: Context>(
+        _ctx: &C,
+        args: types::CodeStorageQuery,
+    ) -> Result<types::CodeStorageQueryResult, Error> {
+        let code_info = Self::load_code_info(args.id)?;
+        let code = Self::load_code(&code_info)?;
+
+        Ok(types::CodeStorageQueryResult { code })
+    }
+
+    #[handler(query = "contracts.Instance")]
+    pub fn query_instance<C: Context>(
+        _ctx: &C,
+        args: types::InstanceQuery,
+    ) -> Result<types::Instance, Error> {
+        Self::load_instance_info(args.id)
+    }
+
+    #[handler(query = "contracts.InstanceStorage")]
+    pub fn query_instance_storage<C: Context>(
+        ctx: &C,
+        args: types::InstanceStorageQuery,
+    ) -> Result<types::InstanceStorageQueryResult, Error> {
+        let instance_info = Self::load_instance_info(args.id)?;
+        // NOTE: We can only access the public store here.
+        let value = store::with_instance_store(ctx, &instance_info, StoreKind::Public, |store| {
+            store.get(&args.key)
+        })?;
+
+        Ok(types::InstanceStorageQueryResult { value })
+    }
+
+    #[handler(query = "contracts.InstanceRawStorage", expensive)]
+    pub fn query_instance_raw_storage<C: Context>(
+        ctx: &C,
+        args: types::InstanceRawStorageQuery,
+    ) -> Result<types::InstanceRawStorageQueryResult, Error> {
+        let cfg: LocalConfig = ctx.local_config(MODULE_NAME).unwrap_or_default();
+        let limit: usize = args
+            .limit
+            .unwrap_or(u64::MAX)
+            .min(cfg.max_instance_raw_storage_query_items)
+            .try_into()
+            .map_err(|_| Error::InvalidArgument)?;
+        let offset: usize = args
+            .offset
+            .unwrap_or(0)
+            .try_into()
+            .map_err(|_| Error::InvalidArgument)?;
+
+        let instance_info = Self::load_instance_info(args.id)?;
+        // Convert contracts API StoreKind to internal storage StoreKind.
+        let sk: StoreKind = (args.store_kind as u32)
+            .try_into()
+            .map_err(|_| Error::InvalidArgument)?;
+
+        let items: Vec<(Vec<u8>, Vec<u8>)> = with_instance_raw_store(&instance_info, sk, |store| {
+            store
+                .iter()
+                // Shave off first 32 bytes of the key to get the contract instance-level key name.
+                .filter(|(k, _)| k.len() >= 32)
+                .map(|(k, v)| (k[32..].to_vec(), v.to_vec()))
+                .skip(offset)
+                .take(limit)
+                .collect()
+        });
+
+        Ok(types::InstanceRawStorageQueryResult { items })
+    }
+
+    #[handler(query = "contracts.PublicKey")]
+    pub fn query_public_key<C: Context>(
+        _ctx: &C,
+        _args: types::PublicKeyQuery,
+    ) -> Result<types::PublicKeyQueryResult, Error> {
+        Err(Error::Unsupported)
+    }
+
+    #[handler(query = "contracts.Custom", expensive)]
+    pub fn query_custom<C: Context>(
+        ctx: &C,
+        args: types::CustomQuery,
+    ) -> Result<types::CustomQueryResult, Error> {
+        let params = Self::params();
+
+        // Load instance information and code.
+        let instance_info = Self::load_instance_info(args.id)?;
+        let code_info = Self::load_code_info(instance_info.code_id)?;
+        let code = Self::load_code(&code_info)?;
+
+        // Load local configuration.
+        let cfg: LocalConfig = ctx.local_config(MODULE_NAME).unwrap_or_default();
+
+        // Run query function.
+        let contract = wasm::Contract {
+            code_info: &code_info,
+            code: &code,
+            instance_info: &instance_info,
+        };
+        let mut exec_ctx = abi::ExecutionContext::new(
+            &params,
+            &code_info,
+            &instance_info,
+            cfg.query_custom_max_gas,
+            Default::default(), // No caller for queries.
+            true,
+            CallFormat::Plain,
+            ctx,
+        );
+        let result = wasm::query::<Cfg, C>(&mut exec_ctx, &contract, &args).inner?; // No need to handle gas.
+
+        Ok(types::CustomQueryResult(result.data))
+    }
+}
+
+impl<Cfg: Config> module::TransactionHandler for Module<Cfg> {}
+impl<Cfg: Config> module::BlockHandler for Module<Cfg> {}
+impl<Cfg: Config> module::InvariantHandler for Module<Cfg> {}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/results.rs.html b/rust/src/oasis_runtime_sdk_contracts/results.rs.html new file mode 100644 index 0000000000..6ea1c0a8d8 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/results.rs.html @@ -0,0 +1,393 @@ +results.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+
//! Processing of execution results.
+use std::convert::TryInto;
+
+use oasis_contract_sdk_types::{
+    event::Event,
+    message::{Message, NotifyReply, Reply},
+    ExecutionOk,
+};
+use oasis_runtime_sdk::{
+    context::Context,
+    event::etag_for_event,
+    modules::core::API as _,
+    runtime::Runtime,
+    state::CurrentState,
+    subcall::{self, SubcallInfo},
+    types::transaction::CallerAddress,
+};
+
+use crate::{
+    abi::{ExecutionContext, ExecutionResult},
+    types::ContractEvent,
+    wasm, Config, Error, Parameters, MODULE_NAME,
+};
+
+/// Process an execution result by performing gas accounting and returning the inner result.
+pub(crate) fn process_execution_result<C: Context>(
+    _ctx: &C,
+    result: ExecutionResult,
+) -> Result<ExecutionOk, Error> {
+    // The following call should never fail as we accounted for all the gas in advance.
+    <C::Runtime as Runtime>::Core::use_tx_gas(result.gas_used)?;
+
+    result.inner
+}
+
+/// Process a successful execution result.
+pub(crate) fn process_execution_success<Cfg: Config, C: Context>(
+    ctx: &C,
+    params: &Parameters,
+    contract: &wasm::Contract<'_>,
+    result: ExecutionOk,
+) -> Result<Vec<u8>, Error> {
+    // Process events.
+    process_events(contract, result.events)?;
+    // Process subcalls.
+    let result = process_subcalls::<Cfg, C>(ctx, params, contract, result.messages, result.data)?;
+
+    Ok(result)
+}
+
+fn process_events(contract: &wasm::Contract<'_>, events: Vec<Event>) -> Result<(), Error> {
+    // Transform contract events into tags using the SDK scheme.
+    CurrentState::with(|state| {
+        for event in events {
+            state.emit_event_raw(etag_for_event(
+                &if event.module.is_empty() {
+                    format!("{}.{}", MODULE_NAME, contract.code_info.id.as_u64())
+                } else {
+                    format!(
+                        "{}.{}.{}",
+                        MODULE_NAME,
+                        contract.code_info.id.as_u64(),
+                        event.module,
+                    )
+                },
+                event.code,
+                cbor::to_value(ContractEvent {
+                    id: contract.instance_info.id,
+                    data: event.data,
+                }),
+            ));
+        }
+    });
+
+    Ok(())
+}
+
+fn process_subcalls<Cfg: Config, C: Context>(
+    ctx: &C,
+    params: &Parameters,
+    contract: &wasm::Contract<'_>,
+    messages: Vec<Message>,
+    data: Vec<u8>,
+) -> Result<Vec<u8>, Error> {
+    // By default the resulting data is what the call returned. Message reply processing may
+    // overwrite this data when it is non-empty.
+    let mut result_data = data;
+
+    // Charge gas for each emitted message.
+    <C::Runtime as Runtime>::Core::use_tx_gas(
+        params
+            .gas_costs
+            .subcall_dispatch
+            .saturating_mul(messages.len() as u64),
+    )?;
+
+    // Make sure the number of subcalls is within limits.
+    let message_count = messages
+        .len()
+        .try_into()
+        .map_err(|_| Error::TooManySubcalls(u16::MAX, params.max_subcall_count))?;
+    if message_count > params.max_subcall_count {
+        return Err(Error::TooManySubcalls(
+            message_count,
+            params.max_subcall_count,
+        ));
+    }
+
+    // Properly propagate original call format and read-only flag.
+    let (orig_call_format, orig_read_only) =
+        CurrentState::with_env(|env| (env.tx_call_format(), env.is_read_only()));
+
+    // Process emitted messages recursively.
+    for msg in messages {
+        match msg {
+            Message::Call {
+                id,
+                data,
+                reply,
+                method,
+                body,
+                max_gas,
+            } => {
+                // Compute the amount of gas that can be used.
+                let remaining_gas = <C::Runtime as Runtime>::Core::remaining_tx_gas();
+                let max_gas = max_gas.unwrap_or(remaining_gas);
+                let max_gas = if max_gas > remaining_gas {
+                    remaining_gas
+                } else {
+                    max_gas
+                };
+
+                let result = subcall::call(
+                    ctx,
+                    SubcallInfo {
+                        caller: CallerAddress::Address(contract.instance_info.address()),
+                        method,
+                        body,
+                        max_depth: params.max_subcall_depth,
+                        max_gas,
+                    },
+                    subcall::AllowAllValidator,
+                )?;
+
+                // Use any gas that was used inside the child context. This should never fail as we
+                // preconfigured the amount of available gas.
+                <C::Runtime as Runtime>::Core::use_tx_gas(result.gas_used)?;
+
+                // Process replies based on filtering criteria.
+                let result = result.call_result;
+                match (reply, result.is_success()) {
+                    (NotifyReply::OnError, false)
+                    | (NotifyReply::OnSuccess, true)
+                    | (NotifyReply::Always, _) => {
+                        // Construct and process reply.
+                        let reply = Reply::Call {
+                            id,
+                            result: result.into(),
+                            data,
+                        };
+                        let mut exec_ctx = ExecutionContext::new(
+                            params,
+                            contract.code_info,
+                            contract.instance_info,
+                            <C::Runtime as Runtime>::Core::remaining_tx_gas(),
+                            CurrentState::with_env(|env| env.tx_caller_address()),
+                            orig_read_only,
+                            orig_call_format,
+                            ctx,
+                        );
+                        let reply_result =
+                            wasm::handle_reply::<Cfg, C>(&mut exec_ctx, contract, reply);
+                        let reply_result = process_execution_result(ctx, reply_result)?;
+                        let reply_result = process_execution_success::<Cfg, C>(
+                            ctx,
+                            params,
+                            contract,
+                            reply_result,
+                        )?;
+
+                        // If there is a non-empty reply, it overwrites the returned data.
+                        if !reply_result.is_empty() {
+                            result_data = reply_result;
+                        }
+                    }
+                    _ => {}
+                }
+            }
+
+            // Message not supported.
+            _ => return Err(Error::Unsupported),
+        }
+    }
+
+    Ok(result_data)
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/store.rs.html b/rust/src/oasis_runtime_sdk_contracts/store.rs.html new file mode 100644 index 0000000000..0dfdd04fe8 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/store.rs.html @@ -0,0 +1,231 @@ +store.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+
//! Contract storage.
+use oasis_contract_sdk_types::storage::StoreKind;
+use oasis_runtime_sdk::{
+    context::Context,
+    dispatcher,
+    keymanager::{self, StateKey},
+    state::CurrentState,
+    storage::{self, Store},
+    subcall,
+};
+
+use crate::{state, types, Error, MODULE_NAME};
+
+/// Confidential store key pair ID domain separation context base.
+pub const CONFIDENTIAL_STORE_KEY_PAIR_ID_CONTEXT_BASE: &[u8] =
+    b"oasis-runtime-sdk/contracts: state";
+
+const CONTEXT_KEY_CONFIDENTIAL_STORE_INSTANCE_COUNT: &str = "contracts.ConfidentialStoreCounter";
+
+/// Run a closure with the contract instance store.
+///
+/// Confidential stores will only work when private key queries for the key
+/// manager are available. In others, an error will be returned describing the
+/// particular key manager failure.
+pub fn with_instance_store<C, F, R>(
+    ctx: &C,
+    instance_info: &types::Instance,
+    store_kind: StoreKind,
+    f: F,
+) -> Result<R, Error>
+where
+    C: Context,
+    F: FnOnce(&mut dyn Store) -> R,
+{
+    // subcall_count, instance_count, round are all used as nonce derivation context
+    // in the confidential store. Along with confidential_key, they all need ctx,
+    // which becomes unavailable after the first PrefixStore is created, since that
+    // keeps a mutable reference to it (via runtime_state()).
+    let subcall_count = if let StoreKind::Confidential = store_kind {
+        subcall::get_current_subcall_depth(ctx)
+    } else {
+        0
+    };
+    let instance_count: Option<usize> = if let StoreKind::Confidential = store_kind {
+        CurrentState::with(|state| {
+            let cnt = *state
+                .block_value(CONTEXT_KEY_CONFIDENTIAL_STORE_INSTANCE_COUNT)
+                .or_default();
+            state
+                .block_value(CONTEXT_KEY_CONFIDENTIAL_STORE_INSTANCE_COUNT)
+                .set(cnt + 1);
+            Some(cnt)
+        })
+    } else {
+        None
+    };
+    let round = ctx.runtime_header().round;
+    let confidential_key: Option<StateKey> = if let StoreKind::Confidential = store_kind {
+        let kmgr_client = ctx.key_manager().ok_or(Error::Unsupported)?;
+        let kid = keymanager::get_key_pair_id([
+            CONFIDENTIAL_STORE_KEY_PAIR_ID_CONTEXT_BASE,
+            &instance_info.id.to_storage_key(),
+        ]);
+        let kp = kmgr_client
+            .get_or_create_keys(kid)
+            .map_err(|err| Error::Abort(dispatcher::Error::KeyManagerFailure(err)))?;
+        Some(kp.state_key)
+    } else {
+        None
+    };
+
+    with_instance_raw_store(instance_info, store_kind, |contract_state| {
+        match store_kind {
+            // For public storage we use a hashed store using the Blake3 hash function.
+            StoreKind::Public => Ok(f(&mut storage::HashedStore::<_, blake3::Hasher>::new(
+                contract_state,
+            ))),
+
+            StoreKind::Confidential => {
+                let mut confidential_store = storage::ConfidentialStore::new_with_key(
+                    contract_state,
+                    confidential_key.unwrap().0,
+                    &[
+                        round.to_le_bytes().as_slice(),
+                        subcall_count.to_le_bytes().as_slice(),
+                        instance_count.unwrap().to_le_bytes().as_slice(),
+                    ],
+                );
+                Ok(f(&mut confidential_store))
+            }
+        }
+    })
+}
+
+/// Run a closure with the per-contract-instance raw (public) store.
+pub fn with_instance_raw_store<F, R>(
+    instance_info: &types::Instance,
+    store_kind: StoreKind,
+    f: F,
+) -> R
+where
+    F: FnOnce(&mut dyn Store) -> R,
+{
+    CurrentState::with_store(|store| {
+        let store = storage::PrefixStore::new(store, &MODULE_NAME);
+        let instance_prefix = instance_info.id.to_storage_key();
+        let contract_state = storage::PrefixStore::new(
+            storage::PrefixStore::new(store, &state::INSTANCE_STATE),
+            instance_prefix,
+        );
+
+        let mut store = storage::PrefixStore::new(contract_state, store_kind.prefix());
+        f(&mut store)
+    })
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/types.rs.html b/rust/src/oasis_runtime_sdk_contracts/types.rs.html new file mode 100644 index 0000000000..0f5c04d6d9 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/types.rs.html @@ -0,0 +1,721 @@ +types.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+
//! Contracts module types.
+pub use oasis_contract_sdk_types::{CodeId, InstanceId};
+use oasis_runtime_sdk::{
+    core::common::crypto::hash::Hash,
+    types::{address::Address, token},
+};
+
+use super::{Error, MODULE_NAME};
+
+/// A generic policy that specifies who is allowed to perform an action.
+#[derive(Clone, Copy, Debug, cbor::Encode, cbor::Decode)]
+pub enum Policy {
+    #[cbor(rename = "nobody", as_struct)]
+    Nobody,
+
+    #[cbor(rename = "address")]
+    Address(Address),
+
+    #[cbor(rename = "everyone", as_struct)]
+    Everyone,
+}
+
+impl Policy {
+    /// Enforce the given policy by returning an error if the policy is not satisfied.
+    pub fn enforce(&self, caller: &Address) -> Result<(), Error> {
+        match self {
+            // Nobody is allowed to perform the action.
+            Policy::Nobody => Err(Error::Forbidden),
+            // Only the given caller is allowed to perform the action.
+            Policy::Address(address) if address == caller => Ok(()),
+            Policy::Address(_) => Err(Error::Forbidden),
+            // Anyone is allowed to perform the action.
+            Policy::Everyone => Ok(()),
+        }
+    }
+}
+
+/// ABI that the given contract should conform to.
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum ABI {
+    /// Custom Oasis SDK-specific ABI (v1).
+    OasisV1 = 1,
+}
+
+/// Stored code information.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Code {
+    /// Unique code identifier.
+    pub id: CodeId,
+
+    /// Code hash.
+    pub hash: Hash,
+
+    /// ABI.
+    pub abi: ABI,
+
+    /// ABI sub-version.
+    #[cbor(optional)]
+    pub abi_sv: u32,
+
+    /// Code uploader address.
+    pub uploader: Address,
+
+    /// Who is allowed to instantiate this code.
+    pub instantiate_policy: Policy,
+}
+
+/// Deployed code instance information.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Instance {
+    /// Unique instance identifier.
+    pub id: InstanceId,
+
+    /// Identifier of code used by the instance.
+    pub code_id: CodeId,
+
+    /// Instance creator address.
+    pub creator: Address,
+
+    /// Who is allowed to upgrade this instance.
+    pub upgrades_policy: Policy,
+}
+
+impl Instance {
+    /// Address associated with a specific contract instance.
+    pub fn address_for(id: InstanceId) -> Address {
+        Address::from_module_raw(MODULE_NAME, &id.as_u64().to_be_bytes())
+    }
+
+    /// Address associated with the contract.
+    pub fn address(&self) -> Address {
+        Self::address_for(self.id)
+    }
+}
+
+/// Upload call.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Upload {
+    /// ABI.
+    pub abi: ABI,
+
+    /// Who is allowed to instantiate this code.
+    pub instantiate_policy: Policy,
+
+    /// Compiled contract code.
+    pub code: Vec<u8>,
+}
+
+/// Upload call result.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct UploadResult {
+    /// Assigned code identifier.
+    pub id: CodeId,
+}
+
+/// Instantiate call.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Instantiate {
+    /// Identifier of code used by the instance.
+    pub code_id: CodeId,
+
+    /// Who is allowed to upgrade this instance.
+    pub upgrades_policy: Policy,
+
+    /// Arguments to contract's instantiation function.
+    pub data: Vec<u8>,
+
+    /// Tokens that should be sent to the contract as part of the instantiate call.
+    pub tokens: Vec<token::BaseUnits>,
+}
+
+/// Instantiate call result.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct InstantiateResult {
+    /// Assigned instance identifier.
+    pub id: InstanceId,
+}
+
+/// Contract call.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Call {
+    /// Instance identifier.
+    pub id: InstanceId,
+
+    /// Call arguments.
+    pub data: Vec<u8>,
+
+    /// Tokens that should be sent to the contract as part of the call.
+    pub tokens: Vec<token::BaseUnits>,
+}
+
+/// Contract call result.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+#[cbor(transparent)]
+pub struct CallResult(pub Vec<u8>);
+
+/// Upgrade call.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct Upgrade {
+    /// Instance identifier.
+    pub id: InstanceId,
+
+    /// Updated code identifier.
+    pub code_id: CodeId,
+
+    /// Arguments to contract's upgrade function.
+    pub data: Vec<u8>,
+
+    /// Tokens that should be sent to the contract as part of the call.
+    pub tokens: Vec<token::BaseUnits>,
+}
+
+/// Change upgrade policy call.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct ChangeUpgradePolicy {
+    /// Instance identifier.
+    pub id: InstanceId,
+
+    /// Updated upgrade policy.
+    pub upgrades_policy: Policy,
+}
+
+/// Code information query.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct CodeQuery {
+    /// Code identifier.
+    pub id: CodeId,
+}
+
+/// Code storage information query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct CodeStorageQuery {
+    /// Code identifier.
+    pub id: CodeId,
+}
+
+/// Code storage query result.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct CodeStorageQueryResult {
+    /// Stored contract code.
+    pub code: Vec<u8>,
+}
+
+/// Instance information query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct InstanceQuery {
+    /// Instance identifier.
+    pub id: InstanceId,
+}
+
+/// Instance storage query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct InstanceStorageQuery {
+    /// Instance identifier.
+    pub id: InstanceId,
+
+    /// Storage key.
+    pub key: Vec<u8>,
+}
+
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct InstanceStorageQueryResult {
+    /// Storage value or `None` if key doesn't exist.
+    pub value: Option<Vec<u8>>,
+}
+
+/// Exposed wrapper for oasis-contract-sdk-types::StoreKind.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[repr(u32)]
+pub enum StoreKind {
+    Public = 0,
+    Confidential = 1,
+}
+
+/// Instance raw storage query.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct InstanceRawStorageQuery {
+    /// Instance identifier.
+    pub id: InstanceId,
+
+    /// Kind of the store to query.
+    pub store_kind: StoreKind,
+
+    /// Maximum number of items per page.
+    #[cbor(optional)]
+    pub limit: Option<u64>,
+
+    /// Number of skipped items.
+    #[cbor(optional)]
+    pub offset: Option<u64>,
+}
+
+/// Instance raw storage query result.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct InstanceRawStorageQueryResult {
+    /// List of key-value pairs in contract's public store.
+    pub items: Vec<(Vec<u8>, Vec<u8>)>,
+}
+
+/// Public key kind.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[repr(u8)]
+pub enum PublicKeyKind {
+    Transaction = 1,
+}
+
+/// Public key query.
+#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
+#[cbor(no_default)]
+pub struct PublicKeyQuery {
+    /// Instance identifier.
+    pub id: InstanceId,
+
+    /// Kind of public key.
+    pub kind: PublicKeyKind,
+}
+
+/// Public key query result.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct PublicKeyQueryResult {
+    /// Public key.
+    pub key: Vec<u8>,
+
+    /// Checksum of the key manager state.
+    pub checksum: Vec<u8>,
+
+    /// Sign(sk, (key || checksum)) from the key manager.
+    pub signature: Vec<u8>,
+}
+
+/// Custom contract query.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct CustomQuery {
+    /// Instance identifier.
+    pub id: InstanceId,
+
+    /// Query arguments.
+    pub data: Vec<u8>,
+}
+
+/// Custom query result.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+#[cbor(transparent)]
+pub struct CustomQueryResult(pub Vec<u8>);
+
+/// An event emitted from a contract, wrapped to include additional metadata.
+#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
+pub struct ContractEvent {
+    /// Identifier of the instance that emitted the event.
+    pub id: InstanceId,
+    /// Raw event data emitted by the instance.
+    #[cbor(optional)]
+    pub data: Vec<u8>,
+}
+
+#[cfg(test)]
+mod test {
+    use super::*;
+
+    #[test]
+    fn test_instanceid_to_address() {
+        let tcs = vec![
+            (
+                InstanceId::from(0),
+                "oasis1qq08mjlkztsgpgrar082rzzxwjaplxmgjs5ftugn",
+            ),
+            (
+                InstanceId::from(1),
+                "oasis1qpg6jv8mxwlv4z578xyjxl7d793jamltdg9czzkx",
+            ),
+            (
+                InstanceId::from(14324),
+                "oasis1qzasj0kq0hlq6vzw4ajhrwgp3tqx6rnwvg2ylu2v",
+            ),
+            (
+                InstanceId::from(u64::MAX),
+                "oasis1qqr0nxsu5aqpu4k85z4h5z08vrfmawnnqycl6gup",
+            ),
+        ];
+
+        for (id, address) in tcs {
+            let instance_address = Instance::address_for(id);
+            assert_eq!(
+                instance_address.to_bech32(),
+                address.to_string(),
+                "instance address should match"
+            );
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_contracts/wasm.rs.html b/rust/src/oasis_runtime_sdk_contracts/wasm.rs.html new file mode 100644 index 0000000000..4b8f903dbd --- /dev/null +++ b/rust/src/oasis_runtime_sdk_contracts/wasm.rs.html @@ -0,0 +1,1251 @@ +wasm.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+
//! WASM runtime.
+use oasis_contract_sdk_types::message::Reply;
+use oasis_runtime_sdk::context::Context;
+
+use super::{
+    abi::{oasis::OasisV1, Abi, ExecutionContext, ExecutionResult, Info},
+    types, Config, Error, Parameters, MODULE_NAME,
+};
+
+/// Everything needed to run a contract.
+pub struct Contract<'a> {
+    pub code_info: &'a types::Code,
+    pub code: &'a [u8],
+    pub instance_info: &'a types::Instance,
+}
+
+/// Error emitted from within a contract.
+#[derive(Debug, thiserror::Error)]
+#[error("{message}")]
+pub struct ContractError {
+    pub module: String,
+    pub code: u32,
+    pub message: String,
+}
+
+impl ContractError {
+    /// Create a new error emitted within a contract.
+    pub fn new(code_id: types::CodeId, module: &str, code: u32, message: &str) -> Self {
+        Self {
+            module: if module.is_empty() {
+                format!("{}.{}", MODULE_NAME, code_id.as_u64())
+            } else {
+                format!("{}.{}.{}", MODULE_NAME, code_id.as_u64(), module)
+            },
+            code,
+            message: message.to_string(),
+        }
+    }
+}
+
+impl oasis_runtime_sdk::error::Error for ContractError {
+    fn module_name(&self) -> &str {
+        &self.module
+    }
+
+    fn code(&self) -> u32 {
+        self.code
+    }
+}
+
+/// Validate the passed contract code to make sure it conforms to the given ABI and perform any
+/// required transformation passes.
+pub(super) fn validate_and_transform<Cfg: Config, C: Context>(
+    code: &[u8],
+    abi: types::ABI,
+    params: &Parameters,
+) -> Result<(Vec<u8>, Info), Error> {
+    // Parse code.
+    let mut module = walrus::ModuleConfig::new()
+        .generate_producers_section(false)
+        .parse(code)
+        .map_err(|_| Error::CodeMalformed)?;
+
+    // Validate ABI selection and make sure the code conforms to the specified ABI.
+    let abi = create_abi::<Cfg, C>(abi)?;
+    let info = abi.validate(&mut module, params)?;
+
+    Ok((module.emit_wasm(), info))
+}
+
+/// Create a new WASM runtime and link the required functions based on the ABI then run the
+/// provided function passing the ABI and module instance.
+fn with_runtime<'ctx, Cfg, C, F>(
+    ctx: &mut ExecutionContext<'ctx, C>,
+    contract: &Contract<'_>,
+    f: F,
+) -> ExecutionResult
+where
+    Cfg: Config,
+    C: Context,
+    F: FnOnce(
+        &mut ExecutionContext<'ctx, C>,
+        &Box<dyn Abi<C>>,
+        &wasm3::Instance<'_, '_, ExecutionContext<'ctx, C>>,
+    ) -> ExecutionResult,
+{
+    let result = move || -> Result<ExecutionResult, Error> {
+        // Create the appropriate ABI.
+        let abi = create_abi::<Cfg, C>(contract.code_info.abi)?;
+
+        // Create the wasm3 environment, parse and instantiate the module.
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(contract.code)
+            .map_err(|_| Error::ModuleLoadingFailed)?;
+        let rt = env
+            .new_runtime::<ExecutionContext<'_, C>>(
+                ctx.params.max_stack_size,
+                Some(ctx.params.max_memory_pages),
+            )
+            .expect("creating a new wasm3 runtime should succeed");
+        let mut instance = rt
+            .load_module(module)
+            .map_err(|_| Error::ModuleLoadingFailed)?;
+
+        // Link functions based on the ABI.
+        abi.link(&mut instance)?;
+        // Set gas limit for the execution.
+        abi.set_gas_limit(&mut instance, ctx.gas_limit)?;
+
+        // Run the given function.
+        Ok(f(ctx, &abi, &instance))
+    }();
+
+    match result {
+        Ok(result) => result,
+        Err(err) => ExecutionResult {
+            inner: Err(err),
+            gas_used: 0,
+        },
+    }
+}
+
+/// Instantiate the contract.
+pub(super) fn instantiate<Cfg: Config, C: Context>(
+    ctx: &mut ExecutionContext<'_, C>,
+    contract: &Contract<'_>,
+    call: &types::Instantiate,
+) -> ExecutionResult {
+    with_runtime::<Cfg, _, _>(ctx, contract, |ctx, abi, instance| {
+        abi.instantiate(ctx, instance, &call.data, &call.tokens)
+    })
+}
+
+/// Call the contract.
+pub(super) fn call<Cfg: Config, C: Context>(
+    ctx: &mut ExecutionContext<'_, C>,
+    contract: &Contract<'_>,
+    call: &types::Call,
+) -> ExecutionResult {
+    with_runtime::<Cfg, _, _>(ctx, contract, |ctx, abi, instance| {
+        abi.call(ctx, instance, &call.data, &call.tokens)
+    })
+}
+
+/// Invoke the contract's reply handler.
+pub(super) fn handle_reply<Cfg: Config, C: Context>(
+    ctx: &mut ExecutionContext<'_, C>,
+    contract: &Contract<'_>,
+    reply: Reply,
+) -> ExecutionResult {
+    with_runtime::<Cfg, _, _>(ctx, contract, move |ctx, abi, instance| {
+        abi.handle_reply(ctx, instance, reply)
+    })
+}
+
+/// Invoke the contract's pre-upgrade handler.
+pub(super) fn pre_upgrade<Cfg: Config, C: Context>(
+    ctx: &mut ExecutionContext<'_, C>,
+    contract: &Contract<'_>,
+    upgrade: &types::Upgrade,
+) -> ExecutionResult {
+    with_runtime::<Cfg, _, _>(ctx, contract, |ctx, abi, instance| {
+        abi.pre_upgrade(ctx, instance, &upgrade.data, &upgrade.tokens)
+    })
+}
+
+/// Invoke the contract's post-upgrade handler.
+pub(super) fn post_upgrade<Cfg: Config, C: Context>(
+    ctx: &mut ExecutionContext<'_, C>,
+    contract: &Contract<'_>,
+    upgrade: &types::Upgrade,
+) -> ExecutionResult {
+    with_runtime::<Cfg, _, _>(ctx, contract, |ctx, abi, instance| {
+        abi.post_upgrade(ctx, instance, &upgrade.data, &upgrade.tokens)
+    })
+}
+
+/// Query the contract.
+pub(super) fn query<Cfg: Config, C: Context>(
+    ctx: &mut ExecutionContext<'_, C>,
+    contract: &Contract<'_>,
+    query: &types::CustomQuery,
+) -> ExecutionResult {
+    with_runtime::<Cfg, _, _>(ctx, contract, |ctx, abi, instance| {
+        abi.query(ctx, instance, &query.data)
+    })
+}
+
+/// Create the appropriate ABI based on contract configuration.
+fn create_abi<Cfg: Config, C: Context>(abi: types::ABI) -> Result<Box<dyn Abi<C>>, Error> {
+    match abi {
+        types::ABI::OasisV1 => Ok(Box::new(OasisV1::<Cfg>::new())),
+    }
+}
+
+#[cfg(all(feature = "benchmarks", test))]
+mod bench {
+    extern crate test;
+    use std::time::Instant;
+    use test::Bencher;
+
+    use crate::abi::gas;
+
+    // cargo build --target wasm32-unknown-unknown --release
+    const BENCH_CODE: &[u8] = include_bytes!(
+        "../../../../tests/contracts/bench/target/wasm32-unknown-unknown/release/bench.wasm"
+    );
+    const OPCODE_SPINS: i32 = 1_000_000;
+
+    fn bench_wat_spinner<F>(b: &mut Bencher, param: i32, code: &str, mut linkup: F)
+    where
+        F: FnMut(&mut wasm3::Instance<'_, '_, wasm3::CallContext<'_, ()>>),
+    {
+        let module_bin = wat::parse_str(code).expect("parsing module wat should succeed");
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(&module_bin)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, wasm3::CallContext<'_, ()>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let mut instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        linkup(&mut instance);
+        let func = instance
+            .find_function::<i32, ()>("spinner")
+            .expect("finding the entrypoint function should succeed");
+        b.iter(|| {
+            func.call(param).expect("function call should succeed");
+        });
+    }
+
+    const LOOP_SKEL: &str = r#"
+        (module
+            (global $globaldummy (mut i32) (i32.const 0))
+            (func $spinner (param $lim i32) (local $dummy i32)
+                (loop $spin
+                    local.get $lim
+                    i32.const 1
+                    i32.sub
+                    local.tee $lim
+
+                    ;; measure this block by comparing runtimes
+                    ;; with the module in bench_loop_skel, where
+                    ;; this section is empty.
+                    {}
+
+                    i32.const 0
+                    i32.ne
+                    br_if $spin
+                )
+            )
+            (export "spinner" (func $spinner))
+        )
+    "#;
+
+    #[bench]
+    fn bench_loop_skel(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace("{}", "");
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_const(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i32.const 0
+            drop
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_block(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            (block $block
+                i32.const 0
+                drop
+            )
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_block_block(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            (block
+                (block
+                    nop
+                )
+            )
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_br_table(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            (block
+                (block
+                    i32.const 0
+                    (br_table 1 2)
+                )
+            )
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_br(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            (block $block
+                i32.const 1
+                br $block
+            )
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_br_if(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            (block $block
+                i32.const 1
+                br_if $block
+            )
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_if_within_block(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            (block $block
+                i32.const 1
+                (if
+                    (then
+                        br $block
+                    )
+                )
+            )
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_local_set(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i32.const 42
+            local.set $dummy
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_global_get(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            global.get $globaldummy
+            drop
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_global_set(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i32.const 1
+            global.set $globaldummy
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_grow_skel(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            local.get $lim
+            i32.const 100000
+            i32.rem_u
+            (if
+                (then
+                    nop
+                    nop
+                )
+            )
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_grow(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            local.get $lim
+            i32.const 100000
+            i32.rem_u
+            (if
+                (then
+                    (memory.grow (i32.const 1))
+                    drop
+                )
+            )
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_add(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i32.const 0
+            i32.add
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_add_64(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i64.extend_i32_u
+            i64.const 0
+            i64.add
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_mul(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i32.const 1
+            i32.mul
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_div(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i32.const 1
+            i32.div_s
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_rotr(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i32.const 1
+            i32.rotr
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_extend(b: &mut Bencher) {
+        let src = LOOP_SKEL.replace(
+            "{}",
+            r#"
+            i32.const 3
+            i64.extend_i32_u
+            drop
+        "#,
+        );
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_call(b: &mut Bencher) {
+        let src = r#"
+            (module
+                (func $callee
+                    return
+                )
+                (func $spinner (param $lim i32)
+                    (loop $spin
+                        local.get $lim
+                        i32.const 1
+                        i32.sub
+                        local.tee $lim
+
+                        ;; measure this block by comparing runtimes
+                        ;; with the module in bench_loop_skel, where
+                        ;; this section is empty.
+                        call $callee
+
+                        i32.const 0
+                        i32.ne
+                        br_if $spin
+                    )
+                )
+                (export "spinner" (func $spinner))
+            )
+        "#;
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |_| {});
+    }
+
+    #[bench]
+    fn bench_loop_call_external(b: &mut Bencher) {
+        let src = r#"
+            (module
+                (import "bench" "callee" (func $callee))
+                (func $spinner (param $lim i32)
+                    (loop $spin
+                        local.get $lim
+                        i32.const 1
+                        i32.sub
+                        local.tee $lim
+
+                        ;; measure this block by comparing runtimes
+                        ;; with the module in bench_loop_skel, where
+                        ;; this section is empty.
+                        call $callee
+
+                        i32.const 0
+                        i32.ne
+                        br_if $spin
+                    )
+                )
+                (export "spinner" (func $spinner))
+            )
+        "#;
+        bench_wat_spinner(b, OPCODE_SPINS, &src, |instance| {
+            let _ =
+                instance.link_function("bench", "callee", |_, _: ()| -> Result<(), wasm3::Trap> {
+                    Ok(())
+                });
+        });
+    }
+
+    #[bench]
+    fn bench_time_waster(_b: &mut Bencher) {
+        let mut module = walrus::ModuleConfig::new()
+            .generate_producers_section(false)
+            .parse(&BENCH_CODE)
+            .unwrap();
+        gas::transform(&mut module);
+        let new_code = module.emit_wasm();
+
+        let env =
+            wasm3::Environment::new().expect("creating a new wasm3 environment should succeed");
+        let module = env
+            .parse_module(&new_code)
+            .expect("parsing the code should succeed");
+        let rt: wasm3::Runtime<'_, wasm3::CallContext<'_, ()>> = env
+            .new_runtime(1 * 1024 * 1024, None)
+            .expect("creating a new wasm3 runtime should succeed");
+        let instance = rt
+            .load_module(module)
+            .expect("instance creation should succeed");
+        let func = instance
+            .find_function::<u64, u64>("waste_time")
+            .expect("finding the entrypoint function should succeed");
+        let initial_gas = 1_000_000_000_000u64;
+        instance
+            .set_global(gas::EXPORT_GAS_LIMIT, initial_gas)
+            .expect("setting gas limit should succeed");
+        let begin = Instant::now();
+        func.call(41).expect("function call should succeed");
+        let gas_limit: u64 = instance
+            .get_global(gas::EXPORT_GAS_LIMIT)
+            .expect("getting gas limit global should succeed");
+        let gas_limit_exhausted: u64 = instance
+            .get_global(gas::EXPORT_GAS_LIMIT_EXHAUSTED)
+            .expect("getting gas limit exhausted global should succeed");
+        let delta = Instant::now().duration_since(begin).as_secs_f64();
+        println!(
+            "  time waster runtime: {} seconds, gas remaining {} [used: {}, exhausted flag: {}]",
+            delta,
+            gas_limit,
+            initial_gas - gas_limit,
+            gas_limit_exhausted
+        );
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/error_derive.rs.html b/rust/src/oasis_runtime_sdk_macros/error_derive.rs.html new file mode 100644 index 0000000000..68ed8b5057 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/error_derive.rs.html @@ -0,0 +1,991 @@ +error_derive.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+
use darling::{util::Flag, FromDeriveInput, FromField, FromVariant};
+use proc_macro2::TokenStream;
+use quote::{format_ident, quote, quote_spanned};
+use syn::{DeriveInput, Ident, Index, Member, Path};
+
+use crate::generators::{self as gen, CodedVariant};
+
+#[derive(FromDeriveInput)]
+#[darling(supports(enum_any), attributes(sdk_error))]
+struct Error {
+    ident: Ident,
+
+    data: darling::ast::Data<ErrorVariant, darling::util::Ignored>,
+
+    /// The path to a const set to the module name.
+    module_name: Option<syn::Path>,
+
+    /// Whether to sequentially autonumber the error codes.
+    /// This option exists as a convenience for runtimes that
+    /// only append errors or release only breaking changes.
+    #[darling(rename = "autonumber")]
+    autonumber: Flag,
+
+    /// Whether the `into_abort` function should return itself. This can only be used when the type
+    /// being annotated is the dispatcher error type so it is only for internal use.
+    #[darling(rename = "abort_self")]
+    abort_self: Flag,
+}
+
+#[derive(FromVariant)]
+#[darling(attributes(sdk_error))]
+struct ErrorVariant {
+    ident: Ident,
+
+    fields: darling::ast::Fields<ErrorField>,
+
+    /// The explicit ID of the error code. Overrides any autonumber set on the error enum.
+    #[darling(rename = "code")]
+    code: Option<u32>,
+
+    #[darling(rename = "transparent")]
+    transparent: Flag,
+
+    #[darling(rename = "abort")]
+    abort: Flag,
+}
+
+impl CodedVariant for ErrorVariant {
+    const FIELD_NAME: &'static str = "code";
+
+    fn ident(&self) -> &Ident {
+        &self.ident
+    }
+
+    fn code(&self) -> Option<u32> {
+        self.code
+    }
+}
+
+#[derive(FromField)]
+#[darling(forward_attrs(source, from))]
+struct ErrorField {
+    ident: Option<Ident>,
+
+    attrs: Vec<syn::Attribute>,
+}
+
+pub fn derive_error(input: DeriveInput) -> TokenStream {
+    let error = match Error::from_derive_input(&input) {
+        Ok(error) => error,
+        Err(e) => return e.write_errors(),
+    };
+
+    let error_ty_ident = &error.ident;
+
+    let module_name = error
+        .module_name
+        .unwrap_or_else(|| syn::parse_quote!(MODULE_NAME));
+
+    let (module_name_body, code_body, abort_body) = convert_variants(
+        &format_ident!("self"),
+        module_name,
+        &error.data.as_ref().take_enum().unwrap(),
+        error.autonumber.is_present(),
+        error.abort_self.is_present(),
+    );
+
+    let sdk_crate = gen::sdk_crate_path();
+
+    gen::wrap_in_const(quote! {
+        use #sdk_crate::{self as __sdk, error::Error as _};
+
+        #[automatically_derived]
+        impl __sdk::error::Error for #error_ty_ident {
+            fn module_name(&self) -> &str {
+                #module_name_body
+            }
+
+            fn code(&self) -> u32 {
+                #code_body
+            }
+
+            fn into_abort(self) -> Result<__sdk::dispatcher::Error, Self> {
+                #abort_body
+            }
+        }
+
+        #[automatically_derived]
+        impl From<#error_ty_ident> for __sdk::error::RuntimeError {
+            fn from(err: #error_ty_ident) -> Self {
+                Self::new(err.module_name(), err.code(), &err.to_string())
+            }
+        }
+    })
+}
+
+fn convert_variants(
+    enum_binding: &Ident,
+    module_name: Path,
+    variants: &[&ErrorVariant],
+    autonumber: bool,
+    abort_self: bool,
+) -> (TokenStream, TokenStream, TokenStream) {
+    if variants.is_empty() {
+        return (quote!(#module_name), quote!(0), quote!(Err(#enum_binding)));
+    }
+
+    let mut next_autonumber = 0u32;
+    let mut reserved_numbers = std::collections::BTreeSet::new();
+
+    let (module_name_matches, (code_matches, abort_matches)): (Vec<_>, (Vec<_>, Vec<_>)) = variants
+        .iter()
+        .map(|variant| {
+            let variant_ident = &variant.ident;
+
+            if variant.transparent.is_present() {
+                // Transparently forward everything to the source.
+                let mut maybe_sources = variant
+                    .fields
+                    .iter()
+                    .enumerate()
+                    .filter(|(_, f)| (!f.attrs.is_empty()))
+                    .map(|(i, f)| (i, f.ident.clone()));
+                let source = maybe_sources.next();
+                if maybe_sources.count() != 0 {
+                    variant_ident
+                        .span()
+                        .unwrap()
+                        .error("multiple error sources specified for variant")
+                        .emit();
+                    return (quote!(), (quote!(), quote!()));
+                }
+                if source.is_none() {
+                    variant_ident
+                        .span()
+                        .unwrap()
+                        .error("no source error specified for variant")
+                        .emit();
+                    return (quote!(), (quote!(), quote!()));
+                }
+                let (field_index, field_ident) = source.unwrap();
+
+                let field = match field_ident {
+                    Some(ident) => Member::Named(ident),
+                    None => Member::Unnamed(Index {
+                        index: field_index as u32,
+                        span: variant_ident.span(),
+                    }),
+                };
+
+                // Get all other fields that are needed for forwarding in abort variants.
+                let non_source_fields = variant
+                    .fields
+                    .iter()
+                    .enumerate()
+                    .filter(|(i, _)| i != &field_index)
+                    .map(|(i, f)| {
+                        let pat = match f.ident {
+                            Some(ref ident) => Member::Named(ident.clone()),
+                            None => Member::Unnamed(Index {
+                                index: i as u32,
+                                span: variant_ident.span(),
+                            }),
+                        };
+                        let ident = Ident::new(&format!("__a{i}"), variant_ident.span());
+                        let binding = quote!( #pat: #ident, );
+
+                        binding
+                    });
+                let non_source_field_bindings = non_source_fields.clone();
+
+                let source = quote!(source);
+                let module_name = quote_spanned!(variant_ident.span()=> #source.module_name());
+                let code = quote_spanned!(variant_ident.span()=> #source.code());
+                let abort_reclaim = quote!(Self::#variant_ident { #field: e, #(#non_source_fields)* });
+                let abort = quote_spanned!(variant_ident.span()=> #source.into_abort().map_err(|e| #abort_reclaim));
+
+                (
+                    quote! {
+                        Self::#variant_ident { #field: #source, .. } => #module_name,
+                    },
+                    (
+                        quote! {
+                            Self::#variant_ident { #field: #source, .. } => #code,
+                        },
+                        quote! {
+                            Self::#variant_ident { #field: #source, #(#non_source_field_bindings)* } => #abort,
+                        },
+                    ),
+                )
+            } else {
+                // Regular case without forwarding.
+                let code = match variant.code {
+                    Some(code) => {
+                        if reserved_numbers.contains(&code) {
+                            variant_ident
+                                .span()
+                                .unwrap()
+                                .error(format!("code {code} already used"))
+                                .emit();
+                            return (quote!(), (quote!(), quote!()));
+                        }
+                        reserved_numbers.insert(code);
+                        code
+                    }
+                    None if autonumber => {
+                        let mut reserved_successors = reserved_numbers.range(next_autonumber..);
+                        while reserved_successors.next() == Some(&next_autonumber) {
+                            next_autonumber += 1;
+                        }
+                        let code = next_autonumber;
+                        reserved_numbers.insert(code);
+                        next_autonumber += 1;
+                        code
+                    }
+                    None => {
+                        variant_ident
+                            .span()
+                            .unwrap()
+                            .error("missing `code` for variant")
+                            .emit();
+                        return (quote!(), (quote!(), quote!()));
+                    }
+                };
+
+                let abort = if variant.abort.is_present() {
+                    quote!{
+                        Self::#variant_ident(err) => Ok(err),
+                    }
+                } else {
+                    quote!{
+                        Self::#variant_ident { .. } => Err(#enum_binding),
+                    }
+                };
+
+                (
+                    quote! {
+                        Self::#variant_ident { .. } => #module_name,
+                    },
+                    (
+                        quote! {
+                            Self::#variant_ident { .. } => #code,
+                        },
+                        abort,
+                    ),
+                )
+            }
+        })
+        .unzip();
+
+    let abort_body = if abort_self {
+        quote!(Ok(self))
+    } else {
+        quote! {
+            match #enum_binding {
+                #(#abort_matches)*
+            }
+        }
+    };
+
+    (
+        quote! {
+            match #enum_binding {
+                #(#module_name_matches)*
+            }
+        },
+        quote! {
+            match #enum_binding {
+                #(#code_matches)*
+            }
+        },
+        abort_body,
+    )
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn generate_error_impl_auto_abort() {
+        let expected: syn::Stmt = syn::parse_quote!(
+            const _: () = {
+                use ::oasis_runtime_sdk::{self as __sdk, error::Error as _};
+                #[automatically_derived]
+                impl __sdk::error::Error for Error {
+                    fn module_name(&self) -> &str {
+                        match self {
+                            Self::Error0 { .. } => MODULE_NAME,
+                            Self::Error2 { .. } => MODULE_NAME,
+                            Self::Error1 { .. } => MODULE_NAME,
+                            Self::Error3 { .. } => MODULE_NAME,
+                            Self::ErrorAbort { .. } => MODULE_NAME,
+                        }
+                    }
+                    fn code(&self) -> u32 {
+                        match self {
+                            Self::Error0 { .. } => 0u32,
+                            Self::Error2 { .. } => 2u32,
+                            Self::Error1 { .. } => 1u32,
+                            Self::Error3 { .. } => 3u32,
+                            Self::ErrorAbort { .. } => 4u32,
+                        }
+                    }
+                    fn into_abort(self) -> Result<__sdk::dispatcher::Error, Self> {
+                        match self {
+                            Self::Error0 { .. } => Err(self),
+                            Self::Error2 { .. } => Err(self),
+                            Self::Error1 { .. } => Err(self),
+                            Self::Error3 { .. } => Err(self),
+                            Self::ErrorAbort(err) => Ok(err),
+                        }
+                    }
+                }
+                #[automatically_derived]
+                impl From<Error> for __sdk::error::RuntimeError {
+                    fn from(err: Error) -> Self {
+                        Self::new(err.module_name(), err.code(), &err.to_string())
+                    }
+                }
+            };
+        );
+
+        let input: syn::DeriveInput = syn::parse_quote!(
+            #[derive(Error)]
+            #[sdk_error(autonumber)]
+            pub enum Error {
+                Error0,
+                #[sdk_error(code = 2)]
+                Error2 {
+                    payload: Vec<u8>,
+                },
+                Error1(String),
+                Error3,
+                #[sdk_error(abort)]
+                ErrorAbort(sdk::dispatcher::Error),
+            }
+        );
+        let error_derivation = super::derive_error(input);
+        let actual: syn::Stmt = syn::parse2(error_derivation).unwrap();
+
+        crate::assert_empty_diff!(actual, expected);
+    }
+
+    #[test]
+    fn generate_error_impl_manual() {
+        let expected: syn::Stmt = syn::parse_quote!(
+            const _: () = {
+                use ::oasis_runtime_sdk::{self as __sdk, error::Error as _};
+                #[automatically_derived]
+                impl __sdk::error::Error for Error {
+                    fn module_name(&self) -> &str {
+                        THE_MODULE_NAME
+                    }
+                    fn code(&self) -> u32 {
+                        0
+                    }
+                    fn into_abort(self) -> Result<__sdk::dispatcher::Error, Self> {
+                        Err(self)
+                    }
+                }
+                #[automatically_derived]
+                impl From<Error> for __sdk::error::RuntimeError {
+                    fn from(err: Error) -> Self {
+                        Self::new(err.module_name(), err.code(), &err.to_string())
+                    }
+                }
+            };
+        );
+
+        let input: syn::DeriveInput = syn::parse_quote!(
+            #[derive(Error)]
+            #[sdk_error(autonumber, module_name = "THE_MODULE_NAME")]
+            pub enum Error {}
+        );
+        let error_derivation = super::derive_error(input);
+        let actual: syn::Stmt = syn::parse2(error_derivation).unwrap();
+
+        crate::assert_empty_diff!(actual, expected);
+    }
+
+    #[test]
+    fn generate_error_impl_from() {
+        let expected: syn::Stmt = syn::parse_quote!(
+            const _: () = {
+                use ::oasis_runtime_sdk::{self as __sdk, error::Error as _};
+                #[automatically_derived]
+                impl __sdk::error::Error for Error {
+                    fn module_name(&self) -> &str {
+                        match self {
+                            Self::Foo { 0: source, .. } => source.module_name(),
+                        }
+                    }
+                    fn code(&self) -> u32 {
+                        match self {
+                            Self::Foo { 0: source, .. } => source.code(),
+                        }
+                    }
+                    fn into_abort(self) -> Result<__sdk::dispatcher::Error, Self> {
+                        match self {
+                            Self::Foo { 0: source } => {
+                                source.into_abort().map_err(|e| Self::Foo { 0: e })
+                            }
+                        }
+                    }
+                }
+                #[automatically_derived]
+                impl From<Error> for __sdk::error::RuntimeError {
+                    fn from(err: Error) -> Self {
+                        Self::new(err.module_name(), err.code(), &err.to_string())
+                    }
+                }
+            };
+        );
+
+        let input: syn::DeriveInput = syn::parse_quote!(
+            #[derive(Error)]
+            #[sdk_error(module_name = "THE_MODULE_NAME")]
+            pub enum Error {
+                #[sdk_error(transparent)]
+                Foo(#[from] AnotherError),
+            }
+        );
+        let error_derivation = super::derive_error(input);
+        let actual: syn::Stmt = syn::parse2(error_derivation).unwrap();
+
+        crate::assert_empty_diff!(actual, expected);
+    }
+
+    #[test]
+    fn generate_error_impl_abort_self() {
+        let expected: syn::Stmt = syn::parse_quote!(
+            const _: () = {
+                use ::oasis_runtime_sdk::{self as __sdk, error::Error as _};
+                #[automatically_derived]
+                impl __sdk::error::Error for Error {
+                    fn module_name(&self) -> &str {
+                        match self {
+                            Self::Foo { .. } => THE_MODULE_NAME,
+                            Self::Bar { .. } => THE_MODULE_NAME,
+                        }
+                    }
+                    fn code(&self) -> u32 {
+                        match self {
+                            Self::Foo { .. } => 1u32,
+                            Self::Bar { .. } => 2u32,
+                        }
+                    }
+                    fn into_abort(self) -> Result<__sdk::dispatcher::Error, Self> {
+                        Ok(self)
+                    }
+                }
+                #[automatically_derived]
+                impl From<Error> for __sdk::error::RuntimeError {
+                    fn from(err: Error) -> Self {
+                        Self::new(err.module_name(), err.code(), &err.to_string())
+                    }
+                }
+            };
+        );
+
+        let input: syn::DeriveInput = syn::parse_quote!(
+            #[derive(Error)]
+            #[sdk_error(module_name = "THE_MODULE_NAME", abort_self)]
+            pub enum Error {
+                #[sdk_error(code = 1)]
+                Foo,
+                #[sdk_error(code = 2)]
+                Bar,
+            }
+        );
+        let error_derivation = super::derive_error(input);
+        let actual: syn::Stmt = syn::parse2(error_derivation).unwrap();
+
+        crate::assert_empty_diff!(actual, expected);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/event_derive.rs.html b/rust/src/oasis_runtime_sdk_macros/event_derive.rs.html new file mode 100644 index 0000000000..efd8e57400 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/event_derive.rs.html @@ -0,0 +1,291 @@ +event_derive.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+
use darling::{util::Flag, FromDeriveInput, FromVariant};
+use proc_macro2::TokenStream;
+use quote::{format_ident, quote};
+use syn::{DeriveInput, Ident};
+
+use crate::generators::{self as gen, CodedVariant};
+
+#[derive(FromDeriveInput)]
+#[darling(supports(enum_any), attributes(sdk_event))]
+struct Event {
+    ident: Ident,
+
+    data: darling::ast::Data<EventVariant, darling::util::Ignored>,
+
+    /// The path to a const set to the module name.
+    module_name: Option<syn::Path>,
+
+    /// Whether to sequentially autonumber the event codes.
+    /// This option exists as a convenience for runtimes that
+    /// only append events or release only breaking changes.
+    #[darling(rename = "autonumber")]
+    autonumber: Flag,
+}
+
+#[derive(FromVariant)]
+#[darling(attributes(sdk_event))]
+struct EventVariant {
+    ident: Ident,
+
+    /// The explicit ID of the event code. Overrides any autonumber set on the event enum.
+    #[darling(rename = "code")]
+    code: Option<u32>,
+}
+
+impl CodedVariant for EventVariant {
+    const FIELD_NAME: &'static str = "code";
+
+    fn ident(&self) -> &Ident {
+        &self.ident
+    }
+
+    fn code(&self) -> Option<u32> {
+        self.code
+    }
+}
+
+pub fn derive_event(input: DeriveInput) -> TokenStream {
+    let event = match Event::from_derive_input(&input) {
+        Ok(event) => event,
+        Err(e) => return e.write_errors(),
+    };
+
+    let event_ty_ident = &event.ident;
+    let module_name = event
+        .module_name
+        .unwrap_or_else(|| syn::parse_quote!(MODULE_NAME));
+
+    let code_converter = gen::enum_code_converter(
+        &format_ident!("self"),
+        &event.data.as_ref().take_enum().unwrap(),
+        event.autonumber.is_present(),
+    );
+
+    let sdk_crate = gen::sdk_crate_path();
+
+    gen::wrap_in_const(quote! {
+        impl #sdk_crate::event::Event for #event_ty_ident {
+            fn module_name() -> &'static str {
+                #module_name
+            }
+
+            fn code(&self) -> u32 {
+                #code_converter
+            }
+        }
+    })
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn generate_event_impl_auto() {
+        let expected: syn::Stmt = syn::parse_quote!(
+            const _: () = {
+                impl ::oasis_runtime_sdk::event::Event for MainEvent {
+                    fn module_name() -> &'static str {
+                        MODULE_NAME
+                    }
+                    fn code(&self) -> u32 {
+                        match self {
+                            Self::Event0 { .. } => 0u32,
+                            Self::Event2 { .. } => 2u32,
+                            Self::Event1 { .. } => 1u32,
+                            Self::Event3 { .. } => 3u32,
+                        }
+                    }
+                }
+            };
+        );
+
+        let input: syn::DeriveInput = syn::parse_quote!(
+            #[derive(Event)]
+            #[sdk_event(autonumber)]
+            pub enum MainEvent {
+                Event0,
+                #[sdk_event(code = 2)]
+                Event2 {
+                    payload: Vec<u8>,
+                },
+                Event1(String),
+                Event3,
+            }
+        );
+        let event_derivation = super::derive_event(input);
+        let actual: syn::Stmt = syn::parse2(event_derivation).unwrap();
+
+        crate::assert_empty_diff!(actual, expected);
+    }
+
+    #[test]
+    fn generate_event_impl_manual() {
+        let expected: syn::Stmt = syn::parse_quote!(
+            const _: () = {
+                impl ::oasis_runtime_sdk::event::Event for MainEvent {
+                    fn module_name() -> &'static str {
+                        THE_MODULE_NAME
+                    }
+                    fn code(&self) -> u32 {
+                        0
+                    }
+                }
+            };
+        );
+
+        let input: syn::DeriveInput = syn::parse_quote!(
+            #[derive(Event)]
+            #[sdk_event(autonumber, module_name = "THE_MODULE_NAME")]
+            pub enum MainEvent {}
+        );
+        let event_derivation = super::derive_event(input);
+        let actual: syn::Stmt = syn::parse2(event_derivation).unwrap();
+
+        crate::assert_empty_diff!(actual, expected);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/generators.rs.html b/rust/src/oasis_runtime_sdk_macros/generators.rs.html new file mode 100644 index 0000000000..7f78fda904 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/generators.rs.html @@ -0,0 +1,245 @@ +generators.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+
use proc_macro2::TokenStream;
+use quote::quote;
+use syn::Ident;
+
+/// Wraps the given code block into an anonymous const code block. Useful when
+/// the code block `use`s stuff that should not leak into the containing scope.
+/// See also https://github.com/serde-rs/serde/issues/159#issuecomment-214002626
+pub fn wrap_in_const(tokens: TokenStream) -> TokenStream {
+    quote! {
+        const _: () = {
+            #tokens
+        };
+    }
+}
+
+/// Determines what crate name should be used to refer to `oasis_runtime_sdk` types.
+/// Required for use within the SDK itself (crates cannot refer to their own names).
+pub fn sdk_crate_path() -> syn::Path {
+    let is_internal = std::env::var("CARGO_PKG_NAME")
+        .map(|pkg_name| pkg_name == "oasis-runtime-sdk")
+        .unwrap_or_default();
+    if is_internal {
+        // Doctests are their own crates, but they share the name of the primary crate.
+        // Thus, the primary crate needs to refer to itself. Either that or depend on unstable
+        // rustdoc env vars.
+        syn::parse_quote!(crate::oasis_runtime_sdk)
+    } else {
+        syn::parse_quote!(::oasis_runtime_sdk)
+    }
+}
+
+pub trait CodedVariant {
+    /// The field in the helper attribute that yields the value provided by `code`.
+    /// For instance, in `#[sdk_event(code = 0)]`, the `FIELD_NAME` would be `code`.
+    const FIELD_NAME: &'static str;
+
+    /// The variant ident.
+    fn ident(&self) -> &Ident;
+
+    /// The code to which the variant should be converted.
+    fn code(&self) -> Option<u32>;
+}
+
+/// Returns a `match` expression that encodes an enum's variants as integral codes.
+pub fn enum_code_converter<V: CodedVariant>(
+    enum_binding: &Ident,
+    variants: &[&V],
+    autonumber: bool,
+) -> TokenStream {
+    if variants.is_empty() {
+        return quote!(0); // Early return with default if there are no variants.
+    }
+
+    let mut next_autonumber = 0u32;
+    let mut reserved_numbers = std::collections::BTreeSet::new();
+    let match_arms = variants.iter().map(|variant| {
+        let variant_ident = variant.ident();
+        let code = match variant.code() {
+            Some(code) => {
+                if reserved_numbers.contains(&code) {
+                    variant_ident
+                        .span()
+                        .unwrap()
+                        .error(format!("code {code} already used"))
+                        .emit();
+                    return quote!({});
+                }
+                reserved_numbers.insert(code);
+                code
+            }
+            None if autonumber => {
+                let mut reserved_successors = reserved_numbers.range(next_autonumber..);
+                while reserved_successors.next() == Some(&next_autonumber) {
+                    next_autonumber += 1;
+                }
+                let code = next_autonumber;
+                reserved_numbers.insert(code);
+                next_autonumber += 1;
+                code
+            }
+            None => {
+                variant_ident
+                    .span()
+                    .unwrap()
+                    .error(format!("missing `{}` for variant", V::FIELD_NAME))
+                    .emit();
+                return quote!();
+            }
+        };
+        quote!(Self::#variant_ident { .. } => { #code })
+    });
+    quote! {
+        match #enum_binding {
+            #(#match_arms)*
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn generate_empty_enum_converter() {
+        struct DummyVariant {}
+        impl CodedVariant for DummyVariant {
+            const FIELD_NAME: &'static str = "code";
+            fn ident(&self) -> &Ident {
+                unimplemented!()
+            }
+            fn code(&self) -> Option<u32> {
+                unimplemented!()
+            }
+        }
+        let variants: &[&DummyVariant] = &[];
+
+        let expected: syn::Expr = syn::parse_quote!(0);
+        let converter = enum_code_converter(&quote::format_ident!("the_enum"), variants, false);
+        let actual: syn::Expr = syn::parse2(converter).unwrap();
+        assert_eq!(expected, actual);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/lib.rs.html b/rust/src/oasis_runtime_sdk_macros/lib.rs.html new file mode 100644 index 0000000000..807f227f9c --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/lib.rs.html @@ -0,0 +1,221 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+
#![feature(proc_macro_diagnostic)]
+#![deny(rust_2018_idioms)]
+
+use proc_macro::TokenStream;
+
+mod error_derive;
+mod event_derive;
+mod generators;
+mod module_derive;
+#[cfg(test)]
+mod test_utils;
+mod version_from_cargo;
+
+/// Emits a compile-time error `msg` from a macro, and uses the span of the
+/// macro invocation if possible. If span info is not available (should only
+/// happen in unit tests), panics with `msg`.
+fn emit_compile_error<S: Into<String> + Clone + std::panic::RefUnwindSafe>(msg: S) -> ! {
+    std::panic::catch_unwind(|| {
+        proc_macro2::Span::call_site()
+            .unwrap()
+            .error(msg.clone().into())
+            .emit();
+    })
+    .ok()
+    .or_else(|| {
+        panic!("{}", msg.into());
+    });
+    unreachable!(); // error().emit() already halts compilation, but type checker doesn't know that
+}
+
+/// Derives the `Event` trait on an enum.
+#[proc_macro_derive(Event, attributes(sdk_event))]
+pub fn event_derive(input: TokenStream) -> TokenStream {
+    let input = syn::parse_macro_input!(input as syn::DeriveInput);
+    event_derive::derive_event(input).into()
+}
+
+/// Derives the `Error` trait on an enum.
+// The helper attribute is `sdk_error` to avoid conflict with `thiserror::Error`.
+#[proc_macro_derive(Error, attributes(sdk_error, source, from))]
+pub fn error_derive(input: TokenStream) -> TokenStream {
+    let input = syn::parse_macro_input!(input as syn::DeriveInput);
+    error_derive::derive_error(input).into()
+}
+
+/// Derives traits from a non-trait `impl` block (rather than from a `struct`).
+///
+/// Only the `Module` trait is supported. In other words, given an `impl MyModule` block, the macro
+/// derives implementations needed for implementing a module.
+/// See also the `#[handler]` and `#[migration]` attributes.
+#[proc_macro_attribute]
+pub fn sdk_derive(args: TokenStream, input: TokenStream) -> TokenStream {
+    let input = syn::parse_macro_input!(input as syn::ItemImpl);
+    if args.to_string() == "Module" {
+        module_derive::derive_module(input).into()
+    } else {
+        emit_compile_error("#[sdk_derive] only supports #[sdk_derive(Module)]");
+    }
+}
+
+/// A helper attribute for `#[sdk_derive(...)]`. It doesn't do anyting on its own;
+/// it only marks functions that represent a paratime method handler.
+/// The permitted forms are:
+///  - `#[handler(call = "my_module.MyCall")]`: Marks a function that handles
+///        the "my_module.MyCall" call and can be passed to
+///        oasis_runtime_sdk::module::dispatch_call.
+///  - `#[handler(prefetch = "my_module.MyCall")]`: Marks a function that handles
+///        the request to prefetch any data ahead of the "my_module.MyCall" call.
+///        Its signature should be `Fn(
+///          add_prefix: &mut dyn FnMut(Prefix) -> (),
+///          body: cbor::Value,
+///          auth_info: &AuthInfo,
+///        ) -> Result<(), oasis_runtime_sdk::error::RuntimeError>`
+///  - `#[handler(query = "my_module.MyQuery")]`: Marks a function that handles
+///        the "my_module.MyQuery" query and can be passed to
+///        oasis_runtime_sdk::module::dispatch_query.
+///  - `#[handler(message_result = "my_module.MyMR")]`: Marks a function that handles
+///        the "my_module.MyMR" message result and can be passed to
+///        oasis_runtime_sdk::module::dispatch_message_result.
+///
+/// Query handler can also contain the `expensive` tag. Example:
+/// `#[handler(query = "my_module.MyQuery", expensive)]`.
+/// Queries tagged `expensive` can be enabled/disabled are disabled by default to avoid
+/// excessive costs to the node operator. This can be overridden in the node config.
+///
+/// NOTE: This attribute is parsed by the `#[sdk_derive(...)]` macro, which cannot
+/// interpret the attribute name semantically. Use `#[handler]`, not
+/// `#[oasis_runtime_sdk_macros::handler]` or other paths/aliases.
+#[proc_macro_attribute]
+pub fn handler(_args: TokenStream, input: TokenStream) -> TokenStream {
+    input
+}
+
+/// A helper attribute for `#[sdk_derive(...)]`. It doesn't do anything on its own;
+/// it only marks functions that represent a module state migration.
+///
+/// The permitted forms are:
+///  - `#[migration(init)]`: Marks the initial (genesis) migration.
+///  - `#[migration(from = v)]`: Marks a migration from version v to v+1, where v is
+///    a non-negative integer.
+#[proc_macro_attribute]
+pub fn migration(_args: TokenStream, input: TokenStream) -> TokenStream {
+    input
+}
+
+/// Constructs an `oasis_sdk::core::common::version::Version` from the Cargo.toml version.
+#[proc_macro]
+pub fn version_from_cargo(_input: TokenStream) -> TokenStream {
+    version_from_cargo::version_from_cargo().into()
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/module_derive/method_handler.rs.html b/rust/src/oasis_runtime_sdk_macros/module_derive/method_handler.rs.html new file mode 100644 index 0000000000..ccc514846a --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/module_derive/method_handler.rs.html @@ -0,0 +1,923 @@ +method_handler.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+
use proc_macro2::TokenStream;
+use quote::quote;
+use syn::parse_quote;
+
+use crate::emit_compile_error;
+
+/// Deriver for the `MethodHandler` trait.
+pub struct DeriveMethodHandler {
+    handlers: Vec<ParsedImplItem>,
+}
+
+impl DeriveMethodHandler {
+    pub fn new() -> Box<Self> {
+        Box::new(Self { handlers: vec![] })
+    }
+}
+
+impl super::Deriver for DeriveMethodHandler {
+    fn preprocess(&mut self, item: syn::ImplItem) -> Option<syn::ImplItem> {
+        let method = match item {
+            syn::ImplItem::Fn(ref f) => f,
+            _ => return Some(item),
+        };
+
+        let attrs = if let Some(attrs) = parse_attrs(&method.attrs) {
+            attrs
+        } else {
+            return Some(item);
+        };
+
+        self.handlers.push(ParsedImplItem {
+            handler: Some(HandlerInfo {
+                attrs,
+                ident: method.sig.ident.clone(),
+            }),
+            item,
+        });
+
+        None // Take the item.
+    }
+
+    fn derive(&mut self, generics: &syn::Generics, ty: &Box<syn::Type>) -> TokenStream {
+        let handlers = &self.handlers;
+        let handler_items = handlers
+            .iter()
+            .map(|ParsedImplItem { item, .. }| item)
+            .collect::<Vec<_>>();
+
+        /// Generates parallel vectors of rpc names and handler idents for all handlers of kind `kind`.
+        fn filter_by_kind(
+            handlers: &[ParsedImplItem],
+            kind: HandlerKind,
+        ) -> (Vec<syn::Expr>, Vec<syn::Ident>) {
+            handlers
+                .iter()
+                .filter_map(|h| h.handler.as_ref())
+                .filter(|h| h.attrs.kind == kind)
+                .map(|h| (h.attrs.rpc_name.clone(), h.ident.clone()))
+                .unzip()
+        }
+
+        let prefetch_impl = {
+            let (handler_names, handler_idents) = filter_by_kind(handlers, HandlerKind::Prefetch);
+
+            // Find call handlers; for every call handler without a corresponding prefetch handler, we'll
+            // generate a dummy prefetch handler.
+            let (call_handler_names, _) = filter_by_kind(handlers, HandlerKind::Call);
+            let handler_names_without_impl: Vec<&syn::Expr> = call_handler_names
+                .iter()
+                .filter(|n| !handler_names.contains(n))
+                .collect();
+
+            if handler_names.is_empty() {
+                quote! {}
+            } else {
+                quote! {
+                    fn prefetch(
+                        prefixes: &mut BTreeSet<Prefix>,
+                        method: &str,
+                        body: cbor::Value,
+                        auth_info: &AuthInfo,
+                    ) -> module::DispatchResult<cbor::Value, Result<(), sdk::error::RuntimeError>> {
+                        let mut add_prefix = |p| {prefixes.insert(p);};
+                        match method {
+                            // "Real", user-defined prefetch handlers.
+                            #(
+                              #handler_names => module::DispatchResult::Handled(
+                                Self::#handler_idents(&mut add_prefix, body, auth_info)
+                              ),
+                            )*
+                            // No-op prefetch handlers.
+                            #(
+                              #handler_names_without_impl => module::DispatchResult::Handled(Ok(())),
+                            )*
+                            _ => module::DispatchResult::Unhandled(body),
+                        }
+                    }
+                }
+            }
+        };
+
+        let dispatch_call_impl = {
+            let (handler_names, handler_fns): (Vec<_>, Vec<_>) = handlers
+                .iter()
+                .filter_map(|h| h.handler.as_ref())
+                .filter(|h| h.attrs.kind == HandlerKind::Call)
+                .map(|h| {
+                    (h.attrs.rpc_name.clone(), {
+                        let ident = &h.ident;
+
+                        if h.attrs.is_internal {
+                            quote! {
+                                |ctx, body| {
+                                    if !sdk::state::CurrentState::with_env(|env| env.is_internal()) {
+                                        return Err(sdk::modules::core::Error::Forbidden.into());
+                                    }
+                                    Self::#ident(ctx, body)
+                                }
+                            }
+                        } else {
+                            quote! { Self::#ident }
+                        }
+                    })
+                })
+                .unzip();
+
+            if handler_names.is_empty() {
+                quote! {}
+            } else {
+                quote! {
+                    fn dispatch_call<C: Context>(
+                        ctx: &C,
+                        method: &str,
+                        body: cbor::Value,
+                    ) -> DispatchResult<cbor::Value, CallResult> {
+                        match method {
+                            #(
+                              #handler_names => module::dispatch_call(ctx, body, #handler_fns),
+                            )*
+                            _ => DispatchResult::Unhandled(body),
+                        }
+                    }
+                }
+            }
+        };
+
+        let query_parameters_impl = {
+            quote! {
+                fn query_parameters<C: Context>(_ctx: &C, _args: ()) -> Result<<Self as module::Module>::Parameters, <Self as module::Module>::Error> {
+                    Ok(Self::params())
+                }
+            }
+        };
+
+        let dispatch_query_impl = {
+            let (handler_names, handler_idents) = filter_by_kind(handlers, HandlerKind::Query);
+
+            if handler_names.is_empty() {
+                quote! {
+                    fn dispatch_query<C: Context>(
+                        ctx: &C,
+                        method: &str,
+                        args: cbor::Value,
+                    ) -> DispatchResult<cbor::Value, Result<cbor::Value, sdk::error::RuntimeError>> {
+                        match method {
+                            q if q == format!("{}.Parameters", Self::NAME) => module::dispatch_query(ctx, args, Self::query_parameters),
+                            _ => DispatchResult::Unhandled(args),
+                        }
+                    }
+                }
+            } else {
+                quote! {
+                    fn dispatch_query<C: Context>(
+                        ctx: &C,
+                        method: &str,
+                        args: cbor::Value,
+                    ) -> DispatchResult<cbor::Value, Result<cbor::Value, sdk::error::RuntimeError>> {
+                        match method {
+                            #(
+                              #handler_names => module::dispatch_query(ctx, args, Self::#handler_idents),
+                            )*
+                            q if q == format!("{}.Parameters", Self::NAME) => module::dispatch_query(ctx, args, Self::query_parameters),
+                            _ => DispatchResult::Unhandled(args),
+                        }
+                    }
+                }
+            }
+        };
+
+        let dispatch_message_result_impl = {
+            let (handler_names, handler_idents) =
+                filter_by_kind(handlers, HandlerKind::MessageResult);
+
+            if handler_names.is_empty() {
+                quote! {}
+            } else {
+                quote! {
+                    fn dispatch_message_result<C: Context>(
+                        ctx: &C,
+                        handler_name: &str,
+                        result: MessageResult,
+                    ) -> DispatchResult<MessageResult, ()> {
+                        match handler_name {
+                            #(
+                              #handler_names => {
+                                  Self::#handler_idents(
+                                      ctx,
+                                      result.event,
+                                      cbor::from_value(result.context).expect("invalid message handler context"),
+                                  );
+                                  DispatchResult::Handled(())
+                              }
+                            )*
+                            _ => DispatchResult::Unhandled(result),
+                        }
+                    }
+                }
+            }
+        };
+
+        let supported_methods_impl = {
+            let (handler_names, handler_kinds): (Vec<syn::Expr>, Vec<syn::Path>) = handlers
+                .iter()
+                .filter_map(|h| h.handler.as_ref())
+                // `prefetch` is an implementation detail of `call` handlers, so we don't list them
+                .filter(|h| h.attrs.kind != HandlerKind::Prefetch)
+                .map(|h| (h.attrs.rpc_name.clone(), h.attrs.kind.as_sdk_ident()))
+                .unzip();
+            if handler_names.is_empty() {
+                quote! {}
+            } else {
+                quote! {
+                    fn supported_methods() -> Vec<core_types::MethodHandlerInfo> {
+                        vec![ #(
+                            core_types::MethodHandlerInfo {
+                                kind: #handler_kinds,
+                                name: #handler_names.to_string(),
+                            },
+                        )* ]
+                    }
+                }
+            }
+        };
+
+        let expensive_queries_impl = {
+            let handler_names: Vec<syn::Expr> = handlers
+                .iter()
+                .filter_map(|h| h.handler.as_ref())
+                .filter(|h| h.attrs.kind == HandlerKind::Query && h.attrs.is_expensive)
+                .map(|h| h.attrs.rpc_name.clone())
+                .collect();
+            if handler_names.is_empty() {
+                quote! {}
+            } else {
+                quote! {
+                    fn is_expensive_query(method: &str) -> bool {
+                        [ #( #handler_names, )* ].contains(&method)
+                    }
+                }
+            }
+        };
+
+        let allowed_private_km_queries_impl = {
+            let handler_names: Vec<syn::Expr> = handlers
+                .iter()
+                .filter_map(|h| h.handler.as_ref())
+                .filter(|h| h.attrs.kind == HandlerKind::Query && h.attrs.allow_private_km)
+                .map(|h| h.attrs.rpc_name.clone())
+                .collect();
+            if handler_names.is_empty() {
+                quote! {}
+            } else {
+                quote! {
+                    fn is_allowed_private_km_query(method: &str) -> bool {
+                        [ #( #handler_names, )* ].contains(&method)
+                    }
+                }
+            }
+        };
+
+        let allowed_interactive_calls_impl = {
+            let handler_names: Vec<syn::Expr> = handlers
+                .iter()
+                .filter_map(|h| h.handler.as_ref())
+                .filter(|h| h.attrs.kind == HandlerKind::Call && h.attrs.allow_interactive)
+                .map(|h| h.attrs.rpc_name.clone())
+                .collect();
+            if handler_names.is_empty() {
+                quote! {}
+            } else {
+                quote! {
+                    fn is_allowed_interactive_call(method: &str) -> bool {
+                        [ #( #handler_names, )* ].contains(&method)
+                    }
+                }
+            }
+        };
+
+        quote! {
+            #[automatically_derived]
+            impl #generics sdk::module::MethodHandler for #ty {
+                #prefetch_impl
+                #dispatch_call_impl
+                #dispatch_query_impl
+                #dispatch_message_result_impl
+                #supported_methods_impl
+                #expensive_queries_impl
+                #allowed_private_km_queries_impl
+                #allowed_interactive_calls_impl
+            }
+
+            #[automatically_derived]
+            impl #generics #ty {
+                #query_parameters_impl
+
+                #(#handler_items)*
+            }
+        }
+    }
+}
+
+/// An item (in the `syn` sense, i.e. a fn, type, comment, etc) in an `impl` block,
+/// plus parsed data about its #[handler] attribute, if any.
+#[derive(Clone)]
+struct ParsedImplItem {
+    item: syn::ImplItem,
+    handler: Option<HandlerInfo>,
+}
+
+#[derive(Clone, Debug)]
+struct HandlerInfo {
+    attrs: MethodHandlerAttr,
+    /// Name of the handler function.
+    ident: syn::Ident,
+}
+
+#[derive(Debug, Copy, Clone, PartialEq)]
+enum HandlerKind {
+    Call,
+    Query,
+    MessageResult,
+    Prefetch,
+}
+
+impl HandlerKind {
+    fn as_sdk_ident(&self) -> syn::Path {
+        match self {
+            HandlerKind::Call => parse_quote!(core_types::MethodHandlerKind::Call),
+            HandlerKind::Query => parse_quote!(core_types::MethodHandlerKind::Query),
+            HandlerKind::MessageResult => {
+                parse_quote!(core_types::MethodHandlerKind::MessageResult)
+            }
+            HandlerKind::Prefetch => {
+                unimplemented!("prefetch cannot be expressed in core::types::MethodHandlerKind")
+            }
+        }
+    }
+}
+
+#[derive(Debug, Clone, PartialEq)]
+struct MethodHandlerAttr {
+    kind: HandlerKind,
+    /// Name of the RPC that this handler handles, e.g. "my_module.MyQuery".
+    rpc_name: syn::Expr,
+    /// Whether this handler is tagged as expensive. Only applies to query handlers.
+    is_expensive: bool,
+    /// Whether this handler is tagged as allowing access to private key manager state. Only applies
+    /// to query handlers.
+    allow_private_km: bool,
+    /// Whether this handler is tagged as allowing interactive calls. Only applies to call handlers.
+    allow_interactive: bool,
+    /// Whether this handler is tagged as internal.
+    is_internal: bool,
+}
+impl syn::parse::Parse for MethodHandlerAttr {
+    fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
+        let kind: syn::Ident = input.parse()?;
+        let kind = match kind.to_string().as_str() {
+            "call" => HandlerKind::Call,
+            "query" => HandlerKind::Query,
+            "message_result" => HandlerKind::MessageResult,
+            "prefetch" => HandlerKind::Prefetch,
+            _ => return Err(syn::Error::new(kind.span(), "invalid handler kind")),
+        };
+        let _: syn::token::Eq = input.parse()?;
+        let rpc_name: syn::Expr = input.parse()?;
+
+        // Parse optional comma-separated tags.
+        let mut is_expensive = false;
+        let mut allow_private_km = false;
+        let mut allow_interactive = false;
+        let mut is_internal = false;
+        while input.peek(syn::token::Comma) {
+            let _: syn::token::Comma = input.parse()?;
+            let tag: syn::Ident = input.parse()?;
+
+            if tag == "expensive" {
+                if kind != HandlerKind::Query {
+                    return Err(syn::Error::new(
+                        tag.span(),
+                        "`expensive` tag is only allowed on `query` handlers",
+                    ));
+                }
+                is_expensive = true;
+            } else if tag == "allow_private_km" {
+                if kind != HandlerKind::Query {
+                    return Err(syn::Error::new(
+                        tag.span(),
+                        "`allow_private_km` tag is only allowed on `query` handlers",
+                    ));
+                }
+                allow_private_km = true;
+            } else if tag == "allow_interactive" {
+                if kind != HandlerKind::Call {
+                    return Err(syn::Error::new(
+                        tag.span(),
+                        "`allow_interactive` tag is only allowed on `call` handlers",
+                    ));
+                }
+                allow_interactive = true;
+            } else if tag == "internal" {
+                if kind != HandlerKind::Call {
+                    return Err(syn::Error::new(
+                        tag.span(),
+                        "`internal` tag is only allowed on `call` handlers",
+                    ));
+                }
+                is_internal = true;
+            } else {
+                return Err(syn::Error::new(
+                    tag.span(),
+                    "invalid handler tag; supported: `expensive`, `allow_private_km`, `allow_interactive`, `internal`",
+                ));
+            }
+        }
+
+        if !input.is_empty() {
+            return Err(syn::Error::new(input.span(), "unexpected extra tokens"));
+        }
+        Ok(Self {
+            kind,
+            rpc_name,
+            is_expensive,
+            allow_private_km,
+            allow_interactive,
+            is_internal,
+        })
+    }
+}
+
+fn parse_attrs(attrs: &[syn::Attribute]) -> Option<MethodHandlerAttr> {
+    let handler_meta = attrs.iter().find(|attr| attr.path().is_ident("handler"))?;
+    handler_meta
+        .parse_args()
+        .map_err(|err| {
+            emit_compile_error(format!(
+                "Unsupported format of #[handler(...)] attribute: {err}"
+            ))
+        })
+        .ok()
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/module_derive/migration_handler.rs.html b/rust/src/oasis_runtime_sdk_macros/module_derive/migration_handler.rs.html new file mode 100644 index 0000000000..4188219760 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/module_derive/migration_handler.rs.html @@ -0,0 +1,343 @@ +migration_handler.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+
use std::collections::HashSet;
+
+use proc_macro2::TokenStream;
+use quote::quote;
+
+use crate::emit_compile_error;
+
+/// Deriver for the `MigrationHandler` trait.
+pub struct DeriveMigrationHandler {
+    /// Item defining the `MigrationHandler::Genesis` associated type.
+    genesis_ty: Option<syn::ImplItem>,
+    /// Migration functions.
+    migrate_fns: Vec<MigrateFn>,
+}
+
+struct MigrateFn {
+    item: syn::ImplItem,
+    ident: syn::Ident,
+    from_version: u32,
+}
+
+impl DeriveMigrationHandler {
+    pub fn new() -> Box<Self> {
+        Box::new(Self {
+            genesis_ty: None,
+            migrate_fns: vec![],
+        })
+    }
+}
+
+impl super::Deriver for DeriveMigrationHandler {
+    fn preprocess(&mut self, item: syn::ImplItem) -> Option<syn::ImplItem> {
+        match item {
+            // We are looking for a `type Genesis = ...;` item.
+            syn::ImplItem::Type(ref ty) if &ty.ident.to_string() == "Genesis" => {
+                self.genesis_ty = Some(item);
+
+                None // Take the item.
+            }
+            syn::ImplItem::Fn(ref f) => {
+                // Check whether a `migration` attribute is set for the method.
+                if let Some(attrs) = parse_attrs(&f.attrs) {
+                    self.migrate_fns.push(MigrateFn {
+                        ident: f.sig.ident.clone(),
+                        from_version: attrs.from_version,
+                        item,
+                    });
+
+                    None // Take the item.
+                } else {
+                    Some(item) // Return the item.
+                }
+            }
+            _ => Some(item), // Return the item.
+        }
+    }
+
+    fn derive(&mut self, generics: &syn::Generics, ty: &Box<syn::Type>) -> TokenStream {
+        let genesis_ty = if let Some(genesis_ty) = &self.genesis_ty {
+            genesis_ty
+        } else {
+            return quote! {};
+        };
+
+        // Sort by version to ensure migrations are processed in the right order.
+        self.migrate_fns.sort_by_key(|f| f.from_version);
+
+        let mut seen_versions = HashSet::new();
+        let (migrate_fns, mut migrate_arms): (Vec<_>, Vec<_>) = self.migrate_fns.iter().map(|f| {
+            let MigrateFn { item, ident, from_version } = f;
+            if seen_versions.contains(from_version) {
+                emit_compile_error(format!(
+                    "Duplicate migration for version: {from_version}"
+                ));
+            }
+            seen_versions.insert(from_version);
+
+            (
+                item,
+                if from_version == &0 {
+                    // Version zero is special as initializing from genesis always gets us latest.
+                    quote! { if version == #from_version { Self::#ident(genesis); version = Self::VERSION; } }
+                } else {
+                    // For other versions, each migration brings us from V to V+1.
+                    // TODO: Add a compile-time assert that version < Self::VERSION.
+                    quote! { if version == #from_version && version < Self::VERSION { Self::#ident(); version += 1; } }
+                }
+            )
+        }).unzip();
+
+        // Ensure there is a genesis migration, at least an empty one that bumps the version.
+        if !seen_versions.contains(&0) {
+            migrate_arms.push(quote! {
+                if version == 0u32 { version = Self::VERSION; }
+            });
+        }
+
+        quote! {
+            #[automatically_derived]
+            impl #generics sdk::module::MigrationHandler for #ty {
+                #genesis_ty
+
+                fn init_or_migrate<C: Context>(
+                    _ctx: &C,
+                    meta: &mut sdk::modules::core::types::Metadata,
+                    genesis: Self::Genesis,
+                ) -> bool {
+                    let mut version = meta.versions.get(Self::NAME).copied().unwrap_or_default();
+                    if version == Self::VERSION {
+                        return false; // Already the latest version.
+                    }
+
+                    #(#migrate_arms)*
+
+                    if version != Self::VERSION {
+                        panic!("no migration for module state from version {version} to {}", Self::VERSION)
+                    }
+
+                    // Update version information.
+                    meta.versions.insert(Self::NAME.to_owned(), Self::VERSION);
+                    return true;
+                }
+            }
+
+            #[automatically_derived]
+            impl #generics #ty {
+                #(#migrate_fns)*
+            }
+        }
+    }
+}
+
+#[derive(Debug, Clone, PartialEq)]
+struct MigrationHandlerAttr {
+    /// Version that this handler handles. Zero indicates genesis.
+    from_version: u32,
+}
+impl syn::parse::Parse for MigrationHandlerAttr {
+    fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
+        let kind: syn::Ident = input.parse()?;
+        let from_version = match kind.to_string().as_str() {
+            "init" => 0,
+            "from" => {
+                let _: syn::token::Eq = input.parse()?;
+                let version: syn::LitInt = input.parse()?;
+
+                version.base10_parse()?
+            }
+            _ => return Err(syn::Error::new(kind.span(), "invalid migration kind")),
+        };
+
+        if !input.is_empty() {
+            return Err(syn::Error::new(input.span(), "unexpected extra tokens"));
+        }
+        Ok(Self { from_version })
+    }
+}
+
+fn parse_attrs(attrs: &[syn::Attribute]) -> Option<MigrationHandlerAttr> {
+    let migration_meta = attrs
+        .iter()
+        .find(|attr| attr.path().is_ident("migration"))?;
+    migration_meta
+        .parse_args()
+        .map_err(|err| {
+            emit_compile_error(format!(
+                "Unsupported format of #[migration(...)] attribute: {err}"
+            ))
+        })
+        .ok()
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/module_derive/mod.rs.html b/rust/src/oasis_runtime_sdk_macros/module_derive/mod.rs.html new file mode 100644 index 0000000000..807340b9ce --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/module_derive/mod.rs.html @@ -0,0 +1,1157 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+
mod method_handler;
+mod migration_handler;
+mod module;
+
+use proc_macro2::TokenStream;
+use quote::quote;
+
+use crate::generators as gen;
+
+/// Given an `impl MyModule` block, produces an `impl *Handler for MyModule`.
+/// See `sdk_derive()` in lib.rs for details.
+pub fn derive_module(impl_block: syn::ItemImpl) -> TokenStream {
+    let sdk_crate = gen::sdk_crate_path();
+    let module_generics = &impl_block.generics;
+    let module_ty = &impl_block.self_ty;
+
+    let mut base_impls: Vec<TokenStream> = Vec::new();
+    let mut derivations: Vec<TokenStream> = Vec::new();
+
+    let mut derivers: Vec<Box<dyn Deriver>> = vec![
+        module::DeriveModule::new(),
+        migration_handler::DeriveMigrationHandler::new(),
+        method_handler::DeriveMethodHandler::new(),
+    ];
+
+    // Iterate through all impl items, collecting them and then deriving everything.
+    'items: for item in impl_block.items {
+        let mut item = Some(item);
+
+        for deriver in derivers.iter_mut() {
+            item = deriver.preprocess(item.take().expect("no deriver claimed the item"));
+            if item.is_none() {
+                continue 'items;
+            }
+        }
+
+        // No deriver claimed the item.
+        let item = item.expect("no deriver claimed the item");
+        base_impls.push(quote!(#item));
+    }
+
+    // Perform the derivation process.
+    for deriver in derivers.iter_mut() {
+        let derivation = deriver.derive(module_generics, module_ty);
+        derivations.push(derivation);
+    }
+
+    let base_impls = if base_impls.is_empty() {
+        None
+    } else {
+        Some(quote! {
+            #[automatically_derived]
+            impl #module_generics #module_ty {
+                #(#base_impls)*
+            }
+        })
+    };
+
+    gen::wrap_in_const(quote! {
+        use #sdk_crate::{
+          self as sdk,
+          cbor,
+          error::Error as _,
+          module::{DispatchResult, CallResult},
+          modules::core::types as core_types,
+          types::message::MessageResult
+        };
+
+        #(#derivations)*
+        #base_impls
+    })
+}
+
+trait Deriver {
+    fn preprocess(&mut self, item: syn::ImplItem) -> Option<syn::ImplItem>;
+
+    #[allow(clippy::borrowed_box)]
+    fn derive(&mut self, generics: &syn::Generics, ty: &Box<syn::Type>) -> TokenStream;
+}
+
+#[cfg(test)]
+mod tests {
+    // Helper; asserts that `derive_module` generates the `expected` code from `input`.
+    fn expect_module_impl(input: syn::ItemImpl, expected: syn::Stmt) {
+        let derivation = super::derive_module(input);
+        let actual: syn::Stmt = syn::parse2(derivation).unwrap();
+
+        crate::assert_empty_diff!(actual, expected);
+    }
+
+    // The `uses` statement common to all autogenerated impls.
+    thread_local! {
+      static USES: proc_macro2::TokenStream = quote::quote! {
+            use ::oasis_runtime_sdk::{
+                  self as sdk, cbor,
+                  error::Error as _,
+                  module::{CallResult, DispatchResult},
+                  modules::core::types as core_types,
+                  types::message::MessageResult,
+              };
+      }
+    }
+
+    /// Unannotated functions in the input impl block should be assumed to be a part of the base
+    /// type implementation.
+    #[test]
+    fn generate_method_handler_impl_unannotated_func() {
+        let input = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                fn unannotated_fn_should_be_passed_thru(foo: Bar) -> Baz {}
+            }
+        );
+
+        expect_module_impl(
+            input,
+            USES.with(|uses| {
+                syn::parse_quote!(
+                    const _: () = {
+                        #uses
+                        #[automatically_derived]
+                        impl<C: Cfg> sdk::module::MethodHandler for MyModule<C> {
+                            fn dispatch_query<C: Context>(
+                                ctx: &C,
+                                method: &str,
+                                args: cbor::Value,
+                            ) -> DispatchResult<cbor::Value, Result<cbor::Value, sdk::error::RuntimeError>>
+                            {
+                                match method {
+                                    q if q == format!("{}.Parameters", Self::NAME) => {
+                                        module::dispatch_query(ctx, args, Self::query_parameters)
+                                    }
+                                    _ => DispatchResult::Unhandled(args),
+                                }
+                            }
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> MyModule<C> {
+                            fn query_parameters<C: Context>(_ctx: &C, _args: ()) -> Result<<Self as module::Module>::Parameters, <Self as module::Module>::Error> {
+                                Ok(Self::params())
+                            }
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> MyModule<C> {
+                            fn unannotated_fn_should_be_passed_thru(foo: Bar) -> Baz {}
+                        }
+                    };
+                )
+            }),
+        );
+    }
+
+    #[test]
+    fn generate_method_handler_impl_calls() {
+        let input = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                #[handler(prefetch = "my_module.MyCall")]
+                fn prefetch_for_my_call() {}
+                #[handler(call = "my_module.MyCall")]
+                fn my_call(foo2: Bar2) -> Baz2 {}
+                #[handler(call = "my_module.MyOtherCall")]
+                fn my_other_call(foo3: Bar3) -> Baz3 {}
+                #[handler(call = "my_module.MyInternalCall", internal)]
+                fn my_internal_call(foo4: Bar4) -> Baz4 {}
+            }
+        );
+
+        expect_module_impl(
+            input,
+            USES.with(|uses| {
+                syn::parse_quote!(
+                    const _: () = {
+                        #uses
+                        #[automatically_derived]
+                        impl<C: Cfg> sdk::module::MethodHandler for MyModule<C> {
+                            fn prefetch(
+                                prefixes: &mut BTreeSet<Prefix>,
+                                method: &str,
+                                body: cbor::Value,
+                                auth_info: &AuthInfo,
+                            ) -> module::DispatchResult<cbor::Value, Result<(), sdk::error::RuntimeError>> {
+                                let mut add_prefix = |p| {
+                                    prefixes.insert(p);
+                                };
+                                match method {
+                                    "my_module.MyCall" => module::DispatchResult::Handled(
+                                        Self::prefetch_for_my_call(&mut add_prefix, body, auth_info),
+                                    ),
+                                    "my_module.MyOtherCall" => module::DispatchResult::Handled(Ok(())),
+                                    "my_module.MyInternalCall" => module::DispatchResult::Handled(Ok(())),
+                                    _ => module::DispatchResult::Unhandled(body),
+                                }
+                            }
+                            fn dispatch_call<C: Context>(
+                                ctx: &C,
+                                method: &str,
+                                body: cbor::Value,
+                            ) -> DispatchResult<cbor::Value, CallResult> {
+                                match method {
+                                    "my_module.MyCall" => module::dispatch_call(ctx, body, Self::my_call),
+                                    "my_module.MyOtherCall" => {
+                                        module::dispatch_call(ctx, body, Self::my_other_call)
+                                    }
+                                    "my_module.MyInternalCall" => module::dispatch_call(ctx, body, |ctx, body| {
+                                        if !sdk::state::CurrentState::with_env(|env| env.is_internal()) {
+                                            return Err(sdk::modules::core::Error::Forbidden.into());
+                                        }
+                                        Self::my_internal_call(ctx, body)
+                                    }),
+                                    _ => DispatchResult::Unhandled(body),
+                                }
+                            }
+                            fn dispatch_query<C: Context>(
+                                ctx: &C,
+                                method: &str,
+                                args: cbor::Value,
+                            ) -> DispatchResult<cbor::Value, Result<cbor::Value, sdk::error::RuntimeError>>
+                            {
+                                match method {
+                                    q if q == format!("{}.Parameters", Self::NAME) => {
+                                        module::dispatch_query(ctx, args, Self::query_parameters)
+                                    }
+                                    _ => DispatchResult::Unhandled(args),
+                                }
+                            }
+                            fn supported_methods() -> Vec<core_types::MethodHandlerInfo> {
+                                vec![
+                                    core_types::MethodHandlerInfo {
+                                        kind: core_types::MethodHandlerKind::Call,
+                                        name: "my_module.MyCall".to_string(),
+                                    },
+                                    core_types::MethodHandlerInfo {
+                                        kind: core_types::MethodHandlerKind::Call,
+                                        name: "my_module.MyOtherCall".to_string(),
+                                    },
+                                    core_types::MethodHandlerInfo {
+                                        kind: core_types::MethodHandlerKind::Call,
+                                        name: "my_module.MyInternalCall".to_string(),
+                                    },
+                                ]
+                            }
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> MyModule<C> {
+                            fn query_parameters<C: Context>(_ctx: &C, _args: ()) -> Result<<Self as module::Module>::Parameters, <Self as module::Module>::Error> {
+                                Ok(Self::params())
+                            }
+                            #[handler(prefetch = "my_module.MyCall")]
+                            fn prefetch_for_my_call() {}
+                            #[handler(call = "my_module.MyCall")]
+                            fn my_call(foo2: Bar2) -> Baz2 {}
+                            #[handler(call = "my_module.MyOtherCall")]
+                            fn my_other_call(foo3: Bar3) -> Baz3 {}
+                            #[handler(call = "my_module.MyInternalCall", internal)]
+                            fn my_internal_call(foo4: Bar4) -> Baz4 {}
+                        }
+                    };
+                )
+            }),
+        );
+    }
+
+    #[test]
+    fn generate_method_handler_impl_queries() {
+        let input = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                #[handler(query = RPC_NAME_OF_MY_QUERY)]
+                fn my_query() -> () {}
+                #[handler(query = "module.OtherQuery", expensive)]
+                fn my_other_query() -> () {}
+                #[handler(query = "module.ConfidentialQuery", expensive, allow_private_km)]
+                fn my_confidential_query() -> () {}
+            }
+        );
+
+        expect_module_impl(
+            input,
+            USES.with(|uses| {
+                syn::parse_quote!(
+                    const _: () = {
+                        #uses
+                        #[automatically_derived]
+                        impl<C: Cfg> sdk::module::MethodHandler for MyModule<C> {
+                            fn dispatch_query<C: Context>(
+                                ctx: &C,
+                                method: &str,
+                                args: cbor::Value,
+                            ) -> DispatchResult<cbor::Value, Result<cbor::Value, sdk::error::RuntimeError>>
+                            {
+                                match method {
+                                    RPC_NAME_OF_MY_QUERY => module::dispatch_query(ctx, args, Self::my_query),
+                                    "module.OtherQuery" => module::dispatch_query(ctx, args, Self::my_other_query),
+                                    "module.ConfidentialQuery" => module::dispatch_query(ctx, args, Self::my_confidential_query),
+                                    q if q == format!("{}.Parameters", Self::NAME) => {
+                                        module::dispatch_query(ctx, args, Self::query_parameters)
+                                    }
+                                    _ => DispatchResult::Unhandled(args),
+                                }
+                            }
+                            fn supported_methods() -> Vec<core_types::MethodHandlerInfo> {
+                                vec![
+                                    core_types::MethodHandlerInfo {
+                                        kind: core_types::MethodHandlerKind::Query,
+                                        name: RPC_NAME_OF_MY_QUERY.to_string(),
+                                    },
+                                    core_types::MethodHandlerInfo {
+                                        kind: core_types::MethodHandlerKind::Query,
+                                        name: "module.OtherQuery".to_string(),
+                                    },
+                                    core_types::MethodHandlerInfo {
+                                        kind: core_types::MethodHandlerKind::Query,
+                                        name: "module.ConfidentialQuery".to_string(),
+                                    },
+                                ]
+                            }
+                            fn is_expensive_query(method: &str) -> bool {
+                                ["module.OtherQuery", "module.ConfidentialQuery"].contains(&method)
+                            }
+                            fn is_allowed_private_km_query(method: &str) -> bool {
+                                ["module.ConfidentialQuery"].contains(&method)
+                            }
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> MyModule<C> {
+                            fn query_parameters<C: Context>(
+                                _ctx: &C,
+                                _args: (),
+                            ) -> Result<<Self as module::Module>::Parameters, <Self as module::Module>::Error>
+                            {
+                                Ok(Self::params())
+                            }
+                            #[handler(query = RPC_NAME_OF_MY_QUERY)]
+                            fn my_query() -> () {}
+                            #[handler(query = "module.OtherQuery", expensive)]
+                            fn my_other_query() -> () {}
+                            #[handler(query = "module.ConfidentialQuery", expensive, allow_private_km)]
+                            fn my_confidential_query() -> () {}
+                        }
+                    };
+                )
+            }),
+        );
+    }
+
+    #[test]
+    fn generate_method_handler_impl_method_calls() {
+        let input = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                #[handler(query = "my_module.MyMC")]
+                fn my_method_call() -> () {}
+            }
+        );
+
+        expect_module_impl(
+            input,
+            USES.with(|uses| {
+                syn::parse_quote!(
+                    const _: () = {
+                        #uses
+                        #[automatically_derived]
+                        impl<C: Cfg> sdk::module::MethodHandler for MyModule<C> {
+                            fn dispatch_query<C: Context>(
+                                ctx: &C,
+                                method: &str,
+                                args: cbor::Value,
+                            ) -> DispatchResult<cbor::Value, Result<cbor::Value, sdk::error::RuntimeError>>
+                            {
+                                match method {
+                                    "my_module.MyMC" => module::dispatch_query(ctx, args, Self::my_method_call),
+                                    q if q == format!("{}.Parameters", Self::NAME) => {
+                                        module::dispatch_query(ctx, args, Self::query_parameters)
+                                    }
+                                    _ => DispatchResult::Unhandled(args),
+                                }
+                            }
+                            fn supported_methods() -> Vec<core_types::MethodHandlerInfo> {
+                                vec![core_types::MethodHandlerInfo {
+                                    kind: core_types::MethodHandlerKind::Query,
+                                    name: "my_module.MyMC".to_string(),
+                                }]
+                            }
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> MyModule<C> {
+                            fn query_parameters<C: Context>(_ctx: &C, _args: ()) -> Result<<Self as module::Module>::Parameters, <Self as module::Module>::Error> {
+                                Ok(Self::params())
+                            }
+                            #[handler(query = "my_module.MyMC")]
+                            fn my_method_call() -> () {}
+                        }
+                    };
+                )
+            }),
+        );
+    }
+
+    #[test]
+    fn generate_module_impl() {
+        let input = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                const NAME: &'static str = MODULE_NAME;
+                const VERSION: u32 = 2;
+                type Error = Error;
+                type Event = ();
+                type Parameters = Parameters;
+                type Genesis = Genesis;
+
+                #[migration(init)]
+                fn init(genesis: Genesis) {
+                    Self::set_params(genesis.parameters);
+                }
+
+                #[migration(from = 2)]
+                fn migrate_v2_to_v3() {}
+
+                #[migration(from = 1)]
+                fn migrate_v1_to_v2() {}
+
+                #[handler(query = "my_module.MyMC")]
+                fn my_method_call() -> () {}
+            }
+        );
+
+        expect_module_impl(
+            input,
+            USES.with(|uses| {
+                syn::parse_quote!(
+                    const _: () = {
+                        #uses
+                        #[automatically_derived]
+                        impl<C: Cfg> sdk::module::Module for MyModule<C> {
+                            const NAME: &'static str = MODULE_NAME;
+                            const VERSION: u32 = 2;
+                            type Error = Error;
+                            type Event = ();
+                            type Parameters = Parameters;
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> sdk::module::MigrationHandler for MyModule<C> {
+                            type Genesis = Genesis;
+                            fn init_or_migrate<C: Context>(
+                                _ctx: &C,
+                                meta: &mut sdk::modules::core::types::Metadata,
+                                genesis: Self::Genesis,
+                            ) -> bool {
+                                let mut version = meta.versions.get(Self::NAME).copied().unwrap_or_default();
+                                if version == Self::VERSION {
+                                    return false;
+                                }
+                                if version == 0u32 {
+                                    Self::init(genesis);
+                                    version = Self::VERSION;
+                                }
+                                if version == 1u32 && version < Self::VERSION {
+                                    Self::migrate_v1_to_v2();
+                                    version += 1;
+                                }
+                                if version == 2u32 && version < Self::VERSION {
+                                    Self::migrate_v2_to_v3();
+                                    version += 1;
+                                }
+                                if version != Self::VERSION {
+                                    panic!(
+                                        "no migration for module state from version {version} to {}",
+                                        Self::VERSION
+                                    )
+                                }
+                                meta.versions.insert(Self::NAME.to_owned(), Self::VERSION);
+                                return true;
+                            }
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> MyModule<C> {
+                            #[migration(init)]
+                            fn init(genesis: Genesis) {
+                                Self::set_params(genesis.parameters);
+                            }
+                            #[migration(from = 1)]
+                            fn migrate_v1_to_v2() {}
+                            #[migration(from = 2)]
+                            fn migrate_v2_to_v3() {}
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> sdk::module::MethodHandler for MyModule<C> {
+                            fn dispatch_query<C: Context>(
+                                ctx: &C,
+                                method: &str,
+                                args: cbor::Value,
+                            ) -> DispatchResult<cbor::Value, Result<cbor::Value, sdk::error::RuntimeError>>
+                            {
+                                match method {
+                                    "my_module.MyMC" => module::dispatch_query(ctx, args, Self::my_method_call),
+                                    q if q == format!("{}.Parameters", Self::NAME) => {
+                                        module::dispatch_query(ctx, args, Self::query_parameters)
+                                    }
+                                    _ => DispatchResult::Unhandled(args),
+                                }
+                            }
+                            fn supported_methods() -> Vec<core_types::MethodHandlerInfo> {
+                                vec![core_types::MethodHandlerInfo {
+                                    kind: core_types::MethodHandlerKind::Query,
+                                    name: "my_module.MyMC".to_string(),
+                                }]
+                            }
+                        }
+                        #[automatically_derived]
+                        impl<C: Cfg> MyModule<C> {
+                            fn query_parameters<C: Context>(_ctx: &C, _args: ()) -> Result<<Self as module::Module>::Parameters, <Self as module::Module>::Error> {
+                                Ok(Self::params())
+                            }
+                            #[handler(query = "my_module.MyMC")]
+                            fn my_method_call() -> () {}
+                        }
+                    };
+                )
+            }),
+        );
+    }
+
+    #[test]
+    #[should_panic(expected = "invalid handler kind")]
+    fn generate_method_handler_malformed_bad_kind() {
+        let input: syn::ItemImpl = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                #[handler(unsupported_key = "some_value")]
+                fn my_method_call() -> () {}
+            }
+        );
+        super::derive_module(input);
+    }
+
+    #[test]
+    #[should_panic(expected = "only allowed on `query` handlers")]
+    fn generate_method_handler_malformed_expensive_nonquery() {
+        let input: syn::ItemImpl = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                #[handler(call = "foo", expensive)]
+                fn my_method_call() -> () {}
+            }
+        );
+        super::derive_module(input);
+    }
+
+    #[test]
+    #[should_panic(expected = "only allowed on `query` handlers")]
+    fn generate_method_handler_malformed_allow_private_km_nonquery() {
+        let input: syn::ItemImpl = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                #[handler(call = "foo", allow_private_km)]
+                fn my_method_call() -> () {}
+            }
+        );
+        super::derive_module(input);
+    }
+
+    #[test]
+    #[should_panic(expected = "only allowed on `call` handlers")]
+    fn generate_method_handler_malformed_internal_noncall() {
+        let input: syn::ItemImpl = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                #[handler(query = "foo", internal)]
+                fn my_method_call() -> () {}
+            }
+        );
+        super::derive_module(input);
+    }
+
+    #[test]
+    #[should_panic]
+    fn generate_method_handler_malformed_multiple_metas() {
+        let input: syn::ItemImpl = syn::parse_quote!(
+            impl<C: Cfg> MyModule<C> {
+                #[handler(call = "foo", query = "bar")]
+                fn my_method_call() -> () {}
+            }
+        );
+        super::derive_module(input);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/module_derive/module.rs.html b/rust/src/oasis_runtime_sdk_macros/module_derive/module.rs.html new file mode 100644 index 0000000000..e3a64d650f --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/module_derive/module.rs.html @@ -0,0 +1,109 @@ +module.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+
use proc_macro2::TokenStream;
+use quote::quote;
+
+/// Deriver for the `Module` trait.
+pub struct DeriveModule {
+    /// Items specifying the module configuration.
+    module_cfg: Vec<syn::ImplItem>,
+}
+
+impl DeriveModule {
+    pub fn new() -> Box<Self> {
+        Box::new(Self { module_cfg: vec![] })
+    }
+}
+
+impl super::Deriver for DeriveModule {
+    fn preprocess(&mut self, item: syn::ImplItem) -> Option<syn::ImplItem> {
+        match item {
+            syn::ImplItem::Type(ref ty) => {
+                match ty.ident.to_string().as_str() {
+                    "Error" | "Event" | "Parameters" => {
+                        self.module_cfg.push(item);
+                        None // Take the item.
+                    }
+                    _ => Some(item), // Return the item.
+                }
+            }
+            syn::ImplItem::Const(ref cnst) => {
+                match cnst.ident.to_string().as_str() {
+                    "NAME" | "VERSION" => {
+                        self.module_cfg.push(item);
+                        None // Take the item.
+                    }
+                    _ => Some(item), // Return the item.
+                }
+            }
+            _ => Some(item), // Return the item.
+        }
+    }
+
+    fn derive(&mut self, generics: &syn::Generics, ty: &Box<syn::Type>) -> TokenStream {
+        if self.module_cfg.is_empty() {
+            return quote! {};
+        }
+        let module_cfg = &self.module_cfg;
+
+        quote! {
+            #[automatically_derived]
+            impl #generics sdk::module::Module for #ty {
+                #(#module_cfg)*
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk_macros/version_from_cargo.rs.html b/rust/src/oasis_runtime_sdk_macros/version_from_cargo.rs.html new file mode 100644 index 0000000000..a0560e5094 --- /dev/null +++ b/rust/src/oasis_runtime_sdk_macros/version_from_cargo.rs.html @@ -0,0 +1,83 @@ +version_from_cargo.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+
use proc_macro2::TokenStream;
+use quote::quote;
+
+macro_rules! parse_cargo_ver {
+    ($ver:literal) => {{
+        let cargo_pkg_version_env_var = if cfg!(test) {
+            concat!("TEST_CARGO_PKG_VERSION_", $ver)
+        } else {
+            concat!("CARGO_PKG_VERSION_", $ver)
+        };
+        std::env::var(cargo_pkg_version_env_var)
+            .unwrap()
+            .parse::<u16>()
+            .unwrap()
+    }};
+}
+
+/// Constructs an `oasis_sdk::core::common::version::Version` from the Cargo.toml version.
+pub fn version_from_cargo() -> TokenStream {
+    let major = parse_cargo_ver!("MAJOR");
+    let minor = parse_cargo_ver!("MINOR");
+    let patch = parse_cargo_ver!("PATCH");
+    quote!(oasis_runtime_sdk::core::common::version::Version::new(#major, #minor, #patch))
+}
+
+#[cfg(test)]
+mod tests {
+    #[test]
+    fn generates_version() {
+        std::env::set_var("TEST_CARGO_PKG_VERSION_MAJOR", "1");
+        std::env::set_var("TEST_CARGO_PKG_VERSION_MINOR", "2");
+        std::env::set_var("TEST_CARGO_PKG_VERSION_PATCH", "3");
+
+        let expected: syn::Expr = syn::parse_quote!(
+            oasis_runtime_sdk::core::common::version::Version::new(1u16, 2u16, 3u16)
+        );
+        let actual: syn::Expr = syn::parse2(super::version_from_cargo()).unwrap();
+
+        crate::assert_empty_diff!(actual, expected);
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/rofl_utils/https.rs.html b/rust/src/rofl_utils/https.rs.html new file mode 100644 index 0000000000..6191f812f3 --- /dev/null +++ b/rust/src/rofl_utils/https.rs.html @@ -0,0 +1,679 @@ +https.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+
//! A very simple HTTPS client that can be used inside ROFL apps.
+//!
+//! This simple client is needed because Fortanix EDP does not yet have support for mio/Tokio
+//! networking and so the usual `hyper` and `reqwest` cannot be used without patches.
+use std::{
+    fmt,
+    io::{Read, Write},
+    net::{Ipv4Addr, SocketAddr, SocketAddrV4, TcpStream},
+    sync::{Arc, OnceLock},
+};
+
+use rustls::{ClientConfig, ClientConnection, StreamOwned};
+use rustls_pki_types::ServerName;
+use ureq::{
+    http::Uri,
+    resolver::Resolver,
+    transport::{
+        time::NextTimeout, Buffers, ChainedConnector, ConnectionDetails, Connector, LazyBuffers,
+        Transport, TransportAdapter,
+    },
+    Agent, AgentConfig,
+};
+
+/// An `ureq::Agent` that can be used to perform blocking HTTPS requests.
+///
+/// Note that this forbids non-HTTPS requests. If you need to perform plain HTTP requests consider
+/// using `agent_with_config` and pass a suitable config.
+pub fn agent() -> Agent {
+    let cfg = AgentConfig {
+        https_only: true, // Not using HTTPS is unsafe unless careful.
+        user_agent: "rofl-utils/0.1.0".to_string(),
+        ..Default::default()
+    };
+    agent_with_config(cfg)
+}
+
+/// An `ureq::Agent` with given configuration that can be used to perform blocking HTTPS requests.
+pub fn agent_with_config(cfg: AgentConfig) -> Agent {
+    Agent::with_parts(
+        cfg,
+        ChainedConnector::new([SgxConnector.boxed(), RustlsConnector::default().boxed()]),
+        SgxResolver,
+    )
+}
+
+#[derive(Debug)]
+struct SgxConnector;
+
+impl Connector for SgxConnector {
+    fn connect(
+        &self,
+        details: &ConnectionDetails,
+        _chained: Option<Box<dyn Transport>>,
+    ) -> Result<Option<Box<dyn Transport>>, ureq::Error> {
+        let config = &details.config;
+        // Has already been validated.
+        let scheme = details.uri.scheme().unwrap();
+        let authority = details.uri.authority().unwrap();
+
+        let host_port = ureq::resolver::DefaultResolver::host_and_port(scheme, authority)
+            .ok_or(ureq::Error::HostNotFound)?;
+        let stream = TcpStream::connect(host_port)?;
+
+        let buffers = LazyBuffers::new(config.input_buffer_size, config.output_buffer_size);
+        let transport = TcpTransport::new(stream, buffers);
+
+        Ok(Some(Box::new(transport)))
+    }
+}
+
+struct TcpTransport {
+    stream: TcpStream,
+    buffers: LazyBuffers,
+}
+
+impl TcpTransport {
+    fn new(stream: TcpStream, buffers: LazyBuffers) -> TcpTransport {
+        TcpTransport { stream, buffers }
+    }
+}
+
+impl Transport for TcpTransport {
+    fn buffers(&mut self) -> &mut dyn Buffers {
+        &mut self.buffers
+    }
+
+    fn transmit_output(&mut self, amount: usize, _timeout: NextTimeout) -> Result<(), ureq::Error> {
+        let output = &self.buffers.output()[..amount];
+        self.stream.write_all(output)?;
+
+        Ok(())
+    }
+
+    fn await_input(&mut self, _timeout: NextTimeout) -> Result<bool, ureq::Error> {
+        if self.buffers.can_use_input() {
+            return Ok(true);
+        }
+
+        let input = self.buffers.input_mut();
+        let amount = self.stream.read(input)?;
+        self.buffers.add_filled(amount);
+
+        Ok(amount > 0)
+    }
+
+    fn is_open(&mut self) -> bool {
+        // No way to detect on SGX.
+        true
+    }
+}
+
+impl fmt::Debug for TcpTransport {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("TcpTransport")
+            .field("addr", &self.stream.peer_addr().ok())
+            .finish()
+    }
+}
+
+#[derive(Debug)]
+struct SgxResolver;
+
+impl Resolver for SgxResolver {
+    fn resolve(
+        &self,
+        _uri: &Uri,
+        _config: &AgentConfig,
+        _timeout: NextTimeout,
+    ) -> Result<ureq::resolver::ResolvedSocketAddrs, ureq::Error> {
+        // Do not resolve anything as SGX does not support resolution and the endpoint must be
+        // passed as a string. We need to return a dummy address.
+        Ok(vec![SocketAddr::V4(SocketAddrV4::new(
+            Ipv4Addr::new(0, 0, 0, 0),
+            0,
+        ))]
+        .into())
+    }
+}
+
+#[derive(Default)]
+struct RustlsConnector {
+    config: OnceLock<Arc<ClientConfig>>,
+}
+
+impl Connector for RustlsConnector {
+    fn connect(
+        &self,
+        details: &ConnectionDetails,
+        chained: Option<Box<dyn Transport>>,
+    ) -> Result<Option<Box<dyn Transport>>, ureq::Error> {
+        let Some(transport) = chained else {
+            panic!("RustlsConnector requires a chained transport");
+        };
+
+        // Only add TLS if we are connecting via HTTPS and the transport isn't TLS
+        // already, otherwise use chained transport as is.
+        if !details.needs_tls() || transport.is_tls() {
+            return Ok(Some(transport));
+        }
+
+        // Initialize the config on first run.
+        let config_ref = self.config.get_or_init(build_config);
+        let config = config_ref.clone();
+
+        let name_borrowed: ServerName<'_> = details
+            .uri
+            .authority()
+            .ok_or(ureq::Error::HostNotFound)?
+            .host()
+            .try_into()
+            .map_err(|_| ureq::Error::HostNotFound)?;
+
+        let name = name_borrowed.to_owned();
+
+        let conn =
+            ClientConnection::new(config, name).map_err(|_| ureq::Error::ConnectionFailed)?;
+        let stream = StreamOwned {
+            conn,
+            sock: TransportAdapter::new(transport),
+        };
+
+        let buffers = LazyBuffers::new(
+            details.config.input_buffer_size,
+            details.config.output_buffer_size,
+        );
+
+        let transport = Box::new(RustlsTransport { buffers, stream });
+
+        Ok(Some(transport))
+    }
+}
+
+fn build_config() -> Arc<ClientConfig> {
+    let provider = Arc::new(rustls_mbedcrypto_provider::mbedtls_crypto_provider());
+
+    let builder = ClientConfig::builder_with_provider(provider)
+        .with_safe_default_protocol_versions()
+        .unwrap();
+
+    let builder = builder
+        .dangerous()
+        .with_custom_certificate_verifier(Arc::new(
+            rustls_mbedpki_provider::MbedTlsServerCertVerifier::new(
+                webpki_root_certs::TLS_SERVER_ROOT_CERTS,
+            )
+            .unwrap(),
+        ));
+
+    let config = builder.with_no_client_auth();
+
+    Arc::new(config)
+}
+
+struct RustlsTransport {
+    buffers: LazyBuffers,
+    stream: StreamOwned<ClientConnection, TransportAdapter>,
+}
+
+impl Transport for RustlsTransport {
+    fn buffers(&mut self) -> &mut dyn Buffers {
+        &mut self.buffers
+    }
+
+    fn transmit_output(&mut self, amount: usize, _timeout: NextTimeout) -> Result<(), ureq::Error> {
+        let output = &self.buffers.output()[..amount];
+        self.stream.write_all(output)?;
+
+        Ok(())
+    }
+
+    fn await_input(&mut self, _timeout: NextTimeout) -> Result<bool, ureq::Error> {
+        if self.buffers.can_use_input() {
+            return Ok(true);
+        }
+
+        let input = self.buffers.input_mut();
+        let amount = self.stream.read(input)?;
+        self.buffers.add_filled(amount);
+
+        Ok(amount > 0)
+    }
+
+    fn is_open(&mut self) -> bool {
+        self.stream.get_mut().get_mut().is_open()
+    }
+
+    fn is_tls(&self) -> bool {
+        true
+    }
+}
+
+impl fmt::Debug for RustlsConnector {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("RustlsConnector").finish()
+    }
+}
+
+impl fmt::Debug for RustlsTransport {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("RustlsTransport").finish()
+    }
+}
+
+#[cfg(test)]
+mod test {
+    use mockito::{mock, server_url};
+
+    use super::{agent, agent_with_config};
+
+    #[test]
+    fn test_get_request() {
+        // Set up a mock server
+        let _mock = mock("GET", "/test")
+            .with_status(200)
+            .with_header("content-type", "text/plain")
+            .with_body("Hello, world!")
+            .create();
+
+        // Create an agent
+        let agent = agent_with_config(Default::default());
+
+        // Make a GET request to the mock server
+        let url = format!("{}/test", server_url());
+        let mut response = agent.get(&url).call().unwrap();
+
+        // Verify the response
+        assert_eq!(response.status(), 200);
+        assert_eq!(
+            response.body_mut().read_to_string().unwrap(),
+            "Hello, world!"
+        );
+    }
+
+    #[test]
+    fn test_post_request() {
+        // Set up a mock server for POST request
+        let _mock = mock("POST", "/submit")
+            .with_status(201)
+            .with_header("content-type", "application/json")
+            .with_body(r#"{"success":true}"#)
+            .create();
+
+        // Create an agent
+        let agent = agent_with_config(Default::default());
+
+        // Make a POST request to the mock server
+        let url = format!("{}/submit", server_url());
+        let mut response = agent
+            .post(&url)
+            .content_type("application/json")
+            .send(r#"{"key":"value"}"#)
+            .unwrap();
+
+        // Verify the response
+        assert_eq!(response.status(), 201);
+        assert_eq!(
+            response.body_mut().read_to_string().unwrap(),
+            r#"{"success":true}"#
+        );
+    }
+
+    #[test]
+    fn test_get_remote_https() {
+        let response = agent().get("https://www.google.com/").call().unwrap();
+
+        // Verify the response
+        assert_eq!(
+            "text/html;charset=ISO-8859-1",
+            response
+                .headers()
+                .get("content-type")
+                .unwrap()
+                .to_str()
+                .unwrap()
+                .replace("; ", ";")
+        );
+        assert_eq!(response.body().mime_type(), Some("text/html"));
+    }
+}
+
\ No newline at end of file diff --git a/rust/src/rofl_utils/lib.rs.html b/rust/src/rofl_utils/lib.rs.html new file mode 100644 index 0000000000..c2c0e17ca1 --- /dev/null +++ b/rust/src/rofl_utils/lib.rs.html @@ -0,0 +1,7 @@ +lib.rs - source
1
+2
+3
+
//! ROFL utilities.
+
+pub mod https;
+
\ No newline at end of file diff --git a/rust/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/rust/static.files/COPYRIGHT-23e9bde6c69aea69.txt new file mode 100644 index 0000000000..1447df792f --- /dev/null +++ b/rust/static.files/COPYRIGHT-23e9bde6c69aea69.txt @@ -0,0 +1,50 @@ +# REUSE-IgnoreStart + +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. + +# REUSE-IgnoreEnd diff --git a/rust/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/rust/static.files/FiraSans-LICENSE-db4b642586e02d97.txt new file mode 100644 index 0000000000..d7e9c149b7 --- /dev/null +++ b/rust/static.files/FiraSans-LICENSE-db4b642586e02d97.txt @@ -0,0 +1,98 @@ +// REUSE-IgnoreStart + +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/rust/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/rust/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 new file mode 100644 index 0000000000..7a1e5fc548 Binary files /dev/null and b/rust/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 differ diff --git a/rust/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/rust/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 new file mode 100644 index 0000000000..e766e06ccb Binary files /dev/null and b/rust/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 differ diff --git a/rust/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/rust/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt new file mode 100644 index 0000000000..16fe87b06e --- /dev/null +++ b/rust/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/rust/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/rust/static.files/LICENSE-MIT-65090b722b3f6c56.txt new file mode 100644 index 0000000000..31aa79387f --- /dev/null +++ b/rust/static.files/LICENSE-MIT-65090b722b3f6c56.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/rust/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/rust/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 new file mode 100644 index 0000000000..1866ad4bce Binary files /dev/null and b/rust/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 differ diff --git a/rust/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/rust/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt new file mode 100644 index 0000000000..4b3edc29eb --- /dev/null +++ b/rust/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt @@ -0,0 +1,103 @@ +// REUSE-IgnoreStart + +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/rust/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/rust/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 new file mode 100644 index 0000000000..462c34efcd Binary files /dev/null and b/rust/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 differ diff --git a/rust/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/rust/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt new file mode 100644 index 0000000000..0d2941e148 --- /dev/null +++ b/rust/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt @@ -0,0 +1,97 @@ +// REUSE-IgnoreStart + +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/rust/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/rust/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 new file mode 100644 index 0000000000..10b558e0b6 Binary files /dev/null and b/rust/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 differ diff --git a/rust/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/rust/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 new file mode 100644 index 0000000000..5ec64eef0e Binary files /dev/null and b/rust/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 differ diff --git a/rust/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/rust/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 new file mode 100644 index 0000000000..181a07f63b Binary files /dev/null and b/rust/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ diff --git a/rust/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/rust/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 new file mode 100644 index 0000000000..2ae08a7bed Binary files /dev/null and b/rust/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ diff --git a/rust/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/rust/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md new file mode 100644 index 0000000000..175fa4f47a --- /dev/null +++ b/rust/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md @@ -0,0 +1,98 @@ + + +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. +Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + + diff --git a/rust/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/rust/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 new file mode 100644 index 0000000000..0263fc3042 Binary files /dev/null and b/rust/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ diff --git a/rust/static.files/favicon-2c020d218678b618.svg b/rust/static.files/favicon-2c020d218678b618.svg new file mode 100644 index 0000000000..8b34b51198 --- /dev/null +++ b/rust/static.files/favicon-2c020d218678b618.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/rust/static.files/favicon-32x32-422f7d1d52889060.png b/rust/static.files/favicon-32x32-422f7d1d52889060.png new file mode 100644 index 0000000000..69b8613ce1 Binary files /dev/null and b/rust/static.files/favicon-32x32-422f7d1d52889060.png differ diff --git a/rust/static.files/main-20a3ad099b048cf2.js b/rust/static.files/main-20a3ad099b048cf2.js new file mode 100644 index 0000000000..133116e4d8 --- /dev/null +++ b/rust/static.files/main-20a3ad099b048cf2.js @@ -0,0 +1,11 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function blurHandler(event,parentElem,hideCallback){if(!parentElem.contains(document.activeElement)&&!parentElem.contains(event.relatedTarget)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerHTML=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url,errorCallback){const script=document.createElement("script");script.src=url;if(errorCallback!==undefined){script.onerror=errorCallback}document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=").map(x=>x.replace(/\+/g," "));params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function sendSearchForm(){document.getElementsByClassName("search-form")[0].submit()}function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"),sendSearchForm);loadScript(resourcePath("search-index",".js"),sendSearchForm)}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},descShards:new Map(),loadDesc:async function({descShard,descIndex}){if(descShard.promise===null){descShard.promise=new Promise((resolve,reject)=>{descShard.resolve=resolve;const ds=descShard;const fname=`${ds.crate}-desc-${ds.shard}-`;const url=resourcePath(`search.desc/${descShard.crate}/${fname}`,".js",);loadScript(url,reject)})}const list=await descShard.promise;return list[descIndex]},loadedDescShard:function(crate,shard,data){this.descShards.get(crate)[shard].resolve(data.split("\n"))},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}},)}}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":case"/":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(path===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","),);for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.textContent=crate;const li=document.createElement("li");if(window.rootPath!=="./"&&crate===window.currentCrate){li.className="current"}li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px",)}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ +the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S / /","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){const SIDEBAR_MIN=100;const SIDEBAR_MAX=500;const RUSTDOC_MOBILE_BREAKPOINT=700;const BODY_MIN=400;const SIDEBAR_VANISH_THRESHOLD=SIDEBAR_MIN/2;const sidebarButton=document.getElementById("sidebar-button");if(sidebarButton){sidebarButton.addEventListener("click",e=>{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false");if(document.querySelector(".rustdoc.src")){window.rustdocToggleSrcSidebar()}e.preventDefault()})}let currentPointerId=null;let desiredSidebarSize=null;let pendingSidebarResizingFrame=false;const resizer=document.querySelector(".sidebar-resizer");const sidebar=document.querySelector(".sidebar");if(!resizer||!sidebar){return}const isSrcPage=hasClass(document.body,"src");function hideSidebar(){if(isSrcPage){window.rustdocCloseSourceSidebar();updateLocalStorage("src-sidebar-width",null);document.documentElement.style.removeProperty("--src-sidebar-width");sidebar.style.removeProperty("--src-sidebar-width");resizer.style.removeProperty("--src-sidebar-width")}else{addClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","true");updateLocalStorage("desktop-sidebar-width",null);document.documentElement.style.removeProperty("--desktop-sidebar-width");sidebar.style.removeProperty("--desktop-sidebar-width");resizer.style.removeProperty("--desktop-sidebar-width")}}function showSidebar(){if(isSrcPage){window.rustdocShowSourceSidebar()}else{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false")}}function changeSidebarSize(size){if(isSrcPage){updateLocalStorage("src-sidebar-width",size);sidebar.style.setProperty("--src-sidebar-width",size+"px");resizer.style.setProperty("--src-sidebar-width",size+"px")}else{updateLocalStorage("desktop-sidebar-width",size);sidebar.style.setProperty("--desktop-sidebar-width",size+"px");resizer.style.setProperty("--desktop-sidebar-width",size+"px")}}function isSidebarHidden(){return isSrcPage?!hasClass(document.documentElement,"src-sidebar-expanded"):hasClass(document.documentElement,"hide-sidebar")}function resize(e){if(currentPointerId===null||currentPointerId!==e.pointerId){return}e.preventDefault();const pos=e.clientX-3;if(pos=SIDEBAR_MIN){if(isSidebarHidden()){showSidebar()}const constrainedPos=Math.min(pos,window.innerWidth-BODY_MIN,SIDEBAR_MAX);changeSidebarSize(constrainedPos);desiredSidebarSize=constrainedPos;if(pendingSidebarResizingFrame!==false){clearTimeout(pendingSidebarResizingFrame)}pendingSidebarResizingFrame=setTimeout(()=>{if(currentPointerId===null||pendingSidebarResizingFrame===false){return}pendingSidebarResizingFrame=false;document.documentElement.style.setProperty("--resizing-sidebar-width",desiredSidebarSize+"px",)},100)}}window.addEventListener("resize",()=>{if(window.innerWidth=(window.innerWidth-BODY_MIN)){changeSidebarSize(window.innerWidth-BODY_MIN)}else if(desiredSidebarSize!==null&&desiredSidebarSize>SIDEBAR_MIN){changeSidebarSize(desiredSidebarSize)}});function stopResize(e){if(currentPointerId===null){return}if(e){e.preventDefault()}desiredSidebarSize=sidebar.getBoundingClientRect().width;removeClass(resizer,"active");window.removeEventListener("pointermove",resize,false);window.removeEventListener("pointerup",stopResize,false);removeClass(document.documentElement,"sidebar-resizing");document.documentElement.style.removeProperty("--resizing-sidebar-width");if(resizer.releasePointerCapture){resizer.releasePointerCapture(currentPointerId);currentPointerId=null}}function initResize(e){if(currentPointerId!==null||e.altKey||e.ctrlKey||e.metaKey||e.button!==0){return}if(resizer.setPointerCapture){resizer.setPointerCapture(e.pointerId);if(!resizer.hasPointerCapture(e.pointerId)){resizer.releasePointerCapture(e.pointerId);return}currentPointerId=e.pointerId}window.hideAllModals(false);e.preventDefault();window.addEventListener("pointermove",resize,false);window.addEventListener("pointercancel",stopResize,false);window.addEventListener("pointerup",stopResize,false);addClass(resizer,"active");addClass(document.documentElement,"sidebar-resizing");const pos=e.clientX-sidebar.offsetLeft-3;document.documentElement.style.setProperty("--resizing-sidebar-width",pos+"px");desiredSidebarSize=null}resizer.addEventListener("pointerdown",initResize,false)}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.classList.add("clicked");if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){reset_button_timeout=null;but.classList.remove("clicked")}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/rust/static.files/normalize-76eba96aa4d2e634.css b/rust/static.files/normalize-76eba96aa4d2e634.css new file mode 100644 index 0000000000..469959f137 --- /dev/null +++ b/rust/static.files/normalize-76eba96aa4d2e634.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/rust/static.files/noscript-df360f571f6edeae.css b/rust/static.files/noscript-df360f571f6edeae.css new file mode 100644 index 0000000000..4c310ae529 --- /dev/null +++ b/rust/static.files/noscript-df360f571f6edeae.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path,#sidebar-button,.sidebar-resizer{display:none !important;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root,:root:not([data-theme]){--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--settings-menu-filter:none;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}@media (prefers-color-scheme:dark){:root,:root:not([data-theme]){--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}} \ No newline at end of file diff --git a/rust/static.files/rust-logo-151179464ae7ed46.svg b/rust/static.files/rust-logo-151179464ae7ed46.svg new file mode 100644 index 0000000000..62424d8ffd --- /dev/null +++ b/rust/static.files/rust-logo-151179464ae7ed46.svg @@ -0,0 +1,61 @@ + + + diff --git a/rust/static.files/rustdoc-dd39b87e5fcfba68.css b/rust/static.files/rustdoc-dd39b87e5fcfba68.css new file mode 100644 index 0000000000..77f8983224 --- /dev/null +++ b/rust/static.files/rustdoc-dd39b87e5fcfba68.css @@ -0,0 +1,46 @@ + :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;--desktop-sidebar-width:200px;--src-sidebar-width:300px;--desktop-sidebar-z-index:100;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.logo-container{line-height:0;display:block;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 var(--desktop-sidebar-width);width:var(--desktop-sidebar-width);overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;z-index:var(--desktop-sidebar-z-index);}.rustdoc.src .sidebar{flex-basis:50px;width:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.hide-sidebar .sidebar,.hide-sidebar .sidebar-resizer{display:none;}.sidebar-resizer{touch-action:none;width:9px;cursor:col-resize;z-index:calc(var(--desktop-sidebar-z-index) + 1);position:fixed;height:100%;left:calc(var(--desktop-sidebar-width) + 1px);}.rustdoc.src .sidebar-resizer{left:49px;}.src-sidebar-expanded .src .sidebar-resizer{left:var(--src-sidebar-width);}.sidebar-resizing{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.sidebar-resizing*{cursor:col-resize !important;}.sidebar-resizing .sidebar{position:fixed;}.sidebar-resizing>body{padding-left:var(--resizing-sidebar-width);}.sidebar-resizer:hover,.sidebar-resizer:active,.sidebar-resizer:focus,.sidebar-resizer.active{width:10px;margin:0;left:var(--desktop-sidebar-width);border-left:solid 1px var(--sidebar-resizer-hover);}.src-sidebar-expanded .rustdoc.src .sidebar-resizer:hover,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:active,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:focus,.src-sidebar-expanded .rustdoc.src .sidebar-resizer.active{left:calc(var(--src-sidebar-width) - 1px);}@media (pointer:coarse){.sidebar-resizer{display:none !important;}}.sidebar-resizer.active{padding:0 140px;width:2px;margin-left:-140px;border-left:none;}.sidebar-resizer.active:before{border-left:solid 2px var(--sidebar-resizer-active);display:block;height:100%;content:"";}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}.src .sidebar>*{visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:var(--src-sidebar-width);width:var(--src-sidebar-width);}.src-sidebar-expanded .src .sidebar>*{visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;margin-right:0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.2rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.2rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}div.where{white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.section-header{display:block;position:relative;}.section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.section-header>.anchor{left:-15px;padding-right:8px;}h2.section-header>.anchor{padding-right:6px;}a.doc-anchor{color:var(--main-color);display:none;position:absolute;left:-17px;padding-right:5px;padding-left:3px;}*:hover>.doc-anchor{display:block;}.top-doc>.docblock>*:first-child>.doc-anchor{display:none !important;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover:not(.doc-anchor),.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block li.current a{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ + ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:calc(var(--desktop-sidebar-z-index) + 1);margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ + \ + ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{display:block;padding:3px;margin-bottom:5px;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji,.item-info .stab::before{font-size:1.25rem;}.stab .emoji{margin-right:0.3rem;}.item-info .stab::before{content:"\0";width:0;display:inline-block;color:transparent;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}.top-doc>.docblock>.warning:first-child::before{top:20px;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}.src-sidebar-title{position:sticky;top:0;display:flex;padding:8px 8px 0 48px;margin-bottom:7px;background:var(--sidebar-background-color);border-bottom:1px solid var(--border-color);}#settings-menu,#help-button{margin-left:4px;display:flex;}#sidebar-button{display:none;line-height:0;}.hide-sidebar #sidebar-button,.src #sidebar-button{display:flex;margin-right:4px;position:fixed;left:6px;height:34px;width:34px;background-color:var(--main-background-color);z-index:1;}.src #sidebar-button{left:8px;z-index:calc(var(--desktop-sidebar-z-index) + 1);}.hide-sidebar .src #sidebar-button{position:static;}#settings-menu>a,#help-button>a,#sidebar-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus,#sidebar-button>a:hover,#sidebar-button>a:focus{border-color:var(--settings-button-border-focus);}#settings-menu>a{line-height:0;font-size:0;}#settings-menu>a:before{content:url('data:image/svg+xml,\ + ');width:22px;height:22px;filter:var(--settings-menu-filter);}#sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');width:22px;height:22px;}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;width:33px;margin-left:10px;padding:0;padding-left:2px;border:0;font-size:0;}#copy-path::before{filter:var(--copy-path-img-filter);content:url('data:image/svg+xml,\ +\ +\ +');width:19px;height:18px;}#copy-path:hover::before{filter:var(--copy-path-img-hover-filter);}#copy-path.clicked::before{content:url('data:image/svg+xml,\ + \ + ');}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}.src #sidebar-button>a:before,.sidebar-menu-toggle:before{content:url('data:image/svg+xml,\ + ');opacity:0.75;}.sidebar-menu-toggle:hover:before,.sidebar-menu-toggle:active:before,.sidebar-menu-toggle:focus:before{opacity:1;}.src #sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');opacity:0.75;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location,.sidebar-resizer{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.src .search-form{margin-left:40px;}.hide-sidebar .search-form{margin-left:32px;}.hide-sidebar .src .search-form{margin-left:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;white-space:nowrap;text-overflow:ellipsis;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.hide-sidebar .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;border:none;line-height:0;}.hide-sidebar .sidebar-menu-toggle{display:none;}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#copy-path,#help-button{display:none;}#sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');width:22px;height:22px;}.sidebar-menu-toggle:before{filter:var(--mobile-sidebar-menu-filter);}.sidebar-menu-toggle:hover{background:var(--main-background-color);}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{position:fixed;max-width:100vw;width:100vw;}.src .src-sidebar-title{padding-top:0;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"],:root:not([data-theme]){--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--settings-menu-filter:none;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--settings-menu-filter:none;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--settings-menu-filter:invert(100%);--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);--sidebar-resizer-hover:hsl(34,50%,33%);--sidebar-resizer-active:hsl(34,100%,66%);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar .current a,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img,:root[data-theme="ayu"] #sidebar-button>a:before{filter:invert(100);} \ No newline at end of file diff --git a/rust/static.files/scrape-examples-ef1e698c1d417c0c.js b/rust/static.files/scrape-examples-ef1e698c1d417c0c.js new file mode 100644 index 0000000000..ba830e3744 --- /dev/null +++ b/rust/static.files/scrape-examples-ef1e698c1d417c0c.js @@ -0,0 +1 @@ +"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/rust/static.files/search-d234aafac6c221dd.js b/rust/static.files/search-d234aafac6c221dd.js new file mode 100644 index 0000000000..3f587f6579 --- /dev/null +++ b/rust/static.files/search-d234aafac6c221dd.js @@ -0,0 +1,5 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["keyword","primitive","mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","associatedtype","constant","associatedconstant","union","foreigntype","existential","attr","derive","traitalias","generic",];const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];const TY_GENERIC=itemTypes.indexOf("generic");const TY_IMPORT=itemTypes.indexOf("import");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";const UNBOXING_LIMIT=5;const REGEX_IDENT=/\p{ID_Start}\p{ID_Continue}*|_\p{ID_Continue}+/uy;const REGEX_INVALID_TYPE_FILTER=/[^a-z]/ui;function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost,);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1,)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let searchIndexDeprecated;let searchIndexEmptyDesc;let functionTypeFingerprint;let currentResults;const typeNameIdMap=new Map();const ALIASES=new Map();const typeNameIdOfArray=buildTypeMapIndex("array");const typeNameIdOfSlice=buildTypeMapIndex("slice");const typeNameIdOfArrayOrSlice=buildTypeMapIndex("[]");const typeNameIdOfTuple=buildTypeMapIndex("tuple");const typeNameIdOfUnit=buildTypeMapIndex("unit");const typeNameIdOfTupleOrUnit=buildTypeMapIndex("()");const typeNameIdOfFn=buildTypeMapIndex("fn");const typeNameIdOfFnMut=buildTypeMapIndex("fnmut");const typeNameIdOfFnOnce=buildTypeMapIndex("fnonce");const typeNameIdOfHof=buildTypeMapIndex("->");function buildTypeMapIndex(name,isAssocType){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){const obj=typeNameIdMap.get(name);obj.assocOnly=isAssocType&&obj.assocOnly;return obj.id}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,{id,assocOnly:isAssocType});return id}}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return"=,>-])".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function consumeIdent(parserState){REGEX_IDENT.lastIndex=parserState.pos;const match=parserState.userQuery.match(REGEX_IDENT);if(match){parserState.pos+=match[0].length;return true}return false}function isSeparatorCharacter(c){return c===","||c==="="}function isPathSeparator(c){return c===":"||c===" "}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return makePrimitiveElement("never",{bindingName})}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();const pathLast=pathSegments[pathSegments.length-1];return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast,normalizedPathLast:pathLast.replace(/_/g,""),generics:generics.filter(gen=>{if(gen.bindingName!==null){if(gen.name!==null){gen.bindingName.generics.unshift(gen)}bindings.set(gen.bindingName.name,gen.bindingName.generics);return false}return true}),bindings,typeFilter,bindingName,}}function getIdentEndPosition(parserState){let afterIdent=consumeIdent(parserState);let end=parserState.pos;let macroExclamation=-1;while(parserState.pos0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]," (not a valid identifier)"]}else{throw["Unexpected ",c," (not a valid identifier)"]}parserState.pos+=1;afterIdent=consumeIdent(parserState);end=parserState.pos}if(macroExclamation!==-1){if(parserState.typeFilter===null){parserState.typeFilter="macro"}else if(parserState.typeFilter!=="macro"){throw["Invalid search type: macro ","!"," and ",parserState.typeFilter," both specified",]}end=macroExclamation}return end}function getFilteredNextElem(query,parserState,elems,isInGenerics){const start=parserState.pos;if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){throw["Expected type filter before ",":"]}getNextElem(query,parserState,elems,isInGenerics);if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}if(elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;getNextElem(query,parserState,elems,isInGenerics)}}function getNextElem(query,parserState,elems,isInGenerics){const generics=[];skipWhitespace(parserState);let start=parserState.pos;let end;if("[(".indexOf(parserState.userQuery[parserState.pos])!==-1){let endChar=")";let name="()";let friendlyName="tuple";if(parserState.userQuery[parserState.pos]==="["){endChar="]";name="[]";friendlyName="slice"}parserState.pos+=1;const{foundSeparator}=getItemsBefore(query,parserState,generics,endChar);const typeFilter=parserState.typeFilter;const bindingName=parserState.isInBinding;parserState.typeFilter=null;parserState.isInBinding=null;for(const gen of generics){if(gen.bindingName!==null){throw["Type parameter ","=",` cannot be within ${friendlyName} `,name]}}if(name==="()"&&!foundSeparator&&generics.length===1&&typeFilter===null){elems.push(generics[0])}else if(name==="()"&&generics.length===1&&generics[0].name==="->"){generics[0].typeFilter=typeFilter;elems.push(generics[0])}else{if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive ",name," and ",typeFilter," both specified",]}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}elems.push(makePrimitiveElement(name,{bindingName,generics}))}}else if(parserState.userQuery[parserState.pos]==="&"){if(parserState.typeFilter!==null&&parserState.typeFilter!=="primitive"){throw["Invalid search type: primitive ","&"," and ",parserState.typeFilter," both specified",]}parserState.typeFilter=null;parserState.pos+=1;let c=parserState.userQuery[parserState.pos];while(c===" "&&parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}else if(parserState.pos=end){throw["Found generics without a path"]}if(parserState.isInBinding){throw["Unexpected ","("," after ","="]}parserState.pos+=1;const typeFilter=parserState.typeFilter;parserState.typeFilter=null;getItemsBefore(query,parserState,generics,")");skipWhitespace(parserState);if(isReturnArrow(parserState)){parserState.pos+=2;skipWhitespace(parserState);getFilteredNextElem(query,parserState,generics,isInGenerics);generics[generics.length-1].bindingName=makePrimitiveElement("output")}else{generics.push(makePrimitiveElement(null,{bindingName:makePrimitiveElement("output"),typeFilter:null,}))}parserState.typeFilter=typeFilter}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics,),)}}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let foundSeparator=false;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let hofParameters=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===")"){extra="("}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"," after ","="]}hofParameters=[...elems];elems.length=0;parserState.pos+=2;foundStopChar=true;foundSeparator=false;continue}else if(c===" "){parserState.pos+=1;continue}else if(isSeparatorCharacter(c)){parserState.pos+=1;foundStopChar=true;foundSeparator=true;continue}else if(c===":"&&isPathStart(parserState)){throw["Unexpected ","::",": paths cannot start with ","::"]}else if(isEndCharacter(c)){throw["Unexpected ",c," after ",extra]}if(!foundStopChar){let extra=[];if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;getFilteredNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;if(hofParameters){foundSeparator=false;if([...elems,...hofParameters].some(x=>x.bindingName)||parserState.isInBinding){throw["Unexpected ","="," within ","->"]}const hofElem=makePrimitiveElement("->",{generics:hofParameters,bindings:new Map([["output",[...elems]]]),typeFilter:null,});elems.length=0;elems[0]=hofElem}parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding;return{foundSeparator}}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();const match=query.match(REGEX_INVALID_TYPE_FILTER);if(match){throw["Unexpected ",match[0]," in type filter (before ",":",")",]}}function parseInput(query,parserState){let foundStopChar=true;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}else if(parserState.pos>0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}throw["Unexpected ",c]}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;getFilteredNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,typeFingerprint:new Uint32Array(4),}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&rawSearchIndex.has(elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}userQuery=userQuery.trim().replace(/\r|\n|\t/g," ");const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,isInBinding:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}async function execQuery(parsedQuery,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=res[2]+"|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}if(obj.ty===TY_IMPORT&&duplicates.has(res[2])){continue}if(duplicates.has(res[2]+"|"+TY_IMPORT)){continue}duplicates.add(obj.fullPath);duplicates.add(res[2]);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}async function sortResults(results,isType,preferredCrate){const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.item=searchIndex[result.id];result.word=searchIndex[result.id].word;result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=searchIndexDeprecated.get(aaa.item.crate).contains(aaa.item.bitIndex);b=searchIndexDeprecated.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=searchIndexEmptyDesc.get(aaa.item.crate).contains(aaa.item.bitIndex);b=searchIndexEmptyDesc.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});return transformResults(result_list)}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}if(fnType.id<0&&queryElem.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,queryElem.id);if(!solutionCb||solutionCb(mgensScratch)){return true}}else if(!solutionCb||solutionCb(mgens?new Map(mgens):null)){return true}}for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}if(fnType.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,0);if(unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgensScratch,solutionCb,unboxingDepth+1,)){return true}}else if(unifyFunctionTypes([...fnType.generics,...Array.from(fnType.bindings.values()).flat()],queryElems,whereClause,mgens?new Map(mgens):null,solutionCb,unboxingDepth+1,)){return true}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==queryElem.id){continue}mgensScratch.set(fnType.id,queryElem.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return!solutionCb||solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch,unboxingDepth,);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){const passesUnification=unifyFunctionTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb,unboxingDepth,);if(passesUnification){return true}}return false},unboxingDepth,);if(passesUnification){return true}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==0){continue}mgensScratch.set(fnType.id,0)}else{mgensScratch=mgens}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...generics,...bindings),queryElems,whereClause,mgensScratch,solutionCb,unboxingDepth+1,);if(passesUnification){return true}}return false}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgensIn){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgensIn){if(mgensIn.has(fnType.id)&&mgensIn.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgensIn.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}return true}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(queryElem.id===typeNameIdOfTupleOrUnit&&(fnType.id===typeNameIdOfTuple||fnType.id===typeNameIdOfUnit)){}else if(queryElem.id===typeNameIdOfHof&&(fnType.id===typeNameIdOfFn||fnType.id===typeNameIdOfFnMut||fnType.id===typeNameIdOfFnOnce)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false},unboxingDepth,);return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...simplifiedGenerics,...binds]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(fnType.id<0&&queryElem.id>=0){if(!whereClause){return false}if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}const mgensTmp=new Map(mgens);mgensTmp.set(fnType.id,null);return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgensTmp,unboxingDepth,)}else if(fnType.generics.length>0||fnType.bindings.size>0){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens,unboxingDepth,)}return false}function checkIfInList(list,elem,whereClause,mgens,unboxingDepth){for(const entry of list){if(checkType(entry,elem,whereClause,mgens,unboxingDepth)){return true}}return false}function checkType(row,elem,whereClause,mgens,unboxingDepth){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(row.bindings.size===0&&elem.bindings.size===0){if(elem.id<0&&mgens===null){return row.id<0||checkIfInList(row.generics,elem,whereClause,mgens,unboxingDepth+1,)}if(row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&typePassesFilter(elem.typeFilter,row.ty)&&elem.generics.length===0&&elem.id!==typeNameIdOfArrayOrSlice&&elem.id!==typeNameIdOfTupleOrUnit&&elem.id!==typeNameIdOfHof){return row.id===elem.id||checkIfInList(row.generics,elem,whereClause,mgens,unboxingDepth,)}}return unifyFunctionTypes([row],[elem],whereClause,mgens,null,unboxingDepth)}function checkPath(contains,ty){if(contains.length===0){return 0}const maxPathEditDistance=Math.floor(contains.reduce((acc,next)=>acc+next.length,0)/3,);let ret_dist=maxPathEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxPathEditDistance){continue pathiter}dist_total+=dist}}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist>maxPathEditDistance?null:ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,descShard:item.descShard,descIndex:item.descIndex,exactPath:item.exactPath,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,bitIndex:item.bitIndex,implDisambiguator:item.implDisambiguator,}}async function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{return searchIndexEmptyDesc.get(alias.crate).contains(alias.bitIndex)?"":searchState.loadDesc(alias)};const[crateDescs,descs]=await Promise.all([Promise.all(crateAliases.map(fetchDesc)),Promise.all(aliases.map(fetchDesc)),]);const pushFunc=alias=>{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach((alias,i)=>{alias.desc=descs[i]});aliases.forEach(pushFunc);crateAliases.forEach((alias,i)=>{alias.desc=crateDescs[i]});crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){if(dist<=maxEditDistance||index!==-1){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance,){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let path_dist=0;const fullId=row.id;const tfpDist=compareTypeFingerprints(fullId,parsedQuery.typeFingerprint,);if(tfpDist!==null){const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause,null,0);const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause,null,0);if(in_args){results_in_args.max_dist=Math.max(results_in_args.max_dist||0,tfpDist);const maxDist=results_in_args.sizenormalizedIndex&&normalizedIndex!==-1)){index=normalizedIndex}if(elem.fullPath.length>1){path_dist=checkPath(elem.pathWithoutLast,row);if(path_dist===null){return}}if(parsedQuery.literalSearch){if(row.word===elem.pathLast){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(row.normalizedName,elem.normalizedPathLast,maxEditDistance);if(index===-1&&dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}const tfpDist=compareTypeFingerprints(row.id,parsedQuery.typeFingerprint,);if(tfpDist===null){return}if(results.size>=MAX_RESULTS&&tfpDist>results.max_dist){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens,null,0,)},0,)){return}results.max_dist=Math.max(results.max_dist||0,tfpDist);addIntoResults(results,row.id,pos,0,tfpDist,0,Number.MAX_VALUE)}function innerRunQuery(){const queryLen=parsedQuery.elems.reduce((acc,next)=>acc+next.pathLast.length,0)+parsedQuery.returned.reduce((acc,next)=>acc+next.pathLast.length,0);const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem,isAssocType){const loweredName=elem.pathLast.toLowerCase();if(typeNameIdMap.has(loweredName)&&(isAssocType||!typeNameIdMap.get(loweredName).assocOnly)){elem.id=typeNameIdMap.get(loweredName).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of typeNameIdMap){const dist=Math.min(editDistance(name,loweredName,maxEditDistance),editDistance(name,elem.normalizedPathLast,maxEditDistance),);if(dist<=matchDist&&dist<=maxEditDistance&&(isAssocType||!assocOnly)){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",];return[null,[]]}for(const elem2 of constraints){convertNameToId(elem2)}return[typeNameIdMap.get(name).id,constraints]}),)}const fps=new Set();for(const elem of parsedQuery.elems){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}for(const elem of parsedQuery.returned){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}if(parsedQuery.foundElems===1&&parsedQuery.returned.length===0){if(parsedQuery.elems.length===1){const elem=parsedQuery.elems[0];for(let i=0,nSearchIndex=searchIndex.length;i0){const sortQ=(a,b)=>{const ag=a.generics.length===0&&a.bindings.size===0;const bg=b.generics.length===0&&b.bindings.size===0;if(ag!==bg){return ag-bg}const ai=a.id>0;const bi=b.id>0;return ai-bi};parsedQuery.elems.sort(sortQ);parsedQuery.returned.sort(sortQ);for(let i=0,nSearchIndex=searchIndex.length;i{const descs=await Promise.all(list.map(result=>{return searchIndexEmptyDesc.get(result.crate).contains(result.bitIndex)?"":searchState.loadDesc(result)}));for(const[i,result]of list.entries()){result.desc=descs[i]}}));if(parsedQuery.error!==null&&ret.others.length!==0){ret.query.error=null}return ret}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;let exactPath=item.exactPath;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor=type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;exactPath=`${myparent.exactPath}::${myparent.name}`;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html#"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href,`${exactPath}::${name}`]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}async function addTab(array,query,display){const extraClass=display?" active":"";const output=document.createElement("div");if(array.length>0){output.className="search-results "+extraClass;for(const item of array){const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)}}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,array.length]}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}async function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const[ret_others,ret_in_args,ret_returned]=await Promise.all([addTab(results.others,results.query,true),addTab(results.in_args,results.query,false),addTab(results.returned,results.query,false),]);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";if(rawSearchIndex.size>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}async function search(forced){const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));await showResults(await execQuery(query,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.length>0?types.map(type=>buildItemSearchType(type,lowercasePaths)):EMPTY_GENERICS_ARRAY}const EMPTY_BINDINGS_MAP=new Map();const EMPTY_GENERICS_ARRAY=[];let TYPES_POOL=new Map();function buildItemSearchType(type,lowercasePaths,isAssocType){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=EMPTY_GENERICS_ARRAY;bindings=EMPTY_BINDINGS_MAP}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths,);if(type.length>BINDINGS_DATA&&type[BINDINGS_DATA].length>0){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[buildItemSearchType(assocType,lowercasePaths,true).id,buildItemSearchTypeAll(constraints,lowercasePaths),]}))}else{bindings=EMPTY_BINDINGS_MAP}}let result;if(pathIndex<0){result={id:pathIndex,ty:TY_GENERIC,path:null,exactPath:null,generics,bindings,}}else if(pathIndex===0){result={id:null,ty:null,path:null,exactPath:null,generics,bindings,}}else{const item=lowercasePaths[pathIndex-1];result={id:buildTypeMapIndex(item.name,isAssocType),ty:item.ty,path:item.path,exactPath:item.exactPath,generics,bindings,}}const cr=TYPES_POOL.get(result.id);if(cr){if(cr.generics.length===result.generics.length&&cr.generics!==result.generics&&cr.generics.every((x,i)=>result.generics[i]===x)){result.generics=cr.generics}if(cr.bindings.size===result.bindings.size&&cr.bindings!==result.bindings){let ok=true;for(const[k,v]of cr.bindings.entries()){const v2=result.bindings.get(v);if(!v2){ok=false;break}if(v!==v2&&v.length===v2.length&&v.every((x,i)=>v2[i]===x)){result.bindings.set(k,v)}else if(v!==v2){ok=false;break}}if(ok){result.bindings=cr.bindings}}if(cr.ty===result.ty&&cr.path===result.path&&cr.bindings===result.bindings&&cr.generics===result.generics&&cr.ty===result.ty){return cr}}TYPES_POOL.set(result.id,result);return result}function buildFunctionSearchTypeCallback(lowercasePaths){return functionSearchType=>{if(functionSearchType===0){return null}const INPUTS_DATA=0;const OUTPUT_DATA=1;let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths,)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths,)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i{k=(~~k+0x7ed55d16)+(k<<12);k=(k ^ 0xc761c23c)^(k>>>19);k=(~~k+0x165667b1)+(k<<5);k=(~~k+0xd3a2646c)^(k<<9);k=(~~k+0xfd7046c5)+(k<<3);return(k ^ 0xb55a4f09)^(k>>>16)};const hashint2=k=>{k=~k+(k<<15);k ^=k>>>12;k+=k<<2;k ^=k>>>4;k=Math.imul(k,2057);return k ^(k>>16)};if(input!==null){const h0a=hashint1(input);const h0b=hashint2(input);const h1a=~~(h0a+Math.imul(h0b,2));const h1b=~~(h0a+Math.imul(h0b,3));const h2a=~~(h0a+Math.imul(h0b,4));const h2b=~~(h0a+Math.imul(h0b,5));output[0]|=(1<<(h0a%32))|(1<<(h1b%32));output[1]|=(1<<(h1a%32))|(1<<(h2b%32));output[2]|=(1<<(h2a%32))|(1<<(h0b%32));fps.add(input)}for(const g of type.generics){buildFunctionTypeFingerprint(g,output,fps)}const fb={id:null,ty:0,generics:EMPTY_GENERICS_ARRAY,bindings:EMPTY_BINDINGS_MAP,};for(const[k,v]of type.bindings.entries()){fb.id=k;fb.generics=v;buildFunctionTypeFingerprint(fb,output,fps)}output[3]=fps.size}function compareTypeFingerprints(fullId,queryFingerprint){const fh0=functionTypeFingerprint[fullId*4];const fh1=functionTypeFingerprint[(fullId*4)+1];const fh2=functionTypeFingerprint[(fullId*4)+2];const[qh0,qh1,qh2]=queryFingerprint;const[in0,in1,in2]=[fh0&qh0,fh1&qh1,fh2&qh2];if((in0 ^ qh0)||(in1 ^ qh1)||(in2 ^ qh2)){return null}return functionTypeFingerprint[(fullId*4)+3]}class VlqHexDecoder{constructor(string,cons){this.string=string;this.cons=cons;this.offset=0;this.backrefQueue=[]}decodeList(){let c=this.string.charCodeAt(this.offset);const ret=[];while(c!==125){ret.push(this.decode());c=this.string.charCodeAt(this.offset)}this.offset+=1;return ret}decode(){let n=0;let c=this.string.charCodeAt(this.offset);if(c===123){this.offset+=1;return this.decodeList()}while(c<96){n=(n<<4)|(c&0xF);this.offset+=1;c=this.string.charCodeAt(this.offset)}n=(n<<4)|(c&0xF);const[sign,value]=[n&1,n>>1];this.offset+=1;return sign?-value:value}next(){const c=this.string.charCodeAt(this.offset);if(c>=48&&c<64){this.offset+=1;return this.backrefQueue[c-48]}if(c===96){this.offset+=1;return this.cons(0)}const result=this.cons(this.decode());this.backrefQueue.unshift(result);if(this.backrefQueue.length>16){this.backrefQueue.pop()}return result}}class RoaringBitmap{constructor(str){const strdecoded=atob(str);const u8array=new Uint8Array(strdecoded.length);for(let j=0;j=4){offsets=[];for(let j=0;j>3]&(1<<(j&0x7))){const runcount=(u8array[i]|(u8array[i+1]<<8));i+=2;this.containers.push(new RoaringBitmapRun(runcount,u8array.slice(i,i+(runcount*4)),));i+=runcount*4}else if(this.cardinalities[j]>=4096){this.containers.push(new RoaringBitmapBits(u8array.slice(i,i+8192)));i+=8192}else{const end=this.cardinalities[j]*2;this.containers.push(new RoaringBitmapArray(this.cardinalities[j],u8array.slice(i,i+end),));i+=end}}}contains(keyvalue){const key=keyvalue>>16;const value=keyvalue&0xFFFF;for(let i=0;i=start&&value<=(start+lenm1)){return true}}return false}}class RoaringBitmapArray{constructor(cardinality,array){this.cardinality=cardinality;this.array=array}contains(value){const l=this.cardinality*2;for(let i=0;i>3]&(1<<(value&7)))}}function buildIndex(rawSearchIndex){searchIndex=[];searchIndexDeprecated=new Map();searchIndexEmptyDesc=new Map();let currentIndex=0;let id=0;for(const crate of rawSearchIndex.values()){id+=crate.t.length+1}functionTypeFingerprint=new Uint32Array((id+1)*4);id=0;for(const[crate,crateCorpus]of rawSearchIndex){const itemDescShardDecoder=new VlqHexDecoder(crateCorpus.D,noop=>noop);let descShard={crate,shard:0,start:0,len:itemDescShardDecoder.next(),promise:null,resolve:null,};const descShardList=[descShard];searchIndexDeprecated.set(crate,new RoaringBitmap(crateCorpus.c));searchIndexEmptyDesc.set(crate,new RoaringBitmap(crateCorpus.e));let descIndex=0;const crateRow={crate,ty:3,name:crate,path:"",descShard,descIndex,exactPath:"",desc:crateCorpus.doc,parent:undefined,type:null,id,word:crate,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),bitIndex:0,implDisambiguator:null,};id+=1;searchIndex.push(crateRow);currentIndex+=1;if(!searchIndexEmptyDesc.get(crate).contains(0)){descIndex+=1}const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemReexports=new Map(crateCorpus.r);const itemParentIdxs=crateCorpus.i;const implDisambiguator=new Map(crateCorpus.b);const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];const itemFunctionDecoder=new VlqHexDecoder(crateCorpus.f,buildFunctionSearchTypeCallback(lowercasePaths),);let len=paths.length;let lastPath=itemPaths.get(0);for(let i=0;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}const exactPath=elem.length>3?itemPaths.get(elem[3]):path;lowercasePaths.push({ty,name:name.toLowerCase(),path,exactPath});paths[i]={ty,name,path,exactPath}}lastPath="";len=itemTypes.length;for(let i=0;i=descShard.len&&!searchIndexEmptyDesc.get(crate).contains(bitIndex)){descShard={crate,shard:descShard.shard+1,start:descShard.start+descShard.len,len:itemDescShardDecoder.next(),promise:null,resolve:null,};descIndex=0;descShardList.push(descShard)}let word="";if(typeof itemNames[i]==="string"){word=itemNames[i].toLowerCase()}const path=itemPaths.has(i)?itemPaths.get(i):lastPath;const type=itemFunctionDecoder.next();if(type!==null){if(type){const fp=functionTypeFingerprint.subarray(id*4,(id+1)*4);const fps=new Set();for(const t of type.inputs){buildFunctionTypeFingerprint(t,fp,fps)}for(const t of type.output){buildFunctionTypeFingerprint(t,fp,fps)}for(const w of type.where_clause){for(const t of w){buildFunctionTypeFingerprint(t,fp,fps)}}}}const row={crate,ty:itemTypes.charCodeAt(i)-65,name:itemNames[i],path,descShard,descIndex,exactPath:itemReexports.has(i)?itemPaths.get(itemReexports.get(i)):path,parent:itemParentIdxs[i]>0?paths[itemParentIdxs[i]-1]:undefined,type,id,word,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),bitIndex,implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path;if(!searchIndexEmptyDesc.get(crate).contains(bitIndex)){descIndex+=1}}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!Object.prototype.hasOwnProperty.call(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=itemTypes.length;searchState.descShards.set(crate,descShardList)}TYPES_POOL=new Map()}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;e.preventDefault();search()}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(true)}buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch(new Map())}})() \ No newline at end of file diff --git a/rust/static.files/settings-4313503d2e1961c2.js b/rust/static.files/settings-4313503d2e1961c2.js new file mode 100644 index 0000000000..ab425fe49d --- /dev/null +++ b/rust/static.files/settings-4313503d2e1961c2.js @@ -0,0 +1,17 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break;case"hide-sidebar":if(value===true){addClass(document.documentElement,"hide-sidebar")}else{removeClass(document.documentElement,"hide-sidebar")}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ +
+
${setting_name}
+
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ + `});output+=`\ +
+
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ +
\ + \ +
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Hide persistent navigation bar","js_name":"hide-sidebar","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display="";onEachLazy(settingsMenu.querySelectorAll("input[type='checkbox']"),el=>{const val=getSettingValue(el.id);const checked=val==="true";if(checked!==el.checked&&val!==null){el.checked=checked}})}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(settingsMenu.contains(event.target)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/rust/static.files/src-script-e66d777a5a92e9b2.js b/rust/static.files/src-script-e66d777a5a92e9b2.js new file mode 100644 index 0000000000..d0aebb8510 --- /dev/null +++ b/rust/static.files/src-script-e66d777a5a92e9b2.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth{removeClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","false")};window.rustdocShowSourceSidebar=()=>{addClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","true")};window.rustdocToggleSrcSidebar=()=>{if(document.documentElement.classList.contains("src-sidebar-expanded")){window.rustdocCloseSourceSidebar()}else{window.rustdocShowSourceSidebar()}};function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;for(const[key,source]of srcIndex){source[NAME_OFFSET]=key;hasFoundFile=createDirEntry(source,sidebar,"",hasFoundFile)}container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}function highlightSrcLines(){const match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",highlightSrcLines);onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/rust/static.files/storage-118b08c4c78b968e.js b/rust/static.files/storage-118b08c4c78b968e.js new file mode 100644 index 0000000000..9818946774 --- /dev/null +++ b/rust/static.files/storage-118b08c4c78b968e.js @@ -0,0 +1,24 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func){for(const elem of arr){if(func(elem)){return true}}return false}function onEachLazy(lazyArray,func){return onEach(Array.prototype.slice.call(lazyArray),func)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){const themeNames=getVar("themes").split(",").filter(t=>t);themeNames.push(...builtinThemes);if(themeNames.indexOf(newThemeName)===-1){return}if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+encodeURIComponent(newThemeName)+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px",)}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px",)}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}});class RustdocSearchElement extends HTMLElement{constructor(){super()}connectedCallback(){const rootPath=getVar("root-path");const currentCrate=getVar("current-crate");this.innerHTML=``}}window.customElements.define("rustdoc-search",RustdocSearchElement) \ No newline at end of file diff --git a/rust/trait.impl/arbitrary/trait.Arbitrary.js b/rust/trait.impl/arbitrary/trait.Arbitrary.js new file mode 100644 index 0000000000..6cb244cd10 --- /dev/null +++ b/rust/trait.impl/arbitrary/trait.Arbitrary.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl<'arbitrary> Arbitrary<'arbitrary> for RawProofEntry"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/bitflags/traits/trait.Flags.js b/rust/trait.impl/bitflags/traits/trait.Flags.js new file mode 100644 index 0000000000..6f9b764058 --- /dev/null +++ b/rust/trait.impl/bitflags/traits/trait.Flags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Flags for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/bitflags/traits/trait.PublicFlags.js b/rust/trait.impl/bitflags/traits/trait.PublicFlags.js new file mode 100644 index 0000000000..1a292666f5 --- /dev/null +++ b/rust/trait.impl/bitflags/traits/trait.PublicFlags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl PublicFlags for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/clone/trait.Clone.js b/rust/trait.impl/core/clone/trait.Clone.js new file mode 100644 index 0000000000..bc3cec245b --- /dev/null +++ b/rust/trait.impl/core/clone/trait.Clone.js @@ -0,0 +1,7 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Clone for MockEnv"],["impl Clone for MockStore"]], +"oasis_contract_sdk_types":[["impl Clone for SignatureKind"],["impl Clone for CallFormat"],["impl Clone for ExecutionResult"],["impl Clone for AccountsQuery"],["impl Clone for AccountsResponse"],["impl Clone for QueryRequest"],["impl Clone for QueryResponse"],["impl Clone for CallResult"],["impl Clone for Message"],["impl Clone for NotifyReply"],["impl Clone for Reply"],["impl Clone for StoreKind"],["impl Clone for Address"],["impl Clone for Event"],["impl Clone for InstantiateResult"],["impl Clone for CodeId"],["impl Clone for ExecutionOk"],["impl Clone for InstanceId"],["impl Clone for BaseUnits"],["impl Clone for Denomination"]], +"oasis_core_runtime":[["impl Clone for Quote"],["impl Clone for Event"],["impl Clone for Vote"],["impl Clone for SuiteId"],["impl Clone for RuntimeGovernanceModel"],["impl Clone for RuntimeKind"],["impl Clone for SGXAttestation"],["impl Clone for SGXConstraints"],["impl Clone for TEEHardware"],["impl Clone for ExecutorCommitmentFailure"],["impl Clone for GovernanceMessage"],["impl Clone for HeaderType"],["impl Clone for Message"],["impl Clone for RegistryMessage"],["impl Clone for StakingMessage"],["impl Clone for CommitteeKind"],["impl Clone for Role"],["impl Clone for EscrowEvent"],["impl Clone for SlashReason"],["impl Clone for ThresholdKind"],["impl Clone for RAKBinding"],["impl Clone for Body"],["impl Clone for Kind"],["impl Clone for Message"],["impl Clone for PeerFeedback"],["impl Clone for LogEntryKind"],["impl Clone for RootType"],["impl Clone for EventKind"],["impl Clone for ExecutionMode"],["impl Clone for HostStorageEndpoint"],["impl Clone for MessageType"],["impl Clone for CacheSet"],["impl Clone for Hash"],["impl Clone for Nonce"],["impl Clone for MultiSigned"],["impl Clone for PublicKey"],["impl Clone for Signature"],["impl Clone for SignatureBundle"],["impl Clone for Signed"],["impl Clone for PrivateKey"],["impl Clone for PublicKey"],["impl Clone for Namespace"],["impl Clone for Quantity"],["impl Clone for AVR"],["impl Clone for QuotePolicy"],["impl Clone for QuoteBundle"],["impl Clone for QuotePolicy"],["impl Clone for TCBBundle"],["impl Clone for TdAttributes"],["impl Clone for TdReport"],["impl Clone for TdxModulePolicy"],["impl Clone for TdxQuotePolicy"],["impl Clone for EnclaveIdentity"],["impl Clone for MrEnclave"],["impl Clone for MrSigner"],["impl Clone for QuotePolicy"],["impl Clone for VerifiedQuote"],["impl Clone for ProtocolVersions"],["impl Clone for Version"],["impl Clone for Config"],["impl Clone for Storage"],["impl Clone for Address"],["impl Clone for EpochTimeState"],["impl Clone for CancelUpgradeProposal"],["impl Clone for ChangeParametersProposal"],["impl Clone for ConsensusParameterChanges"],["impl Clone for ProposalContent"],["impl Clone for ProposalVote"],["impl Clone for UpgradeProposal"],["impl Clone for Application"],["impl Clone for PolicySGX"],["impl Clone for SignedPolicySGX"],["impl Clone for Status"],["impl Clone for EnclavePolicySGX"],["impl Clone for EncryptedEphemeralSecret"],["impl Clone for EncryptedMasterSecret"],["impl Clone for EncryptedSecret"],["impl Clone for PolicySGX"],["impl Clone for SignedEncryptedEphemeralSecret"],["impl Clone for SignedEncryptedMasterSecret"],["impl Clone for SignedPolicySGX"],["impl Clone for AnyNodeRuntimeAdmissionPolicy"],["impl Clone for Capabilities"],["impl Clone for CapabilityTEE"],["impl Clone for ConsensusAddress"],["impl Clone for ConsensusInfo"],["impl Clone for EndorsedCapabilityTEE"],["impl Clone for EntityWhitelistConfig"],["impl Clone for EntityWhitelistRoleAdmissionPolicy"],["impl Clone for EntityWhitelistRoleConfig"],["impl Clone for EntityWhitelistRuntimeAdmissionPolicy"],["impl Clone for ExecutorParameters"],["impl Clone for MaxNodesConstraint"],["impl Clone for MinPoolSizeConstraint"],["impl Clone for Node"],["impl Clone for NodeRuntime"],["impl Clone for P2PInfo"],["impl Clone for PerRoleAdmissionPolicy"],["impl Clone for RolesMask"],["impl Clone for Runtime"],["impl Clone for RuntimeAdmissionPolicy"],["impl Clone for RuntimeGenesis"],["impl Clone for RuntimeStakingParameters"],["impl Clone for SchedulingConstraints"],["impl Clone for StorageParameters"],["impl Clone for TCPAddress"],["impl Clone for TLSAddress"],["impl Clone for TLSInfo"],["impl Clone for TxnSchedulerParameters"],["impl Clone for VRFInfo"],["impl Clone for ValidatorSetConstraint"],["impl Clone for VerifiedAttestation"],["impl Clone for VerifiedEndorsedCapabilityTEE"],["impl Clone for VersionInfo"],["impl Clone for AnnotatedBlock"],["impl Clone for Block"],["impl Clone for ComputeResultsHeader"],["impl Clone for ExecutorCommitment"],["impl Clone for ExecutorCommitmentHeader"],["impl Clone for Header"],["impl Clone for IncomingMessage"],["impl Clone for MessageEvent"],["impl Clone for RoundResults"],["impl Clone for RoundRoots"],["impl Clone for Account"],["impl Clone for AddEscrowResult"],["impl Clone for AllowanceChangeEvent"],["impl Clone for BurnEvent"],["impl Clone for CommissionRateBoundStep"],["impl Clone for CommissionRateStep"],["impl Clone for CommissionSchedule"],["impl Clone for DebondingDelegation"],["impl Clone for Delegation"],["impl Clone for Escrow"],["impl Clone for EscrowAccount"],["impl Clone for Event"],["impl Clone for GeneralAccount"],["impl Clone for ReclaimEscrow"],["impl Clone for ReclaimEscrowResult"],["impl Clone for SharePool"],["impl Clone for Slash"],["impl Clone for StakeAccumulator"],["impl Clone for StakeThreshold"],["impl Clone for Transfer"],["impl Clone for TransferEvent"],["impl Clone for TransferResult"],["impl Clone for Withdraw"],["impl Clone for WithdrawResult"],["impl Clone for Status"],["impl Clone for BlockMetadata"],["impl Clone for LightBlock"],["impl Clone for LightBlockMeta"],["impl Clone for TrustRoot"],["impl Clone for MethodDescriptor"],["impl Clone for Builder"],["impl Clone for Error"],["impl Clone for Frame"],["impl Clone for Request"],["impl Clone for Response"],["impl Clone for SessionID"],["impl Clone for RegisterNotifyOpts"],["impl Clone for SubmitTxOpts"],["impl Clone for TxResult"],["impl Clone for HostInfo"],["impl Clone for LogEntry"],["impl Clone for Prefix"],["impl Clone for Root"],["impl Clone for GetPrefixesRequest"],["impl Clone for GetRequest"],["impl Clone for IterateRequest"],["impl Clone for Proof"],["impl Clone for ProofResponse"],["impl Clone for RawProofEntry"],["impl Clone for TreeID"],["impl Clone for CoarsenedKey"],["impl Clone for ReadWriteSet"],["impl Clone for Tag"],["impl Clone for TxnBatch"],["impl Clone for CheckTxMetadata"],["impl Clone for CheckTxResult"],["impl Clone for ComputedBatch"],["impl Clone for Error"],["impl Clone for FeatureScheduleControl"],["impl Clone for Features"],["impl Clone for HostFetchConsensusEventsRequest"],["impl Clone for HostFetchConsensusEventsResponse"],["impl Clone for RegisterNotifyRuntimeEvent"],["impl Clone for RuntimeInfoRequest"],["impl Clone for RuntimeInfoResponse"],["impl Clone for RuntimeNotifyEvent"],["impl<T: Clone> Clone for Versioned<T>"]], +"oasis_runtime_sdk":[["impl Clone for PublicKey"],["impl Clone for SignatureType"],["impl Clone for AuthDecision"],["impl Clone for RootKind"],["impl Clone for ReceiptKind"],["impl Clone for MethodHandlerKind"],["impl Clone for RewardAction"],["impl Clone for AllowedEndorsement"],["impl Clone for FeePolicy"],["impl Clone for IdentifierScheme"],["impl Clone for Mode"],["impl Clone for SignatureAddressSpec"],["impl Clone for AddressSpec"],["impl Clone for AuthProof"],["impl Clone for CallFormat"],["impl Clone for CallResult"],["impl Clone for CallerAddress"],["impl Clone for Box<dyn KeyManager>"],["impl Clone for Config"],["impl Clone for Signer"],["impl Clone for PublicKey"],["impl Clone for PublicKey"],["impl Clone for PublicKey"],["impl Clone for PublicKey"],["impl Clone for PublicKey"],["impl Clone for Signature"],["impl Clone for QueryRequest"],["impl Clone for EventTag"],["impl Clone for KeyManagerClientWithContext"],["impl Clone for FeeManager"],["impl Clone for TransactionFee"],["impl Clone for GasCosts"],["impl Clone for Genesis"],["impl Clone for Parameters"],["impl Clone for Account"],["impl Clone for AccountBalances"],["impl Clone for AddressesQuery"],["impl Clone for BalancesQuery"],["impl Clone for DenominationInfo"],["impl Clone for DenominationInfoQuery"],["impl Clone for NonceQuery"],["impl Clone for Transfer"],["impl Clone for GasCosts"],["impl Clone for Genesis"],["impl Clone for Parameters"],["impl Clone for RoundRootBody"],["impl Clone for GasCosts"],["impl Clone for Genesis"],["impl Clone for Parameters"],["impl Clone for AccountBalance"],["impl Clone for BalanceQuery"],["impl Clone for ConsensusAccountQuery"],["impl Clone for ConsensusDelegateContext"],["impl Clone for ConsensusError"],["impl Clone for ConsensusTransferContext"],["impl Clone for ConsensusUndelegateContext"],["impl Clone for ConsensusWithdrawContext"],["impl Clone for Delegate"],["impl Clone for DelegationInfo"],["impl Clone for DelegationQuery"],["impl Clone for DelegationsQuery"],["impl Clone for Deposit"],["impl Clone for ExtendedDelegationInfo"],["impl Clone for Receipt"],["impl Clone for TakeReceipt"],["impl Clone for Undelegate"],["impl Clone for UndelegationInfo"],["impl Clone for UndelegationsQuery"],["impl Clone for Withdraw"],["impl Clone for DynamicMinGasPrice"],["impl Clone for GasCosts"],["impl Clone for Genesis"],["impl Clone for LocalConfig"],["impl Clone for Parameters"],["impl Clone for CallDataPublicKeyQueryResponse"],["impl Clone for EstimateGasQuery"],["impl Clone for ExecuteReadOnlyTxQuery"],["impl Clone for ExecuteReadOnlyTxResponse"],["impl Clone for Metadata"],["impl Clone for MethodHandlerInfo"],["impl Clone for ModuleInfo"],["impl Clone for RuntimeInfoResponse"],["impl Clone for Genesis"],["impl Clone for Parameters"],["impl Clone for EpochRewards"],["impl Clone for RewardSchedule"],["impl Clone for RewardStep"],["impl Clone for AppId"],["impl Clone for AppAuthPolicy"],["impl Clone for KeyEndorsementInfo"],["impl Clone for Genesis"],["impl Clone for Parameters"],["impl Clone for AppConfig"],["impl Clone for AppInstanceQuery"],["impl Clone for AppQuery"],["impl Clone for Create"],["impl Clone for Register"],["impl Clone for Registration"],["impl Clone for Remove"],["impl Clone for StakeThresholds"],["impl Clone for Update"],["impl Clone for SenderMeta"],["impl Clone for Environment"],["impl Clone for Options"],["impl Clone for TransactionWithMeta"],["impl Clone for SubcallInfo"],["impl Clone for MockKeyManagerClient"],["impl Clone for CallOptions"],["impl Clone for Address"],["impl Clone for CallEnvelopeX25519DeoxysII"],["impl Clone for ResultEnvelopeX25519DeoxysII"],["impl Clone for MessageEventHookInvocation"],["impl Clone for MessageResult"],["impl Clone for BaseUnits"],["impl Clone for Denomination"],["impl Clone for AuthInfo"],["impl Clone for Call"],["impl Clone for Fee"],["impl Clone for FeeProxy"],["impl Clone for SignerInfo"],["impl Clone for Transaction"],["impl Clone for UnverifiedTransaction"],["impl<A> Clone for Client<A>
where\n A: App,
"],["impl<A> Clone for Environment<A>
where\n A: App,
"]], +"oasis_runtime_sdk_contracts":[["impl Clone for ABI"],["impl Clone for Policy"],["impl Clone for PublicKeyKind"],["impl Clone for StoreKind"],["impl Clone for GasCosts"],["impl Clone for Genesis"],["impl Clone for LocalConfig"],["impl Clone for Parameters"],["impl Clone for Call"],["impl Clone for CallResult"],["impl Clone for ChangeUpgradePolicy"],["impl Clone for Code"],["impl Clone for CodeQuery"],["impl Clone for CodeStorageQuery"],["impl Clone for CodeStorageQueryResult"],["impl Clone for ContractEvent"],["impl Clone for CustomQuery"],["impl Clone for CustomQueryResult"],["impl Clone for Instance"],["impl Clone for InstanceQuery"],["impl Clone for InstanceRawStorageQuery"],["impl Clone for InstanceRawStorageQueryResult"],["impl Clone for InstanceStorageQuery"],["impl Clone for InstanceStorageQueryResult"],["impl Clone for Instantiate"],["impl Clone for InstantiateResult"],["impl Clone for PublicKeyQuery"],["impl Clone for PublicKeyQueryResult"],["impl Clone for Upgrade"],["impl Clone for Upload"],["impl Clone for UploadResult"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/cmp/trait.Eq.js b/rust/trait.impl/core/cmp/trait.Eq.js new file mode 100644 index 0000000000..a1d7bfe778 --- /dev/null +++ b/rust/trait.impl/core/cmp/trait.Eq.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl Eq for CallFormat"],["impl Eq for NotifyReply"],["impl Eq for Address"],["impl Eq for CodeId"],["impl Eq for InstanceId"],["impl Eq for BaseUnits"],["impl Eq for Denomination"]], +"oasis_core_runtime":[["impl Eq for Quote"],["impl Eq for Vote"],["impl Eq for SuiteId"],["impl Eq for RuntimeGovernanceModel"],["impl Eq for RuntimeKind"],["impl Eq for TEEHardware"],["impl Eq for ExecutorCommitmentFailure"],["impl Eq for GovernanceMessage"],["impl Eq for HeaderType"],["impl Eq for Message"],["impl Eq for RegistryMessage"],["impl Eq for StakingMessage"],["impl Eq for CommitteeKind"],["impl Eq for Role"],["impl Eq for EscrowEvent"],["impl Eq for SlashReason"],["impl Eq for ThresholdKind"],["impl Eq for Kind"],["impl Eq for PeerFeedback"],["impl Eq for TeeType"],["impl Eq for LogEntryKind"],["impl Eq for NodeBox"],["impl Eq for RootType"],["impl Eq for ExecutionMode"],["impl Eq for HostStorageEndpoint"],["impl Eq for Hash"],["impl Eq for MultiSigned"],["impl Eq for PublicKey"],["impl Eq for Signature"],["impl Eq for SignatureBundle"],["impl Eq for Signed"],["impl Eq for PublicKey"],["impl Eq for Namespace"],["impl Eq for Quantity"],["impl Eq for AVR"],["impl Eq for QuotePolicy"],["impl Eq for QuoteBundle"],["impl Eq for QuotePolicy"],["impl Eq for TCBBundle"],["impl Eq for TdAttributes"],["impl Eq for TdReport"],["impl Eq for TdxModulePolicy"],["impl Eq for TdxQuotePolicy"],["impl Eq for EnclaveIdentity"],["impl Eq for MrEnclave"],["impl Eq for MrSigner"],["impl Eq for QuotePolicy"],["impl Eq for ProtocolVersions"],["impl Eq for Version"],["impl Eq for Address"],["impl Eq for EpochTimeState"],["impl Eq for CancelUpgradeProposal"],["impl Eq for ChangeParametersProposal"],["impl Eq for ConsensusParameterChanges"],["impl Eq for ProposalContent"],["impl Eq for ProposalVote"],["impl Eq for UpgradeProposal"],["impl Eq for Application"],["impl Eq for PolicySGX"],["impl Eq for SignedPolicySGX"],["impl Eq for Status"],["impl Eq for EnclavePolicySGX"],["impl Eq for EncryptedEphemeralSecret"],["impl Eq for EncryptedMasterSecret"],["impl Eq for EncryptedSecret"],["impl Eq for PolicySGX"],["impl Eq for SignedEncryptedEphemeralSecret"],["impl Eq for SignedEncryptedMasterSecret"],["impl Eq for SignedPolicySGX"],["impl Eq for AnyNodeRuntimeAdmissionPolicy"],["impl Eq for Capabilities"],["impl Eq for CapabilityTEE"],["impl Eq for ConsensusAddress"],["impl Eq for ConsensusInfo"],["impl Eq for EndorsedCapabilityTEE"],["impl Eq for EntityWhitelistConfig"],["impl Eq for EntityWhitelistRoleAdmissionPolicy"],["impl Eq for EntityWhitelistRoleConfig"],["impl Eq for EntityWhitelistRuntimeAdmissionPolicy"],["impl Eq for ExecutorParameters"],["impl Eq for MaxNodesConstraint"],["impl Eq for MinPoolSizeConstraint"],["impl Eq for Node"],["impl Eq for NodeRuntime"],["impl Eq for P2PInfo"],["impl Eq for PerRoleAdmissionPolicy"],["impl Eq for RolesMask"],["impl Eq for Runtime"],["impl Eq for RuntimeAdmissionPolicy"],["impl Eq for RuntimeGenesis"],["impl Eq for RuntimeStakingParameters"],["impl Eq for SchedulingConstraints"],["impl Eq for StorageParameters"],["impl Eq for TCPAddress"],["impl Eq for TLSAddress"],["impl Eq for TLSInfo"],["impl Eq for TxnSchedulerParameters"],["impl Eq for VRFInfo"],["impl Eq for ValidatorSetConstraint"],["impl Eq for VersionInfo"],["impl Eq for AnnotatedBlock"],["impl Eq for Block"],["impl Eq for ComputeResultsHeader"],["impl Eq for ExecutorCommitment"],["impl Eq for ExecutorCommitmentHeader"],["impl Eq for Header"],["impl Eq for IncomingMessage"],["impl Eq for MessageEvent"],["impl Eq for RoundResults"],["impl Eq for RoundRoots"],["impl Eq for Account"],["impl Eq for AddEscrowResult"],["impl Eq for AllowanceChangeEvent"],["impl Eq for BurnEvent"],["impl Eq for CommissionRateBoundStep"],["impl Eq for CommissionRateStep"],["impl Eq for CommissionSchedule"],["impl Eq for DebondingDelegation"],["impl Eq for Delegation"],["impl Eq for Escrow"],["impl Eq for EscrowAccount"],["impl Eq for Event"],["impl Eq for GeneralAccount"],["impl Eq for ReclaimEscrow"],["impl Eq for ReclaimEscrowResult"],["impl Eq for SharePool"],["impl Eq for Slash"],["impl Eq for StakeAccumulator"],["impl Eq for StakeThreshold"],["impl Eq for Transfer"],["impl Eq for TransferEvent"],["impl Eq for TransferResult"],["impl Eq for Withdraw"],["impl Eq for WithdrawResult"],["impl Eq for Status"],["impl Eq for BlockMetadata"],["impl Eq for TrustRoot"],["impl Eq for SessionID"],["impl Eq for LogEntry"],["impl Eq for NodePointer"],["impl Eq for Prefix"],["impl Eq for Root"],["impl Eq for Proof"],["impl Eq for RawProofEntry"],["impl Eq for TreeID"],["impl Eq for CoarsenedKey"],["impl Eq for ReadWriteSet"],["impl Eq for TxnBatch"],["impl<T: Eq> Eq for Versioned<T>"]], +"oasis_runtime_sdk":[["impl Eq for PublicKey"],["impl Eq for SignatureType"],["impl Eq for Event"],["impl Eq for RewardAction"],["impl Eq for AllowedEndorsement"],["impl Eq for FeePolicy"],["impl Eq for Mode"],["impl Eq for SignatureAddressSpec"],["impl Eq for CallFormat"],["impl Eq for PublicKey"],["impl Eq for PublicKey"],["impl Eq for PublicKey"],["impl Eq for PublicKey"],["impl Eq for PublicKey"],["impl Eq for Signature"],["impl Eq for GasCosts"],["impl Eq for Parameters"],["impl Eq for ConsensusError"],["impl Eq for AppId"],["impl Eq for AppAuthPolicy"],["impl Eq for KeyEndorsementInfo"],["impl Eq for Registration"],["impl Eq for SenderMeta"],["impl Eq for Address"],["impl Eq for BaseUnits"],["impl Eq for Denomination"]], +"oasis_runtime_sdk_contracts":[["impl Eq for ABI"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/cmp/trait.Ord.js b/rust/trait.impl/core/cmp/trait.Ord.js new file mode 100644 index 0000000000..605d809b46 --- /dev/null +++ b/rust/trait.impl/core/cmp/trait.Ord.js @@ -0,0 +1,5 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl Ord for Address"],["impl Ord for BaseUnits"],["impl Ord for Denomination"]], +"oasis_core_runtime":[["impl Ord for Vote"],["impl Ord for CommitteeKind"],["impl Ord for Role"],["impl Ord for SlashReason"],["impl Ord for ThresholdKind"],["impl Ord for Hash"],["impl Ord for PublicKey"],["impl Ord for Signature"],["impl Ord for Namespace"],["impl Ord for Quantity"],["impl Ord for MrEnclave"],["impl Ord for MrSigner"],["impl Ord for Address"],["impl Ord for RolesMask"],["impl Ord for SessionID"],["impl Ord for Prefix"]], +"oasis_runtime_sdk":[["impl Ord for PublicKey"],["impl Ord for SignatureType"],["impl Ord for PublicKey"],["impl Ord for PublicKey"],["impl Ord for PublicKey"],["impl Ord for PublicKey"],["impl Ord for PublicKey"],["impl Ord for AppId"],["impl Ord for Address"],["impl Ord for BaseUnits"],["impl Ord for Denomination"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/cmp/trait.PartialEq.js b/rust/trait.impl/core/cmp/trait.PartialEq.js new file mode 100644 index 0000000000..fdb75344ed --- /dev/null +++ b/rust/trait.impl/core/cmp/trait.PartialEq.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl PartialEq for CallFormat"],["impl PartialEq for NotifyReply"],["impl PartialEq for Address"],["impl PartialEq for CodeId"],["impl PartialEq for InstanceId"],["impl PartialEq for BaseUnits"],["impl PartialEq for Denomination"]], +"oasis_core_runtime":[["impl PartialEq for Quote"],["impl PartialEq for Vote"],["impl PartialEq for SuiteId"],["impl PartialEq for RuntimeGovernanceModel"],["impl PartialEq for RuntimeKind"],["impl PartialEq for TEEHardware"],["impl PartialEq for ExecutorCommitmentFailure"],["impl PartialEq for GovernanceMessage"],["impl PartialEq for HeaderType"],["impl PartialEq for Message"],["impl PartialEq for RegistryMessage"],["impl PartialEq for StakingMessage"],["impl PartialEq for CommitteeKind"],["impl PartialEq for Role"],["impl PartialEq for EscrowEvent"],["impl PartialEq for SlashReason"],["impl PartialEq for ThresholdKind"],["impl PartialEq for Kind"],["impl PartialEq for PeerFeedback"],["impl PartialEq for TeeType"],["impl PartialEq for LogEntryKind"],["impl PartialEq for NodeBox"],["impl PartialEq for RootType"],["impl PartialEq for ExecutionMode"],["impl PartialEq for HostStorageEndpoint"],["impl PartialEq for Hash"],["impl PartialEq for MultiSigned"],["impl PartialEq for PublicKey"],["impl PartialEq for Signature"],["impl PartialEq for SignatureBundle"],["impl PartialEq for Signed"],["impl PartialEq for PublicKey"],["impl PartialEq for Namespace"],["impl PartialEq for Quantity"],["impl PartialEq for AVR"],["impl PartialEq for QuotePolicy"],["impl PartialEq for QuoteBundle"],["impl PartialEq for QuotePolicy"],["impl PartialEq for TCBBundle"],["impl PartialEq for TdAttributes"],["impl PartialEq for TdReport"],["impl PartialEq for TdxModulePolicy"],["impl PartialEq for TdxQuotePolicy"],["impl PartialEq for EnclaveIdentity"],["impl PartialEq for MrEnclave"],["impl PartialEq for MrSigner"],["impl PartialEq for QuotePolicy"],["impl PartialEq for ProtocolVersions"],["impl PartialEq for Version"],["impl PartialEq for Address"],["impl PartialEq for EpochTimeState"],["impl PartialEq for CancelUpgradeProposal"],["impl PartialEq for ChangeParametersProposal"],["impl PartialEq for ConsensusParameterChanges"],["impl PartialEq for ProposalContent"],["impl PartialEq for ProposalVote"],["impl PartialEq for UpgradeProposal"],["impl PartialEq for Application"],["impl PartialEq for PolicySGX"],["impl PartialEq for SignedPolicySGX"],["impl PartialEq for Status"],["impl PartialEq for EnclavePolicySGX"],["impl PartialEq for EncryptedEphemeralSecret"],["impl PartialEq for EncryptedMasterSecret"],["impl PartialEq for EncryptedSecret"],["impl PartialEq for PolicySGX"],["impl PartialEq for SignedEncryptedEphemeralSecret"],["impl PartialEq for SignedEncryptedMasterSecret"],["impl PartialEq for SignedPolicySGX"],["impl PartialEq for AnyNodeRuntimeAdmissionPolicy"],["impl PartialEq for Capabilities"],["impl PartialEq for CapabilityTEE"],["impl PartialEq for ConsensusAddress"],["impl PartialEq for ConsensusInfo"],["impl PartialEq for EndorsedCapabilityTEE"],["impl PartialEq for EntityWhitelistConfig"],["impl PartialEq for EntityWhitelistRoleAdmissionPolicy"],["impl PartialEq for EntityWhitelistRoleConfig"],["impl PartialEq for EntityWhitelistRuntimeAdmissionPolicy"],["impl PartialEq for ExecutorParameters"],["impl PartialEq for MaxNodesConstraint"],["impl PartialEq for MinPoolSizeConstraint"],["impl PartialEq for Node"],["impl PartialEq for NodeRuntime"],["impl PartialEq for P2PInfo"],["impl PartialEq for PerRoleAdmissionPolicy"],["impl PartialEq for RolesMask"],["impl PartialEq for Runtime"],["impl PartialEq for RuntimeAdmissionPolicy"],["impl PartialEq for RuntimeGenesis"],["impl PartialEq for RuntimeStakingParameters"],["impl PartialEq for SchedulingConstraints"],["impl PartialEq for StorageParameters"],["impl PartialEq for TCPAddress"],["impl PartialEq for TLSAddress"],["impl PartialEq for TLSInfo"],["impl PartialEq for TxnSchedulerParameters"],["impl PartialEq for VRFInfo"],["impl PartialEq for ValidatorSetConstraint"],["impl PartialEq for VersionInfo"],["impl PartialEq for AnnotatedBlock"],["impl PartialEq for Block"],["impl PartialEq for ComputeResultsHeader"],["impl PartialEq for ExecutorCommitment"],["impl PartialEq for ExecutorCommitmentHeader"],["impl PartialEq for Header"],["impl PartialEq for IncomingMessage"],["impl PartialEq for MessageEvent"],["impl PartialEq for RoundResults"],["impl PartialEq for RoundRoots"],["impl PartialEq for Account"],["impl PartialEq for AddEscrowResult"],["impl PartialEq for AllowanceChangeEvent"],["impl PartialEq for BurnEvent"],["impl PartialEq for CommissionRateBoundStep"],["impl PartialEq for CommissionRateStep"],["impl PartialEq for CommissionSchedule"],["impl PartialEq for DebondingDelegation"],["impl PartialEq for Delegation"],["impl PartialEq for Escrow"],["impl PartialEq for EscrowAccount"],["impl PartialEq for Event"],["impl PartialEq for GeneralAccount"],["impl PartialEq for ReclaimEscrow"],["impl PartialEq for ReclaimEscrowResult"],["impl PartialEq for SharePool"],["impl PartialEq for Slash"],["impl PartialEq for StakeAccumulator"],["impl PartialEq for StakeThreshold"],["impl PartialEq for Transfer"],["impl PartialEq for TransferEvent"],["impl PartialEq for TransferResult"],["impl PartialEq for Withdraw"],["impl PartialEq for WithdrawResult"],["impl PartialEq for Status"],["impl PartialEq for BlockMetadata"],["impl PartialEq for TrustRoot"],["impl PartialEq for SessionID"],["impl PartialEq for LogEntry"],["impl PartialEq for NodePointer"],["impl PartialEq for Prefix"],["impl PartialEq for Root"],["impl PartialEq for Proof"],["impl PartialEq for RawProofEntry"],["impl PartialEq for TreeID"],["impl PartialEq for CoarsenedKey"],["impl PartialEq for ReadWriteSet"],["impl PartialEq for TxnBatch"],["impl<T: PartialEq> PartialEq for Versioned<T>"]], +"oasis_runtime_sdk":[["impl PartialEq for PublicKey"],["impl PartialEq for SignatureType"],["impl PartialEq for Event"],["impl PartialEq for RewardAction"],["impl PartialEq for AllowedEndorsement"],["impl PartialEq for FeePolicy"],["impl PartialEq for Mode"],["impl PartialEq for SignatureAddressSpec"],["impl PartialEq for CallFormat"],["impl PartialEq for PublicKey"],["impl PartialEq for PublicKey"],["impl PartialEq for PublicKey"],["impl PartialEq for PublicKey"],["impl PartialEq for PublicKey"],["impl PartialEq for Signature"],["impl PartialEq for GasCosts"],["impl PartialEq for Parameters"],["impl PartialEq for ConsensusError"],["impl PartialEq for AppId"],["impl PartialEq for AppAuthPolicy"],["impl PartialEq for KeyEndorsementInfo"],["impl PartialEq for Registration"],["impl PartialEq for SenderMeta"],["impl PartialEq for Address"],["impl PartialEq for BaseUnits"],["impl PartialEq for Denomination"],["impl PartialEq<PublicKey> for PublicKey"]], +"oasis_runtime_sdk_contracts":[["impl PartialEq for ABI"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/cmp/trait.PartialOrd.js b/rust/trait.impl/core/cmp/trait.PartialOrd.js new file mode 100644 index 0000000000..44375ae4fa --- /dev/null +++ b/rust/trait.impl/core/cmp/trait.PartialOrd.js @@ -0,0 +1,5 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl PartialOrd for Address"],["impl PartialOrd for BaseUnits"],["impl PartialOrd for Denomination"]], +"oasis_core_runtime":[["impl PartialOrd for Vote"],["impl PartialOrd for CommitteeKind"],["impl PartialOrd for Role"],["impl PartialOrd for SlashReason"],["impl PartialOrd for ThresholdKind"],["impl PartialOrd for Hash"],["impl PartialOrd for PublicKey"],["impl PartialOrd for Signature"],["impl PartialOrd for Namespace"],["impl PartialOrd for Quantity"],["impl PartialOrd for MrEnclave"],["impl PartialOrd for MrSigner"],["impl PartialOrd for Address"],["impl PartialOrd for RolesMask"],["impl PartialOrd for SessionID"],["impl PartialOrd for Prefix"]], +"oasis_runtime_sdk":[["impl PartialOrd for PublicKey"],["impl PartialOrd for SignatureType"],["impl PartialOrd for PublicKey"],["impl PartialOrd for PublicKey"],["impl PartialOrd for PublicKey"],["impl PartialOrd for PublicKey"],["impl PartialOrd for PublicKey"],["impl PartialOrd for AppId"],["impl PartialOrd for Address"],["impl PartialOrd for BaseUnits"],["impl PartialOrd for Denomination"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/convert/trait.AsRef.js b/rust/trait.impl/core/convert/trait.AsRef.js new file mode 100644 index 0000000000..a1015158ff --- /dev/null +++ b/rust/trait.impl/core/convert/trait.AsRef.js @@ -0,0 +1,5 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl AsRef<[u8]> for Address"],["impl AsRef<[u8]> for Denomination"]], +"oasis_core_runtime":[["impl AsRef<[u8]> for Hash"],["impl AsRef<[u8]> for PublicKey"],["impl AsRef<[u8]> for Signature"],["impl AsRef<[u8]> for PrivateKey"],["impl AsRef<[u8]> for PublicKey"],["impl AsRef<[u8]> for Namespace"],["impl AsRef<[u8]> for MrEnclave"],["impl AsRef<[u8]> for MrSigner"],["impl AsRef<[u8]> for Address"],["impl AsRef<[u8]> for SessionID"],["impl AsRef<[u8]> for Prefix"],["impl AsRef<[u8]> for RawProofEntry"],["impl AsRef<[u8]> for CoarsenedKey"]], +"oasis_runtime_sdk":[["impl AsRef<[u8]> for PublicKey"],["impl AsRef<[u8]> for Signature"],["impl AsRef<[u8]> for AppId"],["impl AsRef<[u8]> for Address"],["impl AsRef<[u8]> for Denomination"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/convert/trait.From.js b/rust/trait.impl/core/convert/trait.From.js new file mode 100644 index 0000000000..3b480d4acd --- /dev/null +++ b/rust/trait.impl/core/convert/trait.From.js @@ -0,0 +1,8 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl From<ExecutionContext> for MockContext"]], +"oasis_contract_sdk_storage":[["impl<I: Integer> From<I> for Int<I>"]], +"oasis_contract_sdk_types":[["impl From<&BaseUnits> for BaseUnits"],["impl From<AccountsQuery> for QueryRequest"],["impl From<AccountsResponse> for QueryResponse"],["impl From<CallResult> for CallResult"],["impl From<CallFormat> for CallFormat"],["impl From<u64> for CodeId"],["impl From<u64> for InstanceId"],["impl From<Address> for Address"],["impl From<Denomination> for Denomination"],["impl From<Address> for Address"],["impl From<BaseUnits> for BaseUnits"],["impl From<Denomination> for Denomination"]], +"oasis_core_runtime":[["impl From<&'static str> for Hash"],["impl From<&'static str> for PublicKey"],["impl From<&'static str> for Signature"],["impl From<&'static str> for Namespace"],["impl From<&'static str> for MrEnclave"],["impl From<&'static str> for MrSigner"],["impl From<&'static str> for SessionID"],["impl From<&PrivateKey> for PublicKey"],["impl From<&[u8; 21]> for Address"],["impl From<&[u8]> for Hash"],["impl From<&[u8]> for PublicKey"],["impl From<&[u8]> for Signature"],["impl From<&[u8]> for Namespace"],["impl From<&[u8]> for MrEnclave"],["impl From<&[u8]> for MrSigner"],["impl From<&[u8]> for SessionID"],["impl From<StateError> for Error"],["impl From<StateError> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for RpcClientError"],["impl From<Error> for Error"],["impl From<ProtocolError> for Error"],["impl From<u128> for Quantity"],["impl From<u16> for Quantity"],["impl From<u32> for Quantity"],["impl From<u64> for Quantity"],["impl From<u64> for Version"],["impl From<u8> for Quantity"],["impl From<VecDeque<Vec<u8>>> for TxnBatch"],["impl From<Vec<u8>> for Hash"],["impl From<Vec<u8>> for PublicKey"],["impl From<Vec<u8>> for Signature"],["impl From<Vec<u8>> for Namespace"],["impl From<Vec<u8>> for MrEnclave"],["impl From<Vec<u8>> for MrSigner"],["impl From<Vec<u8>> for SessionID"],["impl From<Vec<u8>> for Prefix"],["impl From<Vec<u8>> for RawProofEntry"],["impl From<Vec<u8>> for CoarsenedKey"],["impl From<Vec<Vec<u8>>> for TxnBatch"],["impl From<Error> for Error"],["impl From<Error> for StateError"],["impl From<Error> for RpcClientError"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Hash> for [u8; 32]"],["impl From<PublicKey> for [u8; 32]"],["impl From<Signature> for [u8; 64]"],["impl From<PrivateKey> for StaticSecret"],["impl From<PublicKey> for PublicKey"],["impl From<Namespace> for [u8; 32]"],["impl From<MrEnclave> for [u8; 32]"],["impl From<MrSigner> for [u8; 32]"],["impl From<VerifiedQuote> for VerifiedAttestation"],["impl From<VerifiedQuote> for VerifiedEndorsedCapabilityTEE"],["impl From<Version> for u64"],["impl From<Address> for [u8; 21]"],["impl From<VerifiedAttestation> for VerifiedEndorsedCapabilityTEE"],["impl From<LightBlockMeta> for LightBlock"],["impl From<SessionID> for [u8; 32]"],["impl From<Prefix> for Vec<u8>"],["impl From<RawProofEntry> for Vec<u8>"],["impl From<CoarsenedKey> for Vec<u8>"],["impl From<TxnBatch> for VecDeque<Vec<u8>>"],["impl From<TxnBatch> for Vec<Vec<u8>>"],["impl From<Error> for Error"],["impl From<DecodeError> for RpcClientError"],["impl From<DecodeError> for Error"],["impl From<JoinError> for Error"],["impl From<PublicKey> for PublicKey"],["impl From<StaticSecret> for PrivateKey"],["impl From<[u8; 32]> for PrivateKey"],["impl From<[u8; 32]> for PublicKey"],["impl<'a> From<&'a str> for Address"]], +"oasis_runtime_sdk":[["impl From<&'static str> for PublicKey"],["impl From<&'static str> for PublicKey"],["impl From<&'static str> for PublicKey"],["impl From<&'static str> for PublicKey"],["impl From<&'static str> for PublicKey"],["impl From<&'static str> for AppId"],["impl From<&'static str> for Address"],["impl From<&Mode> for &'static str"],["impl From<&PublicKey> for PublicKey"],["impl From<StateError> for Error"],["impl From<Error> for Error"],["impl From<Error> for RuntimeError"],["impl From<Error> for Error"],["impl From<Error> for RuntimeError"],["impl From<CallResult> for CallResult"],["impl From<CallResult> for DispatchResult"],["impl From<Error> for RuntimeError"],["impl From<Error> for Error"],["impl From<Error> for RuntimeError"],["impl From<Error> for Error"],["impl From<Error> for RuntimeError"],["impl From<Error> for RuntimeError"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for RuntimeError"],["impl From<Error> for RuntimeError"],["impl From<RewardScheduleError> for ParameterValidationError"],["impl From<Error> for RuntimeError"],["impl From<Error> for RuntimeError"],["impl From<KeyManagerError> for Error"],["impl From<Error> for Error"],["impl From<()> for TransactionResult<()>"],["impl From<Vec<u8>> for Signature"],["impl From<PublicKey> for PublicKey"],["impl From<PublicKey> for PublicKey"],["impl From<MessageEvent> for ConsensusError"],["impl From<PublicKey> for PublicKey"],["impl From<Signature> for Vec<u8>"],["impl From<TxSimulationFailure> for Error"],["impl From<Address> for Address"],["impl<R, E> From<Result<R, E>> for TransactionResult<Result<R, E>>"]], +"oasis_runtime_sdk_contracts":[["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<Error> for RuntimeError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/convert/trait.TryFrom.js b/rust/trait.impl/core/convert/trait.TryFrom.js new file mode 100644 index 0000000000..631f32994c --- /dev/null +++ b/rust/trait.impl/core/convert/trait.TryFrom.js @@ -0,0 +1,5 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl TryFrom<&[u8]> for Address"],["impl TryFrom<&[u8]> for Denomination"],["impl TryFrom<u32> for SignatureKind"],["impl TryFrom<u32> for StoreKind"]], +"oasis_core_runtime":[["impl TryFrom<&Quantity> for u128"],["impl TryFrom<&Quantity> for u64"],["impl TryFrom<Quantity> for u128"],["impl TryFrom<Quantity> for u64"],["impl TryFrom<LightBlock> for LightBlockMeta"]], +"oasis_runtime_sdk":[["impl TryFrom<&[u8]> for AppId"],["impl TryFrom<&[u8]> for Address"],["impl TryFrom<&[u8]> for Denomination"],["impl TryFrom<PublicKey> for PublicKey"],["impl TryFrom<CallResult> for TxSimulationFailure"],["impl TryFrom<u8> for SignatureType"],["impl<'a> TryFrom<&'a [u8]> for Undelegation"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/default/trait.Default.js b/rust/trait.impl/core/default/trait.Default.js new file mode 100644 index 0000000000..7aac6c8dba --- /dev/null +++ b/rust/trait.impl/core/default/trait.Default.js @@ -0,0 +1,7 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Default for MockEnv"],["impl Default for MockStore"]], +"oasis_contract_sdk_types":[["impl Default for CallFormat"],["impl Default for Address"],["impl Default for InstantiateResult"],["impl Default for CodeId"],["impl Default for ExecutionContext"],["impl Default for ExecutionOk"],["impl Default for InstanceId"],["impl Default for BaseUnits"],["impl Default for Denomination"]], +"oasis_core_runtime":[["impl Default for Vote"],["impl Default for SuiteId"],["impl Default for RuntimeGovernanceModel"],["impl Default for RuntimeKind"],["impl Default for TEEHardware"],["impl Default for ExecutorCommitmentFailure"],["impl Default for HeaderType"],["impl Default for CommitteeKind"],["impl Default for Role"],["impl Default for Kind"],["impl Default for TeeType"],["impl Default for NodeBox"],["impl Default for RootType"],["impl Default for Body"],["impl Default for ExecutionMode"],["impl Default for MessageType"],["impl Default for Hash"],["impl Default for MultiSigned"],["impl Default for PublicKey"],["impl Default for Signature"],["impl Default for SignatureBundle"],["impl Default for Signed"],["impl Default for PrivateKey"],["impl Default for PublicKey"],["impl Default for Namespace"],["impl Default for Quantity"],["impl Default for AVR"],["impl Default for QuotePolicy"],["impl Default for QuoteBundle"],["impl Default for QuotePolicy"],["impl Default for TCBBundle"],["impl Default for TdxQuotePolicy"],["impl Default for EnclaveIdentity"],["impl Default for MrEnclave"],["impl Default for MrSigner"],["impl Default for QuotePolicy"],["impl Default for VerifiedQuote"],["impl Default for ProtocolVersions"],["impl Default for Version"],["impl Default for Config"],["impl Default for Storage"],["impl Default for Address"],["impl Default for EpochTimeState"],["impl Default for CancelUpgradeProposal"],["impl Default for ChangeParametersProposal"],["impl Default for ConsensusParameterChanges"],["impl Default for ProposalContent"],["impl Default for ProposalVote"],["impl Default for UpgradeProposal"],["impl Default for Application"],["impl Default for PolicySGX"],["impl Default for SignedPolicySGX"],["impl Default for Status"],["impl Default for EnclavePolicySGX"],["impl Default for EncryptedEphemeralSecret"],["impl Default for EncryptedMasterSecret"],["impl Default for EncryptedSecret"],["impl Default for PolicySGX"],["impl Default for SignedEncryptedEphemeralSecret"],["impl Default for SignedEncryptedMasterSecret"],["impl Default for SignedPolicySGX"],["impl Default for AnyNodeRuntimeAdmissionPolicy"],["impl Default for Capabilities"],["impl Default for CapabilityTEE"],["impl Default for ConsensusAddress"],["impl Default for ConsensusInfo"],["impl Default for EndorsedCapabilityTEE"],["impl Default for EntityWhitelistConfig"],["impl Default for EntityWhitelistRoleAdmissionPolicy"],["impl Default for EntityWhitelistRoleConfig"],["impl Default for EntityWhitelistRuntimeAdmissionPolicy"],["impl Default for ExecutorParameters"],["impl Default for MaxNodesConstraint"],["impl Default for MinPoolSizeConstraint"],["impl Default for Node"],["impl Default for NodeRuntime"],["impl Default for P2PInfo"],["impl Default for PerRoleAdmissionPolicy"],["impl Default for RolesMask"],["impl Default for Runtime"],["impl Default for RuntimeAdmissionPolicy"],["impl Default for RuntimeGenesis"],["impl Default for RuntimeStakingParameters"],["impl Default for SchedulingConstraints"],["impl Default for StorageParameters"],["impl Default for TCPAddress"],["impl Default for TLSAddress"],["impl Default for TLSInfo"],["impl Default for TxnSchedulerParameters"],["impl Default for VRFInfo"],["impl Default for ValidatorSetConstraint"],["impl Default for VerifiedAttestation"],["impl Default for VerifiedEndorsedCapabilityTEE"],["impl Default for VersionInfo"],["impl Default for AnnotatedBlock"],["impl Default for Block"],["impl Default for ComputeResultsHeader"],["impl Default for ExecutorCommitment"],["impl Default for ExecutorCommitmentHeader"],["impl Default for Header"],["impl Default for IncomingMessage"],["impl Default for MessageEvent"],["impl Default for RoundResults"],["impl Default for RoundRoots"],["impl Default for Account"],["impl Default for AddEscrowResult"],["impl Default for AllowanceChangeEvent"],["impl Default for BurnEvent"],["impl Default for CommissionRateBoundStep"],["impl Default for CommissionRateStep"],["impl Default for CommissionSchedule"],["impl Default for DebondingDelegation"],["impl Default for Delegation"],["impl Default for Escrow"],["impl Default for EscrowAccount"],["impl Default for Event"],["impl Default for GeneralAccount"],["impl Default for ReclaimEscrow"],["impl Default for ReclaimEscrowResult"],["impl Default for SharePool"],["impl Default for Slash"],["impl Default for StakeAccumulator"],["impl Default for StakeThreshold"],["impl Default for Transfer"],["impl Default for TransferEvent"],["impl Default for TransferResult"],["impl Default for Withdraw"],["impl Default for WithdrawResult"],["impl Default for Status"],["impl Default for BlockMetadata"],["impl Default for LightBlock"],["impl Default for Proof"],["impl Default for Fee"],["impl Default for Proof"],["impl Default for SignedTransactionWithProof"],["impl Default for TrustRoot"],["impl Default for PostInitState"],["impl Default for Dispatcher"],["impl Default for Builder"],["impl Default for Error"],["impl Default for Frame"],["impl Default for SessionID"],["impl Default for RegisterNotifyOpts"],["impl Default for SubmitTxOpts"],["impl Default for TxResult"],["impl Default for Identity"],["impl Default for LogEntry"],["impl Default for NodePointer"],["impl Default for Prefix"],["impl Default for Root"],["impl Default for GetPrefixesRequest"],["impl Default for GetRequest"],["impl Default for IterateRequest"],["impl Default for Proof"],["impl Default for ProofResponse"],["impl Default for RawProofEntry"],["impl Default for TreeID"],["impl Default for UntrustedInMemoryStorage"],["impl Default for NoopDispatcher"],["impl Default for CoarsenedKey"],["impl Default for ReadWriteSet"],["impl Default for Tag"],["impl Default for TxnBatch"],["impl Default for CheckTxMetadata"],["impl Default for CheckTxResult"],["impl Default for ComputedBatch"],["impl Default for Error"],["impl Default for FeatureScheduleControl"],["impl Default for Features"],["impl Default for HostFetchConsensusEventsResponse"],["impl Default for Message"],["impl Default for RegisterNotifyRuntimeEvent"],["impl Default for RuntimeInfoRequest"],["impl Default for RuntimeInfoResponse"],["impl Default for RuntimeNotifyEvent"]], +"oasis_runtime_sdk":[["impl Default for Authorization"],["impl Default for ReceiptKind"],["impl Default for RewardAction"],["impl Default for FeePolicy"],["impl Default for IdentifierScheme"],["impl Default for Mode"],["impl Default for AuthProof"],["impl Default for CallFormat"],["impl Default for CallResult"],["impl Default for Config"],["impl Default for Signature"],["impl Default for QueryRequest"],["impl Default for FeeManager"],["impl Default for TransactionFee"],["impl Default for GasCosts"],["impl Default for Genesis"],["impl Default for Parameters"],["impl Default for Account"],["impl Default for AccountBalances"],["impl Default for AddressesQuery"],["impl Default for BalancesQuery"],["impl Default for DenominationInfo"],["impl Default for DenominationInfoQuery"],["impl Default for NonceQuery"],["impl Default for Transfer"],["impl Default for GasCosts"],["impl Default for Genesis"],["impl Default for Parameters"],["impl Default for GasCosts"],["impl Default for Genesis"],["impl Default for Parameters"],["impl Default for AccountBalance"],["impl Default for BalanceQuery"],["impl Default for ConsensusAccountQuery"],["impl Default for ConsensusDelegateContext"],["impl Default for ConsensusError"],["impl Default for ConsensusTransferContext"],["impl Default for ConsensusUndelegateContext"],["impl Default for ConsensusWithdrawContext"],["impl Default for Delegate"],["impl Default for DelegationInfo"],["impl Default for DelegationQuery"],["impl Default for DelegationsQuery"],["impl Default for Deposit"],["impl Default for ExtendedDelegationInfo"],["impl Default for Receipt"],["impl Default for TakeReceipt"],["impl Default for Undelegate"],["impl Default for UndelegationInfo"],["impl Default for UndelegationsQuery"],["impl Default for Withdraw"],["impl Default for DynamicMinGasPrice"],["impl Default for GasCosts"],["impl Default for Genesis"],["impl Default for LocalConfig"],["impl Default for Parameters"],["impl Default for CallDataPublicKeyQueryResponse"],["impl Default for ExecuteReadOnlyTxQuery"],["impl Default for ExecuteReadOnlyTxResponse"],["impl Default for Metadata"],["impl Default for Genesis"],["impl Default for Parameters"],["impl Default for EpochRewards"],["impl Default for RewardSchedule"],["impl Default for RewardStep"],["impl Default for AppId"],["impl Default for AppAuthPolicy"],["impl Default for KeyEndorsementInfo"],["impl Default for Genesis"],["impl Default for Parameters"],["impl Default for AppConfig"],["impl Default for AppQuery"],["impl Default for Create"],["impl Default for Register"],["impl Default for Registration"],["impl Default for Remove"],["impl Default for StakeThresholds"],["impl Default for Update"],["impl Default for SenderMeta"],["impl Default for Environment"],["impl Default for Options"],["impl Default for MockKeyManagerClient"],["impl Default for CallOptions"],["impl Default for Mock"],["impl Default for Address"],["impl Default for CallEnvelopeX25519DeoxysII"],["impl Default for ResultEnvelopeX25519DeoxysII"],["impl Default for BaseUnits"],["impl Default for Denomination"],["impl Default for AuthInfo"],["impl Default for Call"],["impl Default for Fee"],["impl Default for FeeProxy"],["impl<'a> Default for DispatchOptions<'a>"]], +"oasis_runtime_sdk_contracts":[["impl Default for GasCosts"],["impl Default for Genesis"],["impl Default for LocalConfig"],["impl Default for Parameters"],["impl Default for CallResult"],["impl Default for CodeStorageQuery"],["impl Default for CodeStorageQueryResult"],["impl Default for ContractEvent"],["impl Default for CustomQuery"],["impl Default for CustomQueryResult"],["impl Default for InstanceQuery"],["impl Default for InstanceRawStorageQueryResult"],["impl Default for InstanceStorageQuery"],["impl Default for InstanceStorageQueryResult"],["impl Default for InstantiateResult"],["impl Default for PublicKeyQueryResult"],["impl Default for UploadResult"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/error/trait.Error.js b/rust/trait.impl/core/error/trait.Error.js new file mode 100644 index 0000000000..e2da02d2c7 --- /dev/null +++ b/rust/trait.impl/core/error/trait.Error.js @@ -0,0 +1,7 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Error for CryptoError"]], +"oasis_contract_sdk_types":[["impl Error for Error"],["impl Error for Error"]], +"oasis_core_runtime":[["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for StateError"],["impl Error for Error"],["impl Error for RpcClientError"],["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for PolicyVerifierError"],["impl Error for ProtocolError"],["impl Error for SyncerError"],["impl Error for Error"]], +"oasis_runtime_sdk":[["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for ParameterValidationError"],["impl Error for Error"],["impl Error for ParameterValidationError"],["impl Error for Error"],["impl Error for Error"],["impl Error for ParameterValidationError"],["impl Error for Error"],["impl Error for ParameterValidationError"],["impl Error for RewardScheduleError"],["impl Error for Error"],["impl Error for Error"],["impl Error for ParameterValidationError"],["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for Error"],["impl Error for TxSimulationFailure"]], +"oasis_runtime_sdk_contracts":[["impl Error for Error"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/fmt/trait.Binary.js b/rust/trait.impl/core/fmt/trait.Binary.js new file mode 100644 index 0000000000..90d4e89f2b --- /dev/null +++ b/rust/trait.impl/core/fmt/trait.Binary.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Binary for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/fmt/trait.Debug.js b/rust/trait.impl/core/fmt/trait.Debug.js new file mode 100644 index 0000000000..9ddc18cd90 --- /dev/null +++ b/rust/trait.impl/core/fmt/trait.Debug.js @@ -0,0 +1,7 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Debug for CryptoError"]], +"oasis_contract_sdk_types":[["impl Debug for Error"],["impl Debug for CallFormat"],["impl Debug for ExecutionResult"],["impl Debug for AccountsQuery"],["impl Debug for AccountsResponse"],["impl Debug for QueryRequest"],["impl Debug for QueryResponse"],["impl Debug for CallResult"],["impl Debug for Message"],["impl Debug for NotifyReply"],["impl Debug for Reply"],["impl Debug for Error"],["impl Debug for Address"],["impl Debug for Event"],["impl Debug for InstantiateResult"],["impl Debug for CodeId"],["impl Debug for ExecutionContext"],["impl Debug for ExecutionOk"],["impl Debug for InstanceId"],["impl Debug for BaseUnits"],["impl Debug for Denomination"]], +"oasis_core_runtime":[["impl Debug for Quote"],["impl Debug for Error"],["impl Debug for Event"],["impl Debug for Vote"],["impl Debug for Error"],["impl Debug for SuiteId"],["impl Debug for Error"],["impl Debug for RuntimeGovernanceModel"],["impl Debug for RuntimeKind"],["impl Debug for SGXAttestation"],["impl Debug for SGXConstraints"],["impl Debug for TEEHardware"],["impl Debug for Error"],["impl Debug for ExecutorCommitmentFailure"],["impl Debug for GovernanceMessage"],["impl Debug for HeaderType"],["impl Debug for Message"],["impl Debug for RegistryMessage"],["impl Debug for StakingMessage"],["impl Debug for CommitteeKind"],["impl Debug for Role"],["impl Debug for EscrowEvent"],["impl Debug for SlashReason"],["impl Debug for ThresholdKind"],["impl Debug for StateError"],["impl Debug for Error"],["impl Debug for RpcClientError"],["impl Debug for Error"],["impl Debug for RAKBinding"],["impl Debug for Error"],["impl Debug for Body"],["impl Debug for Kind"],["impl Debug for Message"],["impl Debug for PeerFeedback"],["impl Debug for TeeType"],["impl Debug for Error"],["impl Debug for PolicyVerifierError"],["impl Debug for ProtocolError"],["impl Debug for LogEntryKind"],["impl Debug for NodeBox"],["impl Debug for RootType"],["impl Debug for SyncerError"],["impl Debug for Body"],["impl Debug for EventKind"],["impl Debug for ExecutionMode"],["impl Debug for HostStorageEndpoint"],["impl Debug for MessageType"],["impl Debug for StorageSyncRequest"],["impl Debug for StorageSyncResponse"],["impl Debug for Hash"],["impl Debug for Nonce"],["impl Debug for MultiSigned"],["impl Debug for PublicKey"],["impl Debug for Signature"],["impl Debug for SignatureBundle"],["impl Debug for Signed"],["impl Debug for PublicKey"],["impl Debug for Namespace"],["impl Debug for Quantity"],["impl Debug for AVR"],["impl Debug for QuotePolicy"],["impl Debug for QuoteBundle"],["impl Debug for QuotePolicy"],["impl Debug for TCBBundle"],["impl Debug for TdAttributes"],["impl Debug for TdReport"],["impl Debug for TdxModulePolicy"],["impl Debug for TdxQuotePolicy"],["impl Debug for EnclaveIdentity"],["impl Debug for MrEnclave"],["impl Debug for MrSigner"],["impl Debug for QuotePolicy"],["impl Debug for VerifiedQuote"],["impl Debug for ProtocolVersions"],["impl Debug for Version"],["impl Debug for Config"],["impl Debug for Storage"],["impl Debug for Address"],["impl Debug for EpochTimeState"],["impl Debug for CancelUpgradeProposal"],["impl Debug for ChangeParametersProposal"],["impl Debug for ConsensusParameterChanges"],["impl Debug for ProposalContent"],["impl Debug for ProposalVote"],["impl Debug for UpgradeProposal"],["impl Debug for Application"],["impl Debug for PolicySGX"],["impl Debug for SignedPolicySGX"],["impl Debug for Status"],["impl Debug for EnclavePolicySGX"],["impl Debug for EncryptedEphemeralSecret"],["impl Debug for EncryptedMasterSecret"],["impl Debug for EncryptedSecret"],["impl Debug for PolicySGX"],["impl Debug for SignedEncryptedEphemeralSecret"],["impl Debug for SignedEncryptedMasterSecret"],["impl Debug for SignedPolicySGX"],["impl Debug for AnyNodeRuntimeAdmissionPolicy"],["impl Debug for Capabilities"],["impl Debug for CapabilityTEE"],["impl Debug for ConsensusAddress"],["impl Debug for ConsensusInfo"],["impl Debug for EndorsedCapabilityTEE"],["impl Debug for EntityWhitelistConfig"],["impl Debug for EntityWhitelistRoleAdmissionPolicy"],["impl Debug for EntityWhitelistRoleConfig"],["impl Debug for EntityWhitelistRuntimeAdmissionPolicy"],["impl Debug for ExecutorParameters"],["impl Debug for MaxNodesConstraint"],["impl Debug for MinPoolSizeConstraint"],["impl Debug for Node"],["impl Debug for NodeRuntime"],["impl Debug for P2PInfo"],["impl Debug for PerRoleAdmissionPolicy"],["impl Debug for RolesMask"],["impl Debug for Runtime"],["impl Debug for RuntimeAdmissionPolicy"],["impl Debug for RuntimeGenesis"],["impl Debug for RuntimeStakingParameters"],["impl Debug for SchedulingConstraints"],["impl Debug for StorageParameters"],["impl Debug for TCPAddress"],["impl Debug for TLSAddress"],["impl Debug for TLSInfo"],["impl Debug for TxnSchedulerParameters"],["impl Debug for VRFInfo"],["impl Debug for ValidatorSetConstraint"],["impl Debug for VerifiedAttestation"],["impl Debug for VerifiedEndorsedCapabilityTEE"],["impl Debug for VersionInfo"],["impl Debug for AnnotatedBlock"],["impl Debug for Block"],["impl Debug for ComputeResultsHeader"],["impl Debug for ExecutorCommitment"],["impl Debug for ExecutorCommitmentHeader"],["impl Debug for Header"],["impl Debug for IncomingMessage"],["impl Debug for MessageEvent"],["impl Debug for RoundResults"],["impl Debug for RoundRoots"],["impl Debug for Account"],["impl Debug for AddEscrowResult"],["impl Debug for AllowanceChangeEvent"],["impl Debug for BurnEvent"],["impl Debug for CommissionRateBoundStep"],["impl Debug for CommissionRateStep"],["impl Debug for CommissionSchedule"],["impl Debug for DebondingDelegation"],["impl Debug for Delegation"],["impl Debug for Escrow"],["impl Debug for EscrowAccount"],["impl Debug for Event"],["impl Debug for GeneralAccount"],["impl Debug for ReclaimEscrow"],["impl Debug for ReclaimEscrowResult"],["impl Debug for SharePool"],["impl Debug for Slash"],["impl Debug for StakeAccumulator"],["impl Debug for StakeThreshold"],["impl Debug for Transfer"],["impl Debug for TransferEvent"],["impl Debug for TransferResult"],["impl Debug for Withdraw"],["impl Debug for WithdrawResult"],["impl Debug for Status"],["impl Debug for BlockMetadata"],["impl Debug for LightBlock"],["impl Debug for Proof"],["impl Debug for LightBlockMeta"],["impl Debug for Fee"],["impl Debug for Proof"],["impl Debug for SignedTransactionWithProof"],["impl Debug for Transaction"],["impl Debug for TrustRoot"],["impl Debug for MethodDescriptor"],["impl Debug for Error"],["impl Debug for Frame"],["impl Debug for Request"],["impl Debug for Response"],["impl Debug for SessionID"],["impl Debug for RegisterNotifyOpts"],["impl Debug for SubmitTxOpts"],["impl Debug for TxResult"],["impl Debug for HostInfo"],["impl Debug for LogEntry"],["impl Debug for NodePointer"],["impl Debug for Prefix"],["impl Debug for Root"],["impl Debug for Tree"],["impl Debug for GetPrefixesRequest"],["impl Debug for GetRequest"],["impl Debug for IterateRequest"],["impl Debug for Proof"],["impl Debug for ProofResponse"],["impl Debug for RawProofEntry"],["impl Debug for TreeID"],["impl Debug for BuildInfo"],["impl Debug for CoarsenedKey"],["impl Debug for ReadWriteSet"],["impl Debug for Tag"],["impl Debug for TxnBatch"],["impl Debug for CheckTxMetadata"],["impl Debug for CheckTxResult"],["impl Debug for ComputedBatch"],["impl Debug for Error"],["impl Debug for FeatureScheduleControl"],["impl Debug for Features"],["impl Debug for HostFetchConsensusEventsRequest"],["impl Debug for HostFetchConsensusEventsResponse"],["impl Debug for Message"],["impl Debug for RegisterNotifyRuntimeEvent"],["impl Debug for RuntimeInfoRequest"],["impl Debug for RuntimeInfoResponse"],["impl Debug for RuntimeNotifyEvent"],["impl Debug for StorageSyncRequestWithEndpoint"],["impl<'a> Debug for Quote<'a>"],["impl<T: Debug> Debug for Versioned<T>"]], +"oasis_runtime_sdk":[["impl Debug for Metadata"],["impl Debug for Error"],["impl Debug for Error"],["impl Debug for PublicKey"],["impl Debug for SignatureType"],["impl Debug for Error"],["impl Debug for Error"],["impl Debug for AuthDecision"],["impl Debug for CallResult"],["impl Debug for Error"],["impl Debug for Error"],["impl Debug for Event"],["impl Debug for ParameterValidationError"],["impl Debug for Error"],["impl Debug for Event"],["impl Debug for ParameterValidationError"],["impl Debug for RootKind"],["impl Debug for Error"],["impl Debug for Event"],["impl Debug for ReceiptKind"],["impl Debug for Error"],["impl Debug for Event"],["impl Debug for ParameterValidationError"],["impl Debug for MethodHandlerKind"],["impl Debug for Error"],["impl Debug for ParameterValidationError"],["impl Debug for RewardAction"],["impl Debug for RewardScheduleError"],["impl Debug for Error"],["impl Debug for Error"],["impl Debug for Event"],["impl Debug for ParameterValidationError"],["impl Debug for AllowedEndorsement"],["impl Debug for FeePolicy"],["impl Debug for IdentifierScheme"],["impl Debug for Error"],["impl Debug for Mode"],["impl Debug for Error"],["impl Debug for Error"],["impl Debug for SignatureAddressSpec"],["impl Debug for Error"],["impl Debug for AddressSpec"],["impl Debug for AuthProof"],["impl Debug for CallFormat"],["impl Debug for CallResult"],["impl Debug for CallerAddress"],["impl Debug for Error"],["impl Debug for Config"],["impl Debug for Signer"],["impl Debug for PublicKey"],["impl Debug for PublicKey"],["impl Debug for PublicKey"],["impl Debug for PublicKey"],["impl Debug for PublicKey"],["impl Debug for Signature"],["impl Debug for DispatchResult"],["impl Debug for QueryRequest"],["impl Debug for EventTag"],["impl Debug for FeeManager"],["impl Debug for TransactionFee"],["impl Debug for GasCosts"],["impl Debug for Genesis"],["impl Debug for Parameters"],["impl Debug for Account"],["impl Debug for AccountBalances"],["impl Debug for AddressesQuery"],["impl Debug for BalancesQuery"],["impl Debug for DenominationInfo"],["impl Debug for DenominationInfoQuery"],["impl Debug for NonceQuery"],["impl Debug for Transfer"],["impl Debug for GasCosts"],["impl Debug for Genesis"],["impl Debug for Parameters"],["impl Debug for RoundRootBody"],["impl Debug for GasCosts"],["impl Debug for Genesis"],["impl Debug for Parameters"],["impl Debug for AccountBalance"],["impl Debug for BalanceQuery"],["impl Debug for ConsensusAccountQuery"],["impl Debug for ConsensusDelegateContext"],["impl Debug for ConsensusError"],["impl Debug for ConsensusTransferContext"],["impl Debug for ConsensusUndelegateContext"],["impl Debug for ConsensusWithdrawContext"],["impl Debug for Delegate"],["impl Debug for DelegationInfo"],["impl Debug for DelegationQuery"],["impl Debug for DelegationsQuery"],["impl Debug for Deposit"],["impl Debug for ExtendedDelegationInfo"],["impl Debug for Receipt"],["impl Debug for TakeReceipt"],["impl Debug for Undelegate"],["impl Debug for UndelegationInfo"],["impl Debug for UndelegationsQuery"],["impl Debug for Withdraw"],["impl Debug for DynamicMinGasPrice"],["impl Debug for GasCosts"],["impl Debug for Genesis"],["impl Debug for LocalConfig"],["impl Debug for Parameters"],["impl Debug for TxSimulationFailure"],["impl Debug for CallDataPublicKeyQueryResponse"],["impl Debug for EstimateGasQuery"],["impl Debug for ExecuteReadOnlyTxQuery"],["impl Debug for ExecuteReadOnlyTxResponse"],["impl Debug for Metadata"],["impl Debug for MethodHandlerInfo"],["impl Debug for ModuleInfo"],["impl Debug for RuntimeInfoResponse"],["impl Debug for Genesis"],["impl Debug for Parameters"],["impl Debug for EpochRewards"],["impl Debug for RewardSchedule"],["impl Debug for RewardStep"],["impl Debug for AppId"],["impl Debug for AppAuthPolicy"],["impl Debug for KeyEndorsementInfo"],["impl Debug for Genesis"],["impl Debug for Parameters"],["impl Debug for AppConfig"],["impl Debug for AppInstanceQuery"],["impl Debug for AppQuery"],["impl Debug for Create"],["impl Debug for Register"],["impl Debug for Registration"],["impl Debug for Remove"],["impl Debug for StakeThresholds"],["impl Debug for Update"],["impl Debug for SenderMeta"],["impl Debug for Environment"],["impl Debug for Options"],["impl Debug for TransactionWithMeta"],["impl Debug for SubcallInfo"],["impl Debug for SubcallResult"],["impl Debug for CallOptions"],["impl Debug for Address"],["impl Debug for CallEnvelopeX25519DeoxysII"],["impl Debug for ResultEnvelopeX25519DeoxysII"],["impl Debug for MessageEventHookInvocation"],["impl Debug for MessageResult"],["impl Debug for BaseUnits"],["impl Debug for Denomination"],["impl Debug for AuthInfo"],["impl Debug for Call"],["impl Debug for Fee"],["impl Debug for FeeProxy"],["impl Debug for SignerInfo"],["impl Debug for Transaction"],["impl Debug for UnverifiedTransaction"]], +"oasis_runtime_sdk_contracts":[["impl Debug for Error"],["impl Debug for Event"],["impl Debug for ABI"],["impl Debug for Policy"],["impl Debug for PublicKeyKind"],["impl Debug for StoreKind"],["impl Debug for GasCosts"],["impl Debug for Genesis"],["impl Debug for LocalConfig"],["impl Debug for Parameters"],["impl Debug for Call"],["impl Debug for CallResult"],["impl Debug for ChangeUpgradePolicy"],["impl Debug for Code"],["impl Debug for CodeQuery"],["impl Debug for CodeStorageQuery"],["impl Debug for CodeStorageQueryResult"],["impl Debug for ContractEvent"],["impl Debug for CustomQuery"],["impl Debug for CustomQueryResult"],["impl Debug for Instance"],["impl Debug for InstanceQuery"],["impl Debug for InstanceRawStorageQuery"],["impl Debug for InstanceRawStorageQueryResult"],["impl Debug for InstanceStorageQuery"],["impl Debug for InstanceStorageQueryResult"],["impl Debug for Instantiate"],["impl Debug for InstantiateResult"],["impl Debug for PublicKeyQuery"],["impl Debug for PublicKeyQueryResult"],["impl Debug for Upgrade"],["impl Debug for Upload"],["impl Debug for UploadResult"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/fmt/trait.Display.js b/rust/trait.impl/core/fmt/trait.Display.js new file mode 100644 index 0000000000..a74597eaba --- /dev/null +++ b/rust/trait.impl/core/fmt/trait.Display.js @@ -0,0 +1,7 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Display for CryptoError"]], +"oasis_contract_sdk_types":[["impl Display for Error"],["impl Display for Error"],["impl Display for BaseUnits"],["impl Display for Denomination"]], +"oasis_core_runtime":[["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for StateError"],["impl Display for Error"],["impl Display for RpcClientError"],["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for PolicyVerifierError"],["impl Display for ProtocolError"],["impl Display for SyncerError"],["impl Display for Hash"],["impl Display for PublicKey"],["impl Display for Signature"],["impl Display for Namespace"],["impl Display for Quantity"],["impl Display for MrEnclave"],["impl Display for MrSigner"],["impl Display for SessionID"],["impl Display for Error"]], +"oasis_runtime_sdk":[["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for ParameterValidationError"],["impl Display for Error"],["impl Display for ParameterValidationError"],["impl Display for Error"],["impl Display for Error"],["impl Display for ParameterValidationError"],["impl Display for Error"],["impl Display for ParameterValidationError"],["impl Display for RewardScheduleError"],["impl Display for Error"],["impl Display for Error"],["impl Display for ParameterValidationError"],["impl Display for Error"],["impl Display for Mode"],["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for Error"],["impl Display for TxSimulationFailure"],["impl Display for AppId"],["impl Display for Address"],["impl Display for BaseUnits"],["impl Display for Denomination"]], +"oasis_runtime_sdk_contracts":[["impl Display for Error"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/fmt/trait.LowerHex.js b/rust/trait.impl/core/fmt/trait.LowerHex.js new file mode 100644 index 0000000000..449d1dd3aa --- /dev/null +++ b/rust/trait.impl/core/fmt/trait.LowerHex.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl LowerHex for Hash"],["impl LowerHex for PublicKey"],["impl LowerHex for Signature"],["impl LowerHex for Namespace"],["impl LowerHex for TdAttributes"],["impl LowerHex for MrEnclave"],["impl LowerHex for MrSigner"],["impl LowerHex for Address"],["impl LowerHex for SessionID"]], +"oasis_runtime_sdk":[["impl LowerHex for AppId"],["impl LowerHex for Address"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/fmt/trait.Octal.js b/rust/trait.impl/core/fmt/trait.Octal.js new file mode 100644 index 0000000000..11df4d9145 --- /dev/null +++ b/rust/trait.impl/core/fmt/trait.Octal.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Octal for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/fmt/trait.UpperHex.js b/rust/trait.impl/core/fmt/trait.UpperHex.js new file mode 100644 index 0000000000..5a95859170 --- /dev/null +++ b/rust/trait.impl/core/fmt/trait.UpperHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl UpperHex for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/hash/trait.Hash.js b/rust/trait.impl/core/hash/trait.Hash.js new file mode 100644 index 0000000000..383323d4b4 --- /dev/null +++ b/rust/trait.impl/core/hash/trait.Hash.js @@ -0,0 +1,5 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Hash for Vote"],["impl Hash for RuntimeGovernanceModel"],["impl Hash for RuntimeKind"],["impl Hash for TEEHardware"],["impl Hash for HeaderType"],["impl Hash for RegistryMessage"],["impl Hash for StakingMessage"],["impl Hash for CommitteeKind"],["impl Hash for Role"],["impl Hash for EscrowEvent"],["impl Hash for SlashReason"],["impl Hash for ThresholdKind"],["impl Hash for Kind"],["impl Hash for RootType"],["impl Hash for HostStorageEndpoint"],["impl Hash for Hash"],["impl Hash for MultiSigned"],["impl Hash for PublicKey"],["impl Hash for Signature"],["impl Hash for SignatureBundle"],["impl Hash for Signed"],["impl Hash for PublicKey"],["impl Hash for Namespace"],["impl Hash for Quantity"],["impl Hash for EnclaveIdentity"],["impl Hash for MrEnclave"],["impl Hash for MrSigner"],["impl Hash for ProtocolVersions"],["impl Hash for Version"],["impl Hash for Address"],["impl Hash for EpochTimeState"],["impl Hash for CancelUpgradeProposal"],["impl Hash for ConsensusParameterChanges"],["impl Hash for ProposalVote"],["impl Hash for UpgradeProposal"],["impl Hash for AnyNodeRuntimeAdmissionPolicy"],["impl Hash for Capabilities"],["impl Hash for CapabilityTEE"],["impl Hash for ConsensusAddress"],["impl Hash for ConsensusInfo"],["impl Hash for EndorsedCapabilityTEE"],["impl Hash for EntityWhitelistConfig"],["impl Hash for EntityWhitelistRoleAdmissionPolicy"],["impl Hash for EntityWhitelistRoleConfig"],["impl Hash for EntityWhitelistRuntimeAdmissionPolicy"],["impl Hash for ExecutorParameters"],["impl Hash for MaxNodesConstraint"],["impl Hash for MinPoolSizeConstraint"],["impl Hash for NodeRuntime"],["impl Hash for P2PInfo"],["impl Hash for PerRoleAdmissionPolicy"],["impl Hash for RolesMask"],["impl Hash for Runtime"],["impl Hash for RuntimeAdmissionPolicy"],["impl Hash for RuntimeGenesis"],["impl Hash for RuntimeStakingParameters"],["impl Hash for SchedulingConstraints"],["impl Hash for StorageParameters"],["impl Hash for TCPAddress"],["impl Hash for TLSAddress"],["impl Hash for TLSInfo"],["impl Hash for TxnSchedulerParameters"],["impl Hash for VRFInfo"],["impl Hash for ValidatorSetConstraint"],["impl Hash for VersionInfo"],["impl Hash for AnnotatedBlock"],["impl Hash for Block"],["impl Hash for ComputeResultsHeader"],["impl Hash for Header"],["impl Hash for IncomingMessage"],["impl Hash for RoundRoots"],["impl Hash for Account"],["impl Hash for AddEscrowResult"],["impl Hash for AllowanceChangeEvent"],["impl Hash for BurnEvent"],["impl Hash for CommissionRateBoundStep"],["impl Hash for CommissionRateStep"],["impl Hash for CommissionSchedule"],["impl Hash for DebondingDelegation"],["impl Hash for Delegation"],["impl Hash for Escrow"],["impl Hash for EscrowAccount"],["impl Hash for Event"],["impl Hash for GeneralAccount"],["impl Hash for ReclaimEscrow"],["impl Hash for ReclaimEscrowResult"],["impl Hash for SharePool"],["impl Hash for Slash"],["impl Hash for StakeAccumulator"],["impl Hash for StakeThreshold"],["impl Hash for Transfer"],["impl Hash for TransferEvent"],["impl Hash for TransferResult"],["impl Hash for Withdraw"],["impl Hash for WithdrawResult"],["impl Hash for SessionID"],["impl Hash for LogEntry"],["impl<T: Hash> Hash for Versioned<T>"]], +"oasis_runtime_sdk":[["impl Hash for PublicKey"],["impl Hash for SignatureType"],["impl Hash for PublicKey"],["impl Hash for PublicKey"],["impl Hash for PublicKey"],["impl Hash for PublicKey"],["impl Hash for PublicKey"],["impl Hash for AppId"],["impl Hash for Address"],["impl Hash for Denomination"]], +"oasis_runtime_sdk_contracts":[["impl Hash for ABI"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/iter/traits/collect/trait.Extend.js b/rust/trait.impl/core/iter/traits/collect/trait.Extend.js new file mode 100644 index 0000000000..58992f6eb3 --- /dev/null +++ b/rust/trait.impl/core/iter/traits/collect/trait.Extend.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Extend<TdAttributes> for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/rust/trait.impl/core/iter/traits/collect/trait.FromIterator.js new file mode 100644 index 0000000000..c3cc20951e --- /dev/null +++ b/rust/trait.impl/core/iter/traits/collect/trait.FromIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl FromIterator<TdAttributes> for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/iter/traits/collect/trait.IntoIterator.js b/rust/trait.impl/core/iter/traits/collect/trait.IntoIterator.js new file mode 100644 index 0000000000..83e2b2239f --- /dev/null +++ b/rust/trait.impl/core/iter/traits/collect/trait.IntoIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl IntoIterator for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/marker/trait.Copy.js b/rust/trait.impl/core/marker/trait.Copy.js new file mode 100644 index 0000000000..ad82965d00 --- /dev/null +++ b/rust/trait.impl/core/marker/trait.Copy.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl Copy for SignatureKind"],["impl Copy for CallFormat"],["impl Copy for NotifyReply"],["impl Copy for StoreKind"],["impl Copy for Address"],["impl Copy for CodeId"],["impl Copy for InstanceId"]], +"oasis_core_runtime":[["impl Copy for Kind"],["impl Copy for PeerFeedback"],["impl Copy for LogEntryKind"],["impl Copy for RootType"],["impl Copy for EventKind"],["impl Copy for HostStorageEndpoint"],["impl Copy for MessageType"],["impl Copy for Hash"],["impl Copy for PublicKey"],["impl Copy for Signature"],["impl Copy for PublicKey"],["impl Copy for Namespace"],["impl Copy for TdAttributes"],["impl Copy for MrEnclave"],["impl Copy for MrSigner"],["impl Copy for Version"],["impl Copy for RolesMask"],["impl Copy for SessionID"],["impl Copy for Root"]], +"oasis_runtime_sdk":[["impl Copy for SignatureType"],["impl Copy for MethodHandlerKind"],["impl Copy for IdentifierScheme"],["impl Copy for Mode"],["impl Copy for CallFormat"],["impl Copy for AppId"],["impl Copy for Address"]], +"oasis_runtime_sdk_contracts":[["impl Copy for ABI"],["impl Copy for Policy"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/marker/trait.Freeze.js b/rust/trait.impl/core/marker/trait.Freeze.js new file mode 100644 index 0000000000..aaf27be482 --- /dev/null +++ b/rust/trait.impl/core/marker/trait.Freeze.js @@ -0,0 +1,8 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Freeze for CryptoError",1,["oasis_contract_sdk::env::CryptoError"]],["impl Freeze for HostRegion",1,["oasis_contract_sdk::memory::HostRegion"]],["impl Freeze for MockContext",1,["oasis_contract_sdk::testing::MockContext"]],["impl Freeze for MockEnv",1,["oasis_contract_sdk::testing::MockEnv"]],["impl Freeze for MockStore",1,["oasis_contract_sdk::testing::MockStore"]],["impl<'a> Freeze for HostRegionRef<'a>",1,["oasis_contract_sdk::memory::HostRegionRef"]]], +"oasis_contract_sdk_storage":[["impl<'key, K, V> Freeze for ConfidentialMap<'key, K, V>",1,["oasis_contract_sdk_storage::map::ConfidentialMap"]],["impl<'key, K, V> Freeze for PublicMap<'key, K, V>",1,["oasis_contract_sdk_storage::map::PublicMap"]],["impl<'key, T> Freeze for ConfidentialCell<'key, T>",1,["oasis_contract_sdk_storage::cell::ConfidentialCell"]],["impl<'key, T> Freeze for PublicCell<'key, T>",1,["oasis_contract_sdk_storage::cell::PublicCell"]],["impl<I> Freeze for Int<I>
where\n <I as Integer>::Encoded: Freeze,
",1,["oasis_contract_sdk_storage::map::Int"]]], +"oasis_contract_sdk_types":[["impl Freeze for Error",1,["oasis_contract_sdk_types::address::Error"]],["impl Freeze for SignatureKind",1,["oasis_contract_sdk_types::crypto::SignatureKind"]],["impl Freeze for CallFormat",1,["oasis_contract_sdk_types::CallFormat"]],["impl Freeze for ExecutionResult",1,["oasis_contract_sdk_types::ExecutionResult"]],["impl Freeze for AccountsQuery",1,["oasis_contract_sdk_types::env::AccountsQuery"]],["impl Freeze for AccountsResponse",1,["oasis_contract_sdk_types::env::AccountsResponse"]],["impl Freeze for QueryRequest",1,["oasis_contract_sdk_types::env::QueryRequest"]],["impl Freeze for QueryResponse",1,["oasis_contract_sdk_types::env::QueryResponse"]],["impl Freeze for CallResult",1,["oasis_contract_sdk_types::message::CallResult"]],["impl Freeze for Message",1,["oasis_contract_sdk_types::message::Message"]],["impl Freeze for NotifyReply",1,["oasis_contract_sdk_types::message::NotifyReply"]],["impl Freeze for Reply",1,["oasis_contract_sdk_types::message::Reply"]],["impl Freeze for StoreKind",1,["oasis_contract_sdk_types::storage::StoreKind"]],["impl Freeze for Error",1,["oasis_contract_sdk_types::token::Error"]],["impl Freeze for Address",1,["oasis_contract_sdk_types::address::Address"]],["impl Freeze for Event",1,["oasis_contract_sdk_types::event::Event"]],["impl Freeze for InstantiateResult",1,["oasis_contract_sdk_types::modules::contracts::InstantiateResult"]],["impl Freeze for CodeId",1,["oasis_contract_sdk_types::CodeId"]],["impl Freeze for ExecutionContext",1,["oasis_contract_sdk_types::ExecutionContext"]],["impl Freeze for ExecutionOk",1,["oasis_contract_sdk_types::ExecutionOk"]],["impl Freeze for InstanceId",1,["oasis_contract_sdk_types::InstanceId"]],["impl Freeze for BaseUnits",1,["oasis_contract_sdk_types::token::BaseUnits"]],["impl Freeze for Denomination",1,["oasis_contract_sdk_types::token::Denomination"]]], +"oasis_core_runtime":[["impl !Freeze for Cache",1,["oasis_core_runtime::cache::Cache"]],["impl !Freeze for ConsensusState",1,["oasis_core_runtime::consensus::state::ConsensusState"]],["impl !Freeze for Dispatcher",1,["oasis_core_runtime::dispatcher::Dispatcher"]],["impl !Freeze for RpcClient",1,["oasis_core_runtime::enclave_rpc::client::RpcClient"]],["impl !Freeze for Demux",1,["oasis_core_runtime::enclave_rpc::demux::Demux"]],["impl !Freeze for Identity",1,["oasis_core_runtime::identity::Identity"]],["impl !Freeze for Protocol",1,["oasis_core_runtime::protocol::Protocol"]],["impl !Freeze for Tree",1,["oasis_core_runtime::storage::mkvs::tree::Tree"]],["impl !Freeze for UntrustedInMemoryStorage",1,["oasis_core_runtime::storage::UntrustedInMemoryStorage"]],["impl !Freeze for Tree",1,["oasis_core_runtime::transaction::tree::Tree"]],["impl Freeze for Quote",1,["oasis_core_runtime::common::sgx::Quote"]],["impl Freeze for Error",1,["oasis_core_runtime::common::sgx::pcs::Error"]],["impl Freeze for Event",1,["oasis_core_runtime::consensus::Event"]],["impl Freeze for Vote",1,["oasis_core_runtime::consensus::governance::Vote"]],["impl Freeze for Error",1,["oasis_core_runtime::consensus::keymanager::churp::Error"]],["impl Freeze for SuiteId",1,["oasis_core_runtime::consensus::keymanager::churp::SuiteId"]],["impl Freeze for Error",1,["oasis_core_runtime::consensus::keymanager::Error"]],["impl Freeze for RuntimeGovernanceModel",1,["oasis_core_runtime::consensus::registry::RuntimeGovernanceModel"]],["impl Freeze for RuntimeKind",1,["oasis_core_runtime::consensus::registry::RuntimeKind"]],["impl Freeze for SGXAttestation",1,["oasis_core_runtime::consensus::registry::SGXAttestation"]],["impl Freeze for SGXConstraints",1,["oasis_core_runtime::consensus::registry::SGXConstraints"]],["impl Freeze for TEEHardware",1,["oasis_core_runtime::consensus::registry::TEEHardware"]],["impl Freeze for Error",1,["oasis_core_runtime::consensus::roothash::Error"]],["impl Freeze for ExecutorCommitmentFailure",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentFailure"]],["impl Freeze for GovernanceMessage",1,["oasis_core_runtime::consensus::roothash::message::GovernanceMessage"]],["impl Freeze for HeaderType",1,["oasis_core_runtime::consensus::roothash::block::HeaderType"]],["impl Freeze for Message",1,["oasis_core_runtime::consensus::roothash::message::Message"]],["impl Freeze for RegistryMessage",1,["oasis_core_runtime::consensus::roothash::message::RegistryMessage"]],["impl Freeze for StakingMessage",1,["oasis_core_runtime::consensus::roothash::message::StakingMessage"]],["impl Freeze for CommitteeKind",1,["oasis_core_runtime::consensus::scheduler::CommitteeKind"]],["impl Freeze for Role",1,["oasis_core_runtime::consensus::scheduler::Role"]],["impl Freeze for EscrowEvent",1,["oasis_core_runtime::consensus::staking::EscrowEvent"]],["impl Freeze for SlashReason",1,["oasis_core_runtime::consensus::staking::SlashReason"]],["impl Freeze for ThresholdKind",1,["oasis_core_runtime::consensus::staking::ThresholdKind"]],["impl Freeze for StateError",1,["oasis_core_runtime::consensus::state::StateError"]],["impl Freeze for Error",1,["oasis_core_runtime::consensus::verifier::Error"]],["impl Freeze for RpcClientError",1,["oasis_core_runtime::enclave_rpc::client::RpcClientError"]],["impl Freeze for Error",1,["oasis_core_runtime::enclave_rpc::demux::Error"]],["impl Freeze for RAKBinding",1,["oasis_core_runtime::enclave_rpc::session::RAKBinding"]],["impl Freeze for Error",1,["oasis_core_runtime::enclave_rpc::sessions::Error"]],["impl Freeze for Body",1,["oasis_core_runtime::enclave_rpc::types::Body"]],["impl Freeze for Kind",1,["oasis_core_runtime::enclave_rpc::types::Kind"]],["impl Freeze for Message",1,["oasis_core_runtime::enclave_rpc::types::Message"]],["impl Freeze for PeerFeedback",1,["oasis_core_runtime::enclave_rpc::types::PeerFeedback"]],["impl Freeze for TeeType",1,["oasis_core_runtime::TeeType"]],["impl Freeze for Error",1,["oasis_core_runtime::host::Error"]],["impl Freeze for PolicyVerifierError",1,["oasis_core_runtime::policy::PolicyVerifierError"]],["impl Freeze for ProtocolError",1,["oasis_core_runtime::protocol::ProtocolError"]],["impl Freeze for Stream",1,["oasis_core_runtime::protocol::Stream"]],["impl Freeze for LogEntryKind",1,["oasis_core_runtime::storage::mkvs::LogEntryKind"]],["impl Freeze for NodeBox",1,["oasis_core_runtime::storage::mkvs::tree::node::NodeBox"]],["impl Freeze for RootType",1,["oasis_core_runtime::storage::mkvs::tree::node::RootType"]],["impl Freeze for SyncerError",1,["oasis_core_runtime::storage::mkvs::sync::errors::SyncerError"]],["impl Freeze for Body",1,["oasis_core_runtime::types::Body"]],["impl Freeze for EventKind",1,["oasis_core_runtime::types::EventKind"]],["impl Freeze for ExecutionMode",1,["oasis_core_runtime::types::ExecutionMode"]],["impl Freeze for HostStorageEndpoint",1,["oasis_core_runtime::types::HostStorageEndpoint"]],["impl Freeze for MessageType",1,["oasis_core_runtime::types::MessageType"]],["impl Freeze for StorageSyncRequest",1,["oasis_core_runtime::types::StorageSyncRequest"]],["impl Freeze for StorageSyncResponse",1,["oasis_core_runtime::types::StorageSyncResponse"]],["impl Freeze for NoopApp",1,["oasis_core_runtime::app::NoopApp"]],["impl Freeze for CacheSet",1,["oasis_core_runtime::cache::CacheSet"]],["impl Freeze for Hash",1,["oasis_core_runtime::common::crypto::hash::Hash"]],["impl Freeze for Nonce",1,["oasis_core_runtime::common::crypto::mrae::nonce::Nonce"]],["impl Freeze for MultiSigned",1,["oasis_core_runtime::common::crypto::signature::MultiSigned"]],["impl Freeze for PrivateKey",1,["oasis_core_runtime::common::crypto::signature::PrivateKey"]],["impl Freeze for PublicKey",1,["oasis_core_runtime::common::crypto::signature::PublicKey"]],["impl Freeze for Signature",1,["oasis_core_runtime::common::crypto::signature::Signature"]],["impl Freeze for SignatureBundle",1,["oasis_core_runtime::common::crypto::signature::SignatureBundle"]],["impl Freeze for Signed",1,["oasis_core_runtime::common::crypto::signature::Signed"]],["impl Freeze for PrivateKey",1,["oasis_core_runtime::common::crypto::x25519::PrivateKey"]],["impl Freeze for PublicKey",1,["oasis_core_runtime::common::crypto::x25519::PublicKey"]],["impl Freeze for Namespace",1,["oasis_core_runtime::common::namespace::Namespace"]],["impl Freeze for AbortOnPanic",1,["oasis_core_runtime::common::panic::AbortOnPanic"]],["impl Freeze for Quantity",1,["oasis_core_runtime::common::quantity::Quantity"]],["impl Freeze for AVR",1,["oasis_core_runtime::common::sgx::ias::AVR"]],["impl Freeze for QuotePolicy",1,["oasis_core_runtime::common::sgx::ias::QuotePolicy"]],["impl Freeze for QuoteBundle",1,["oasis_core_runtime::common::sgx::pcs::quote::QuoteBundle"]],["impl Freeze for QuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::QuotePolicy"]],["impl Freeze for TCBBundle",1,["oasis_core_runtime::common::sgx::pcs::tcb::TCBBundle"]],["impl Freeze for TdAttributes",1,["oasis_core_runtime::common::sgx::pcs::report::TdAttributes"]],["impl Freeze for TdReport",1,["oasis_core_runtime::common::sgx::pcs::report::TdReport"]],["impl Freeze for TdxModulePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxModulePolicy"]],["impl Freeze for TdxQuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxQuotePolicy"]],["impl Freeze for EnclaveIdentity",1,["oasis_core_runtime::common::sgx::EnclaveIdentity"]],["impl Freeze for MrEnclave",1,["oasis_core_runtime::common::sgx::MrEnclave"]],["impl Freeze for MrSigner",1,["oasis_core_runtime::common::sgx::MrSigner"]],["impl Freeze for QuotePolicy",1,["oasis_core_runtime::common::sgx::QuotePolicy"]],["impl Freeze for VerifiedQuote",1,["oasis_core_runtime::common::sgx::VerifiedQuote"]],["impl Freeze for ProtocolVersions",1,["oasis_core_runtime::common::version::ProtocolVersions"]],["impl Freeze for Version",1,["oasis_core_runtime::common::version::Version"]],["impl Freeze for Config",1,["oasis_core_runtime::config::Config"]],["impl Freeze for Storage",1,["oasis_core_runtime::config::Storage"]],["impl Freeze for Address",1,["oasis_core_runtime::consensus::address::Address"]],["impl Freeze for COMMON_POOL_ADDRESS",1,["oasis_core_runtime::consensus::address::COMMON_POOL_ADDRESS"]],["impl Freeze for FEE_ACC_ADDRESS",1,["oasis_core_runtime::consensus::address::FEE_ACC_ADDRESS"]],["impl Freeze for GOVERNANCE_DEPOSITS_ADDRESS",1,["oasis_core_runtime::consensus::address::GOVERNANCE_DEPOSITS_ADDRESS"]],["impl Freeze for EpochTimeState",1,["oasis_core_runtime::consensus::beacon::EpochTimeState"]],["impl Freeze for CancelUpgradeProposal",1,["oasis_core_runtime::consensus::governance::CancelUpgradeProposal"]],["impl Freeze for ChangeParametersProposal",1,["oasis_core_runtime::consensus::governance::ChangeParametersProposal"]],["impl Freeze for ConsensusParameterChanges",1,["oasis_core_runtime::consensus::governance::ConsensusParameterChanges"]],["impl Freeze for ProposalContent",1,["oasis_core_runtime::consensus::governance::ProposalContent"]],["impl Freeze for ProposalVote",1,["oasis_core_runtime::consensus::governance::ProposalVote"]],["impl Freeze for UpgradeProposal",1,["oasis_core_runtime::consensus::governance::UpgradeProposal"]],["impl Freeze for Application",1,["oasis_core_runtime::consensus::keymanager::churp::Application"]],["impl Freeze for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::PolicySGX"]],["impl Freeze for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::SignedPolicySGX"]],["impl Freeze for Status",1,["oasis_core_runtime::consensus::keymanager::churp::Status"]],["impl Freeze for EnclavePolicySGX",1,["oasis_core_runtime::consensus::keymanager::EnclavePolicySGX"]],["impl Freeze for EncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedEphemeralSecret"]],["impl Freeze for EncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedMasterSecret"]],["impl Freeze for EncryptedSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedSecret"]],["impl Freeze for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::PolicySGX"]],["impl Freeze for SignedEncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedEphemeralSecret"]],["impl Freeze for SignedEncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedMasterSecret"]],["impl Freeze for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::SignedPolicySGX"]],["impl Freeze for AnyNodeRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::AnyNodeRuntimeAdmissionPolicy"]],["impl Freeze for Capabilities",1,["oasis_core_runtime::consensus::registry::Capabilities"]],["impl Freeze for CapabilityTEE",1,["oasis_core_runtime::consensus::registry::CapabilityTEE"]],["impl Freeze for ConsensusAddress",1,["oasis_core_runtime::consensus::registry::ConsensusAddress"]],["impl Freeze for ConsensusInfo",1,["oasis_core_runtime::consensus::registry::ConsensusInfo"]],["impl Freeze for EndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::EndorsedCapabilityTEE"]],["impl Freeze for EntityWhitelistConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistConfig"]],["impl Freeze for EntityWhitelistRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleAdmissionPolicy"]],["impl Freeze for EntityWhitelistRoleConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleConfig"]],["impl Freeze for EntityWhitelistRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRuntimeAdmissionPolicy"]],["impl Freeze for ExecutorParameters",1,["oasis_core_runtime::consensus::registry::ExecutorParameters"]],["impl Freeze for MaxNodesConstraint",1,["oasis_core_runtime::consensus::registry::MaxNodesConstraint"]],["impl Freeze for MinPoolSizeConstraint",1,["oasis_core_runtime::consensus::registry::MinPoolSizeConstraint"]],["impl Freeze for Node",1,["oasis_core_runtime::consensus::registry::Node"]],["impl Freeze for NodeRuntime",1,["oasis_core_runtime::consensus::registry::NodeRuntime"]],["impl Freeze for P2PInfo",1,["oasis_core_runtime::consensus::registry::P2PInfo"]],["impl Freeze for PerRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::PerRoleAdmissionPolicy"]],["impl Freeze for RolesMask",1,["oasis_core_runtime::consensus::registry::RolesMask"]],["impl Freeze for Runtime",1,["oasis_core_runtime::consensus::registry::Runtime"]],["impl Freeze for RuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::RuntimeAdmissionPolicy"]],["impl Freeze for RuntimeGenesis",1,["oasis_core_runtime::consensus::registry::RuntimeGenesis"]],["impl Freeze for RuntimeStakingParameters",1,["oasis_core_runtime::consensus::registry::RuntimeStakingParameters"]],["impl Freeze for SchedulingConstraints",1,["oasis_core_runtime::consensus::registry::SchedulingConstraints"]],["impl Freeze for StorageParameters",1,["oasis_core_runtime::consensus::registry::StorageParameters"]],["impl Freeze for TCPAddress",1,["oasis_core_runtime::consensus::registry::TCPAddress"]],["impl Freeze for TLSAddress",1,["oasis_core_runtime::consensus::registry::TLSAddress"]],["impl Freeze for TLSInfo",1,["oasis_core_runtime::consensus::registry::TLSInfo"]],["impl Freeze for TxnSchedulerParameters",1,["oasis_core_runtime::consensus::registry::TxnSchedulerParameters"]],["impl Freeze for VRFInfo",1,["oasis_core_runtime::consensus::registry::VRFInfo"]],["impl Freeze for ValidatorSetConstraint",1,["oasis_core_runtime::consensus::registry::ValidatorSetConstraint"]],["impl Freeze for VerifiedAttestation",1,["oasis_core_runtime::consensus::registry::VerifiedAttestation"]],["impl Freeze for VerifiedEndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::VerifiedEndorsedCapabilityTEE"]],["impl Freeze for VersionInfo",1,["oasis_core_runtime::consensus::registry::VersionInfo"]],["impl Freeze for AnnotatedBlock",1,["oasis_core_runtime::consensus::roothash::AnnotatedBlock"]],["impl Freeze for Block",1,["oasis_core_runtime::consensus::roothash::block::Block"]],["impl Freeze for ComputeResultsHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ComputeResultsHeader"]],["impl Freeze for ExecutorCommitment",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitment"]],["impl Freeze for ExecutorCommitmentHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentHeader"]],["impl Freeze for Header",1,["oasis_core_runtime::consensus::roothash::block::Header"]],["impl Freeze for IncomingMessage",1,["oasis_core_runtime::consensus::roothash::message::IncomingMessage"]],["impl Freeze for MessageEvent",1,["oasis_core_runtime::consensus::roothash::MessageEvent"]],["impl Freeze for Pool",1,["oasis_core_runtime::consensus::roothash::commitment::pool::Pool"]],["impl Freeze for RoundResults",1,["oasis_core_runtime::consensus::roothash::RoundResults"]],["impl Freeze for RoundRoots",1,["oasis_core_runtime::consensus::roothash::RoundRoots"]],["impl Freeze for Committee",1,["oasis_core_runtime::consensus::scheduler::Committee"]],["impl Freeze for CommitteeNode",1,["oasis_core_runtime::consensus::scheduler::CommitteeNode"]],["impl Freeze for Account",1,["oasis_core_runtime::consensus::staking::Account"]],["impl Freeze for AddEscrowResult",1,["oasis_core_runtime::consensus::staking::AddEscrowResult"]],["impl Freeze for AllowanceChangeEvent",1,["oasis_core_runtime::consensus::staking::AllowanceChangeEvent"]],["impl Freeze for BurnEvent",1,["oasis_core_runtime::consensus::staking::BurnEvent"]],["impl Freeze for CommissionRateBoundStep",1,["oasis_core_runtime::consensus::staking::CommissionRateBoundStep"]],["impl Freeze for CommissionRateStep",1,["oasis_core_runtime::consensus::staking::CommissionRateStep"]],["impl Freeze for CommissionSchedule",1,["oasis_core_runtime::consensus::staking::CommissionSchedule"]],["impl Freeze for DebondingDelegation",1,["oasis_core_runtime::consensus::staking::DebondingDelegation"]],["impl Freeze for Delegation",1,["oasis_core_runtime::consensus::staking::Delegation"]],["impl Freeze for Escrow",1,["oasis_core_runtime::consensus::staking::Escrow"]],["impl Freeze for EscrowAccount",1,["oasis_core_runtime::consensus::staking::EscrowAccount"]],["impl Freeze for Event",1,["oasis_core_runtime::consensus::staking::Event"]],["impl Freeze for GeneralAccount",1,["oasis_core_runtime::consensus::staking::GeneralAccount"]],["impl Freeze for ReclaimEscrow",1,["oasis_core_runtime::consensus::staking::ReclaimEscrow"]],["impl Freeze for ReclaimEscrowResult",1,["oasis_core_runtime::consensus::staking::ReclaimEscrowResult"]],["impl Freeze for SharePool",1,["oasis_core_runtime::consensus::staking::SharePool"]],["impl Freeze for Slash",1,["oasis_core_runtime::consensus::staking::Slash"]],["impl Freeze for StakeAccumulator",1,["oasis_core_runtime::consensus::staking::StakeAccumulator"]],["impl Freeze for StakeThreshold",1,["oasis_core_runtime::consensus::staking::StakeThreshold"]],["impl Freeze for Transfer",1,["oasis_core_runtime::consensus::staking::Transfer"]],["impl Freeze for TransferEvent",1,["oasis_core_runtime::consensus::staking::TransferEvent"]],["impl Freeze for TransferResult",1,["oasis_core_runtime::consensus::staking::TransferResult"]],["impl Freeze for Withdraw",1,["oasis_core_runtime::consensus::staking::Withdraw"]],["impl Freeze for WithdrawResult",1,["oasis_core_runtime::consensus::staking::WithdrawResult"]],["impl Freeze for MutableState",1,["oasis_core_runtime::consensus::state::beacon::MutableState"]],["impl Freeze for Status",1,["oasis_core_runtime::consensus::state::keymanager::Status"]],["impl Freeze for BlockMetadata",1,["oasis_core_runtime::consensus::BlockMetadata"]],["impl Freeze for LightBlock",1,["oasis_core_runtime::consensus::LightBlock"]],["impl Freeze for Proof",1,["oasis_core_runtime::consensus::tendermint::merkle::Proof"]],["impl Freeze for LightBlockMeta",1,["oasis_core_runtime::consensus::tendermint::LightBlockMeta"]],["impl Freeze for NopVerifier",1,["oasis_core_runtime::consensus::tendermint::verifier::noop::NopVerifier"]],["impl Freeze for Verifier",1,["oasis_core_runtime::consensus::tendermint::verifier::Verifier"]],["impl Freeze for Fee",1,["oasis_core_runtime::consensus::transaction::Fee"]],["impl Freeze for Proof",1,["oasis_core_runtime::consensus::transaction::Proof"]],["impl Freeze for SignedTransactionWithProof",1,["oasis_core_runtime::consensus::transaction::SignedTransactionWithProof"]],["impl Freeze for Transaction",1,["oasis_core_runtime::consensus::transaction::Transaction"]],["impl Freeze for TrustRoot",1,["oasis_core_runtime::consensus::verifier::TrustRoot"]],["impl Freeze for PostInitState",1,["oasis_core_runtime::dispatcher::PostInitState"]],["impl Freeze for Context",1,["oasis_core_runtime::enclave_rpc::context::Context"]],["impl Freeze for Dispatcher",1,["oasis_core_runtime::enclave_rpc::dispatcher::Dispatcher"]],["impl Freeze for Method",1,["oasis_core_runtime::enclave_rpc::dispatcher::Method"]],["impl Freeze for MethodDescriptor",1,["oasis_core_runtime::enclave_rpc::dispatcher::MethodDescriptor"]],["impl Freeze for Builder",1,["oasis_core_runtime::enclave_rpc::session::Builder"]],["impl Freeze for Session",1,["oasis_core_runtime::enclave_rpc::session::Session"]],["impl Freeze for SessionInfo",1,["oasis_core_runtime::enclave_rpc::session::SessionInfo"]],["impl Freeze for Error",1,["oasis_core_runtime::enclave_rpc::types::Error"]],["impl Freeze for Frame",1,["oasis_core_runtime::enclave_rpc::types::Frame"]],["impl Freeze for Request",1,["oasis_core_runtime::enclave_rpc::types::Request"]],["impl Freeze for Response",1,["oasis_core_runtime::enclave_rpc::types::Response"]],["impl Freeze for SessionID",1,["oasis_core_runtime::enclave_rpc::types::SessionID"]],["impl Freeze for RegisterNotifyOpts",1,["oasis_core_runtime::host::RegisterNotifyOpts"]],["impl Freeze for SubmitTxOpts",1,["oasis_core_runtime::host::SubmitTxOpts"]],["impl Freeze for TxResult",1,["oasis_core_runtime::host::TxResult"]],["impl Freeze for PolicyVerifier",1,["oasis_core_runtime::policy::PolicyVerifier"]],["impl Freeze for HostInfo",1,["oasis_core_runtime::protocol::HostInfo"]],["impl Freeze for ProtocolUntrustedLocalStorage",1,["oasis_core_runtime::protocol::ProtocolUntrustedLocalStorage"]],["impl Freeze for LogEntry",1,["oasis_core_runtime::storage::mkvs::LogEntry"]],["impl Freeze for NodePointer",1,["oasis_core_runtime::storage::mkvs::tree::node::NodePointer"]],["impl Freeze for Prefix",1,["oasis_core_runtime::storage::mkvs::Prefix"]],["impl Freeze for Root",1,["oasis_core_runtime::storage::mkvs::tree::node::Root"]],["impl Freeze for GetPrefixesRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetPrefixesRequest"]],["impl Freeze for GetRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetRequest"]],["impl Freeze for HostReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::host::HostReadSyncer"]],["impl Freeze for IterateRequest",1,["oasis_core_runtime::storage::mkvs::sync::IterateRequest"]],["impl Freeze for NoopReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::noop::NoopReadSyncer"]],["impl Freeze for Proof",1,["oasis_core_runtime::storage::mkvs::sync::proof::Proof"]],["impl Freeze for ProofBuilder",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofBuilder"]],["impl Freeze for ProofResponse",1,["oasis_core_runtime::storage::mkvs::sync::ProofResponse"]],["impl Freeze for ProofVerifier",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofVerifier"]],["impl Freeze for RawProofEntry",1,["oasis_core_runtime::storage::mkvs::sync::proof::RawProofEntry"]],["impl Freeze for StatsCollector",1,["oasis_core_runtime::storage::mkvs::sync::stats::StatsCollector"]],["impl Freeze for TreeID",1,["oasis_core_runtime::storage::mkvs::sync::TreeID"]],["impl Freeze for BUILD_INFO",1,["oasis_core_runtime::BUILD_INFO"]],["impl Freeze for BuildInfo",1,["oasis_core_runtime::BuildInfo"]],["impl Freeze for ExecuteBatchResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteBatchResult"]],["impl Freeze for ExecuteTxResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteTxResult"]],["impl Freeze for NoopDispatcher",1,["oasis_core_runtime::transaction::dispatcher::NoopDispatcher"]],["impl Freeze for CoarsenedKey",1,["oasis_core_runtime::transaction::rwset::CoarsenedKey"]],["impl Freeze for ReadWriteSet",1,["oasis_core_runtime::transaction::rwset::ReadWriteSet"]],["impl Freeze for Tag",1,["oasis_core_runtime::transaction::tags::Tag"]],["impl Freeze for TxnBatch",1,["oasis_core_runtime::transaction::types::TxnBatch"]],["impl Freeze for CheckTxMetadata",1,["oasis_core_runtime::types::CheckTxMetadata"]],["impl Freeze for CheckTxResult",1,["oasis_core_runtime::types::CheckTxResult"]],["impl Freeze for ComputedBatch",1,["oasis_core_runtime::types::ComputedBatch"]],["impl Freeze for Error",1,["oasis_core_runtime::types::Error"]],["impl Freeze for FeatureScheduleControl",1,["oasis_core_runtime::types::FeatureScheduleControl"]],["impl Freeze for Features",1,["oasis_core_runtime::types::Features"]],["impl Freeze for HostFetchConsensusEventsRequest",1,["oasis_core_runtime::types::HostFetchConsensusEventsRequest"]],["impl Freeze for HostFetchConsensusEventsResponse",1,["oasis_core_runtime::types::HostFetchConsensusEventsResponse"]],["impl Freeze for Message",1,["oasis_core_runtime::types::Message"]],["impl Freeze for RegisterNotifyRuntimeEvent",1,["oasis_core_runtime::types::RegisterNotifyRuntimeEvent"]],["impl Freeze for RuntimeInfoRequest",1,["oasis_core_runtime::types::RuntimeInfoRequest"]],["impl Freeze for RuntimeInfoResponse",1,["oasis_core_runtime::types::RuntimeInfoResponse"]],["impl Freeze for RuntimeNotifyEvent",1,["oasis_core_runtime::types::RuntimeNotifyEvent"]],["impl Freeze for StorageSyncRequestWithEndpoint",1,["oasis_core_runtime::types::StorageSyncRequestWithEndpoint"]],["impl<'a> !Freeze for Context<'a>",1,["oasis_core_runtime::transaction::context::Context"]],["impl<'a> Freeze for Quote<'a>",1,["oasis_core_runtime::common::sgx::pcs::quote::Quote"]],["impl<'a> Freeze for PreInitState<'a>",1,["oasis_core_runtime::dispatcher::PreInitState"]],["impl<'a, T> Freeze for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::beacon::ImmutableState"]],["impl<'a, T> Freeze for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::keymanager::churp::ImmutableState"]],["impl<'a, T> Freeze for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::keymanager::ImmutableState"]],["impl<'a, T> Freeze for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::registry::ImmutableState"]],["impl<'a, T> Freeze for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::roothash::ImmutableState"]],["impl<'a, T> Freeze for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::staking::ImmutableState"]],["impl<'a, T> Freeze for Response<'a, T>
where\n T: Freeze,
",1,["oasis_core_runtime::enclave_rpc::client::Response"]],["impl<PeerID> Freeze for MultiplexedSession<PeerID>
where\n PeerID: Freeze,
",1,["oasis_core_runtime::enclave_rpc::sessions::MultiplexedSession"]],["impl<PeerID> Freeze for SessionMeta<PeerID>
where\n PeerID: Freeze,
",1,["oasis_core_runtime::enclave_rpc::sessions::SessionMeta"]],["impl<PeerID> Freeze for Sessions<PeerID>",1,["oasis_core_runtime::enclave_rpc::sessions::Sessions"]],["impl<T> Freeze for Versioned<T>
where\n T: Freeze,
",1,["oasis_core_runtime::common::versioned::Versioned"]],["impl<T> Freeze for OverlayTree<T>
where\n T: Freeze,
",1,["oasis_core_runtime::storage::mkvs::tree::overlay::OverlayTree"]]], +"oasis_runtime_sdk":[["impl !Freeze for RootRng",1,["oasis_runtime_sdk::crypto::random::RootRng"]],["impl !Freeze for State",1,["oasis_runtime_sdk::state::State"]],["impl !Freeze for HostStore",1,["oasis_runtime_sdk::storage::host::HostStore"]],["impl !Freeze for MockKeyManagerClient",1,["oasis_runtime_sdk::testing::keymanager::MockKeyManagerClient"]],["impl !Freeze for Mock",1,["oasis_runtime_sdk::testing::mock::Mock"]],["impl Freeze for Metadata",1,["oasis_runtime_sdk::callformat::Metadata"]],["impl Freeze for Error",1,["oasis_runtime_sdk::crypto::multisig::Error"]],["impl Freeze for Error",1,["oasis_runtime_sdk::crypto::signature::Error"]],["impl Freeze for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::MemorySigner"]],["impl Freeze for PublicKey",1,["oasis_runtime_sdk::crypto::signature::PublicKey"]],["impl Freeze for SignatureType",1,["oasis_runtime_sdk::crypto::signature::SignatureType"]],["impl Freeze for Error",1,["oasis_runtime_sdk::dispatcher::Error"]],["impl Freeze for Error",1,["oasis_runtime_sdk::history::Error"]],["impl Freeze for AuthDecision",1,["oasis_runtime_sdk::module::AuthDecision"]],["impl Freeze for CallResult",1,["oasis_runtime_sdk::module::CallResult"]],["impl Freeze for Error",1,["oasis_runtime_sdk::modules::access::Error"]],["impl Freeze for Authorization",1,["oasis_runtime_sdk::modules::access::types::Authorization"]],["impl Freeze for MethodAuthorization",1,["oasis_runtime_sdk::modules::access::types::MethodAuthorization"]],["impl Freeze for Error",1,["oasis_runtime_sdk::modules::accounts::Error"]],["impl Freeze for Event",1,["oasis_runtime_sdk::modules::accounts::Event"]],["impl Freeze for ParameterValidationError",1,["oasis_runtime_sdk::modules::accounts::ParameterValidationError"]],["impl Freeze for Error",1,["oasis_runtime_sdk::modules::consensus::Error"]],["impl Freeze for Event",1,["oasis_runtime_sdk::modules::consensus::Event"]],["impl Freeze for ParameterValidationError",1,["oasis_runtime_sdk::modules::consensus::ParameterValidationError"]],["impl Freeze for RootKind",1,["oasis_runtime_sdk::modules::consensus::types::RootKind"]],["impl Freeze for Error",1,["oasis_runtime_sdk::modules::consensus_accounts::Error"]],["impl Freeze for Event",1,["oasis_runtime_sdk::modules::consensus_accounts::Event"]],["impl Freeze for ReceiptKind",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ReceiptKind"]],["impl Freeze for Error",1,["oasis_runtime_sdk::modules::core::Error"]],["impl Freeze for Event",1,["oasis_runtime_sdk::modules::core::Event"]],["impl Freeze for ParameterValidationError",1,["oasis_runtime_sdk::modules::core::ParameterValidationError"]],["impl Freeze for MethodHandlerKind",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerKind"]],["impl Freeze for Error",1,["oasis_runtime_sdk::modules::rewards::Error"]],["impl Freeze for ParameterValidationError",1,["oasis_runtime_sdk::modules::rewards::ParameterValidationError"]],["impl Freeze for RewardAction",1,["oasis_runtime_sdk::modules::rewards::types::RewardAction"]],["impl Freeze for RewardScheduleError",1,["oasis_runtime_sdk::modules::rewards::types::RewardScheduleError"]],["impl Freeze for Error",1,["oasis_runtime_sdk::modules::rofl::app_id::Error"]],["impl Freeze for Error",1,["oasis_runtime_sdk::modules::rofl::error::Error"]],["impl Freeze for Event",1,["oasis_runtime_sdk::modules::rofl::event::Event"]],["impl Freeze for ParameterValidationError",1,["oasis_runtime_sdk::modules::rofl::ParameterValidationError"]],["impl Freeze for AllowedEndorsement",1,["oasis_runtime_sdk::modules::rofl::policy::AllowedEndorsement"]],["impl Freeze for FeePolicy",1,["oasis_runtime_sdk::modules::rofl::policy::FeePolicy"]],["impl Freeze for IdentifierScheme",1,["oasis_runtime_sdk::modules::rofl::types::IdentifierScheme"]],["impl Freeze for Error",1,["oasis_runtime_sdk::schedule_control::Error"]],["impl Freeze for Mode",1,["oasis_runtime_sdk::state::Mode"]],["impl Freeze for Error",1,["oasis_runtime_sdk::storage::confidential::Error"]],["impl Freeze for Error",1,["oasis_runtime_sdk::types::address::Error"]],["impl Freeze for SignatureAddressSpec",1,["oasis_runtime_sdk::types::address::SignatureAddressSpec"]],["impl Freeze for Error",1,["oasis_runtime_sdk::types::token::Error"]],["impl Freeze for AddressSpec",1,["oasis_runtime_sdk::types::transaction::AddressSpec"]],["impl Freeze for AuthProof",1,["oasis_runtime_sdk::types::transaction::AuthProof"]],["impl Freeze for CallFormat",1,["oasis_runtime_sdk::types::transaction::CallFormat"]],["impl Freeze for CallResult",1,["oasis_runtime_sdk::types::transaction::CallResult"]],["impl Freeze for CallerAddress",1,["oasis_runtime_sdk::types::transaction::CallerAddress"]],["impl Freeze for Error",1,["oasis_runtime_sdk::types::transaction::Error"]],["impl Freeze for ScheduleControl",1,["oasis_runtime_sdk::config::ScheduleControl"]],["impl Freeze for Config",1,["oasis_runtime_sdk::crypto::multisig::Config"]],["impl Freeze for Signer",1,["oasis_runtime_sdk::crypto::multisig::Signer"]],["impl Freeze for LeafRng",1,["oasis_runtime_sdk::crypto::random::LeafRng"]],["impl Freeze for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::ed25519::MemorySigner"]],["impl Freeze for PublicKey",1,["oasis_runtime_sdk::crypto::signature::ed25519::PublicKey"]],["impl Freeze for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256k1::MemorySigner"]],["impl Freeze for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256k1::PublicKey"]],["impl Freeze for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256r1::MemorySigner"]],["impl Freeze for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256r1::PublicKey"]],["impl Freeze for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp384r1::MemorySigner"]],["impl Freeze for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp384r1::PublicKey"]],["impl Freeze for PublicKey",1,["oasis_runtime_sdk::crypto::signature::sr25519::PublicKey"]],["impl Freeze for Signature",1,["oasis_runtime_sdk::crypto::signature::Signature"]],["impl Freeze for DispatchResult",1,["oasis_runtime_sdk::dispatcher::DispatchResult"]],["impl Freeze for QueryRequest",1,["oasis_runtime_sdk::enclave_rpc::QueryRequest"]],["impl Freeze for EventTag",1,["oasis_runtime_sdk::event::EventTag"]],["impl Freeze for KeyManagerClientWithContext",1,["oasis_runtime_sdk::keymanager::KeyManagerClientWithContext"]],["impl Freeze for FeeManager",1,["oasis_runtime_sdk::modules::accounts::fee::FeeManager"]],["impl Freeze for FeeUpdates",1,["oasis_runtime_sdk::modules::accounts::fee::FeeUpdates"]],["impl Freeze for TransactionFee",1,["oasis_runtime_sdk::modules::accounts::fee::TransactionFee"]],["impl Freeze for GasCosts",1,["oasis_runtime_sdk::modules::accounts::GasCosts"]],["impl Freeze for Genesis",1,["oasis_runtime_sdk::modules::accounts::Genesis"]],["impl Freeze for Module",1,["oasis_runtime_sdk::modules::accounts::Module"]],["impl Freeze for Parameters",1,["oasis_runtime_sdk::modules::accounts::Parameters"]],["impl Freeze for Account",1,["oasis_runtime_sdk::modules::accounts::types::Account"]],["impl Freeze for AccountBalances",1,["oasis_runtime_sdk::modules::accounts::types::AccountBalances"]],["impl Freeze for AddressesQuery",1,["oasis_runtime_sdk::modules::accounts::types::AddressesQuery"]],["impl Freeze for BalancesQuery",1,["oasis_runtime_sdk::modules::accounts::types::BalancesQuery"]],["impl Freeze for DenominationInfo",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfo"]],["impl Freeze for DenominationInfoQuery",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfoQuery"]],["impl Freeze for NonceQuery",1,["oasis_runtime_sdk::modules::accounts::types::NonceQuery"]],["impl Freeze for Transfer",1,["oasis_runtime_sdk::modules::accounts::types::Transfer"]],["impl Freeze for GasCosts",1,["oasis_runtime_sdk::modules::consensus::GasCosts"]],["impl Freeze for Genesis",1,["oasis_runtime_sdk::modules::consensus::Genesis"]],["impl Freeze for Module",1,["oasis_runtime_sdk::modules::consensus::Module"]],["impl Freeze for Parameters",1,["oasis_runtime_sdk::modules::consensus::Parameters"]],["impl Freeze for RoundRootBody",1,["oasis_runtime_sdk::modules::consensus::types::RoundRootBody"]],["impl Freeze for Undelegation",1,["oasis_runtime_sdk::modules::consensus_accounts::state::Undelegation"]],["impl Freeze for GasCosts",1,["oasis_runtime_sdk::modules::consensus_accounts::GasCosts"]],["impl Freeze for Genesis",1,["oasis_runtime_sdk::modules::consensus_accounts::Genesis"]],["impl Freeze for Parameters",1,["oasis_runtime_sdk::modules::consensus_accounts::Parameters"]],["impl Freeze for AccountBalance",1,["oasis_runtime_sdk::modules::consensus_accounts::types::AccountBalance"]],["impl Freeze for BalanceQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::BalanceQuery"]],["impl Freeze for ConsensusAccountQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusAccountQuery"]],["impl Freeze for ConsensusDelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusDelegateContext"]],["impl Freeze for ConsensusError",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusError"]],["impl Freeze for ConsensusTransferContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusTransferContext"]],["impl Freeze for ConsensusUndelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusUndelegateContext"]],["impl Freeze for ConsensusWithdrawContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusWithdrawContext"]],["impl Freeze for Delegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Delegate"]],["impl Freeze for DelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationInfo"]],["impl Freeze for DelegationQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationQuery"]],["impl Freeze for DelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationsQuery"]],["impl Freeze for Deposit",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Deposit"]],["impl Freeze for ExtendedDelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ExtendedDelegationInfo"]],["impl Freeze for Receipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Receipt"]],["impl Freeze for TakeReceipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::TakeReceipt"]],["impl Freeze for Undelegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Undelegate"]],["impl Freeze for UndelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationInfo"]],["impl Freeze for UndelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationsQuery"]],["impl Freeze for Withdraw",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Withdraw"]],["impl Freeze for DynamicMinGasPrice",1,["oasis_runtime_sdk::modules::core::DynamicMinGasPrice"]],["impl Freeze for GasCosts",1,["oasis_runtime_sdk::modules::core::GasCosts"]],["impl Freeze for Genesis",1,["oasis_runtime_sdk::modules::core::Genesis"]],["impl Freeze for LocalConfig",1,["oasis_runtime_sdk::modules::core::LocalConfig"]],["impl Freeze for Parameters",1,["oasis_runtime_sdk::modules::core::Parameters"]],["impl Freeze for TxSimulationFailure",1,["oasis_runtime_sdk::modules::core::TxSimulationFailure"]],["impl Freeze for CallDataPublicKeyQueryResponse",1,["oasis_runtime_sdk::modules::core::types::CallDataPublicKeyQueryResponse"]],["impl Freeze for EstimateGasQuery",1,["oasis_runtime_sdk::modules::core::types::EstimateGasQuery"]],["impl Freeze for ExecuteReadOnlyTxQuery",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxQuery"]],["impl Freeze for ExecuteReadOnlyTxResponse",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxResponse"]],["impl Freeze for Metadata",1,["oasis_runtime_sdk::modules::core::types::Metadata"]],["impl Freeze for MethodHandlerInfo",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerInfo"]],["impl Freeze for ModuleInfo",1,["oasis_runtime_sdk::modules::core::types::ModuleInfo"]],["impl Freeze for RuntimeInfoResponse",1,["oasis_runtime_sdk::modules::core::types::RuntimeInfoResponse"]],["impl Freeze for Genesis",1,["oasis_runtime_sdk::modules::rewards::Genesis"]],["impl Freeze for Module",1,["oasis_runtime_sdk::modules::rewards::Module"]],["impl Freeze for Parameters",1,["oasis_runtime_sdk::modules::rewards::Parameters"]],["impl Freeze for EpochRewards",1,["oasis_runtime_sdk::modules::rewards::types::EpochRewards"]],["impl Freeze for RewardSchedule",1,["oasis_runtime_sdk::modules::rewards::types::RewardSchedule"]],["impl Freeze for RewardStep",1,["oasis_runtime_sdk::modules::rewards::types::RewardStep"]],["impl Freeze for AppId",1,["oasis_runtime_sdk::modules::rofl::app_id::AppId"]],["impl Freeze for AppAuthPolicy",1,["oasis_runtime_sdk::modules::rofl::policy::AppAuthPolicy"]],["impl Freeze for KeyEndorsementInfo",1,["oasis_runtime_sdk::modules::rofl::state::KeyEndorsementInfo"]],["impl Freeze for Genesis",1,["oasis_runtime_sdk::modules::rofl::Genesis"]],["impl Freeze for Parameters",1,["oasis_runtime_sdk::modules::rofl::Parameters"]],["impl Freeze for AppConfig",1,["oasis_runtime_sdk::modules::rofl::types::AppConfig"]],["impl Freeze for AppInstanceQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppInstanceQuery"]],["impl Freeze for AppQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppQuery"]],["impl Freeze for Create",1,["oasis_runtime_sdk::modules::rofl::types::Create"]],["impl Freeze for Register",1,["oasis_runtime_sdk::modules::rofl::types::Register"]],["impl Freeze for Registration",1,["oasis_runtime_sdk::modules::rofl::types::Registration"]],["impl Freeze for Remove",1,["oasis_runtime_sdk::modules::rofl::types::Remove"]],["impl Freeze for StakeThresholds",1,["oasis_runtime_sdk::modules::rofl::types::StakeThresholds"]],["impl Freeze for Update",1,["oasis_runtime_sdk::modules::rofl::types::Update"]],["impl Freeze for SenderMeta",1,["oasis_runtime_sdk::sender::SenderMeta"]],["impl Freeze for CurrentState",1,["oasis_runtime_sdk::state::CurrentState"]],["impl Freeze for Environment",1,["oasis_runtime_sdk::state::Environment"]],["impl Freeze for Options",1,["oasis_runtime_sdk::state::Options"]],["impl Freeze for TransactionWithMeta",1,["oasis_runtime_sdk::state::TransactionWithMeta"]],["impl Freeze for AllowAllValidator",1,["oasis_runtime_sdk::subcall::AllowAllValidator"]],["impl Freeze for SubcallInfo",1,["oasis_runtime_sdk::subcall::SubcallInfo"]],["impl Freeze for SubcallResult",1,["oasis_runtime_sdk::subcall::SubcallResult"]],["impl Freeze for CallOptions",1,["oasis_runtime_sdk::testing::mock::CallOptions"]],["impl Freeze for Config",1,["oasis_runtime_sdk::testing::mock::Config"]],["impl Freeze for EmptyRuntime",1,["oasis_runtime_sdk::testing::mock::EmptyRuntime"]],["impl Freeze for Signer",1,["oasis_runtime_sdk::testing::mock::Signer"]],["impl Freeze for Address",1,["oasis_runtime_sdk::types::address::Address"]],["impl Freeze for CallEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::CallEnvelopeX25519DeoxysII"]],["impl Freeze for ResultEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::ResultEnvelopeX25519DeoxysII"]],["impl Freeze for MessageEventHookInvocation",1,["oasis_runtime_sdk::types::message::MessageEventHookInvocation"]],["impl Freeze for MessageResult",1,["oasis_runtime_sdk::types::message::MessageResult"]],["impl Freeze for BaseUnits",1,["oasis_runtime_sdk::types::token::BaseUnits"]],["impl Freeze for Denomination",1,["oasis_runtime_sdk::types::token::Denomination"]],["impl Freeze for AuthInfo",1,["oasis_runtime_sdk::types::transaction::AuthInfo"]],["impl Freeze for Call",1,["oasis_runtime_sdk::types::transaction::Call"]],["impl Freeze for Fee",1,["oasis_runtime_sdk::types::transaction::Fee"]],["impl Freeze for FeeProxy",1,["oasis_runtime_sdk::types::transaction::FeeProxy"]],["impl Freeze for SignerInfo",1,["oasis_runtime_sdk::types::transaction::SignerInfo"]],["impl Freeze for Transaction",1,["oasis_runtime_sdk::types::transaction::Transaction"]],["impl Freeze for TransactionSigner",1,["oasis_runtime_sdk::types::transaction::TransactionSigner"]],["impl Freeze for UnverifiedTransaction",1,["oasis_runtime_sdk::types::transaction::UnverifiedTransaction"]],["impl<'a> Freeze for DispatchOptions<'a>",1,["oasis_runtime_sdk::dispatcher::DispatchOptions"]],["impl<'a, R> Freeze for RuntimeBatchContext<'a, R>",1,["oasis_runtime_sdk::context::RuntimeBatchContext"]],["impl<'a, V> Freeze for StateValue<'a, V>",1,["oasis_runtime_sdk::state::StateValue"]],["impl<A> Freeze for Client<A>",1,["oasis_runtime_sdk::modules::rofl::app::client::Client"]],["impl<A> Freeze for Environment<A>",1,["oasis_runtime_sdk::modules::rofl::app::env::Environment"]],["impl<B, R> Freeze for DispatchResult<B, R>
where\n R: Freeze,\n B: Freeze,
",1,["oasis_runtime_sdk::module::DispatchResult"]],["impl<Cfg> Freeze for Module<Cfg>",1,["oasis_runtime_sdk::modules::access::Module"]],["impl<Cfg> Freeze for Module<Cfg>",1,["oasis_runtime_sdk::modules::core::Module"]],["impl<Cfg> Freeze for Module<Cfg>",1,["oasis_runtime_sdk::modules::rofl::Module"]],["impl<Consensus> Freeze for Module<Consensus>",1,["oasis_runtime_sdk::modules::consensus_accounts::Module"]],["impl<M> Freeze for MKVSStore<M>
where\n M: Freeze,
",1,["oasis_runtime_sdk::storage::mkvs::MKVSStore"]],["impl<R> Freeze for Dispatcher<R>",1,["oasis_runtime_sdk::dispatcher::Dispatcher"]],["impl<S> Freeze for ConfidentialStore<S>
where\n S: Freeze,
",1,["oasis_runtime_sdk::storage::confidential::ConfidentialStore"]],["impl<S> Freeze for OverlayStore<S>
where\n S: Freeze,
",1,["oasis_runtime_sdk::storage::overlay::OverlayStore"]],["impl<S> Freeze for TypedStore<S>
where\n S: Freeze,
",1,["oasis_runtime_sdk::storage::typed::TypedStore"]],["impl<S, D> Freeze for HashedStore<S, D>
where\n S: Freeze,
",1,["oasis_runtime_sdk::storage::hashed::HashedStore"]],["impl<S, P> Freeze for PrefixStore<S, P>
where\n S: Freeze,\n P: Freeze,
",1,["oasis_runtime_sdk::storage::prefix::PrefixStore"]],["impl<T> Freeze for TransactionResult<T>
where\n T: Freeze,
",1,["oasis_runtime_sdk::state::TransactionResult"]]], +"oasis_runtime_sdk_contracts":[["impl Freeze for Error",1,["oasis_runtime_sdk_contracts::Error"]],["impl Freeze for Event",1,["oasis_runtime_sdk_contracts::Event"]],["impl Freeze for ABI",1,["oasis_runtime_sdk_contracts::types::ABI"]],["impl Freeze for Policy",1,["oasis_runtime_sdk_contracts::types::Policy"]],["impl Freeze for PublicKeyKind",1,["oasis_runtime_sdk_contracts::types::PublicKeyKind"]],["impl Freeze for StoreKind",1,["oasis_runtime_sdk_contracts::types::StoreKind"]],["impl Freeze for GasCosts",1,["oasis_runtime_sdk_contracts::GasCosts"]],["impl Freeze for Genesis",1,["oasis_runtime_sdk_contracts::Genesis"]],["impl Freeze for LocalConfig",1,["oasis_runtime_sdk_contracts::LocalConfig"]],["impl Freeze for Parameters",1,["oasis_runtime_sdk_contracts::Parameters"]],["impl Freeze for Call",1,["oasis_runtime_sdk_contracts::types::Call"]],["impl Freeze for CallResult",1,["oasis_runtime_sdk_contracts::types::CallResult"]],["impl Freeze for ChangeUpgradePolicy",1,["oasis_runtime_sdk_contracts::types::ChangeUpgradePolicy"]],["impl Freeze for Code",1,["oasis_runtime_sdk_contracts::types::Code"]],["impl Freeze for CodeQuery",1,["oasis_runtime_sdk_contracts::types::CodeQuery"]],["impl Freeze for CodeStorageQuery",1,["oasis_runtime_sdk_contracts::types::CodeStorageQuery"]],["impl Freeze for CodeStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::CodeStorageQueryResult"]],["impl Freeze for ContractEvent",1,["oasis_runtime_sdk_contracts::types::ContractEvent"]],["impl Freeze for CustomQuery",1,["oasis_runtime_sdk_contracts::types::CustomQuery"]],["impl Freeze for CustomQueryResult",1,["oasis_runtime_sdk_contracts::types::CustomQueryResult"]],["impl Freeze for Instance",1,["oasis_runtime_sdk_contracts::types::Instance"]],["impl Freeze for InstanceQuery",1,["oasis_runtime_sdk_contracts::types::InstanceQuery"]],["impl Freeze for InstanceRawStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQuery"]],["impl Freeze for InstanceRawStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQueryResult"]],["impl Freeze for InstanceStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQuery"]],["impl Freeze for InstanceStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQueryResult"]],["impl Freeze for Instantiate",1,["oasis_runtime_sdk_contracts::types::Instantiate"]],["impl Freeze for InstantiateResult",1,["oasis_runtime_sdk_contracts::types::InstantiateResult"]],["impl Freeze for PublicKeyQuery",1,["oasis_runtime_sdk_contracts::types::PublicKeyQuery"]],["impl Freeze for PublicKeyQueryResult",1,["oasis_runtime_sdk_contracts::types::PublicKeyQueryResult"]],["impl Freeze for Upgrade",1,["oasis_runtime_sdk_contracts::types::Upgrade"]],["impl Freeze for Upload",1,["oasis_runtime_sdk_contracts::types::Upload"]],["impl Freeze for UploadResult",1,["oasis_runtime_sdk_contracts::types::UploadResult"]],["impl<Cfg> Freeze for Module<Cfg>",1,["oasis_runtime_sdk_contracts::Module"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/marker/trait.Send.js b/rust/trait.impl/core/marker/trait.Send.js new file mode 100644 index 0000000000..08f9517dfa --- /dev/null +++ b/rust/trait.impl/core/marker/trait.Send.js @@ -0,0 +1,8 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Send for CryptoError",1,["oasis_contract_sdk::env::CryptoError"]],["impl Send for HostRegion",1,["oasis_contract_sdk::memory::HostRegion"]],["impl Send for MockContext",1,["oasis_contract_sdk::testing::MockContext"]],["impl Send for MockEnv",1,["oasis_contract_sdk::testing::MockEnv"]],["impl Send for MockStore",1,["oasis_contract_sdk::testing::MockStore"]],["impl<'a> Send for HostRegionRef<'a>",1,["oasis_contract_sdk::memory::HostRegionRef"]]], +"oasis_contract_sdk_storage":[["impl<'key, K, V> Send for ConfidentialMap<'key, K, V>
where\n K: Send,\n V: Send,
",1,["oasis_contract_sdk_storage::map::ConfidentialMap"]],["impl<'key, K, V> Send for PublicMap<'key, K, V>
where\n K: Send,\n V: Send,
",1,["oasis_contract_sdk_storage::map::PublicMap"]],["impl<'key, T> Send for ConfidentialCell<'key, T>
where\n T: Send,
",1,["oasis_contract_sdk_storage::cell::ConfidentialCell"]],["impl<'key, T> Send for PublicCell<'key, T>
where\n T: Send,
",1,["oasis_contract_sdk_storage::cell::PublicCell"]],["impl<I> Send for Int<I>
where\n <I as Integer>::Encoded: Send,\n I: Send,
",1,["oasis_contract_sdk_storage::map::Int"]]], +"oasis_contract_sdk_types":[["impl Send for Error",1,["oasis_contract_sdk_types::address::Error"]],["impl Send for SignatureKind",1,["oasis_contract_sdk_types::crypto::SignatureKind"]],["impl Send for CallFormat",1,["oasis_contract_sdk_types::CallFormat"]],["impl Send for ExecutionResult",1,["oasis_contract_sdk_types::ExecutionResult"]],["impl Send for AccountsQuery",1,["oasis_contract_sdk_types::env::AccountsQuery"]],["impl Send for AccountsResponse",1,["oasis_contract_sdk_types::env::AccountsResponse"]],["impl Send for QueryRequest",1,["oasis_contract_sdk_types::env::QueryRequest"]],["impl Send for QueryResponse",1,["oasis_contract_sdk_types::env::QueryResponse"]],["impl Send for CallResult",1,["oasis_contract_sdk_types::message::CallResult"]],["impl Send for Message",1,["oasis_contract_sdk_types::message::Message"]],["impl Send for NotifyReply",1,["oasis_contract_sdk_types::message::NotifyReply"]],["impl Send for Reply",1,["oasis_contract_sdk_types::message::Reply"]],["impl Send for StoreKind",1,["oasis_contract_sdk_types::storage::StoreKind"]],["impl Send for Error",1,["oasis_contract_sdk_types::token::Error"]],["impl Send for Address",1,["oasis_contract_sdk_types::address::Address"]],["impl Send for Event",1,["oasis_contract_sdk_types::event::Event"]],["impl Send for InstantiateResult",1,["oasis_contract_sdk_types::modules::contracts::InstantiateResult"]],["impl Send for CodeId",1,["oasis_contract_sdk_types::CodeId"]],["impl Send for ExecutionContext",1,["oasis_contract_sdk_types::ExecutionContext"]],["impl Send for ExecutionOk",1,["oasis_contract_sdk_types::ExecutionOk"]],["impl Send for InstanceId",1,["oasis_contract_sdk_types::InstanceId"]],["impl Send for BaseUnits",1,["oasis_contract_sdk_types::token::BaseUnits"]],["impl Send for Denomination",1,["oasis_contract_sdk_types::token::Denomination"]]], +"oasis_core_runtime":[["impl !Send for NodeBox",1,["oasis_core_runtime::storage::mkvs::tree::node::NodeBox"]],["impl !Send for NodePointer",1,["oasis_core_runtime::storage::mkvs::tree::node::NodePointer"]],["impl !Send for StatsCollector",1,["oasis_core_runtime::storage::mkvs::sync::stats::StatsCollector"]],["impl Send for Quote",1,["oasis_core_runtime::common::sgx::Quote"]],["impl Send for Error",1,["oasis_core_runtime::common::sgx::pcs::Error"]],["impl Send for Event",1,["oasis_core_runtime::consensus::Event"]],["impl Send for Vote",1,["oasis_core_runtime::consensus::governance::Vote"]],["impl Send for Error",1,["oasis_core_runtime::consensus::keymanager::churp::Error"]],["impl Send for SuiteId",1,["oasis_core_runtime::consensus::keymanager::churp::SuiteId"]],["impl Send for Error",1,["oasis_core_runtime::consensus::keymanager::Error"]],["impl Send for RuntimeGovernanceModel",1,["oasis_core_runtime::consensus::registry::RuntimeGovernanceModel"]],["impl Send for RuntimeKind",1,["oasis_core_runtime::consensus::registry::RuntimeKind"]],["impl Send for SGXAttestation",1,["oasis_core_runtime::consensus::registry::SGXAttestation"]],["impl Send for SGXConstraints",1,["oasis_core_runtime::consensus::registry::SGXConstraints"]],["impl Send for TEEHardware",1,["oasis_core_runtime::consensus::registry::TEEHardware"]],["impl Send for Error",1,["oasis_core_runtime::consensus::roothash::Error"]],["impl Send for ExecutorCommitmentFailure",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentFailure"]],["impl Send for GovernanceMessage",1,["oasis_core_runtime::consensus::roothash::message::GovernanceMessage"]],["impl Send for HeaderType",1,["oasis_core_runtime::consensus::roothash::block::HeaderType"]],["impl Send for Message",1,["oasis_core_runtime::consensus::roothash::message::Message"]],["impl Send for RegistryMessage",1,["oasis_core_runtime::consensus::roothash::message::RegistryMessage"]],["impl Send for StakingMessage",1,["oasis_core_runtime::consensus::roothash::message::StakingMessage"]],["impl Send for CommitteeKind",1,["oasis_core_runtime::consensus::scheduler::CommitteeKind"]],["impl Send for Role",1,["oasis_core_runtime::consensus::scheduler::Role"]],["impl Send for EscrowEvent",1,["oasis_core_runtime::consensus::staking::EscrowEvent"]],["impl Send for SlashReason",1,["oasis_core_runtime::consensus::staking::SlashReason"]],["impl Send for ThresholdKind",1,["oasis_core_runtime::consensus::staking::ThresholdKind"]],["impl Send for StateError",1,["oasis_core_runtime::consensus::state::StateError"]],["impl Send for Error",1,["oasis_core_runtime::consensus::verifier::Error"]],["impl Send for RpcClientError",1,["oasis_core_runtime::enclave_rpc::client::RpcClientError"]],["impl Send for Error",1,["oasis_core_runtime::enclave_rpc::demux::Error"]],["impl Send for RAKBinding",1,["oasis_core_runtime::enclave_rpc::session::RAKBinding"]],["impl Send for Error",1,["oasis_core_runtime::enclave_rpc::sessions::Error"]],["impl Send for Body",1,["oasis_core_runtime::enclave_rpc::types::Body"]],["impl Send for Kind",1,["oasis_core_runtime::enclave_rpc::types::Kind"]],["impl Send for Message",1,["oasis_core_runtime::enclave_rpc::types::Message"]],["impl Send for PeerFeedback",1,["oasis_core_runtime::enclave_rpc::types::PeerFeedback"]],["impl Send for TeeType",1,["oasis_core_runtime::TeeType"]],["impl Send for Error",1,["oasis_core_runtime::host::Error"]],["impl Send for PolicyVerifierError",1,["oasis_core_runtime::policy::PolicyVerifierError"]],["impl Send for ProtocolError",1,["oasis_core_runtime::protocol::ProtocolError"]],["impl Send for Stream",1,["oasis_core_runtime::protocol::Stream"]],["impl Send for LogEntryKind",1,["oasis_core_runtime::storage::mkvs::LogEntryKind"]],["impl Send for RootType",1,["oasis_core_runtime::storage::mkvs::tree::node::RootType"]],["impl Send for SyncerError",1,["oasis_core_runtime::storage::mkvs::sync::errors::SyncerError"]],["impl Send for Body",1,["oasis_core_runtime::types::Body"]],["impl Send for EventKind",1,["oasis_core_runtime::types::EventKind"]],["impl Send for ExecutionMode",1,["oasis_core_runtime::types::ExecutionMode"]],["impl Send for HostStorageEndpoint",1,["oasis_core_runtime::types::HostStorageEndpoint"]],["impl Send for MessageType",1,["oasis_core_runtime::types::MessageType"]],["impl Send for StorageSyncRequest",1,["oasis_core_runtime::types::StorageSyncRequest"]],["impl Send for StorageSyncResponse",1,["oasis_core_runtime::types::StorageSyncResponse"]],["impl Send for NoopApp",1,["oasis_core_runtime::app::NoopApp"]],["impl Send for Cache",1,["oasis_core_runtime::cache::Cache"]],["impl Send for CacheSet",1,["oasis_core_runtime::cache::CacheSet"]],["impl Send for Hash",1,["oasis_core_runtime::common::crypto::hash::Hash"]],["impl Send for Nonce",1,["oasis_core_runtime::common::crypto::mrae::nonce::Nonce"]],["impl Send for MultiSigned",1,["oasis_core_runtime::common::crypto::signature::MultiSigned"]],["impl Send for PrivateKey",1,["oasis_core_runtime::common::crypto::signature::PrivateKey"]],["impl Send for PublicKey",1,["oasis_core_runtime::common::crypto::signature::PublicKey"]],["impl Send for Signature",1,["oasis_core_runtime::common::crypto::signature::Signature"]],["impl Send for SignatureBundle",1,["oasis_core_runtime::common::crypto::signature::SignatureBundle"]],["impl Send for Signed",1,["oasis_core_runtime::common::crypto::signature::Signed"]],["impl Send for PrivateKey",1,["oasis_core_runtime::common::crypto::x25519::PrivateKey"]],["impl Send for PublicKey",1,["oasis_core_runtime::common::crypto::x25519::PublicKey"]],["impl Send for Namespace",1,["oasis_core_runtime::common::namespace::Namespace"]],["impl Send for AbortOnPanic",1,["oasis_core_runtime::common::panic::AbortOnPanic"]],["impl Send for Quantity",1,["oasis_core_runtime::common::quantity::Quantity"]],["impl Send for AVR",1,["oasis_core_runtime::common::sgx::ias::AVR"]],["impl Send for QuotePolicy",1,["oasis_core_runtime::common::sgx::ias::QuotePolicy"]],["impl Send for QuoteBundle",1,["oasis_core_runtime::common::sgx::pcs::quote::QuoteBundle"]],["impl Send for QuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::QuotePolicy"]],["impl Send for TCBBundle",1,["oasis_core_runtime::common::sgx::pcs::tcb::TCBBundle"]],["impl Send for TdAttributes",1,["oasis_core_runtime::common::sgx::pcs::report::TdAttributes"]],["impl Send for TdReport",1,["oasis_core_runtime::common::sgx::pcs::report::TdReport"]],["impl Send for TdxModulePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxModulePolicy"]],["impl Send for TdxQuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxQuotePolicy"]],["impl Send for EnclaveIdentity",1,["oasis_core_runtime::common::sgx::EnclaveIdentity"]],["impl Send for MrEnclave",1,["oasis_core_runtime::common::sgx::MrEnclave"]],["impl Send for MrSigner",1,["oasis_core_runtime::common::sgx::MrSigner"]],["impl Send for QuotePolicy",1,["oasis_core_runtime::common::sgx::QuotePolicy"]],["impl Send for VerifiedQuote",1,["oasis_core_runtime::common::sgx::VerifiedQuote"]],["impl Send for ProtocolVersions",1,["oasis_core_runtime::common::version::ProtocolVersions"]],["impl Send for Version",1,["oasis_core_runtime::common::version::Version"]],["impl Send for Config",1,["oasis_core_runtime::config::Config"]],["impl Send for Storage",1,["oasis_core_runtime::config::Storage"]],["impl Send for Address",1,["oasis_core_runtime::consensus::address::Address"]],["impl Send for COMMON_POOL_ADDRESS",1,["oasis_core_runtime::consensus::address::COMMON_POOL_ADDRESS"]],["impl Send for FEE_ACC_ADDRESS",1,["oasis_core_runtime::consensus::address::FEE_ACC_ADDRESS"]],["impl Send for GOVERNANCE_DEPOSITS_ADDRESS",1,["oasis_core_runtime::consensus::address::GOVERNANCE_DEPOSITS_ADDRESS"]],["impl Send for EpochTimeState",1,["oasis_core_runtime::consensus::beacon::EpochTimeState"]],["impl Send for CancelUpgradeProposal",1,["oasis_core_runtime::consensus::governance::CancelUpgradeProposal"]],["impl Send for ChangeParametersProposal",1,["oasis_core_runtime::consensus::governance::ChangeParametersProposal"]],["impl Send for ConsensusParameterChanges",1,["oasis_core_runtime::consensus::governance::ConsensusParameterChanges"]],["impl Send for ProposalContent",1,["oasis_core_runtime::consensus::governance::ProposalContent"]],["impl Send for ProposalVote",1,["oasis_core_runtime::consensus::governance::ProposalVote"]],["impl Send for UpgradeProposal",1,["oasis_core_runtime::consensus::governance::UpgradeProposal"]],["impl Send for Application",1,["oasis_core_runtime::consensus::keymanager::churp::Application"]],["impl Send for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::PolicySGX"]],["impl Send for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::SignedPolicySGX"]],["impl Send for Status",1,["oasis_core_runtime::consensus::keymanager::churp::Status"]],["impl Send for EnclavePolicySGX",1,["oasis_core_runtime::consensus::keymanager::EnclavePolicySGX"]],["impl Send for EncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedEphemeralSecret"]],["impl Send for EncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedMasterSecret"]],["impl Send for EncryptedSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedSecret"]],["impl Send for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::PolicySGX"]],["impl Send for SignedEncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedEphemeralSecret"]],["impl Send for SignedEncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedMasterSecret"]],["impl Send for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::SignedPolicySGX"]],["impl Send for AnyNodeRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::AnyNodeRuntimeAdmissionPolicy"]],["impl Send for Capabilities",1,["oasis_core_runtime::consensus::registry::Capabilities"]],["impl Send for CapabilityTEE",1,["oasis_core_runtime::consensus::registry::CapabilityTEE"]],["impl Send for ConsensusAddress",1,["oasis_core_runtime::consensus::registry::ConsensusAddress"]],["impl Send for ConsensusInfo",1,["oasis_core_runtime::consensus::registry::ConsensusInfo"]],["impl Send for EndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::EndorsedCapabilityTEE"]],["impl Send for EntityWhitelistConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistConfig"]],["impl Send for EntityWhitelistRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleAdmissionPolicy"]],["impl Send for EntityWhitelistRoleConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleConfig"]],["impl Send for EntityWhitelistRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRuntimeAdmissionPolicy"]],["impl Send for ExecutorParameters",1,["oasis_core_runtime::consensus::registry::ExecutorParameters"]],["impl Send for MaxNodesConstraint",1,["oasis_core_runtime::consensus::registry::MaxNodesConstraint"]],["impl Send for MinPoolSizeConstraint",1,["oasis_core_runtime::consensus::registry::MinPoolSizeConstraint"]],["impl Send for Node",1,["oasis_core_runtime::consensus::registry::Node"]],["impl Send for NodeRuntime",1,["oasis_core_runtime::consensus::registry::NodeRuntime"]],["impl Send for P2PInfo",1,["oasis_core_runtime::consensus::registry::P2PInfo"]],["impl Send for PerRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::PerRoleAdmissionPolicy"]],["impl Send for RolesMask",1,["oasis_core_runtime::consensus::registry::RolesMask"]],["impl Send for Runtime",1,["oasis_core_runtime::consensus::registry::Runtime"]],["impl Send for RuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::RuntimeAdmissionPolicy"]],["impl Send for RuntimeGenesis",1,["oasis_core_runtime::consensus::registry::RuntimeGenesis"]],["impl Send for RuntimeStakingParameters",1,["oasis_core_runtime::consensus::registry::RuntimeStakingParameters"]],["impl Send for SchedulingConstraints",1,["oasis_core_runtime::consensus::registry::SchedulingConstraints"]],["impl Send for StorageParameters",1,["oasis_core_runtime::consensus::registry::StorageParameters"]],["impl Send for TCPAddress",1,["oasis_core_runtime::consensus::registry::TCPAddress"]],["impl Send for TLSAddress",1,["oasis_core_runtime::consensus::registry::TLSAddress"]],["impl Send for TLSInfo",1,["oasis_core_runtime::consensus::registry::TLSInfo"]],["impl Send for TxnSchedulerParameters",1,["oasis_core_runtime::consensus::registry::TxnSchedulerParameters"]],["impl Send for VRFInfo",1,["oasis_core_runtime::consensus::registry::VRFInfo"]],["impl Send for ValidatorSetConstraint",1,["oasis_core_runtime::consensus::registry::ValidatorSetConstraint"]],["impl Send for VerifiedAttestation",1,["oasis_core_runtime::consensus::registry::VerifiedAttestation"]],["impl Send for VerifiedEndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::VerifiedEndorsedCapabilityTEE"]],["impl Send for VersionInfo",1,["oasis_core_runtime::consensus::registry::VersionInfo"]],["impl Send for AnnotatedBlock",1,["oasis_core_runtime::consensus::roothash::AnnotatedBlock"]],["impl Send for Block",1,["oasis_core_runtime::consensus::roothash::block::Block"]],["impl Send for ComputeResultsHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ComputeResultsHeader"]],["impl Send for ExecutorCommitment",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitment"]],["impl Send for ExecutorCommitmentHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentHeader"]],["impl Send for Header",1,["oasis_core_runtime::consensus::roothash::block::Header"]],["impl Send for IncomingMessage",1,["oasis_core_runtime::consensus::roothash::message::IncomingMessage"]],["impl Send for MessageEvent",1,["oasis_core_runtime::consensus::roothash::MessageEvent"]],["impl Send for Pool",1,["oasis_core_runtime::consensus::roothash::commitment::pool::Pool"]],["impl Send for RoundResults",1,["oasis_core_runtime::consensus::roothash::RoundResults"]],["impl Send for RoundRoots",1,["oasis_core_runtime::consensus::roothash::RoundRoots"]],["impl Send for Committee",1,["oasis_core_runtime::consensus::scheduler::Committee"]],["impl Send for CommitteeNode",1,["oasis_core_runtime::consensus::scheduler::CommitteeNode"]],["impl Send for Account",1,["oasis_core_runtime::consensus::staking::Account"]],["impl Send for AddEscrowResult",1,["oasis_core_runtime::consensus::staking::AddEscrowResult"]],["impl Send for AllowanceChangeEvent",1,["oasis_core_runtime::consensus::staking::AllowanceChangeEvent"]],["impl Send for BurnEvent",1,["oasis_core_runtime::consensus::staking::BurnEvent"]],["impl Send for CommissionRateBoundStep",1,["oasis_core_runtime::consensus::staking::CommissionRateBoundStep"]],["impl Send for CommissionRateStep",1,["oasis_core_runtime::consensus::staking::CommissionRateStep"]],["impl Send for CommissionSchedule",1,["oasis_core_runtime::consensus::staking::CommissionSchedule"]],["impl Send for DebondingDelegation",1,["oasis_core_runtime::consensus::staking::DebondingDelegation"]],["impl Send for Delegation",1,["oasis_core_runtime::consensus::staking::Delegation"]],["impl Send for Escrow",1,["oasis_core_runtime::consensus::staking::Escrow"]],["impl Send for EscrowAccount",1,["oasis_core_runtime::consensus::staking::EscrowAccount"]],["impl Send for Event",1,["oasis_core_runtime::consensus::staking::Event"]],["impl Send for GeneralAccount",1,["oasis_core_runtime::consensus::staking::GeneralAccount"]],["impl Send for ReclaimEscrow",1,["oasis_core_runtime::consensus::staking::ReclaimEscrow"]],["impl Send for ReclaimEscrowResult",1,["oasis_core_runtime::consensus::staking::ReclaimEscrowResult"]],["impl Send for SharePool",1,["oasis_core_runtime::consensus::staking::SharePool"]],["impl Send for Slash",1,["oasis_core_runtime::consensus::staking::Slash"]],["impl Send for StakeAccumulator",1,["oasis_core_runtime::consensus::staking::StakeAccumulator"]],["impl Send for StakeThreshold",1,["oasis_core_runtime::consensus::staking::StakeThreshold"]],["impl Send for Transfer",1,["oasis_core_runtime::consensus::staking::Transfer"]],["impl Send for TransferEvent",1,["oasis_core_runtime::consensus::staking::TransferEvent"]],["impl Send for TransferResult",1,["oasis_core_runtime::consensus::staking::TransferResult"]],["impl Send for Withdraw",1,["oasis_core_runtime::consensus::staking::Withdraw"]],["impl Send for WithdrawResult",1,["oasis_core_runtime::consensus::staking::WithdrawResult"]],["impl Send for MutableState",1,["oasis_core_runtime::consensus::state::beacon::MutableState"]],["impl Send for Status",1,["oasis_core_runtime::consensus::state::keymanager::Status"]],["impl Send for ConsensusState",1,["oasis_core_runtime::consensus::state::ConsensusState"]],["impl Send for BlockMetadata",1,["oasis_core_runtime::consensus::BlockMetadata"]],["impl Send for LightBlock",1,["oasis_core_runtime::consensus::LightBlock"]],["impl Send for Proof",1,["oasis_core_runtime::consensus::tendermint::merkle::Proof"]],["impl Send for LightBlockMeta",1,["oasis_core_runtime::consensus::tendermint::LightBlockMeta"]],["impl Send for NopVerifier",1,["oasis_core_runtime::consensus::tendermint::verifier::noop::NopVerifier"]],["impl Send for Verifier",1,["oasis_core_runtime::consensus::tendermint::verifier::Verifier"]],["impl Send for Fee",1,["oasis_core_runtime::consensus::transaction::Fee"]],["impl Send for Proof",1,["oasis_core_runtime::consensus::transaction::Proof"]],["impl Send for SignedTransactionWithProof",1,["oasis_core_runtime::consensus::transaction::SignedTransactionWithProof"]],["impl Send for Transaction",1,["oasis_core_runtime::consensus::transaction::Transaction"]],["impl Send for TrustRoot",1,["oasis_core_runtime::consensus::verifier::TrustRoot"]],["impl Send for Dispatcher",1,["oasis_core_runtime::dispatcher::Dispatcher"]],["impl Send for PostInitState",1,["oasis_core_runtime::dispatcher::PostInitState"]],["impl Send for RpcClient",1,["oasis_core_runtime::enclave_rpc::client::RpcClient"]],["impl Send for Context",1,["oasis_core_runtime::enclave_rpc::context::Context"]],["impl Send for Demux",1,["oasis_core_runtime::enclave_rpc::demux::Demux"]],["impl Send for Dispatcher",1,["oasis_core_runtime::enclave_rpc::dispatcher::Dispatcher"]],["impl Send for Method",1,["oasis_core_runtime::enclave_rpc::dispatcher::Method"]],["impl Send for MethodDescriptor",1,["oasis_core_runtime::enclave_rpc::dispatcher::MethodDescriptor"]],["impl Send for Builder",1,["oasis_core_runtime::enclave_rpc::session::Builder"]],["impl Send for Session",1,["oasis_core_runtime::enclave_rpc::session::Session"]],["impl Send for SessionInfo",1,["oasis_core_runtime::enclave_rpc::session::SessionInfo"]],["impl Send for Error",1,["oasis_core_runtime::enclave_rpc::types::Error"]],["impl Send for Frame",1,["oasis_core_runtime::enclave_rpc::types::Frame"]],["impl Send for Request",1,["oasis_core_runtime::enclave_rpc::types::Request"]],["impl Send for Response",1,["oasis_core_runtime::enclave_rpc::types::Response"]],["impl Send for SessionID",1,["oasis_core_runtime::enclave_rpc::types::SessionID"]],["impl Send for RegisterNotifyOpts",1,["oasis_core_runtime::host::RegisterNotifyOpts"]],["impl Send for SubmitTxOpts",1,["oasis_core_runtime::host::SubmitTxOpts"]],["impl Send for TxResult",1,["oasis_core_runtime::host::TxResult"]],["impl Send for Identity",1,["oasis_core_runtime::identity::Identity"]],["impl Send for PolicyVerifier",1,["oasis_core_runtime::policy::PolicyVerifier"]],["impl Send for HostInfo",1,["oasis_core_runtime::protocol::HostInfo"]],["impl Send for Protocol",1,["oasis_core_runtime::protocol::Protocol"]],["impl Send for ProtocolUntrustedLocalStorage",1,["oasis_core_runtime::protocol::ProtocolUntrustedLocalStorage"]],["impl Send for LogEntry",1,["oasis_core_runtime::storage::mkvs::LogEntry"]],["impl Send for Prefix",1,["oasis_core_runtime::storage::mkvs::Prefix"]],["impl Send for Root",1,["oasis_core_runtime::storage::mkvs::tree::node::Root"]],["impl Send for Tree"],["impl Send for GetPrefixesRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetPrefixesRequest"]],["impl Send for GetRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetRequest"]],["impl Send for HostReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::host::HostReadSyncer"]],["impl Send for IterateRequest",1,["oasis_core_runtime::storage::mkvs::sync::IterateRequest"]],["impl Send for NoopReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::noop::NoopReadSyncer"]],["impl Send for Proof",1,["oasis_core_runtime::storage::mkvs::sync::proof::Proof"]],["impl Send for ProofBuilder",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofBuilder"]],["impl Send for ProofResponse",1,["oasis_core_runtime::storage::mkvs::sync::ProofResponse"]],["impl Send for ProofVerifier",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofVerifier"]],["impl Send for RawProofEntry",1,["oasis_core_runtime::storage::mkvs::sync::proof::RawProofEntry"]],["impl Send for TreeID",1,["oasis_core_runtime::storage::mkvs::sync::TreeID"]],["impl Send for UntrustedInMemoryStorage",1,["oasis_core_runtime::storage::UntrustedInMemoryStorage"]],["impl Send for BUILD_INFO",1,["oasis_core_runtime::BUILD_INFO"]],["impl Send for BuildInfo",1,["oasis_core_runtime::BuildInfo"]],["impl Send for ExecuteBatchResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteBatchResult"]],["impl Send for ExecuteTxResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteTxResult"]],["impl Send for NoopDispatcher",1,["oasis_core_runtime::transaction::dispatcher::NoopDispatcher"]],["impl Send for CoarsenedKey",1,["oasis_core_runtime::transaction::rwset::CoarsenedKey"]],["impl Send for ReadWriteSet",1,["oasis_core_runtime::transaction::rwset::ReadWriteSet"]],["impl Send for Tag",1,["oasis_core_runtime::transaction::tags::Tag"]],["impl Send for Tree",1,["oasis_core_runtime::transaction::tree::Tree"]],["impl Send for TxnBatch",1,["oasis_core_runtime::transaction::types::TxnBatch"]],["impl Send for CheckTxMetadata",1,["oasis_core_runtime::types::CheckTxMetadata"]],["impl Send for CheckTxResult",1,["oasis_core_runtime::types::CheckTxResult"]],["impl Send for ComputedBatch",1,["oasis_core_runtime::types::ComputedBatch"]],["impl Send for Error",1,["oasis_core_runtime::types::Error"]],["impl Send for FeatureScheduleControl",1,["oasis_core_runtime::types::FeatureScheduleControl"]],["impl Send for Features",1,["oasis_core_runtime::types::Features"]],["impl Send for HostFetchConsensusEventsRequest",1,["oasis_core_runtime::types::HostFetchConsensusEventsRequest"]],["impl Send for HostFetchConsensusEventsResponse",1,["oasis_core_runtime::types::HostFetchConsensusEventsResponse"]],["impl Send for Message",1,["oasis_core_runtime::types::Message"]],["impl Send for RegisterNotifyRuntimeEvent",1,["oasis_core_runtime::types::RegisterNotifyRuntimeEvent"]],["impl Send for RuntimeInfoRequest",1,["oasis_core_runtime::types::RuntimeInfoRequest"]],["impl Send for RuntimeInfoResponse",1,["oasis_core_runtime::types::RuntimeInfoResponse"]],["impl Send for RuntimeNotifyEvent",1,["oasis_core_runtime::types::RuntimeNotifyEvent"]],["impl Send for StorageSyncRequestWithEndpoint",1,["oasis_core_runtime::types::StorageSyncRequestWithEndpoint"]],["impl<'a> !Send for Context<'a>",1,["oasis_core_runtime::transaction::context::Context"]],["impl<'a> Send for Quote<'a>",1,["oasis_core_runtime::common::sgx::pcs::quote::Quote"]],["impl<'a> Send for PreInitState<'a>",1,["oasis_core_runtime::dispatcher::PreInitState"]],["impl<'a, T> Send for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::beacon::ImmutableState"]],["impl<'a, T> Send for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::keymanager::churp::ImmutableState"]],["impl<'a, T> Send for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::keymanager::ImmutableState"]],["impl<'a, T> Send for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::registry::ImmutableState"]],["impl<'a, T> Send for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::roothash::ImmutableState"]],["impl<'a, T> Send for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::staking::ImmutableState"]],["impl<'a, T> Send for Response<'a, T>
where\n T: Send,
",1,["oasis_core_runtime::enclave_rpc::client::Response"]],["impl<PeerID> Send for MultiplexedSession<PeerID>
where\n PeerID: Send,
",1,["oasis_core_runtime::enclave_rpc::sessions::MultiplexedSession"]],["impl<PeerID> Send for SessionMeta<PeerID>
where\n PeerID: Send,
",1,["oasis_core_runtime::enclave_rpc::sessions::SessionMeta"]],["impl<PeerID> Send for Sessions<PeerID>
where\n PeerID: Send,
",1,["oasis_core_runtime::enclave_rpc::sessions::Sessions"]],["impl<T> Send for Versioned<T>
where\n T: Send,
",1,["oasis_core_runtime::common::versioned::Versioned"]],["impl<T> Send for OverlayTree<T>
where\n T: Send,
",1,["oasis_core_runtime::storage::mkvs::tree::overlay::OverlayTree"]]], +"oasis_runtime_sdk":[["impl !Send for State",1,["oasis_runtime_sdk::state::State"]],["impl !Send for Mock",1,["oasis_runtime_sdk::testing::mock::Mock"]],["impl Send for Metadata",1,["oasis_runtime_sdk::callformat::Metadata"]],["impl Send for Error",1,["oasis_runtime_sdk::crypto::multisig::Error"]],["impl Send for Error",1,["oasis_runtime_sdk::crypto::signature::Error"]],["impl Send for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::MemorySigner"]],["impl Send for PublicKey",1,["oasis_runtime_sdk::crypto::signature::PublicKey"]],["impl Send for SignatureType",1,["oasis_runtime_sdk::crypto::signature::SignatureType"]],["impl Send for Error",1,["oasis_runtime_sdk::dispatcher::Error"]],["impl Send for Error",1,["oasis_runtime_sdk::history::Error"]],["impl Send for AuthDecision",1,["oasis_runtime_sdk::module::AuthDecision"]],["impl Send for CallResult",1,["oasis_runtime_sdk::module::CallResult"]],["impl Send for Error",1,["oasis_runtime_sdk::modules::access::Error"]],["impl Send for Authorization",1,["oasis_runtime_sdk::modules::access::types::Authorization"]],["impl Send for MethodAuthorization",1,["oasis_runtime_sdk::modules::access::types::MethodAuthorization"]],["impl Send for Error",1,["oasis_runtime_sdk::modules::accounts::Error"]],["impl Send for Event",1,["oasis_runtime_sdk::modules::accounts::Event"]],["impl Send for ParameterValidationError",1,["oasis_runtime_sdk::modules::accounts::ParameterValidationError"]],["impl Send for Error",1,["oasis_runtime_sdk::modules::consensus::Error"]],["impl Send for Event",1,["oasis_runtime_sdk::modules::consensus::Event"]],["impl Send for ParameterValidationError",1,["oasis_runtime_sdk::modules::consensus::ParameterValidationError"]],["impl Send for RootKind",1,["oasis_runtime_sdk::modules::consensus::types::RootKind"]],["impl Send for Error",1,["oasis_runtime_sdk::modules::consensus_accounts::Error"]],["impl Send for Event",1,["oasis_runtime_sdk::modules::consensus_accounts::Event"]],["impl Send for ReceiptKind",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ReceiptKind"]],["impl Send for Error",1,["oasis_runtime_sdk::modules::core::Error"]],["impl Send for Event",1,["oasis_runtime_sdk::modules::core::Event"]],["impl Send for ParameterValidationError",1,["oasis_runtime_sdk::modules::core::ParameterValidationError"]],["impl Send for MethodHandlerKind",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerKind"]],["impl Send for Error",1,["oasis_runtime_sdk::modules::rewards::Error"]],["impl Send for ParameterValidationError",1,["oasis_runtime_sdk::modules::rewards::ParameterValidationError"]],["impl Send for RewardAction",1,["oasis_runtime_sdk::modules::rewards::types::RewardAction"]],["impl Send for RewardScheduleError",1,["oasis_runtime_sdk::modules::rewards::types::RewardScheduleError"]],["impl Send for Error",1,["oasis_runtime_sdk::modules::rofl::app_id::Error"]],["impl Send for Error",1,["oasis_runtime_sdk::modules::rofl::error::Error"]],["impl Send for Event",1,["oasis_runtime_sdk::modules::rofl::event::Event"]],["impl Send for ParameterValidationError",1,["oasis_runtime_sdk::modules::rofl::ParameterValidationError"]],["impl Send for AllowedEndorsement",1,["oasis_runtime_sdk::modules::rofl::policy::AllowedEndorsement"]],["impl Send for FeePolicy",1,["oasis_runtime_sdk::modules::rofl::policy::FeePolicy"]],["impl Send for IdentifierScheme",1,["oasis_runtime_sdk::modules::rofl::types::IdentifierScheme"]],["impl Send for Error",1,["oasis_runtime_sdk::schedule_control::Error"]],["impl Send for Mode",1,["oasis_runtime_sdk::state::Mode"]],["impl Send for Error",1,["oasis_runtime_sdk::storage::confidential::Error"]],["impl Send for Error",1,["oasis_runtime_sdk::types::address::Error"]],["impl Send for SignatureAddressSpec",1,["oasis_runtime_sdk::types::address::SignatureAddressSpec"]],["impl Send for Error",1,["oasis_runtime_sdk::types::token::Error"]],["impl Send for AddressSpec",1,["oasis_runtime_sdk::types::transaction::AddressSpec"]],["impl Send for AuthProof",1,["oasis_runtime_sdk::types::transaction::AuthProof"]],["impl Send for CallFormat",1,["oasis_runtime_sdk::types::transaction::CallFormat"]],["impl Send for CallResult",1,["oasis_runtime_sdk::types::transaction::CallResult"]],["impl Send for CallerAddress",1,["oasis_runtime_sdk::types::transaction::CallerAddress"]],["impl Send for Error",1,["oasis_runtime_sdk::types::transaction::Error"]],["impl Send for ScheduleControl",1,["oasis_runtime_sdk::config::ScheduleControl"]],["impl Send for Config",1,["oasis_runtime_sdk::crypto::multisig::Config"]],["impl Send for Signer",1,["oasis_runtime_sdk::crypto::multisig::Signer"]],["impl Send for LeafRng",1,["oasis_runtime_sdk::crypto::random::LeafRng"]],["impl Send for RootRng",1,["oasis_runtime_sdk::crypto::random::RootRng"]],["impl Send for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::ed25519::MemorySigner"]],["impl Send for PublicKey",1,["oasis_runtime_sdk::crypto::signature::ed25519::PublicKey"]],["impl Send for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256k1::MemorySigner"]],["impl Send for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256k1::PublicKey"]],["impl Send for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256r1::MemorySigner"]],["impl Send for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256r1::PublicKey"]],["impl Send for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp384r1::MemorySigner"]],["impl Send for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp384r1::PublicKey"]],["impl Send for PublicKey",1,["oasis_runtime_sdk::crypto::signature::sr25519::PublicKey"]],["impl Send for Signature",1,["oasis_runtime_sdk::crypto::signature::Signature"]],["impl Send for DispatchResult",1,["oasis_runtime_sdk::dispatcher::DispatchResult"]],["impl Send for QueryRequest",1,["oasis_runtime_sdk::enclave_rpc::QueryRequest"]],["impl Send for EventTag",1,["oasis_runtime_sdk::event::EventTag"]],["impl Send for KeyManagerClientWithContext",1,["oasis_runtime_sdk::keymanager::KeyManagerClientWithContext"]],["impl Send for FeeManager",1,["oasis_runtime_sdk::modules::accounts::fee::FeeManager"]],["impl Send for FeeUpdates",1,["oasis_runtime_sdk::modules::accounts::fee::FeeUpdates"]],["impl Send for TransactionFee",1,["oasis_runtime_sdk::modules::accounts::fee::TransactionFee"]],["impl Send for GasCosts",1,["oasis_runtime_sdk::modules::accounts::GasCosts"]],["impl Send for Genesis",1,["oasis_runtime_sdk::modules::accounts::Genesis"]],["impl Send for Module",1,["oasis_runtime_sdk::modules::accounts::Module"]],["impl Send for Parameters",1,["oasis_runtime_sdk::modules::accounts::Parameters"]],["impl Send for Account",1,["oasis_runtime_sdk::modules::accounts::types::Account"]],["impl Send for AccountBalances",1,["oasis_runtime_sdk::modules::accounts::types::AccountBalances"]],["impl Send for AddressesQuery",1,["oasis_runtime_sdk::modules::accounts::types::AddressesQuery"]],["impl Send for BalancesQuery",1,["oasis_runtime_sdk::modules::accounts::types::BalancesQuery"]],["impl Send for DenominationInfo",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfo"]],["impl Send for DenominationInfoQuery",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfoQuery"]],["impl Send for NonceQuery",1,["oasis_runtime_sdk::modules::accounts::types::NonceQuery"]],["impl Send for Transfer",1,["oasis_runtime_sdk::modules::accounts::types::Transfer"]],["impl Send for GasCosts",1,["oasis_runtime_sdk::modules::consensus::GasCosts"]],["impl Send for Genesis",1,["oasis_runtime_sdk::modules::consensus::Genesis"]],["impl Send for Module",1,["oasis_runtime_sdk::modules::consensus::Module"]],["impl Send for Parameters",1,["oasis_runtime_sdk::modules::consensus::Parameters"]],["impl Send for RoundRootBody",1,["oasis_runtime_sdk::modules::consensus::types::RoundRootBody"]],["impl Send for Undelegation",1,["oasis_runtime_sdk::modules::consensus_accounts::state::Undelegation"]],["impl Send for GasCosts",1,["oasis_runtime_sdk::modules::consensus_accounts::GasCosts"]],["impl Send for Genesis",1,["oasis_runtime_sdk::modules::consensus_accounts::Genesis"]],["impl Send for Parameters",1,["oasis_runtime_sdk::modules::consensus_accounts::Parameters"]],["impl Send for AccountBalance",1,["oasis_runtime_sdk::modules::consensus_accounts::types::AccountBalance"]],["impl Send for BalanceQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::BalanceQuery"]],["impl Send for ConsensusAccountQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusAccountQuery"]],["impl Send for ConsensusDelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusDelegateContext"]],["impl Send for ConsensusError",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusError"]],["impl Send for ConsensusTransferContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusTransferContext"]],["impl Send for ConsensusUndelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusUndelegateContext"]],["impl Send for ConsensusWithdrawContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusWithdrawContext"]],["impl Send for Delegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Delegate"]],["impl Send for DelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationInfo"]],["impl Send for DelegationQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationQuery"]],["impl Send for DelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationsQuery"]],["impl Send for Deposit",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Deposit"]],["impl Send for ExtendedDelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ExtendedDelegationInfo"]],["impl Send for Receipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Receipt"]],["impl Send for TakeReceipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::TakeReceipt"]],["impl Send for Undelegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Undelegate"]],["impl Send for UndelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationInfo"]],["impl Send for UndelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationsQuery"]],["impl Send for Withdraw",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Withdraw"]],["impl Send for DynamicMinGasPrice",1,["oasis_runtime_sdk::modules::core::DynamicMinGasPrice"]],["impl Send for GasCosts",1,["oasis_runtime_sdk::modules::core::GasCosts"]],["impl Send for Genesis",1,["oasis_runtime_sdk::modules::core::Genesis"]],["impl Send for LocalConfig",1,["oasis_runtime_sdk::modules::core::LocalConfig"]],["impl Send for Parameters",1,["oasis_runtime_sdk::modules::core::Parameters"]],["impl Send for TxSimulationFailure",1,["oasis_runtime_sdk::modules::core::TxSimulationFailure"]],["impl Send for CallDataPublicKeyQueryResponse",1,["oasis_runtime_sdk::modules::core::types::CallDataPublicKeyQueryResponse"]],["impl Send for EstimateGasQuery",1,["oasis_runtime_sdk::modules::core::types::EstimateGasQuery"]],["impl Send for ExecuteReadOnlyTxQuery",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxQuery"]],["impl Send for ExecuteReadOnlyTxResponse",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxResponse"]],["impl Send for Metadata",1,["oasis_runtime_sdk::modules::core::types::Metadata"]],["impl Send for MethodHandlerInfo",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerInfo"]],["impl Send for ModuleInfo",1,["oasis_runtime_sdk::modules::core::types::ModuleInfo"]],["impl Send for RuntimeInfoResponse",1,["oasis_runtime_sdk::modules::core::types::RuntimeInfoResponse"]],["impl Send for Genesis",1,["oasis_runtime_sdk::modules::rewards::Genesis"]],["impl Send for Module",1,["oasis_runtime_sdk::modules::rewards::Module"]],["impl Send for Parameters",1,["oasis_runtime_sdk::modules::rewards::Parameters"]],["impl Send for EpochRewards",1,["oasis_runtime_sdk::modules::rewards::types::EpochRewards"]],["impl Send for RewardSchedule",1,["oasis_runtime_sdk::modules::rewards::types::RewardSchedule"]],["impl Send for RewardStep",1,["oasis_runtime_sdk::modules::rewards::types::RewardStep"]],["impl Send for AppId",1,["oasis_runtime_sdk::modules::rofl::app_id::AppId"]],["impl Send for AppAuthPolicy",1,["oasis_runtime_sdk::modules::rofl::policy::AppAuthPolicy"]],["impl Send for KeyEndorsementInfo",1,["oasis_runtime_sdk::modules::rofl::state::KeyEndorsementInfo"]],["impl Send for Genesis",1,["oasis_runtime_sdk::modules::rofl::Genesis"]],["impl Send for Parameters",1,["oasis_runtime_sdk::modules::rofl::Parameters"]],["impl Send for AppConfig",1,["oasis_runtime_sdk::modules::rofl::types::AppConfig"]],["impl Send for AppInstanceQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppInstanceQuery"]],["impl Send for AppQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppQuery"]],["impl Send for Create",1,["oasis_runtime_sdk::modules::rofl::types::Create"]],["impl Send for Register",1,["oasis_runtime_sdk::modules::rofl::types::Register"]],["impl Send for Registration",1,["oasis_runtime_sdk::modules::rofl::types::Registration"]],["impl Send for Remove",1,["oasis_runtime_sdk::modules::rofl::types::Remove"]],["impl Send for StakeThresholds",1,["oasis_runtime_sdk::modules::rofl::types::StakeThresholds"]],["impl Send for Update",1,["oasis_runtime_sdk::modules::rofl::types::Update"]],["impl Send for SenderMeta",1,["oasis_runtime_sdk::sender::SenderMeta"]],["impl Send for CurrentState",1,["oasis_runtime_sdk::state::CurrentState"]],["impl Send for Environment",1,["oasis_runtime_sdk::state::Environment"]],["impl Send for Options",1,["oasis_runtime_sdk::state::Options"]],["impl Send for TransactionWithMeta",1,["oasis_runtime_sdk::state::TransactionWithMeta"]],["impl Send for HostStore",1,["oasis_runtime_sdk::storage::host::HostStore"]],["impl Send for AllowAllValidator",1,["oasis_runtime_sdk::subcall::AllowAllValidator"]],["impl Send for SubcallInfo",1,["oasis_runtime_sdk::subcall::SubcallInfo"]],["impl Send for SubcallResult",1,["oasis_runtime_sdk::subcall::SubcallResult"]],["impl Send for MockKeyManagerClient",1,["oasis_runtime_sdk::testing::keymanager::MockKeyManagerClient"]],["impl Send for CallOptions",1,["oasis_runtime_sdk::testing::mock::CallOptions"]],["impl Send for Config",1,["oasis_runtime_sdk::testing::mock::Config"]],["impl Send for EmptyRuntime",1,["oasis_runtime_sdk::testing::mock::EmptyRuntime"]],["impl Send for Signer",1,["oasis_runtime_sdk::testing::mock::Signer"]],["impl Send for Address",1,["oasis_runtime_sdk::types::address::Address"]],["impl Send for CallEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::CallEnvelopeX25519DeoxysII"]],["impl Send for ResultEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::ResultEnvelopeX25519DeoxysII"]],["impl Send for MessageEventHookInvocation",1,["oasis_runtime_sdk::types::message::MessageEventHookInvocation"]],["impl Send for MessageResult",1,["oasis_runtime_sdk::types::message::MessageResult"]],["impl Send for BaseUnits",1,["oasis_runtime_sdk::types::token::BaseUnits"]],["impl Send for Denomination",1,["oasis_runtime_sdk::types::token::Denomination"]],["impl Send for AuthInfo",1,["oasis_runtime_sdk::types::transaction::AuthInfo"]],["impl Send for Call",1,["oasis_runtime_sdk::types::transaction::Call"]],["impl Send for Fee",1,["oasis_runtime_sdk::types::transaction::Fee"]],["impl Send for FeeProxy",1,["oasis_runtime_sdk::types::transaction::FeeProxy"]],["impl Send for SignerInfo",1,["oasis_runtime_sdk::types::transaction::SignerInfo"]],["impl Send for Transaction",1,["oasis_runtime_sdk::types::transaction::Transaction"]],["impl Send for TransactionSigner",1,["oasis_runtime_sdk::types::transaction::TransactionSigner"]],["impl Send for UnverifiedTransaction",1,["oasis_runtime_sdk::types::transaction::UnverifiedTransaction"]],["impl<'a> !Send for DispatchOptions<'a>",1,["oasis_runtime_sdk::dispatcher::DispatchOptions"]],["impl<'a, R> !Send for RuntimeBatchContext<'a, R>",1,["oasis_runtime_sdk::context::RuntimeBatchContext"]],["impl<'a, V> !Send for StateValue<'a, V>",1,["oasis_runtime_sdk::state::StateValue"]],["impl<A> Send for Client<A>",1,["oasis_runtime_sdk::modules::rofl::app::client::Client"]],["impl<A> Send for Environment<A>",1,["oasis_runtime_sdk::modules::rofl::app::env::Environment"]],["impl<B, R> Send for DispatchResult<B, R>
where\n R: Send,\n B: Send,
",1,["oasis_runtime_sdk::module::DispatchResult"]],["impl<Cfg> Send for Module<Cfg>
where\n Cfg: Send,
",1,["oasis_runtime_sdk::modules::access::Module"]],["impl<Cfg> Send for Module<Cfg>
where\n Cfg: Send,
",1,["oasis_runtime_sdk::modules::core::Module"]],["impl<Cfg> Send for Module<Cfg>
where\n Cfg: Send,
",1,["oasis_runtime_sdk::modules::rofl::Module"]],["impl<Consensus> Send for Module<Consensus>
where\n Consensus: Send,
",1,["oasis_runtime_sdk::modules::consensus_accounts::Module"]],["impl<M> Send for MKVSStore<M>
where\n M: Send,
",1,["oasis_runtime_sdk::storage::mkvs::MKVSStore"]],["impl<R> Send for Dispatcher<R>
where\n R: Send,
",1,["oasis_runtime_sdk::dispatcher::Dispatcher"]],["impl<S> Send for ConfidentialStore<S>
where\n S: Send,
",1,["oasis_runtime_sdk::storage::confidential::ConfidentialStore"]],["impl<S> Send for OverlayStore<S>
where\n S: Send,
",1,["oasis_runtime_sdk::storage::overlay::OverlayStore"]],["impl<S> Send for TypedStore<S>
where\n S: Send,
",1,["oasis_runtime_sdk::storage::typed::TypedStore"]],["impl<S, D> Send for HashedStore<S, D>
where\n S: Send,\n D: Send,
",1,["oasis_runtime_sdk::storage::hashed::HashedStore"]],["impl<S, P> Send for PrefixStore<S, P>
where\n S: Send,\n P: Send,
",1,["oasis_runtime_sdk::storage::prefix::PrefixStore"]],["impl<T> Send for TransactionResult<T>
where\n T: Send,
",1,["oasis_runtime_sdk::state::TransactionResult"]]], +"oasis_runtime_sdk_contracts":[["impl Send for Error",1,["oasis_runtime_sdk_contracts::Error"]],["impl Send for Event",1,["oasis_runtime_sdk_contracts::Event"]],["impl Send for ABI",1,["oasis_runtime_sdk_contracts::types::ABI"]],["impl Send for Policy",1,["oasis_runtime_sdk_contracts::types::Policy"]],["impl Send for PublicKeyKind",1,["oasis_runtime_sdk_contracts::types::PublicKeyKind"]],["impl Send for StoreKind",1,["oasis_runtime_sdk_contracts::types::StoreKind"]],["impl Send for GasCosts",1,["oasis_runtime_sdk_contracts::GasCosts"]],["impl Send for Genesis",1,["oasis_runtime_sdk_contracts::Genesis"]],["impl Send for LocalConfig",1,["oasis_runtime_sdk_contracts::LocalConfig"]],["impl Send for Parameters",1,["oasis_runtime_sdk_contracts::Parameters"]],["impl Send for Call",1,["oasis_runtime_sdk_contracts::types::Call"]],["impl Send for CallResult",1,["oasis_runtime_sdk_contracts::types::CallResult"]],["impl Send for ChangeUpgradePolicy",1,["oasis_runtime_sdk_contracts::types::ChangeUpgradePolicy"]],["impl Send for Code",1,["oasis_runtime_sdk_contracts::types::Code"]],["impl Send for CodeQuery",1,["oasis_runtime_sdk_contracts::types::CodeQuery"]],["impl Send for CodeStorageQuery",1,["oasis_runtime_sdk_contracts::types::CodeStorageQuery"]],["impl Send for CodeStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::CodeStorageQueryResult"]],["impl Send for ContractEvent",1,["oasis_runtime_sdk_contracts::types::ContractEvent"]],["impl Send for CustomQuery",1,["oasis_runtime_sdk_contracts::types::CustomQuery"]],["impl Send for CustomQueryResult",1,["oasis_runtime_sdk_contracts::types::CustomQueryResult"]],["impl Send for Instance",1,["oasis_runtime_sdk_contracts::types::Instance"]],["impl Send for InstanceQuery",1,["oasis_runtime_sdk_contracts::types::InstanceQuery"]],["impl Send for InstanceRawStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQuery"]],["impl Send for InstanceRawStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQueryResult"]],["impl Send for InstanceStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQuery"]],["impl Send for InstanceStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQueryResult"]],["impl Send for Instantiate",1,["oasis_runtime_sdk_contracts::types::Instantiate"]],["impl Send for InstantiateResult",1,["oasis_runtime_sdk_contracts::types::InstantiateResult"]],["impl Send for PublicKeyQuery",1,["oasis_runtime_sdk_contracts::types::PublicKeyQuery"]],["impl Send for PublicKeyQueryResult",1,["oasis_runtime_sdk_contracts::types::PublicKeyQueryResult"]],["impl Send for Upgrade",1,["oasis_runtime_sdk_contracts::types::Upgrade"]],["impl Send for Upload",1,["oasis_runtime_sdk_contracts::types::Upload"]],["impl Send for UploadResult",1,["oasis_runtime_sdk_contracts::types::UploadResult"]],["impl<Cfg> Send for Module<Cfg>
where\n Cfg: Send,
",1,["oasis_runtime_sdk_contracts::Module"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/marker/trait.StructuralPartialEq.js b/rust/trait.impl/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 0000000000..2accc93143 --- /dev/null +++ b/rust/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl StructuralPartialEq for CallFormat"],["impl StructuralPartialEq for NotifyReply"],["impl StructuralPartialEq for Address"],["impl StructuralPartialEq for CodeId"],["impl StructuralPartialEq for InstanceId"],["impl StructuralPartialEq for BaseUnits"],["impl StructuralPartialEq for Denomination"]], +"oasis_core_runtime":[["impl StructuralPartialEq for Quote"],["impl StructuralPartialEq for Vote"],["impl StructuralPartialEq for SuiteId"],["impl StructuralPartialEq for RuntimeGovernanceModel"],["impl StructuralPartialEq for RuntimeKind"],["impl StructuralPartialEq for TEEHardware"],["impl StructuralPartialEq for ExecutorCommitmentFailure"],["impl StructuralPartialEq for GovernanceMessage"],["impl StructuralPartialEq for HeaderType"],["impl StructuralPartialEq for Message"],["impl StructuralPartialEq for RegistryMessage"],["impl StructuralPartialEq for StakingMessage"],["impl StructuralPartialEq for CommitteeKind"],["impl StructuralPartialEq for Role"],["impl StructuralPartialEq for EscrowEvent"],["impl StructuralPartialEq for SlashReason"],["impl StructuralPartialEq for ThresholdKind"],["impl StructuralPartialEq for Kind"],["impl StructuralPartialEq for PeerFeedback"],["impl StructuralPartialEq for TeeType"],["impl StructuralPartialEq for LogEntryKind"],["impl StructuralPartialEq for NodeBox"],["impl StructuralPartialEq for RootType"],["impl StructuralPartialEq for ExecutionMode"],["impl StructuralPartialEq for HostStorageEndpoint"],["impl StructuralPartialEq for MultiSigned"],["impl StructuralPartialEq for SignatureBundle"],["impl StructuralPartialEq for Signed"],["impl StructuralPartialEq for PublicKey"],["impl StructuralPartialEq for Quantity"],["impl StructuralPartialEq for AVR"],["impl StructuralPartialEq for QuotePolicy"],["impl StructuralPartialEq for QuoteBundle"],["impl StructuralPartialEq for QuotePolicy"],["impl StructuralPartialEq for TCBBundle"],["impl StructuralPartialEq for TdAttributes"],["impl StructuralPartialEq for TdReport"],["impl StructuralPartialEq for TdxModulePolicy"],["impl StructuralPartialEq for TdxQuotePolicy"],["impl StructuralPartialEq for EnclaveIdentity"],["impl StructuralPartialEq for QuotePolicy"],["impl StructuralPartialEq for ProtocolVersions"],["impl StructuralPartialEq for Version"],["impl StructuralPartialEq for Address"],["impl StructuralPartialEq for EpochTimeState"],["impl StructuralPartialEq for CancelUpgradeProposal"],["impl StructuralPartialEq for ChangeParametersProposal"],["impl StructuralPartialEq for ConsensusParameterChanges"],["impl StructuralPartialEq for ProposalContent"],["impl StructuralPartialEq for ProposalVote"],["impl StructuralPartialEq for UpgradeProposal"],["impl StructuralPartialEq for Application"],["impl StructuralPartialEq for PolicySGX"],["impl StructuralPartialEq for SignedPolicySGX"],["impl StructuralPartialEq for Status"],["impl StructuralPartialEq for EnclavePolicySGX"],["impl StructuralPartialEq for EncryptedEphemeralSecret"],["impl StructuralPartialEq for EncryptedMasterSecret"],["impl StructuralPartialEq for EncryptedSecret"],["impl StructuralPartialEq for PolicySGX"],["impl StructuralPartialEq for SignedEncryptedEphemeralSecret"],["impl StructuralPartialEq for SignedEncryptedMasterSecret"],["impl StructuralPartialEq for SignedPolicySGX"],["impl StructuralPartialEq for AnyNodeRuntimeAdmissionPolicy"],["impl StructuralPartialEq for Capabilities"],["impl StructuralPartialEq for CapabilityTEE"],["impl StructuralPartialEq for ConsensusAddress"],["impl StructuralPartialEq for ConsensusInfo"],["impl StructuralPartialEq for EndorsedCapabilityTEE"],["impl StructuralPartialEq for EntityWhitelistConfig"],["impl StructuralPartialEq for EntityWhitelistRoleAdmissionPolicy"],["impl StructuralPartialEq for EntityWhitelistRoleConfig"],["impl StructuralPartialEq for EntityWhitelistRuntimeAdmissionPolicy"],["impl StructuralPartialEq for ExecutorParameters"],["impl StructuralPartialEq for MaxNodesConstraint"],["impl StructuralPartialEq for MinPoolSizeConstraint"],["impl StructuralPartialEq for Node"],["impl StructuralPartialEq for NodeRuntime"],["impl StructuralPartialEq for P2PInfo"],["impl StructuralPartialEq for PerRoleAdmissionPolicy"],["impl StructuralPartialEq for RolesMask"],["impl StructuralPartialEq for Runtime"],["impl StructuralPartialEq for RuntimeAdmissionPolicy"],["impl StructuralPartialEq for RuntimeGenesis"],["impl StructuralPartialEq for RuntimeStakingParameters"],["impl StructuralPartialEq for SchedulingConstraints"],["impl StructuralPartialEq for StorageParameters"],["impl StructuralPartialEq for TCPAddress"],["impl StructuralPartialEq for TLSAddress"],["impl StructuralPartialEq for TLSInfo"],["impl StructuralPartialEq for TxnSchedulerParameters"],["impl StructuralPartialEq for VRFInfo"],["impl StructuralPartialEq for ValidatorSetConstraint"],["impl StructuralPartialEq for VersionInfo"],["impl StructuralPartialEq for AnnotatedBlock"],["impl StructuralPartialEq for Block"],["impl StructuralPartialEq for ComputeResultsHeader"],["impl StructuralPartialEq for ExecutorCommitment"],["impl StructuralPartialEq for ExecutorCommitmentHeader"],["impl StructuralPartialEq for Header"],["impl StructuralPartialEq for IncomingMessage"],["impl StructuralPartialEq for MessageEvent"],["impl StructuralPartialEq for RoundResults"],["impl StructuralPartialEq for RoundRoots"],["impl StructuralPartialEq for Account"],["impl StructuralPartialEq for AddEscrowResult"],["impl StructuralPartialEq for AllowanceChangeEvent"],["impl StructuralPartialEq for BurnEvent"],["impl StructuralPartialEq for CommissionRateBoundStep"],["impl StructuralPartialEq for CommissionRateStep"],["impl StructuralPartialEq for CommissionSchedule"],["impl StructuralPartialEq for DebondingDelegation"],["impl StructuralPartialEq for Delegation"],["impl StructuralPartialEq for Escrow"],["impl StructuralPartialEq for EscrowAccount"],["impl StructuralPartialEq for Event"],["impl StructuralPartialEq for GeneralAccount"],["impl StructuralPartialEq for ReclaimEscrow"],["impl StructuralPartialEq for ReclaimEscrowResult"],["impl StructuralPartialEq for SharePool"],["impl StructuralPartialEq for Slash"],["impl StructuralPartialEq for StakeAccumulator"],["impl StructuralPartialEq for StakeThreshold"],["impl StructuralPartialEq for Transfer"],["impl StructuralPartialEq for TransferEvent"],["impl StructuralPartialEq for TransferResult"],["impl StructuralPartialEq for Withdraw"],["impl StructuralPartialEq for WithdrawResult"],["impl StructuralPartialEq for Status"],["impl StructuralPartialEq for BlockMetadata"],["impl StructuralPartialEq for TrustRoot"],["impl StructuralPartialEq for LogEntry"],["impl StructuralPartialEq for Prefix"],["impl StructuralPartialEq for Root"],["impl StructuralPartialEq for Proof"],["impl StructuralPartialEq for RawProofEntry"],["impl StructuralPartialEq for TreeID"],["impl StructuralPartialEq for CoarsenedKey"],["impl StructuralPartialEq for ReadWriteSet"],["impl StructuralPartialEq for TxnBatch"],["impl<T> StructuralPartialEq for Versioned<T>"]], +"oasis_runtime_sdk":[["impl StructuralPartialEq for PublicKey"],["impl StructuralPartialEq for SignatureType"],["impl StructuralPartialEq for Event"],["impl StructuralPartialEq for RewardAction"],["impl StructuralPartialEq for AllowedEndorsement"],["impl StructuralPartialEq for FeePolicy"],["impl StructuralPartialEq for Mode"],["impl StructuralPartialEq for SignatureAddressSpec"],["impl StructuralPartialEq for CallFormat"],["impl StructuralPartialEq for PublicKey"],["impl StructuralPartialEq for PublicKey"],["impl StructuralPartialEq for PublicKey"],["impl StructuralPartialEq for PublicKey"],["impl StructuralPartialEq for PublicKey"],["impl StructuralPartialEq for Signature"],["impl StructuralPartialEq for GasCosts"],["impl StructuralPartialEq for Parameters"],["impl StructuralPartialEq for ConsensusError"],["impl StructuralPartialEq for AppId"],["impl StructuralPartialEq for AppAuthPolicy"],["impl StructuralPartialEq for KeyEndorsementInfo"],["impl StructuralPartialEq for Registration"],["impl StructuralPartialEq for SenderMeta"],["impl StructuralPartialEq for Address"],["impl StructuralPartialEq for BaseUnits"],["impl StructuralPartialEq for Denomination"]], +"oasis_runtime_sdk_contracts":[["impl StructuralPartialEq for ABI"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/marker/trait.Sync.js b/rust/trait.impl/core/marker/trait.Sync.js new file mode 100644 index 0000000000..55e776ba77 --- /dev/null +++ b/rust/trait.impl/core/marker/trait.Sync.js @@ -0,0 +1,8 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Sync for CryptoError",1,["oasis_contract_sdk::env::CryptoError"]],["impl Sync for HostRegion",1,["oasis_contract_sdk::memory::HostRegion"]],["impl Sync for MockContext",1,["oasis_contract_sdk::testing::MockContext"]],["impl Sync for MockEnv",1,["oasis_contract_sdk::testing::MockEnv"]],["impl Sync for MockStore",1,["oasis_contract_sdk::testing::MockStore"]],["impl<'a> Sync for HostRegionRef<'a>",1,["oasis_contract_sdk::memory::HostRegionRef"]]], +"oasis_contract_sdk_storage":[["impl<'key, K, V> Sync for ConfidentialMap<'key, K, V>
where\n K: Sync,\n V: Sync,
",1,["oasis_contract_sdk_storage::map::ConfidentialMap"]],["impl<'key, K, V> Sync for PublicMap<'key, K, V>
where\n K: Sync,\n V: Sync,
",1,["oasis_contract_sdk_storage::map::PublicMap"]],["impl<'key, T> Sync for ConfidentialCell<'key, T>
where\n T: Sync,
",1,["oasis_contract_sdk_storage::cell::ConfidentialCell"]],["impl<'key, T> Sync for PublicCell<'key, T>
where\n T: Sync,
",1,["oasis_contract_sdk_storage::cell::PublicCell"]],["impl<I> Sync for Int<I>
where\n <I as Integer>::Encoded: Sync,\n I: Sync,
",1,["oasis_contract_sdk_storage::map::Int"]]], +"oasis_contract_sdk_types":[["impl Sync for Error",1,["oasis_contract_sdk_types::address::Error"]],["impl Sync for SignatureKind",1,["oasis_contract_sdk_types::crypto::SignatureKind"]],["impl Sync for CallFormat",1,["oasis_contract_sdk_types::CallFormat"]],["impl Sync for ExecutionResult",1,["oasis_contract_sdk_types::ExecutionResult"]],["impl Sync for AccountsQuery",1,["oasis_contract_sdk_types::env::AccountsQuery"]],["impl Sync for AccountsResponse",1,["oasis_contract_sdk_types::env::AccountsResponse"]],["impl Sync for QueryRequest",1,["oasis_contract_sdk_types::env::QueryRequest"]],["impl Sync for QueryResponse",1,["oasis_contract_sdk_types::env::QueryResponse"]],["impl Sync for CallResult",1,["oasis_contract_sdk_types::message::CallResult"]],["impl Sync for Message",1,["oasis_contract_sdk_types::message::Message"]],["impl Sync for NotifyReply",1,["oasis_contract_sdk_types::message::NotifyReply"]],["impl Sync for Reply",1,["oasis_contract_sdk_types::message::Reply"]],["impl Sync for StoreKind",1,["oasis_contract_sdk_types::storage::StoreKind"]],["impl Sync for Error",1,["oasis_contract_sdk_types::token::Error"]],["impl Sync for Address",1,["oasis_contract_sdk_types::address::Address"]],["impl Sync for Event",1,["oasis_contract_sdk_types::event::Event"]],["impl Sync for InstantiateResult",1,["oasis_contract_sdk_types::modules::contracts::InstantiateResult"]],["impl Sync for CodeId",1,["oasis_contract_sdk_types::CodeId"]],["impl Sync for ExecutionContext",1,["oasis_contract_sdk_types::ExecutionContext"]],["impl Sync for ExecutionOk",1,["oasis_contract_sdk_types::ExecutionOk"]],["impl Sync for InstanceId",1,["oasis_contract_sdk_types::InstanceId"]],["impl Sync for BaseUnits",1,["oasis_contract_sdk_types::token::BaseUnits"]],["impl Sync for Denomination",1,["oasis_contract_sdk_types::token::Denomination"]]], +"oasis_core_runtime":[["impl !Sync for NodeBox",1,["oasis_core_runtime::storage::mkvs::tree::node::NodeBox"]],["impl !Sync for Cache",1,["oasis_core_runtime::cache::Cache"]],["impl !Sync for ConsensusState",1,["oasis_core_runtime::consensus::state::ConsensusState"]],["impl !Sync for NodePointer",1,["oasis_core_runtime::storage::mkvs::tree::node::NodePointer"]],["impl !Sync for Tree",1,["oasis_core_runtime::storage::mkvs::tree::Tree"]],["impl !Sync for StatsCollector",1,["oasis_core_runtime::storage::mkvs::sync::stats::StatsCollector"]],["impl !Sync for Tree",1,["oasis_core_runtime::transaction::tree::Tree"]],["impl Sync for Quote",1,["oasis_core_runtime::common::sgx::Quote"]],["impl Sync for Error",1,["oasis_core_runtime::common::sgx::pcs::Error"]],["impl Sync for Event",1,["oasis_core_runtime::consensus::Event"]],["impl Sync for Vote",1,["oasis_core_runtime::consensus::governance::Vote"]],["impl Sync for Error",1,["oasis_core_runtime::consensus::keymanager::churp::Error"]],["impl Sync for SuiteId",1,["oasis_core_runtime::consensus::keymanager::churp::SuiteId"]],["impl Sync for Error",1,["oasis_core_runtime::consensus::keymanager::Error"]],["impl Sync for RuntimeGovernanceModel",1,["oasis_core_runtime::consensus::registry::RuntimeGovernanceModel"]],["impl Sync for RuntimeKind",1,["oasis_core_runtime::consensus::registry::RuntimeKind"]],["impl Sync for SGXAttestation",1,["oasis_core_runtime::consensus::registry::SGXAttestation"]],["impl Sync for SGXConstraints",1,["oasis_core_runtime::consensus::registry::SGXConstraints"]],["impl Sync for TEEHardware",1,["oasis_core_runtime::consensus::registry::TEEHardware"]],["impl Sync for Error",1,["oasis_core_runtime::consensus::roothash::Error"]],["impl Sync for ExecutorCommitmentFailure",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentFailure"]],["impl Sync for GovernanceMessage",1,["oasis_core_runtime::consensus::roothash::message::GovernanceMessage"]],["impl Sync for HeaderType",1,["oasis_core_runtime::consensus::roothash::block::HeaderType"]],["impl Sync for Message",1,["oasis_core_runtime::consensus::roothash::message::Message"]],["impl Sync for RegistryMessage",1,["oasis_core_runtime::consensus::roothash::message::RegistryMessage"]],["impl Sync for StakingMessage",1,["oasis_core_runtime::consensus::roothash::message::StakingMessage"]],["impl Sync for CommitteeKind",1,["oasis_core_runtime::consensus::scheduler::CommitteeKind"]],["impl Sync for Role",1,["oasis_core_runtime::consensus::scheduler::Role"]],["impl Sync for EscrowEvent",1,["oasis_core_runtime::consensus::staking::EscrowEvent"]],["impl Sync for SlashReason",1,["oasis_core_runtime::consensus::staking::SlashReason"]],["impl Sync for ThresholdKind",1,["oasis_core_runtime::consensus::staking::ThresholdKind"]],["impl Sync for StateError",1,["oasis_core_runtime::consensus::state::StateError"]],["impl Sync for Error",1,["oasis_core_runtime::consensus::verifier::Error"]],["impl Sync for RpcClientError",1,["oasis_core_runtime::enclave_rpc::client::RpcClientError"]],["impl Sync for Error",1,["oasis_core_runtime::enclave_rpc::demux::Error"]],["impl Sync for RAKBinding",1,["oasis_core_runtime::enclave_rpc::session::RAKBinding"]],["impl Sync for Error",1,["oasis_core_runtime::enclave_rpc::sessions::Error"]],["impl Sync for Body",1,["oasis_core_runtime::enclave_rpc::types::Body"]],["impl Sync for Kind",1,["oasis_core_runtime::enclave_rpc::types::Kind"]],["impl Sync for Message",1,["oasis_core_runtime::enclave_rpc::types::Message"]],["impl Sync for PeerFeedback",1,["oasis_core_runtime::enclave_rpc::types::PeerFeedback"]],["impl Sync for TeeType",1,["oasis_core_runtime::TeeType"]],["impl Sync for Error",1,["oasis_core_runtime::host::Error"]],["impl Sync for PolicyVerifierError",1,["oasis_core_runtime::policy::PolicyVerifierError"]],["impl Sync for ProtocolError",1,["oasis_core_runtime::protocol::ProtocolError"]],["impl Sync for Stream",1,["oasis_core_runtime::protocol::Stream"]],["impl Sync for LogEntryKind",1,["oasis_core_runtime::storage::mkvs::LogEntryKind"]],["impl Sync for RootType",1,["oasis_core_runtime::storage::mkvs::tree::node::RootType"]],["impl Sync for SyncerError",1,["oasis_core_runtime::storage::mkvs::sync::errors::SyncerError"]],["impl Sync for Body",1,["oasis_core_runtime::types::Body"]],["impl Sync for EventKind",1,["oasis_core_runtime::types::EventKind"]],["impl Sync for ExecutionMode",1,["oasis_core_runtime::types::ExecutionMode"]],["impl Sync for HostStorageEndpoint",1,["oasis_core_runtime::types::HostStorageEndpoint"]],["impl Sync for MessageType",1,["oasis_core_runtime::types::MessageType"]],["impl Sync for StorageSyncRequest",1,["oasis_core_runtime::types::StorageSyncRequest"]],["impl Sync for StorageSyncResponse",1,["oasis_core_runtime::types::StorageSyncResponse"]],["impl Sync for NoopApp",1,["oasis_core_runtime::app::NoopApp"]],["impl Sync for CacheSet",1,["oasis_core_runtime::cache::CacheSet"]],["impl Sync for Hash",1,["oasis_core_runtime::common::crypto::hash::Hash"]],["impl Sync for Nonce",1,["oasis_core_runtime::common::crypto::mrae::nonce::Nonce"]],["impl Sync for MultiSigned",1,["oasis_core_runtime::common::crypto::signature::MultiSigned"]],["impl Sync for PrivateKey",1,["oasis_core_runtime::common::crypto::signature::PrivateKey"]],["impl Sync for PublicKey",1,["oasis_core_runtime::common::crypto::signature::PublicKey"]],["impl Sync for Signature",1,["oasis_core_runtime::common::crypto::signature::Signature"]],["impl Sync for SignatureBundle",1,["oasis_core_runtime::common::crypto::signature::SignatureBundle"]],["impl Sync for Signed",1,["oasis_core_runtime::common::crypto::signature::Signed"]],["impl Sync for PrivateKey",1,["oasis_core_runtime::common::crypto::x25519::PrivateKey"]],["impl Sync for PublicKey",1,["oasis_core_runtime::common::crypto::x25519::PublicKey"]],["impl Sync for Namespace",1,["oasis_core_runtime::common::namespace::Namespace"]],["impl Sync for AbortOnPanic",1,["oasis_core_runtime::common::panic::AbortOnPanic"]],["impl Sync for Quantity",1,["oasis_core_runtime::common::quantity::Quantity"]],["impl Sync for AVR",1,["oasis_core_runtime::common::sgx::ias::AVR"]],["impl Sync for QuotePolicy",1,["oasis_core_runtime::common::sgx::ias::QuotePolicy"]],["impl Sync for QuoteBundle",1,["oasis_core_runtime::common::sgx::pcs::quote::QuoteBundle"]],["impl Sync for QuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::QuotePolicy"]],["impl Sync for TCBBundle",1,["oasis_core_runtime::common::sgx::pcs::tcb::TCBBundle"]],["impl Sync for TdAttributes",1,["oasis_core_runtime::common::sgx::pcs::report::TdAttributes"]],["impl Sync for TdReport",1,["oasis_core_runtime::common::sgx::pcs::report::TdReport"]],["impl Sync for TdxModulePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxModulePolicy"]],["impl Sync for TdxQuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxQuotePolicy"]],["impl Sync for EnclaveIdentity",1,["oasis_core_runtime::common::sgx::EnclaveIdentity"]],["impl Sync for MrEnclave",1,["oasis_core_runtime::common::sgx::MrEnclave"]],["impl Sync for MrSigner",1,["oasis_core_runtime::common::sgx::MrSigner"]],["impl Sync for QuotePolicy",1,["oasis_core_runtime::common::sgx::QuotePolicy"]],["impl Sync for VerifiedQuote",1,["oasis_core_runtime::common::sgx::VerifiedQuote"]],["impl Sync for ProtocolVersions",1,["oasis_core_runtime::common::version::ProtocolVersions"]],["impl Sync for Version",1,["oasis_core_runtime::common::version::Version"]],["impl Sync for Config",1,["oasis_core_runtime::config::Config"]],["impl Sync for Storage",1,["oasis_core_runtime::config::Storage"]],["impl Sync for Address",1,["oasis_core_runtime::consensus::address::Address"]],["impl Sync for COMMON_POOL_ADDRESS",1,["oasis_core_runtime::consensus::address::COMMON_POOL_ADDRESS"]],["impl Sync for FEE_ACC_ADDRESS",1,["oasis_core_runtime::consensus::address::FEE_ACC_ADDRESS"]],["impl Sync for GOVERNANCE_DEPOSITS_ADDRESS",1,["oasis_core_runtime::consensus::address::GOVERNANCE_DEPOSITS_ADDRESS"]],["impl Sync for EpochTimeState",1,["oasis_core_runtime::consensus::beacon::EpochTimeState"]],["impl Sync for CancelUpgradeProposal",1,["oasis_core_runtime::consensus::governance::CancelUpgradeProposal"]],["impl Sync for ChangeParametersProposal",1,["oasis_core_runtime::consensus::governance::ChangeParametersProposal"]],["impl Sync for ConsensusParameterChanges",1,["oasis_core_runtime::consensus::governance::ConsensusParameterChanges"]],["impl Sync for ProposalContent",1,["oasis_core_runtime::consensus::governance::ProposalContent"]],["impl Sync for ProposalVote",1,["oasis_core_runtime::consensus::governance::ProposalVote"]],["impl Sync for UpgradeProposal",1,["oasis_core_runtime::consensus::governance::UpgradeProposal"]],["impl Sync for Application",1,["oasis_core_runtime::consensus::keymanager::churp::Application"]],["impl Sync for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::PolicySGX"]],["impl Sync for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::SignedPolicySGX"]],["impl Sync for Status",1,["oasis_core_runtime::consensus::keymanager::churp::Status"]],["impl Sync for EnclavePolicySGX",1,["oasis_core_runtime::consensus::keymanager::EnclavePolicySGX"]],["impl Sync for EncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedEphemeralSecret"]],["impl Sync for EncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedMasterSecret"]],["impl Sync for EncryptedSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedSecret"]],["impl Sync for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::PolicySGX"]],["impl Sync for SignedEncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedEphemeralSecret"]],["impl Sync for SignedEncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedMasterSecret"]],["impl Sync for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::SignedPolicySGX"]],["impl Sync for AnyNodeRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::AnyNodeRuntimeAdmissionPolicy"]],["impl Sync for Capabilities",1,["oasis_core_runtime::consensus::registry::Capabilities"]],["impl Sync for CapabilityTEE",1,["oasis_core_runtime::consensus::registry::CapabilityTEE"]],["impl Sync for ConsensusAddress",1,["oasis_core_runtime::consensus::registry::ConsensusAddress"]],["impl Sync for ConsensusInfo",1,["oasis_core_runtime::consensus::registry::ConsensusInfo"]],["impl Sync for EndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::EndorsedCapabilityTEE"]],["impl Sync for EntityWhitelistConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistConfig"]],["impl Sync for EntityWhitelistRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleAdmissionPolicy"]],["impl Sync for EntityWhitelistRoleConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleConfig"]],["impl Sync for EntityWhitelistRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRuntimeAdmissionPolicy"]],["impl Sync for ExecutorParameters",1,["oasis_core_runtime::consensus::registry::ExecutorParameters"]],["impl Sync for MaxNodesConstraint",1,["oasis_core_runtime::consensus::registry::MaxNodesConstraint"]],["impl Sync for MinPoolSizeConstraint",1,["oasis_core_runtime::consensus::registry::MinPoolSizeConstraint"]],["impl Sync for Node",1,["oasis_core_runtime::consensus::registry::Node"]],["impl Sync for NodeRuntime",1,["oasis_core_runtime::consensus::registry::NodeRuntime"]],["impl Sync for P2PInfo",1,["oasis_core_runtime::consensus::registry::P2PInfo"]],["impl Sync for PerRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::PerRoleAdmissionPolicy"]],["impl Sync for RolesMask",1,["oasis_core_runtime::consensus::registry::RolesMask"]],["impl Sync for Runtime",1,["oasis_core_runtime::consensus::registry::Runtime"]],["impl Sync for RuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::RuntimeAdmissionPolicy"]],["impl Sync for RuntimeGenesis",1,["oasis_core_runtime::consensus::registry::RuntimeGenesis"]],["impl Sync for RuntimeStakingParameters",1,["oasis_core_runtime::consensus::registry::RuntimeStakingParameters"]],["impl Sync for SchedulingConstraints",1,["oasis_core_runtime::consensus::registry::SchedulingConstraints"]],["impl Sync for StorageParameters",1,["oasis_core_runtime::consensus::registry::StorageParameters"]],["impl Sync for TCPAddress",1,["oasis_core_runtime::consensus::registry::TCPAddress"]],["impl Sync for TLSAddress",1,["oasis_core_runtime::consensus::registry::TLSAddress"]],["impl Sync for TLSInfo",1,["oasis_core_runtime::consensus::registry::TLSInfo"]],["impl Sync for TxnSchedulerParameters",1,["oasis_core_runtime::consensus::registry::TxnSchedulerParameters"]],["impl Sync for VRFInfo",1,["oasis_core_runtime::consensus::registry::VRFInfo"]],["impl Sync for ValidatorSetConstraint",1,["oasis_core_runtime::consensus::registry::ValidatorSetConstraint"]],["impl Sync for VerifiedAttestation",1,["oasis_core_runtime::consensus::registry::VerifiedAttestation"]],["impl Sync for VerifiedEndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::VerifiedEndorsedCapabilityTEE"]],["impl Sync for VersionInfo",1,["oasis_core_runtime::consensus::registry::VersionInfo"]],["impl Sync for AnnotatedBlock",1,["oasis_core_runtime::consensus::roothash::AnnotatedBlock"]],["impl Sync for Block",1,["oasis_core_runtime::consensus::roothash::block::Block"]],["impl Sync for ComputeResultsHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ComputeResultsHeader"]],["impl Sync for ExecutorCommitment",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitment"]],["impl Sync for ExecutorCommitmentHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentHeader"]],["impl Sync for Header",1,["oasis_core_runtime::consensus::roothash::block::Header"]],["impl Sync for IncomingMessage",1,["oasis_core_runtime::consensus::roothash::message::IncomingMessage"]],["impl Sync for MessageEvent",1,["oasis_core_runtime::consensus::roothash::MessageEvent"]],["impl Sync for Pool",1,["oasis_core_runtime::consensus::roothash::commitment::pool::Pool"]],["impl Sync for RoundResults",1,["oasis_core_runtime::consensus::roothash::RoundResults"]],["impl Sync for RoundRoots",1,["oasis_core_runtime::consensus::roothash::RoundRoots"]],["impl Sync for Committee",1,["oasis_core_runtime::consensus::scheduler::Committee"]],["impl Sync for CommitteeNode",1,["oasis_core_runtime::consensus::scheduler::CommitteeNode"]],["impl Sync for Account",1,["oasis_core_runtime::consensus::staking::Account"]],["impl Sync for AddEscrowResult",1,["oasis_core_runtime::consensus::staking::AddEscrowResult"]],["impl Sync for AllowanceChangeEvent",1,["oasis_core_runtime::consensus::staking::AllowanceChangeEvent"]],["impl Sync for BurnEvent",1,["oasis_core_runtime::consensus::staking::BurnEvent"]],["impl Sync for CommissionRateBoundStep",1,["oasis_core_runtime::consensus::staking::CommissionRateBoundStep"]],["impl Sync for CommissionRateStep",1,["oasis_core_runtime::consensus::staking::CommissionRateStep"]],["impl Sync for CommissionSchedule",1,["oasis_core_runtime::consensus::staking::CommissionSchedule"]],["impl Sync for DebondingDelegation",1,["oasis_core_runtime::consensus::staking::DebondingDelegation"]],["impl Sync for Delegation",1,["oasis_core_runtime::consensus::staking::Delegation"]],["impl Sync for Escrow",1,["oasis_core_runtime::consensus::staking::Escrow"]],["impl Sync for EscrowAccount",1,["oasis_core_runtime::consensus::staking::EscrowAccount"]],["impl Sync for Event",1,["oasis_core_runtime::consensus::staking::Event"]],["impl Sync for GeneralAccount",1,["oasis_core_runtime::consensus::staking::GeneralAccount"]],["impl Sync for ReclaimEscrow",1,["oasis_core_runtime::consensus::staking::ReclaimEscrow"]],["impl Sync for ReclaimEscrowResult",1,["oasis_core_runtime::consensus::staking::ReclaimEscrowResult"]],["impl Sync for SharePool",1,["oasis_core_runtime::consensus::staking::SharePool"]],["impl Sync for Slash",1,["oasis_core_runtime::consensus::staking::Slash"]],["impl Sync for StakeAccumulator",1,["oasis_core_runtime::consensus::staking::StakeAccumulator"]],["impl Sync for StakeThreshold",1,["oasis_core_runtime::consensus::staking::StakeThreshold"]],["impl Sync for Transfer",1,["oasis_core_runtime::consensus::staking::Transfer"]],["impl Sync for TransferEvent",1,["oasis_core_runtime::consensus::staking::TransferEvent"]],["impl Sync for TransferResult",1,["oasis_core_runtime::consensus::staking::TransferResult"]],["impl Sync for Withdraw",1,["oasis_core_runtime::consensus::staking::Withdraw"]],["impl Sync for WithdrawResult",1,["oasis_core_runtime::consensus::staking::WithdrawResult"]],["impl Sync for MutableState",1,["oasis_core_runtime::consensus::state::beacon::MutableState"]],["impl Sync for Status",1,["oasis_core_runtime::consensus::state::keymanager::Status"]],["impl Sync for BlockMetadata",1,["oasis_core_runtime::consensus::BlockMetadata"]],["impl Sync for LightBlock",1,["oasis_core_runtime::consensus::LightBlock"]],["impl Sync for Proof",1,["oasis_core_runtime::consensus::tendermint::merkle::Proof"]],["impl Sync for LightBlockMeta",1,["oasis_core_runtime::consensus::tendermint::LightBlockMeta"]],["impl Sync for NopVerifier",1,["oasis_core_runtime::consensus::tendermint::verifier::noop::NopVerifier"]],["impl Sync for Verifier",1,["oasis_core_runtime::consensus::tendermint::verifier::Verifier"]],["impl Sync for Fee",1,["oasis_core_runtime::consensus::transaction::Fee"]],["impl Sync for Proof",1,["oasis_core_runtime::consensus::transaction::Proof"]],["impl Sync for SignedTransactionWithProof",1,["oasis_core_runtime::consensus::transaction::SignedTransactionWithProof"]],["impl Sync for Transaction",1,["oasis_core_runtime::consensus::transaction::Transaction"]],["impl Sync for TrustRoot",1,["oasis_core_runtime::consensus::verifier::TrustRoot"]],["impl Sync for Dispatcher",1,["oasis_core_runtime::dispatcher::Dispatcher"]],["impl Sync for PostInitState",1,["oasis_core_runtime::dispatcher::PostInitState"]],["impl Sync for RpcClient",1,["oasis_core_runtime::enclave_rpc::client::RpcClient"]],["impl Sync for Context",1,["oasis_core_runtime::enclave_rpc::context::Context"]],["impl Sync for Demux",1,["oasis_core_runtime::enclave_rpc::demux::Demux"]],["impl Sync for Dispatcher",1,["oasis_core_runtime::enclave_rpc::dispatcher::Dispatcher"]],["impl Sync for Method",1,["oasis_core_runtime::enclave_rpc::dispatcher::Method"]],["impl Sync for MethodDescriptor",1,["oasis_core_runtime::enclave_rpc::dispatcher::MethodDescriptor"]],["impl Sync for Builder",1,["oasis_core_runtime::enclave_rpc::session::Builder"]],["impl Sync for Session",1,["oasis_core_runtime::enclave_rpc::session::Session"]],["impl Sync for SessionInfo",1,["oasis_core_runtime::enclave_rpc::session::SessionInfo"]],["impl Sync for Error",1,["oasis_core_runtime::enclave_rpc::types::Error"]],["impl Sync for Frame",1,["oasis_core_runtime::enclave_rpc::types::Frame"]],["impl Sync for Request",1,["oasis_core_runtime::enclave_rpc::types::Request"]],["impl Sync for Response",1,["oasis_core_runtime::enclave_rpc::types::Response"]],["impl Sync for SessionID",1,["oasis_core_runtime::enclave_rpc::types::SessionID"]],["impl Sync for RegisterNotifyOpts",1,["oasis_core_runtime::host::RegisterNotifyOpts"]],["impl Sync for SubmitTxOpts",1,["oasis_core_runtime::host::SubmitTxOpts"]],["impl Sync for TxResult",1,["oasis_core_runtime::host::TxResult"]],["impl Sync for Identity",1,["oasis_core_runtime::identity::Identity"]],["impl Sync for PolicyVerifier",1,["oasis_core_runtime::policy::PolicyVerifier"]],["impl Sync for HostInfo",1,["oasis_core_runtime::protocol::HostInfo"]],["impl Sync for Protocol",1,["oasis_core_runtime::protocol::Protocol"]],["impl Sync for ProtocolUntrustedLocalStorage",1,["oasis_core_runtime::protocol::ProtocolUntrustedLocalStorage"]],["impl Sync for LogEntry",1,["oasis_core_runtime::storage::mkvs::LogEntry"]],["impl Sync for Prefix",1,["oasis_core_runtime::storage::mkvs::Prefix"]],["impl Sync for Root",1,["oasis_core_runtime::storage::mkvs::tree::node::Root"]],["impl Sync for GetPrefixesRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetPrefixesRequest"]],["impl Sync for GetRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetRequest"]],["impl Sync for HostReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::host::HostReadSyncer"]],["impl Sync for IterateRequest",1,["oasis_core_runtime::storage::mkvs::sync::IterateRequest"]],["impl Sync for NoopReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::noop::NoopReadSyncer"]],["impl Sync for Proof",1,["oasis_core_runtime::storage::mkvs::sync::proof::Proof"]],["impl Sync for ProofBuilder",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofBuilder"]],["impl Sync for ProofResponse",1,["oasis_core_runtime::storage::mkvs::sync::ProofResponse"]],["impl Sync for ProofVerifier",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofVerifier"]],["impl Sync for RawProofEntry",1,["oasis_core_runtime::storage::mkvs::sync::proof::RawProofEntry"]],["impl Sync for TreeID",1,["oasis_core_runtime::storage::mkvs::sync::TreeID"]],["impl Sync for UntrustedInMemoryStorage",1,["oasis_core_runtime::storage::UntrustedInMemoryStorage"]],["impl Sync for BUILD_INFO",1,["oasis_core_runtime::BUILD_INFO"]],["impl Sync for BuildInfo",1,["oasis_core_runtime::BuildInfo"]],["impl Sync for ExecuteBatchResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteBatchResult"]],["impl Sync for ExecuteTxResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteTxResult"]],["impl Sync for NoopDispatcher",1,["oasis_core_runtime::transaction::dispatcher::NoopDispatcher"]],["impl Sync for CoarsenedKey",1,["oasis_core_runtime::transaction::rwset::CoarsenedKey"]],["impl Sync for ReadWriteSet",1,["oasis_core_runtime::transaction::rwset::ReadWriteSet"]],["impl Sync for Tag",1,["oasis_core_runtime::transaction::tags::Tag"]],["impl Sync for TxnBatch",1,["oasis_core_runtime::transaction::types::TxnBatch"]],["impl Sync for CheckTxMetadata",1,["oasis_core_runtime::types::CheckTxMetadata"]],["impl Sync for CheckTxResult",1,["oasis_core_runtime::types::CheckTxResult"]],["impl Sync for ComputedBatch",1,["oasis_core_runtime::types::ComputedBatch"]],["impl Sync for Error",1,["oasis_core_runtime::types::Error"]],["impl Sync for FeatureScheduleControl",1,["oasis_core_runtime::types::FeatureScheduleControl"]],["impl Sync for Features",1,["oasis_core_runtime::types::Features"]],["impl Sync for HostFetchConsensusEventsRequest",1,["oasis_core_runtime::types::HostFetchConsensusEventsRequest"]],["impl Sync for HostFetchConsensusEventsResponse",1,["oasis_core_runtime::types::HostFetchConsensusEventsResponse"]],["impl Sync for Message",1,["oasis_core_runtime::types::Message"]],["impl Sync for RegisterNotifyRuntimeEvent",1,["oasis_core_runtime::types::RegisterNotifyRuntimeEvent"]],["impl Sync for RuntimeInfoRequest",1,["oasis_core_runtime::types::RuntimeInfoRequest"]],["impl Sync for RuntimeInfoResponse",1,["oasis_core_runtime::types::RuntimeInfoResponse"]],["impl Sync for RuntimeNotifyEvent",1,["oasis_core_runtime::types::RuntimeNotifyEvent"]],["impl Sync for StorageSyncRequestWithEndpoint",1,["oasis_core_runtime::types::StorageSyncRequestWithEndpoint"]],["impl<'a> !Sync for Context<'a>",1,["oasis_core_runtime::transaction::context::Context"]],["impl<'a> Sync for Quote<'a>",1,["oasis_core_runtime::common::sgx::pcs::quote::Quote"]],["impl<'a> Sync for PreInitState<'a>",1,["oasis_core_runtime::dispatcher::PreInitState"]],["impl<'a, T> Sync for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::beacon::ImmutableState"]],["impl<'a, T> Sync for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::keymanager::churp::ImmutableState"]],["impl<'a, T> Sync for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::keymanager::ImmutableState"]],["impl<'a, T> Sync for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::registry::ImmutableState"]],["impl<'a, T> Sync for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::roothash::ImmutableState"]],["impl<'a, T> Sync for ImmutableState<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::consensus::state::staking::ImmutableState"]],["impl<'a, T> Sync for Response<'a, T>
where\n T: Sync,
",1,["oasis_core_runtime::enclave_rpc::client::Response"]],["impl<PeerID> Sync for MultiplexedSession<PeerID>
where\n PeerID: Sync,
",1,["oasis_core_runtime::enclave_rpc::sessions::MultiplexedSession"]],["impl<PeerID> Sync for SessionMeta<PeerID>
where\n PeerID: Sync + Send,
",1,["oasis_core_runtime::enclave_rpc::sessions::SessionMeta"]],["impl<PeerID> Sync for Sessions<PeerID>
where\n PeerID: Sync + Send,
",1,["oasis_core_runtime::enclave_rpc::sessions::Sessions"]],["impl<T> Sync for Versioned<T>
where\n T: Sync,
",1,["oasis_core_runtime::common::versioned::Versioned"]],["impl<T> Sync for OverlayTree<T>
where\n T: Sync,
",1,["oasis_core_runtime::storage::mkvs::tree::overlay::OverlayTree"]]], +"oasis_runtime_sdk":[["impl !Sync for RootRng",1,["oasis_runtime_sdk::crypto::random::RootRng"]],["impl !Sync for State",1,["oasis_runtime_sdk::state::State"]],["impl !Sync for HostStore",1,["oasis_runtime_sdk::storage::host::HostStore"]],["impl !Sync for Mock",1,["oasis_runtime_sdk::testing::mock::Mock"]],["impl Sync for Metadata",1,["oasis_runtime_sdk::callformat::Metadata"]],["impl Sync for Error",1,["oasis_runtime_sdk::crypto::multisig::Error"]],["impl Sync for Error",1,["oasis_runtime_sdk::crypto::signature::Error"]],["impl Sync for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::MemorySigner"]],["impl Sync for PublicKey",1,["oasis_runtime_sdk::crypto::signature::PublicKey"]],["impl Sync for SignatureType",1,["oasis_runtime_sdk::crypto::signature::SignatureType"]],["impl Sync for Error",1,["oasis_runtime_sdk::dispatcher::Error"]],["impl Sync for Error",1,["oasis_runtime_sdk::history::Error"]],["impl Sync for AuthDecision",1,["oasis_runtime_sdk::module::AuthDecision"]],["impl Sync for CallResult",1,["oasis_runtime_sdk::module::CallResult"]],["impl Sync for Error",1,["oasis_runtime_sdk::modules::access::Error"]],["impl Sync for Authorization",1,["oasis_runtime_sdk::modules::access::types::Authorization"]],["impl Sync for MethodAuthorization",1,["oasis_runtime_sdk::modules::access::types::MethodAuthorization"]],["impl Sync for Error",1,["oasis_runtime_sdk::modules::accounts::Error"]],["impl Sync for Event",1,["oasis_runtime_sdk::modules::accounts::Event"]],["impl Sync for ParameterValidationError",1,["oasis_runtime_sdk::modules::accounts::ParameterValidationError"]],["impl Sync for Error",1,["oasis_runtime_sdk::modules::consensus::Error"]],["impl Sync for Event",1,["oasis_runtime_sdk::modules::consensus::Event"]],["impl Sync for ParameterValidationError",1,["oasis_runtime_sdk::modules::consensus::ParameterValidationError"]],["impl Sync for RootKind",1,["oasis_runtime_sdk::modules::consensus::types::RootKind"]],["impl Sync for Error",1,["oasis_runtime_sdk::modules::consensus_accounts::Error"]],["impl Sync for Event",1,["oasis_runtime_sdk::modules::consensus_accounts::Event"]],["impl Sync for ReceiptKind",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ReceiptKind"]],["impl Sync for Error",1,["oasis_runtime_sdk::modules::core::Error"]],["impl Sync for Event",1,["oasis_runtime_sdk::modules::core::Event"]],["impl Sync for ParameterValidationError",1,["oasis_runtime_sdk::modules::core::ParameterValidationError"]],["impl Sync for MethodHandlerKind",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerKind"]],["impl Sync for Error",1,["oasis_runtime_sdk::modules::rewards::Error"]],["impl Sync for ParameterValidationError",1,["oasis_runtime_sdk::modules::rewards::ParameterValidationError"]],["impl Sync for RewardAction",1,["oasis_runtime_sdk::modules::rewards::types::RewardAction"]],["impl Sync for RewardScheduleError",1,["oasis_runtime_sdk::modules::rewards::types::RewardScheduleError"]],["impl Sync for Error",1,["oasis_runtime_sdk::modules::rofl::app_id::Error"]],["impl Sync for Error",1,["oasis_runtime_sdk::modules::rofl::error::Error"]],["impl Sync for Event",1,["oasis_runtime_sdk::modules::rofl::event::Event"]],["impl Sync for ParameterValidationError",1,["oasis_runtime_sdk::modules::rofl::ParameterValidationError"]],["impl Sync for AllowedEndorsement",1,["oasis_runtime_sdk::modules::rofl::policy::AllowedEndorsement"]],["impl Sync for FeePolicy",1,["oasis_runtime_sdk::modules::rofl::policy::FeePolicy"]],["impl Sync for IdentifierScheme",1,["oasis_runtime_sdk::modules::rofl::types::IdentifierScheme"]],["impl Sync for Error",1,["oasis_runtime_sdk::schedule_control::Error"]],["impl Sync for Mode",1,["oasis_runtime_sdk::state::Mode"]],["impl Sync for Error",1,["oasis_runtime_sdk::storage::confidential::Error"]],["impl Sync for Error",1,["oasis_runtime_sdk::types::address::Error"]],["impl Sync for SignatureAddressSpec",1,["oasis_runtime_sdk::types::address::SignatureAddressSpec"]],["impl Sync for Error",1,["oasis_runtime_sdk::types::token::Error"]],["impl Sync for AddressSpec",1,["oasis_runtime_sdk::types::transaction::AddressSpec"]],["impl Sync for AuthProof",1,["oasis_runtime_sdk::types::transaction::AuthProof"]],["impl Sync for CallFormat",1,["oasis_runtime_sdk::types::transaction::CallFormat"]],["impl Sync for CallResult",1,["oasis_runtime_sdk::types::transaction::CallResult"]],["impl Sync for CallerAddress",1,["oasis_runtime_sdk::types::transaction::CallerAddress"]],["impl Sync for Error",1,["oasis_runtime_sdk::types::transaction::Error"]],["impl Sync for ScheduleControl",1,["oasis_runtime_sdk::config::ScheduleControl"]],["impl Sync for Config",1,["oasis_runtime_sdk::crypto::multisig::Config"]],["impl Sync for Signer",1,["oasis_runtime_sdk::crypto::multisig::Signer"]],["impl Sync for LeafRng",1,["oasis_runtime_sdk::crypto::random::LeafRng"]],["impl Sync for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::ed25519::MemorySigner"]],["impl Sync for PublicKey",1,["oasis_runtime_sdk::crypto::signature::ed25519::PublicKey"]],["impl Sync for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256k1::MemorySigner"]],["impl Sync for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256k1::PublicKey"]],["impl Sync for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256r1::MemorySigner"]],["impl Sync for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256r1::PublicKey"]],["impl Sync for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp384r1::MemorySigner"]],["impl Sync for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp384r1::PublicKey"]],["impl Sync for PublicKey",1,["oasis_runtime_sdk::crypto::signature::sr25519::PublicKey"]],["impl Sync for Signature",1,["oasis_runtime_sdk::crypto::signature::Signature"]],["impl Sync for DispatchResult",1,["oasis_runtime_sdk::dispatcher::DispatchResult"]],["impl Sync for QueryRequest",1,["oasis_runtime_sdk::enclave_rpc::QueryRequest"]],["impl Sync for EventTag",1,["oasis_runtime_sdk::event::EventTag"]],["impl Sync for KeyManagerClientWithContext",1,["oasis_runtime_sdk::keymanager::KeyManagerClientWithContext"]],["impl Sync for FeeManager",1,["oasis_runtime_sdk::modules::accounts::fee::FeeManager"]],["impl Sync for FeeUpdates",1,["oasis_runtime_sdk::modules::accounts::fee::FeeUpdates"]],["impl Sync for TransactionFee",1,["oasis_runtime_sdk::modules::accounts::fee::TransactionFee"]],["impl Sync for GasCosts",1,["oasis_runtime_sdk::modules::accounts::GasCosts"]],["impl Sync for Genesis",1,["oasis_runtime_sdk::modules::accounts::Genesis"]],["impl Sync for Module",1,["oasis_runtime_sdk::modules::accounts::Module"]],["impl Sync for Parameters",1,["oasis_runtime_sdk::modules::accounts::Parameters"]],["impl Sync for Account",1,["oasis_runtime_sdk::modules::accounts::types::Account"]],["impl Sync for AccountBalances",1,["oasis_runtime_sdk::modules::accounts::types::AccountBalances"]],["impl Sync for AddressesQuery",1,["oasis_runtime_sdk::modules::accounts::types::AddressesQuery"]],["impl Sync for BalancesQuery",1,["oasis_runtime_sdk::modules::accounts::types::BalancesQuery"]],["impl Sync for DenominationInfo",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfo"]],["impl Sync for DenominationInfoQuery",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfoQuery"]],["impl Sync for NonceQuery",1,["oasis_runtime_sdk::modules::accounts::types::NonceQuery"]],["impl Sync for Transfer",1,["oasis_runtime_sdk::modules::accounts::types::Transfer"]],["impl Sync for GasCosts",1,["oasis_runtime_sdk::modules::consensus::GasCosts"]],["impl Sync for Genesis",1,["oasis_runtime_sdk::modules::consensus::Genesis"]],["impl Sync for Module",1,["oasis_runtime_sdk::modules::consensus::Module"]],["impl Sync for Parameters",1,["oasis_runtime_sdk::modules::consensus::Parameters"]],["impl Sync for RoundRootBody",1,["oasis_runtime_sdk::modules::consensus::types::RoundRootBody"]],["impl Sync for Undelegation",1,["oasis_runtime_sdk::modules::consensus_accounts::state::Undelegation"]],["impl Sync for GasCosts",1,["oasis_runtime_sdk::modules::consensus_accounts::GasCosts"]],["impl Sync for Genesis",1,["oasis_runtime_sdk::modules::consensus_accounts::Genesis"]],["impl Sync for Parameters",1,["oasis_runtime_sdk::modules::consensus_accounts::Parameters"]],["impl Sync for AccountBalance",1,["oasis_runtime_sdk::modules::consensus_accounts::types::AccountBalance"]],["impl Sync for BalanceQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::BalanceQuery"]],["impl Sync for ConsensusAccountQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusAccountQuery"]],["impl Sync for ConsensusDelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusDelegateContext"]],["impl Sync for ConsensusError",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusError"]],["impl Sync for ConsensusTransferContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusTransferContext"]],["impl Sync for ConsensusUndelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusUndelegateContext"]],["impl Sync for ConsensusWithdrawContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusWithdrawContext"]],["impl Sync for Delegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Delegate"]],["impl Sync for DelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationInfo"]],["impl Sync for DelegationQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationQuery"]],["impl Sync for DelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationsQuery"]],["impl Sync for Deposit",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Deposit"]],["impl Sync for ExtendedDelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ExtendedDelegationInfo"]],["impl Sync for Receipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Receipt"]],["impl Sync for TakeReceipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::TakeReceipt"]],["impl Sync for Undelegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Undelegate"]],["impl Sync for UndelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationInfo"]],["impl Sync for UndelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationsQuery"]],["impl Sync for Withdraw",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Withdraw"]],["impl Sync for DynamicMinGasPrice",1,["oasis_runtime_sdk::modules::core::DynamicMinGasPrice"]],["impl Sync for GasCosts",1,["oasis_runtime_sdk::modules::core::GasCosts"]],["impl Sync for Genesis",1,["oasis_runtime_sdk::modules::core::Genesis"]],["impl Sync for LocalConfig",1,["oasis_runtime_sdk::modules::core::LocalConfig"]],["impl Sync for Parameters",1,["oasis_runtime_sdk::modules::core::Parameters"]],["impl Sync for TxSimulationFailure",1,["oasis_runtime_sdk::modules::core::TxSimulationFailure"]],["impl Sync for CallDataPublicKeyQueryResponse",1,["oasis_runtime_sdk::modules::core::types::CallDataPublicKeyQueryResponse"]],["impl Sync for EstimateGasQuery",1,["oasis_runtime_sdk::modules::core::types::EstimateGasQuery"]],["impl Sync for ExecuteReadOnlyTxQuery",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxQuery"]],["impl Sync for ExecuteReadOnlyTxResponse",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxResponse"]],["impl Sync for Metadata",1,["oasis_runtime_sdk::modules::core::types::Metadata"]],["impl Sync for MethodHandlerInfo",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerInfo"]],["impl Sync for ModuleInfo",1,["oasis_runtime_sdk::modules::core::types::ModuleInfo"]],["impl Sync for RuntimeInfoResponse",1,["oasis_runtime_sdk::modules::core::types::RuntimeInfoResponse"]],["impl Sync for Genesis",1,["oasis_runtime_sdk::modules::rewards::Genesis"]],["impl Sync for Module",1,["oasis_runtime_sdk::modules::rewards::Module"]],["impl Sync for Parameters",1,["oasis_runtime_sdk::modules::rewards::Parameters"]],["impl Sync for EpochRewards",1,["oasis_runtime_sdk::modules::rewards::types::EpochRewards"]],["impl Sync for RewardSchedule",1,["oasis_runtime_sdk::modules::rewards::types::RewardSchedule"]],["impl Sync for RewardStep",1,["oasis_runtime_sdk::modules::rewards::types::RewardStep"]],["impl Sync for AppId",1,["oasis_runtime_sdk::modules::rofl::app_id::AppId"]],["impl Sync for AppAuthPolicy",1,["oasis_runtime_sdk::modules::rofl::policy::AppAuthPolicy"]],["impl Sync for KeyEndorsementInfo",1,["oasis_runtime_sdk::modules::rofl::state::KeyEndorsementInfo"]],["impl Sync for Genesis",1,["oasis_runtime_sdk::modules::rofl::Genesis"]],["impl Sync for Parameters",1,["oasis_runtime_sdk::modules::rofl::Parameters"]],["impl Sync for AppConfig",1,["oasis_runtime_sdk::modules::rofl::types::AppConfig"]],["impl Sync for AppInstanceQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppInstanceQuery"]],["impl Sync for AppQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppQuery"]],["impl Sync for Create",1,["oasis_runtime_sdk::modules::rofl::types::Create"]],["impl Sync for Register",1,["oasis_runtime_sdk::modules::rofl::types::Register"]],["impl Sync for Registration",1,["oasis_runtime_sdk::modules::rofl::types::Registration"]],["impl Sync for Remove",1,["oasis_runtime_sdk::modules::rofl::types::Remove"]],["impl Sync for StakeThresholds",1,["oasis_runtime_sdk::modules::rofl::types::StakeThresholds"]],["impl Sync for Update",1,["oasis_runtime_sdk::modules::rofl::types::Update"]],["impl Sync for SenderMeta",1,["oasis_runtime_sdk::sender::SenderMeta"]],["impl Sync for CurrentState",1,["oasis_runtime_sdk::state::CurrentState"]],["impl Sync for Environment",1,["oasis_runtime_sdk::state::Environment"]],["impl Sync for Options",1,["oasis_runtime_sdk::state::Options"]],["impl Sync for TransactionWithMeta",1,["oasis_runtime_sdk::state::TransactionWithMeta"]],["impl Sync for AllowAllValidator",1,["oasis_runtime_sdk::subcall::AllowAllValidator"]],["impl Sync for SubcallInfo",1,["oasis_runtime_sdk::subcall::SubcallInfo"]],["impl Sync for SubcallResult",1,["oasis_runtime_sdk::subcall::SubcallResult"]],["impl Sync for MockKeyManagerClient",1,["oasis_runtime_sdk::testing::keymanager::MockKeyManagerClient"]],["impl Sync for CallOptions",1,["oasis_runtime_sdk::testing::mock::CallOptions"]],["impl Sync for Config",1,["oasis_runtime_sdk::testing::mock::Config"]],["impl Sync for EmptyRuntime",1,["oasis_runtime_sdk::testing::mock::EmptyRuntime"]],["impl Sync for Signer",1,["oasis_runtime_sdk::testing::mock::Signer"]],["impl Sync for Address",1,["oasis_runtime_sdk::types::address::Address"]],["impl Sync for CallEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::CallEnvelopeX25519DeoxysII"]],["impl Sync for ResultEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::ResultEnvelopeX25519DeoxysII"]],["impl Sync for MessageEventHookInvocation",1,["oasis_runtime_sdk::types::message::MessageEventHookInvocation"]],["impl Sync for MessageResult",1,["oasis_runtime_sdk::types::message::MessageResult"]],["impl Sync for BaseUnits",1,["oasis_runtime_sdk::types::token::BaseUnits"]],["impl Sync for Denomination",1,["oasis_runtime_sdk::types::token::Denomination"]],["impl Sync for AuthInfo",1,["oasis_runtime_sdk::types::transaction::AuthInfo"]],["impl Sync for Call",1,["oasis_runtime_sdk::types::transaction::Call"]],["impl Sync for Fee",1,["oasis_runtime_sdk::types::transaction::Fee"]],["impl Sync for FeeProxy",1,["oasis_runtime_sdk::types::transaction::FeeProxy"]],["impl Sync for SignerInfo",1,["oasis_runtime_sdk::types::transaction::SignerInfo"]],["impl Sync for Transaction",1,["oasis_runtime_sdk::types::transaction::Transaction"]],["impl Sync for TransactionSigner",1,["oasis_runtime_sdk::types::transaction::TransactionSigner"]],["impl Sync for UnverifiedTransaction",1,["oasis_runtime_sdk::types::transaction::UnverifiedTransaction"]],["impl<'a> !Sync for DispatchOptions<'a>",1,["oasis_runtime_sdk::dispatcher::DispatchOptions"]],["impl<'a, R> !Sync for RuntimeBatchContext<'a, R>",1,["oasis_runtime_sdk::context::RuntimeBatchContext"]],["impl<'a, V> !Sync for StateValue<'a, V>",1,["oasis_runtime_sdk::state::StateValue"]],["impl<A> Sync for Client<A>",1,["oasis_runtime_sdk::modules::rofl::app::client::Client"]],["impl<A> Sync for Environment<A>",1,["oasis_runtime_sdk::modules::rofl::app::env::Environment"]],["impl<B, R> Sync for DispatchResult<B, R>
where\n R: Sync,\n B: Sync,
",1,["oasis_runtime_sdk::module::DispatchResult"]],["impl<Cfg> Sync for Module<Cfg>
where\n Cfg: Sync,
",1,["oasis_runtime_sdk::modules::access::Module"]],["impl<Cfg> Sync for Module<Cfg>
where\n Cfg: Sync,
",1,["oasis_runtime_sdk::modules::core::Module"]],["impl<Cfg> Sync for Module<Cfg>
where\n Cfg: Sync,
",1,["oasis_runtime_sdk::modules::rofl::Module"]],["impl<Consensus> Sync for Module<Consensus>
where\n Consensus: Sync,
",1,["oasis_runtime_sdk::modules::consensus_accounts::Module"]],["impl<M> Sync for MKVSStore<M>
where\n M: Sync,
",1,["oasis_runtime_sdk::storage::mkvs::MKVSStore"]],["impl<R> Sync for Dispatcher<R>
where\n R: Sync,
",1,["oasis_runtime_sdk::dispatcher::Dispatcher"]],["impl<S> Sync for ConfidentialStore<S>
where\n S: Sync,
",1,["oasis_runtime_sdk::storage::confidential::ConfidentialStore"]],["impl<S> Sync for OverlayStore<S>
where\n S: Sync,
",1,["oasis_runtime_sdk::storage::overlay::OverlayStore"]],["impl<S> Sync for TypedStore<S>
where\n S: Sync,
",1,["oasis_runtime_sdk::storage::typed::TypedStore"]],["impl<S, D> Sync for HashedStore<S, D>
where\n S: Sync,\n D: Sync,
",1,["oasis_runtime_sdk::storage::hashed::HashedStore"]],["impl<S, P> Sync for PrefixStore<S, P>
where\n S: Sync,\n P: Sync,
",1,["oasis_runtime_sdk::storage::prefix::PrefixStore"]],["impl<T> Sync for TransactionResult<T>
where\n T: Sync,
",1,["oasis_runtime_sdk::state::TransactionResult"]]], +"oasis_runtime_sdk_contracts":[["impl Sync for Error",1,["oasis_runtime_sdk_contracts::Error"]],["impl Sync for Event",1,["oasis_runtime_sdk_contracts::Event"]],["impl Sync for ABI",1,["oasis_runtime_sdk_contracts::types::ABI"]],["impl Sync for Policy",1,["oasis_runtime_sdk_contracts::types::Policy"]],["impl Sync for PublicKeyKind",1,["oasis_runtime_sdk_contracts::types::PublicKeyKind"]],["impl Sync for StoreKind",1,["oasis_runtime_sdk_contracts::types::StoreKind"]],["impl Sync for GasCosts",1,["oasis_runtime_sdk_contracts::GasCosts"]],["impl Sync for Genesis",1,["oasis_runtime_sdk_contracts::Genesis"]],["impl Sync for LocalConfig",1,["oasis_runtime_sdk_contracts::LocalConfig"]],["impl Sync for Parameters",1,["oasis_runtime_sdk_contracts::Parameters"]],["impl Sync for Call",1,["oasis_runtime_sdk_contracts::types::Call"]],["impl Sync for CallResult",1,["oasis_runtime_sdk_contracts::types::CallResult"]],["impl Sync for ChangeUpgradePolicy",1,["oasis_runtime_sdk_contracts::types::ChangeUpgradePolicy"]],["impl Sync for Code",1,["oasis_runtime_sdk_contracts::types::Code"]],["impl Sync for CodeQuery",1,["oasis_runtime_sdk_contracts::types::CodeQuery"]],["impl Sync for CodeStorageQuery",1,["oasis_runtime_sdk_contracts::types::CodeStorageQuery"]],["impl Sync for CodeStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::CodeStorageQueryResult"]],["impl Sync for ContractEvent",1,["oasis_runtime_sdk_contracts::types::ContractEvent"]],["impl Sync for CustomQuery",1,["oasis_runtime_sdk_contracts::types::CustomQuery"]],["impl Sync for CustomQueryResult",1,["oasis_runtime_sdk_contracts::types::CustomQueryResult"]],["impl Sync for Instance",1,["oasis_runtime_sdk_contracts::types::Instance"]],["impl Sync for InstanceQuery",1,["oasis_runtime_sdk_contracts::types::InstanceQuery"]],["impl Sync for InstanceRawStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQuery"]],["impl Sync for InstanceRawStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQueryResult"]],["impl Sync for InstanceStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQuery"]],["impl Sync for InstanceStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQueryResult"]],["impl Sync for Instantiate",1,["oasis_runtime_sdk_contracts::types::Instantiate"]],["impl Sync for InstantiateResult",1,["oasis_runtime_sdk_contracts::types::InstantiateResult"]],["impl Sync for PublicKeyQuery",1,["oasis_runtime_sdk_contracts::types::PublicKeyQuery"]],["impl Sync for PublicKeyQueryResult",1,["oasis_runtime_sdk_contracts::types::PublicKeyQueryResult"]],["impl Sync for Upgrade",1,["oasis_runtime_sdk_contracts::types::Upgrade"]],["impl Sync for Upload",1,["oasis_runtime_sdk_contracts::types::Upload"]],["impl Sync for UploadResult",1,["oasis_runtime_sdk_contracts::types::UploadResult"]],["impl<Cfg> Sync for Module<Cfg>
where\n Cfg: Sync,
",1,["oasis_runtime_sdk_contracts::Module"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/marker/trait.Unpin.js b/rust/trait.impl/core/marker/trait.Unpin.js new file mode 100644 index 0000000000..5d30411821 --- /dev/null +++ b/rust/trait.impl/core/marker/trait.Unpin.js @@ -0,0 +1,8 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl Unpin for CryptoError",1,["oasis_contract_sdk::env::CryptoError"]],["impl Unpin for HostRegion",1,["oasis_contract_sdk::memory::HostRegion"]],["impl Unpin for MockContext",1,["oasis_contract_sdk::testing::MockContext"]],["impl Unpin for MockEnv",1,["oasis_contract_sdk::testing::MockEnv"]],["impl Unpin for MockStore",1,["oasis_contract_sdk::testing::MockStore"]],["impl<'a> Unpin for HostRegionRef<'a>",1,["oasis_contract_sdk::memory::HostRegionRef"]]], +"oasis_contract_sdk_storage":[["impl<'key, K, V> Unpin for ConfidentialMap<'key, K, V>
where\n K: Unpin,\n V: Unpin,
",1,["oasis_contract_sdk_storage::map::ConfidentialMap"]],["impl<'key, K, V> Unpin for PublicMap<'key, K, V>
where\n K: Unpin,\n V: Unpin,
",1,["oasis_contract_sdk_storage::map::PublicMap"]],["impl<'key, T> Unpin for ConfidentialCell<'key, T>
where\n T: Unpin,
",1,["oasis_contract_sdk_storage::cell::ConfidentialCell"]],["impl<'key, T> Unpin for PublicCell<'key, T>
where\n T: Unpin,
",1,["oasis_contract_sdk_storage::cell::PublicCell"]],["impl<I> Unpin for Int<I>
where\n <I as Integer>::Encoded: Unpin,\n I: Unpin,
",1,["oasis_contract_sdk_storage::map::Int"]]], +"oasis_contract_sdk_types":[["impl Unpin for Error",1,["oasis_contract_sdk_types::address::Error"]],["impl Unpin for SignatureKind",1,["oasis_contract_sdk_types::crypto::SignatureKind"]],["impl Unpin for CallFormat",1,["oasis_contract_sdk_types::CallFormat"]],["impl Unpin for ExecutionResult",1,["oasis_contract_sdk_types::ExecutionResult"]],["impl Unpin for AccountsQuery",1,["oasis_contract_sdk_types::env::AccountsQuery"]],["impl Unpin for AccountsResponse",1,["oasis_contract_sdk_types::env::AccountsResponse"]],["impl Unpin for QueryRequest",1,["oasis_contract_sdk_types::env::QueryRequest"]],["impl Unpin for QueryResponse",1,["oasis_contract_sdk_types::env::QueryResponse"]],["impl Unpin for CallResult",1,["oasis_contract_sdk_types::message::CallResult"]],["impl Unpin for Message",1,["oasis_contract_sdk_types::message::Message"]],["impl Unpin for NotifyReply",1,["oasis_contract_sdk_types::message::NotifyReply"]],["impl Unpin for Reply",1,["oasis_contract_sdk_types::message::Reply"]],["impl Unpin for StoreKind",1,["oasis_contract_sdk_types::storage::StoreKind"]],["impl Unpin for Error",1,["oasis_contract_sdk_types::token::Error"]],["impl Unpin for Address",1,["oasis_contract_sdk_types::address::Address"]],["impl Unpin for Event",1,["oasis_contract_sdk_types::event::Event"]],["impl Unpin for InstantiateResult",1,["oasis_contract_sdk_types::modules::contracts::InstantiateResult"]],["impl Unpin for CodeId",1,["oasis_contract_sdk_types::CodeId"]],["impl Unpin for ExecutionContext",1,["oasis_contract_sdk_types::ExecutionContext"]],["impl Unpin for ExecutionOk",1,["oasis_contract_sdk_types::ExecutionOk"]],["impl Unpin for InstanceId",1,["oasis_contract_sdk_types::InstanceId"]],["impl Unpin for BaseUnits",1,["oasis_contract_sdk_types::token::BaseUnits"]],["impl Unpin for Denomination",1,["oasis_contract_sdk_types::token::Denomination"]]], +"oasis_core_runtime":[["impl Unpin for Quote",1,["oasis_core_runtime::common::sgx::Quote"]],["impl Unpin for Error",1,["oasis_core_runtime::common::sgx::pcs::Error"]],["impl Unpin for Event",1,["oasis_core_runtime::consensus::Event"]],["impl Unpin for Vote",1,["oasis_core_runtime::consensus::governance::Vote"]],["impl Unpin for Error",1,["oasis_core_runtime::consensus::keymanager::churp::Error"]],["impl Unpin for SuiteId",1,["oasis_core_runtime::consensus::keymanager::churp::SuiteId"]],["impl Unpin for Error",1,["oasis_core_runtime::consensus::keymanager::Error"]],["impl Unpin for RuntimeGovernanceModel",1,["oasis_core_runtime::consensus::registry::RuntimeGovernanceModel"]],["impl Unpin for RuntimeKind",1,["oasis_core_runtime::consensus::registry::RuntimeKind"]],["impl Unpin for SGXAttestation",1,["oasis_core_runtime::consensus::registry::SGXAttestation"]],["impl Unpin for SGXConstraints",1,["oasis_core_runtime::consensus::registry::SGXConstraints"]],["impl Unpin for TEEHardware",1,["oasis_core_runtime::consensus::registry::TEEHardware"]],["impl Unpin for Error",1,["oasis_core_runtime::consensus::roothash::Error"]],["impl Unpin for ExecutorCommitmentFailure",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentFailure"]],["impl Unpin for GovernanceMessage",1,["oasis_core_runtime::consensus::roothash::message::GovernanceMessage"]],["impl Unpin for HeaderType",1,["oasis_core_runtime::consensus::roothash::block::HeaderType"]],["impl Unpin for Message",1,["oasis_core_runtime::consensus::roothash::message::Message"]],["impl Unpin for RegistryMessage",1,["oasis_core_runtime::consensus::roothash::message::RegistryMessage"]],["impl Unpin for StakingMessage",1,["oasis_core_runtime::consensus::roothash::message::StakingMessage"]],["impl Unpin for CommitteeKind",1,["oasis_core_runtime::consensus::scheduler::CommitteeKind"]],["impl Unpin for Role",1,["oasis_core_runtime::consensus::scheduler::Role"]],["impl Unpin for EscrowEvent",1,["oasis_core_runtime::consensus::staking::EscrowEvent"]],["impl Unpin for SlashReason",1,["oasis_core_runtime::consensus::staking::SlashReason"]],["impl Unpin for ThresholdKind",1,["oasis_core_runtime::consensus::staking::ThresholdKind"]],["impl Unpin for StateError",1,["oasis_core_runtime::consensus::state::StateError"]],["impl Unpin for Error",1,["oasis_core_runtime::consensus::verifier::Error"]],["impl Unpin for RpcClientError",1,["oasis_core_runtime::enclave_rpc::client::RpcClientError"]],["impl Unpin for Error",1,["oasis_core_runtime::enclave_rpc::demux::Error"]],["impl Unpin for RAKBinding",1,["oasis_core_runtime::enclave_rpc::session::RAKBinding"]],["impl Unpin for Error",1,["oasis_core_runtime::enclave_rpc::sessions::Error"]],["impl Unpin for Body",1,["oasis_core_runtime::enclave_rpc::types::Body"]],["impl Unpin for Kind",1,["oasis_core_runtime::enclave_rpc::types::Kind"]],["impl Unpin for Message",1,["oasis_core_runtime::enclave_rpc::types::Message"]],["impl Unpin for PeerFeedback",1,["oasis_core_runtime::enclave_rpc::types::PeerFeedback"]],["impl Unpin for TeeType",1,["oasis_core_runtime::TeeType"]],["impl Unpin for Error",1,["oasis_core_runtime::host::Error"]],["impl Unpin for PolicyVerifierError",1,["oasis_core_runtime::policy::PolicyVerifierError"]],["impl Unpin for ProtocolError",1,["oasis_core_runtime::protocol::ProtocolError"]],["impl Unpin for Stream",1,["oasis_core_runtime::protocol::Stream"]],["impl Unpin for LogEntryKind",1,["oasis_core_runtime::storage::mkvs::LogEntryKind"]],["impl Unpin for NodeBox",1,["oasis_core_runtime::storage::mkvs::tree::node::NodeBox"]],["impl Unpin for RootType",1,["oasis_core_runtime::storage::mkvs::tree::node::RootType"]],["impl Unpin for SyncerError",1,["oasis_core_runtime::storage::mkvs::sync::errors::SyncerError"]],["impl Unpin for Body",1,["oasis_core_runtime::types::Body"]],["impl Unpin for EventKind",1,["oasis_core_runtime::types::EventKind"]],["impl Unpin for ExecutionMode",1,["oasis_core_runtime::types::ExecutionMode"]],["impl Unpin for HostStorageEndpoint",1,["oasis_core_runtime::types::HostStorageEndpoint"]],["impl Unpin for MessageType",1,["oasis_core_runtime::types::MessageType"]],["impl Unpin for StorageSyncRequest",1,["oasis_core_runtime::types::StorageSyncRequest"]],["impl Unpin for StorageSyncResponse",1,["oasis_core_runtime::types::StorageSyncResponse"]],["impl Unpin for NoopApp",1,["oasis_core_runtime::app::NoopApp"]],["impl Unpin for Cache",1,["oasis_core_runtime::cache::Cache"]],["impl Unpin for CacheSet",1,["oasis_core_runtime::cache::CacheSet"]],["impl Unpin for Hash",1,["oasis_core_runtime::common::crypto::hash::Hash"]],["impl Unpin for Nonce",1,["oasis_core_runtime::common::crypto::mrae::nonce::Nonce"]],["impl Unpin for MultiSigned",1,["oasis_core_runtime::common::crypto::signature::MultiSigned"]],["impl Unpin for PrivateKey",1,["oasis_core_runtime::common::crypto::signature::PrivateKey"]],["impl Unpin for PublicKey",1,["oasis_core_runtime::common::crypto::signature::PublicKey"]],["impl Unpin for Signature",1,["oasis_core_runtime::common::crypto::signature::Signature"]],["impl Unpin for SignatureBundle",1,["oasis_core_runtime::common::crypto::signature::SignatureBundle"]],["impl Unpin for Signed",1,["oasis_core_runtime::common::crypto::signature::Signed"]],["impl Unpin for PrivateKey",1,["oasis_core_runtime::common::crypto::x25519::PrivateKey"]],["impl Unpin for PublicKey",1,["oasis_core_runtime::common::crypto::x25519::PublicKey"]],["impl Unpin for Namespace",1,["oasis_core_runtime::common::namespace::Namespace"]],["impl Unpin for AbortOnPanic",1,["oasis_core_runtime::common::panic::AbortOnPanic"]],["impl Unpin for Quantity",1,["oasis_core_runtime::common::quantity::Quantity"]],["impl Unpin for AVR",1,["oasis_core_runtime::common::sgx::ias::AVR"]],["impl Unpin for QuotePolicy",1,["oasis_core_runtime::common::sgx::ias::QuotePolicy"]],["impl Unpin for QuoteBundle",1,["oasis_core_runtime::common::sgx::pcs::quote::QuoteBundle"]],["impl Unpin for QuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::QuotePolicy"]],["impl Unpin for TCBBundle",1,["oasis_core_runtime::common::sgx::pcs::tcb::TCBBundle"]],["impl Unpin for TdAttributes",1,["oasis_core_runtime::common::sgx::pcs::report::TdAttributes"]],["impl Unpin for TdReport",1,["oasis_core_runtime::common::sgx::pcs::report::TdReport"]],["impl Unpin for TdxModulePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxModulePolicy"]],["impl Unpin for TdxQuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxQuotePolicy"]],["impl Unpin for EnclaveIdentity",1,["oasis_core_runtime::common::sgx::EnclaveIdentity"]],["impl Unpin for MrEnclave",1,["oasis_core_runtime::common::sgx::MrEnclave"]],["impl Unpin for MrSigner",1,["oasis_core_runtime::common::sgx::MrSigner"]],["impl Unpin for QuotePolicy",1,["oasis_core_runtime::common::sgx::QuotePolicy"]],["impl Unpin for VerifiedQuote",1,["oasis_core_runtime::common::sgx::VerifiedQuote"]],["impl Unpin for ProtocolVersions",1,["oasis_core_runtime::common::version::ProtocolVersions"]],["impl Unpin for Version",1,["oasis_core_runtime::common::version::Version"]],["impl Unpin for Config",1,["oasis_core_runtime::config::Config"]],["impl Unpin for Storage",1,["oasis_core_runtime::config::Storage"]],["impl Unpin for Address",1,["oasis_core_runtime::consensus::address::Address"]],["impl Unpin for COMMON_POOL_ADDRESS",1,["oasis_core_runtime::consensus::address::COMMON_POOL_ADDRESS"]],["impl Unpin for FEE_ACC_ADDRESS",1,["oasis_core_runtime::consensus::address::FEE_ACC_ADDRESS"]],["impl Unpin for GOVERNANCE_DEPOSITS_ADDRESS",1,["oasis_core_runtime::consensus::address::GOVERNANCE_DEPOSITS_ADDRESS"]],["impl Unpin for EpochTimeState",1,["oasis_core_runtime::consensus::beacon::EpochTimeState"]],["impl Unpin for CancelUpgradeProposal",1,["oasis_core_runtime::consensus::governance::CancelUpgradeProposal"]],["impl Unpin for ChangeParametersProposal",1,["oasis_core_runtime::consensus::governance::ChangeParametersProposal"]],["impl Unpin for ConsensusParameterChanges",1,["oasis_core_runtime::consensus::governance::ConsensusParameterChanges"]],["impl Unpin for ProposalContent",1,["oasis_core_runtime::consensus::governance::ProposalContent"]],["impl Unpin for ProposalVote",1,["oasis_core_runtime::consensus::governance::ProposalVote"]],["impl Unpin for UpgradeProposal",1,["oasis_core_runtime::consensus::governance::UpgradeProposal"]],["impl Unpin for Application",1,["oasis_core_runtime::consensus::keymanager::churp::Application"]],["impl Unpin for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::PolicySGX"]],["impl Unpin for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::SignedPolicySGX"]],["impl Unpin for Status",1,["oasis_core_runtime::consensus::keymanager::churp::Status"]],["impl Unpin for EnclavePolicySGX",1,["oasis_core_runtime::consensus::keymanager::EnclavePolicySGX"]],["impl Unpin for EncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedEphemeralSecret"]],["impl Unpin for EncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedMasterSecret"]],["impl Unpin for EncryptedSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedSecret"]],["impl Unpin for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::PolicySGX"]],["impl Unpin for SignedEncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedEphemeralSecret"]],["impl Unpin for SignedEncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedMasterSecret"]],["impl Unpin for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::SignedPolicySGX"]],["impl Unpin for AnyNodeRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::AnyNodeRuntimeAdmissionPolicy"]],["impl Unpin for Capabilities",1,["oasis_core_runtime::consensus::registry::Capabilities"]],["impl Unpin for CapabilityTEE",1,["oasis_core_runtime::consensus::registry::CapabilityTEE"]],["impl Unpin for ConsensusAddress",1,["oasis_core_runtime::consensus::registry::ConsensusAddress"]],["impl Unpin for ConsensusInfo",1,["oasis_core_runtime::consensus::registry::ConsensusInfo"]],["impl Unpin for EndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::EndorsedCapabilityTEE"]],["impl Unpin for EntityWhitelistConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistConfig"]],["impl Unpin for EntityWhitelistRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleAdmissionPolicy"]],["impl Unpin for EntityWhitelistRoleConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleConfig"]],["impl Unpin for EntityWhitelistRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRuntimeAdmissionPolicy"]],["impl Unpin for ExecutorParameters",1,["oasis_core_runtime::consensus::registry::ExecutorParameters"]],["impl Unpin for MaxNodesConstraint",1,["oasis_core_runtime::consensus::registry::MaxNodesConstraint"]],["impl Unpin for MinPoolSizeConstraint",1,["oasis_core_runtime::consensus::registry::MinPoolSizeConstraint"]],["impl Unpin for Node",1,["oasis_core_runtime::consensus::registry::Node"]],["impl Unpin for NodeRuntime",1,["oasis_core_runtime::consensus::registry::NodeRuntime"]],["impl Unpin for P2PInfo",1,["oasis_core_runtime::consensus::registry::P2PInfo"]],["impl Unpin for PerRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::PerRoleAdmissionPolicy"]],["impl Unpin for RolesMask",1,["oasis_core_runtime::consensus::registry::RolesMask"]],["impl Unpin for Runtime",1,["oasis_core_runtime::consensus::registry::Runtime"]],["impl Unpin for RuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::RuntimeAdmissionPolicy"]],["impl Unpin for RuntimeGenesis",1,["oasis_core_runtime::consensus::registry::RuntimeGenesis"]],["impl Unpin for RuntimeStakingParameters",1,["oasis_core_runtime::consensus::registry::RuntimeStakingParameters"]],["impl Unpin for SchedulingConstraints",1,["oasis_core_runtime::consensus::registry::SchedulingConstraints"]],["impl Unpin for StorageParameters",1,["oasis_core_runtime::consensus::registry::StorageParameters"]],["impl Unpin for TCPAddress",1,["oasis_core_runtime::consensus::registry::TCPAddress"]],["impl Unpin for TLSAddress",1,["oasis_core_runtime::consensus::registry::TLSAddress"]],["impl Unpin for TLSInfo",1,["oasis_core_runtime::consensus::registry::TLSInfo"]],["impl Unpin for TxnSchedulerParameters",1,["oasis_core_runtime::consensus::registry::TxnSchedulerParameters"]],["impl Unpin for VRFInfo",1,["oasis_core_runtime::consensus::registry::VRFInfo"]],["impl Unpin for ValidatorSetConstraint",1,["oasis_core_runtime::consensus::registry::ValidatorSetConstraint"]],["impl Unpin for VerifiedAttestation",1,["oasis_core_runtime::consensus::registry::VerifiedAttestation"]],["impl Unpin for VerifiedEndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::VerifiedEndorsedCapabilityTEE"]],["impl Unpin for VersionInfo",1,["oasis_core_runtime::consensus::registry::VersionInfo"]],["impl Unpin for AnnotatedBlock",1,["oasis_core_runtime::consensus::roothash::AnnotatedBlock"]],["impl Unpin for Block",1,["oasis_core_runtime::consensus::roothash::block::Block"]],["impl Unpin for ComputeResultsHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ComputeResultsHeader"]],["impl Unpin for ExecutorCommitment",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitment"]],["impl Unpin for ExecutorCommitmentHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentHeader"]],["impl Unpin for Header",1,["oasis_core_runtime::consensus::roothash::block::Header"]],["impl Unpin for IncomingMessage",1,["oasis_core_runtime::consensus::roothash::message::IncomingMessage"]],["impl Unpin for MessageEvent",1,["oasis_core_runtime::consensus::roothash::MessageEvent"]],["impl Unpin for Pool",1,["oasis_core_runtime::consensus::roothash::commitment::pool::Pool"]],["impl Unpin for RoundResults",1,["oasis_core_runtime::consensus::roothash::RoundResults"]],["impl Unpin for RoundRoots",1,["oasis_core_runtime::consensus::roothash::RoundRoots"]],["impl Unpin for Committee",1,["oasis_core_runtime::consensus::scheduler::Committee"]],["impl Unpin for CommitteeNode",1,["oasis_core_runtime::consensus::scheduler::CommitteeNode"]],["impl Unpin for Account",1,["oasis_core_runtime::consensus::staking::Account"]],["impl Unpin for AddEscrowResult",1,["oasis_core_runtime::consensus::staking::AddEscrowResult"]],["impl Unpin for AllowanceChangeEvent",1,["oasis_core_runtime::consensus::staking::AllowanceChangeEvent"]],["impl Unpin for BurnEvent",1,["oasis_core_runtime::consensus::staking::BurnEvent"]],["impl Unpin for CommissionRateBoundStep",1,["oasis_core_runtime::consensus::staking::CommissionRateBoundStep"]],["impl Unpin for CommissionRateStep",1,["oasis_core_runtime::consensus::staking::CommissionRateStep"]],["impl Unpin for CommissionSchedule",1,["oasis_core_runtime::consensus::staking::CommissionSchedule"]],["impl Unpin for DebondingDelegation",1,["oasis_core_runtime::consensus::staking::DebondingDelegation"]],["impl Unpin for Delegation",1,["oasis_core_runtime::consensus::staking::Delegation"]],["impl Unpin for Escrow",1,["oasis_core_runtime::consensus::staking::Escrow"]],["impl Unpin for EscrowAccount",1,["oasis_core_runtime::consensus::staking::EscrowAccount"]],["impl Unpin for Event",1,["oasis_core_runtime::consensus::staking::Event"]],["impl Unpin for GeneralAccount",1,["oasis_core_runtime::consensus::staking::GeneralAccount"]],["impl Unpin for ReclaimEscrow",1,["oasis_core_runtime::consensus::staking::ReclaimEscrow"]],["impl Unpin for ReclaimEscrowResult",1,["oasis_core_runtime::consensus::staking::ReclaimEscrowResult"]],["impl Unpin for SharePool",1,["oasis_core_runtime::consensus::staking::SharePool"]],["impl Unpin for Slash",1,["oasis_core_runtime::consensus::staking::Slash"]],["impl Unpin for StakeAccumulator",1,["oasis_core_runtime::consensus::staking::StakeAccumulator"]],["impl Unpin for StakeThreshold",1,["oasis_core_runtime::consensus::staking::StakeThreshold"]],["impl Unpin for Transfer",1,["oasis_core_runtime::consensus::staking::Transfer"]],["impl Unpin for TransferEvent",1,["oasis_core_runtime::consensus::staking::TransferEvent"]],["impl Unpin for TransferResult",1,["oasis_core_runtime::consensus::staking::TransferResult"]],["impl Unpin for Withdraw",1,["oasis_core_runtime::consensus::staking::Withdraw"]],["impl Unpin for WithdrawResult",1,["oasis_core_runtime::consensus::staking::WithdrawResult"]],["impl Unpin for MutableState",1,["oasis_core_runtime::consensus::state::beacon::MutableState"]],["impl Unpin for Status",1,["oasis_core_runtime::consensus::state::keymanager::Status"]],["impl Unpin for ConsensusState",1,["oasis_core_runtime::consensus::state::ConsensusState"]],["impl Unpin for BlockMetadata",1,["oasis_core_runtime::consensus::BlockMetadata"]],["impl Unpin for LightBlock",1,["oasis_core_runtime::consensus::LightBlock"]],["impl Unpin for Proof",1,["oasis_core_runtime::consensus::tendermint::merkle::Proof"]],["impl Unpin for LightBlockMeta",1,["oasis_core_runtime::consensus::tendermint::LightBlockMeta"]],["impl Unpin for NopVerifier",1,["oasis_core_runtime::consensus::tendermint::verifier::noop::NopVerifier"]],["impl Unpin for Verifier",1,["oasis_core_runtime::consensus::tendermint::verifier::Verifier"]],["impl Unpin for Fee",1,["oasis_core_runtime::consensus::transaction::Fee"]],["impl Unpin for Proof",1,["oasis_core_runtime::consensus::transaction::Proof"]],["impl Unpin for SignedTransactionWithProof",1,["oasis_core_runtime::consensus::transaction::SignedTransactionWithProof"]],["impl Unpin for Transaction",1,["oasis_core_runtime::consensus::transaction::Transaction"]],["impl Unpin for TrustRoot",1,["oasis_core_runtime::consensus::verifier::TrustRoot"]],["impl Unpin for Dispatcher",1,["oasis_core_runtime::dispatcher::Dispatcher"]],["impl Unpin for PostInitState",1,["oasis_core_runtime::dispatcher::PostInitState"]],["impl Unpin for RpcClient",1,["oasis_core_runtime::enclave_rpc::client::RpcClient"]],["impl Unpin for Context",1,["oasis_core_runtime::enclave_rpc::context::Context"]],["impl Unpin for Demux",1,["oasis_core_runtime::enclave_rpc::demux::Demux"]],["impl Unpin for Dispatcher",1,["oasis_core_runtime::enclave_rpc::dispatcher::Dispatcher"]],["impl Unpin for Method",1,["oasis_core_runtime::enclave_rpc::dispatcher::Method"]],["impl Unpin for MethodDescriptor",1,["oasis_core_runtime::enclave_rpc::dispatcher::MethodDescriptor"]],["impl Unpin for Builder",1,["oasis_core_runtime::enclave_rpc::session::Builder"]],["impl Unpin for Session",1,["oasis_core_runtime::enclave_rpc::session::Session"]],["impl Unpin for SessionInfo",1,["oasis_core_runtime::enclave_rpc::session::SessionInfo"]],["impl Unpin for Error",1,["oasis_core_runtime::enclave_rpc::types::Error"]],["impl Unpin for Frame",1,["oasis_core_runtime::enclave_rpc::types::Frame"]],["impl Unpin for Request",1,["oasis_core_runtime::enclave_rpc::types::Request"]],["impl Unpin for Response",1,["oasis_core_runtime::enclave_rpc::types::Response"]],["impl Unpin for SessionID",1,["oasis_core_runtime::enclave_rpc::types::SessionID"]],["impl Unpin for RegisterNotifyOpts",1,["oasis_core_runtime::host::RegisterNotifyOpts"]],["impl Unpin for SubmitTxOpts",1,["oasis_core_runtime::host::SubmitTxOpts"]],["impl Unpin for TxResult",1,["oasis_core_runtime::host::TxResult"]],["impl Unpin for Identity",1,["oasis_core_runtime::identity::Identity"]],["impl Unpin for PolicyVerifier",1,["oasis_core_runtime::policy::PolicyVerifier"]],["impl Unpin for HostInfo",1,["oasis_core_runtime::protocol::HostInfo"]],["impl Unpin for Protocol",1,["oasis_core_runtime::protocol::Protocol"]],["impl Unpin for ProtocolUntrustedLocalStorage",1,["oasis_core_runtime::protocol::ProtocolUntrustedLocalStorage"]],["impl Unpin for LogEntry",1,["oasis_core_runtime::storage::mkvs::LogEntry"]],["impl Unpin for NodePointer",1,["oasis_core_runtime::storage::mkvs::tree::node::NodePointer"]],["impl Unpin for Prefix",1,["oasis_core_runtime::storage::mkvs::Prefix"]],["impl Unpin for Root",1,["oasis_core_runtime::storage::mkvs::tree::node::Root"]],["impl Unpin for Tree",1,["oasis_core_runtime::storage::mkvs::tree::Tree"]],["impl Unpin for GetPrefixesRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetPrefixesRequest"]],["impl Unpin for GetRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetRequest"]],["impl Unpin for HostReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::host::HostReadSyncer"]],["impl Unpin for IterateRequest",1,["oasis_core_runtime::storage::mkvs::sync::IterateRequest"]],["impl Unpin for NoopReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::noop::NoopReadSyncer"]],["impl Unpin for Proof",1,["oasis_core_runtime::storage::mkvs::sync::proof::Proof"]],["impl Unpin for ProofBuilder",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofBuilder"]],["impl Unpin for ProofResponse",1,["oasis_core_runtime::storage::mkvs::sync::ProofResponse"]],["impl Unpin for ProofVerifier",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofVerifier"]],["impl Unpin for RawProofEntry",1,["oasis_core_runtime::storage::mkvs::sync::proof::RawProofEntry"]],["impl Unpin for StatsCollector",1,["oasis_core_runtime::storage::mkvs::sync::stats::StatsCollector"]],["impl Unpin for TreeID",1,["oasis_core_runtime::storage::mkvs::sync::TreeID"]],["impl Unpin for UntrustedInMemoryStorage",1,["oasis_core_runtime::storage::UntrustedInMemoryStorage"]],["impl Unpin for BUILD_INFO",1,["oasis_core_runtime::BUILD_INFO"]],["impl Unpin for BuildInfo",1,["oasis_core_runtime::BuildInfo"]],["impl Unpin for ExecuteBatchResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteBatchResult"]],["impl Unpin for ExecuteTxResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteTxResult"]],["impl Unpin for NoopDispatcher",1,["oasis_core_runtime::transaction::dispatcher::NoopDispatcher"]],["impl Unpin for CoarsenedKey",1,["oasis_core_runtime::transaction::rwset::CoarsenedKey"]],["impl Unpin for ReadWriteSet",1,["oasis_core_runtime::transaction::rwset::ReadWriteSet"]],["impl Unpin for Tag",1,["oasis_core_runtime::transaction::tags::Tag"]],["impl Unpin for Tree",1,["oasis_core_runtime::transaction::tree::Tree"]],["impl Unpin for TxnBatch",1,["oasis_core_runtime::transaction::types::TxnBatch"]],["impl Unpin for CheckTxMetadata",1,["oasis_core_runtime::types::CheckTxMetadata"]],["impl Unpin for CheckTxResult",1,["oasis_core_runtime::types::CheckTxResult"]],["impl Unpin for ComputedBatch",1,["oasis_core_runtime::types::ComputedBatch"]],["impl Unpin for Error",1,["oasis_core_runtime::types::Error"]],["impl Unpin for FeatureScheduleControl",1,["oasis_core_runtime::types::FeatureScheduleControl"]],["impl Unpin for Features",1,["oasis_core_runtime::types::Features"]],["impl Unpin for HostFetchConsensusEventsRequest",1,["oasis_core_runtime::types::HostFetchConsensusEventsRequest"]],["impl Unpin for HostFetchConsensusEventsResponse",1,["oasis_core_runtime::types::HostFetchConsensusEventsResponse"]],["impl Unpin for Message",1,["oasis_core_runtime::types::Message"]],["impl Unpin for RegisterNotifyRuntimeEvent",1,["oasis_core_runtime::types::RegisterNotifyRuntimeEvent"]],["impl Unpin for RuntimeInfoRequest",1,["oasis_core_runtime::types::RuntimeInfoRequest"]],["impl Unpin for RuntimeInfoResponse",1,["oasis_core_runtime::types::RuntimeInfoResponse"]],["impl Unpin for RuntimeNotifyEvent",1,["oasis_core_runtime::types::RuntimeNotifyEvent"]],["impl Unpin for StorageSyncRequestWithEndpoint",1,["oasis_core_runtime::types::StorageSyncRequestWithEndpoint"]],["impl<'a> Unpin for Quote<'a>",1,["oasis_core_runtime::common::sgx::pcs::quote::Quote"]],["impl<'a> Unpin for PreInitState<'a>",1,["oasis_core_runtime::dispatcher::PreInitState"]],["impl<'a> Unpin for Context<'a>",1,["oasis_core_runtime::transaction::context::Context"]],["impl<'a, T> Unpin for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::beacon::ImmutableState"]],["impl<'a, T> Unpin for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::keymanager::churp::ImmutableState"]],["impl<'a, T> Unpin for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::keymanager::ImmutableState"]],["impl<'a, T> Unpin for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::registry::ImmutableState"]],["impl<'a, T> Unpin for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::roothash::ImmutableState"]],["impl<'a, T> Unpin for ImmutableState<'a, T>",1,["oasis_core_runtime::consensus::state::staking::ImmutableState"]],["impl<'a, T> Unpin for Response<'a, T>
where\n T: Unpin,
",1,["oasis_core_runtime::enclave_rpc::client::Response"]],["impl<PeerID> Unpin for MultiplexedSession<PeerID>
where\n PeerID: Unpin,
",1,["oasis_core_runtime::enclave_rpc::sessions::MultiplexedSession"]],["impl<PeerID> Unpin for SessionMeta<PeerID>
where\n PeerID: Unpin,
",1,["oasis_core_runtime::enclave_rpc::sessions::SessionMeta"]],["impl<PeerID> Unpin for Sessions<PeerID>
where\n PeerID: Unpin,
",1,["oasis_core_runtime::enclave_rpc::sessions::Sessions"]],["impl<T> Unpin for Versioned<T>
where\n T: Unpin,
",1,["oasis_core_runtime::common::versioned::Versioned"]],["impl<T> Unpin for OverlayTree<T>
where\n T: Unpin,
",1,["oasis_core_runtime::storage::mkvs::tree::overlay::OverlayTree"]]], +"oasis_runtime_sdk":[["impl Unpin for Metadata",1,["oasis_runtime_sdk::callformat::Metadata"]],["impl Unpin for Error",1,["oasis_runtime_sdk::crypto::multisig::Error"]],["impl Unpin for Error",1,["oasis_runtime_sdk::crypto::signature::Error"]],["impl Unpin for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::MemorySigner"]],["impl Unpin for PublicKey",1,["oasis_runtime_sdk::crypto::signature::PublicKey"]],["impl Unpin for SignatureType",1,["oasis_runtime_sdk::crypto::signature::SignatureType"]],["impl Unpin for Error",1,["oasis_runtime_sdk::dispatcher::Error"]],["impl Unpin for Error",1,["oasis_runtime_sdk::history::Error"]],["impl Unpin for AuthDecision",1,["oasis_runtime_sdk::module::AuthDecision"]],["impl Unpin for CallResult",1,["oasis_runtime_sdk::module::CallResult"]],["impl Unpin for Error",1,["oasis_runtime_sdk::modules::access::Error"]],["impl Unpin for Authorization",1,["oasis_runtime_sdk::modules::access::types::Authorization"]],["impl Unpin for MethodAuthorization",1,["oasis_runtime_sdk::modules::access::types::MethodAuthorization"]],["impl Unpin for Error",1,["oasis_runtime_sdk::modules::accounts::Error"]],["impl Unpin for Event",1,["oasis_runtime_sdk::modules::accounts::Event"]],["impl Unpin for ParameterValidationError",1,["oasis_runtime_sdk::modules::accounts::ParameterValidationError"]],["impl Unpin for Error",1,["oasis_runtime_sdk::modules::consensus::Error"]],["impl Unpin for Event",1,["oasis_runtime_sdk::modules::consensus::Event"]],["impl Unpin for ParameterValidationError",1,["oasis_runtime_sdk::modules::consensus::ParameterValidationError"]],["impl Unpin for RootKind",1,["oasis_runtime_sdk::modules::consensus::types::RootKind"]],["impl Unpin for Error",1,["oasis_runtime_sdk::modules::consensus_accounts::Error"]],["impl Unpin for Event",1,["oasis_runtime_sdk::modules::consensus_accounts::Event"]],["impl Unpin for ReceiptKind",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ReceiptKind"]],["impl Unpin for Error",1,["oasis_runtime_sdk::modules::core::Error"]],["impl Unpin for Event",1,["oasis_runtime_sdk::modules::core::Event"]],["impl Unpin for ParameterValidationError",1,["oasis_runtime_sdk::modules::core::ParameterValidationError"]],["impl Unpin for MethodHandlerKind",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerKind"]],["impl Unpin for Error",1,["oasis_runtime_sdk::modules::rewards::Error"]],["impl Unpin for ParameterValidationError",1,["oasis_runtime_sdk::modules::rewards::ParameterValidationError"]],["impl Unpin for RewardAction",1,["oasis_runtime_sdk::modules::rewards::types::RewardAction"]],["impl Unpin for RewardScheduleError",1,["oasis_runtime_sdk::modules::rewards::types::RewardScheduleError"]],["impl Unpin for Error",1,["oasis_runtime_sdk::modules::rofl::app_id::Error"]],["impl Unpin for Error",1,["oasis_runtime_sdk::modules::rofl::error::Error"]],["impl Unpin for Event",1,["oasis_runtime_sdk::modules::rofl::event::Event"]],["impl Unpin for ParameterValidationError",1,["oasis_runtime_sdk::modules::rofl::ParameterValidationError"]],["impl Unpin for AllowedEndorsement",1,["oasis_runtime_sdk::modules::rofl::policy::AllowedEndorsement"]],["impl Unpin for FeePolicy",1,["oasis_runtime_sdk::modules::rofl::policy::FeePolicy"]],["impl Unpin for IdentifierScheme",1,["oasis_runtime_sdk::modules::rofl::types::IdentifierScheme"]],["impl Unpin for Error",1,["oasis_runtime_sdk::schedule_control::Error"]],["impl Unpin for Mode",1,["oasis_runtime_sdk::state::Mode"]],["impl Unpin for Error",1,["oasis_runtime_sdk::storage::confidential::Error"]],["impl Unpin for Error",1,["oasis_runtime_sdk::types::address::Error"]],["impl Unpin for SignatureAddressSpec",1,["oasis_runtime_sdk::types::address::SignatureAddressSpec"]],["impl Unpin for Error",1,["oasis_runtime_sdk::types::token::Error"]],["impl Unpin for AddressSpec",1,["oasis_runtime_sdk::types::transaction::AddressSpec"]],["impl Unpin for AuthProof",1,["oasis_runtime_sdk::types::transaction::AuthProof"]],["impl Unpin for CallFormat",1,["oasis_runtime_sdk::types::transaction::CallFormat"]],["impl Unpin for CallResult",1,["oasis_runtime_sdk::types::transaction::CallResult"]],["impl Unpin for CallerAddress",1,["oasis_runtime_sdk::types::transaction::CallerAddress"]],["impl Unpin for Error",1,["oasis_runtime_sdk::types::transaction::Error"]],["impl Unpin for ScheduleControl",1,["oasis_runtime_sdk::config::ScheduleControl"]],["impl Unpin for Config",1,["oasis_runtime_sdk::crypto::multisig::Config"]],["impl Unpin for Signer",1,["oasis_runtime_sdk::crypto::multisig::Signer"]],["impl Unpin for LeafRng",1,["oasis_runtime_sdk::crypto::random::LeafRng"]],["impl Unpin for RootRng",1,["oasis_runtime_sdk::crypto::random::RootRng"]],["impl Unpin for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::ed25519::MemorySigner"]],["impl Unpin for PublicKey",1,["oasis_runtime_sdk::crypto::signature::ed25519::PublicKey"]],["impl Unpin for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256k1::MemorySigner"]],["impl Unpin for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256k1::PublicKey"]],["impl Unpin for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256r1::MemorySigner"]],["impl Unpin for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256r1::PublicKey"]],["impl Unpin for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp384r1::MemorySigner"]],["impl Unpin for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp384r1::PublicKey"]],["impl Unpin for PublicKey",1,["oasis_runtime_sdk::crypto::signature::sr25519::PublicKey"]],["impl Unpin for Signature",1,["oasis_runtime_sdk::crypto::signature::Signature"]],["impl Unpin for DispatchResult",1,["oasis_runtime_sdk::dispatcher::DispatchResult"]],["impl Unpin for QueryRequest",1,["oasis_runtime_sdk::enclave_rpc::QueryRequest"]],["impl Unpin for EventTag",1,["oasis_runtime_sdk::event::EventTag"]],["impl Unpin for KeyManagerClientWithContext",1,["oasis_runtime_sdk::keymanager::KeyManagerClientWithContext"]],["impl Unpin for FeeManager",1,["oasis_runtime_sdk::modules::accounts::fee::FeeManager"]],["impl Unpin for FeeUpdates",1,["oasis_runtime_sdk::modules::accounts::fee::FeeUpdates"]],["impl Unpin for TransactionFee",1,["oasis_runtime_sdk::modules::accounts::fee::TransactionFee"]],["impl Unpin for GasCosts",1,["oasis_runtime_sdk::modules::accounts::GasCosts"]],["impl Unpin for Genesis",1,["oasis_runtime_sdk::modules::accounts::Genesis"]],["impl Unpin for Module",1,["oasis_runtime_sdk::modules::accounts::Module"]],["impl Unpin for Parameters",1,["oasis_runtime_sdk::modules::accounts::Parameters"]],["impl Unpin for Account",1,["oasis_runtime_sdk::modules::accounts::types::Account"]],["impl Unpin for AccountBalances",1,["oasis_runtime_sdk::modules::accounts::types::AccountBalances"]],["impl Unpin for AddressesQuery",1,["oasis_runtime_sdk::modules::accounts::types::AddressesQuery"]],["impl Unpin for BalancesQuery",1,["oasis_runtime_sdk::modules::accounts::types::BalancesQuery"]],["impl Unpin for DenominationInfo",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfo"]],["impl Unpin for DenominationInfoQuery",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfoQuery"]],["impl Unpin for NonceQuery",1,["oasis_runtime_sdk::modules::accounts::types::NonceQuery"]],["impl Unpin for Transfer",1,["oasis_runtime_sdk::modules::accounts::types::Transfer"]],["impl Unpin for GasCosts",1,["oasis_runtime_sdk::modules::consensus::GasCosts"]],["impl Unpin for Genesis",1,["oasis_runtime_sdk::modules::consensus::Genesis"]],["impl Unpin for Module",1,["oasis_runtime_sdk::modules::consensus::Module"]],["impl Unpin for Parameters",1,["oasis_runtime_sdk::modules::consensus::Parameters"]],["impl Unpin for RoundRootBody",1,["oasis_runtime_sdk::modules::consensus::types::RoundRootBody"]],["impl Unpin for Undelegation",1,["oasis_runtime_sdk::modules::consensus_accounts::state::Undelegation"]],["impl Unpin for GasCosts",1,["oasis_runtime_sdk::modules::consensus_accounts::GasCosts"]],["impl Unpin for Genesis",1,["oasis_runtime_sdk::modules::consensus_accounts::Genesis"]],["impl Unpin for Parameters",1,["oasis_runtime_sdk::modules::consensus_accounts::Parameters"]],["impl Unpin for AccountBalance",1,["oasis_runtime_sdk::modules::consensus_accounts::types::AccountBalance"]],["impl Unpin for BalanceQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::BalanceQuery"]],["impl Unpin for ConsensusAccountQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusAccountQuery"]],["impl Unpin for ConsensusDelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusDelegateContext"]],["impl Unpin for ConsensusError",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusError"]],["impl Unpin for ConsensusTransferContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusTransferContext"]],["impl Unpin for ConsensusUndelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusUndelegateContext"]],["impl Unpin for ConsensusWithdrawContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusWithdrawContext"]],["impl Unpin for Delegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Delegate"]],["impl Unpin for DelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationInfo"]],["impl Unpin for DelegationQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationQuery"]],["impl Unpin for DelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationsQuery"]],["impl Unpin for Deposit",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Deposit"]],["impl Unpin for ExtendedDelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ExtendedDelegationInfo"]],["impl Unpin for Receipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Receipt"]],["impl Unpin for TakeReceipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::TakeReceipt"]],["impl Unpin for Undelegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Undelegate"]],["impl Unpin for UndelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationInfo"]],["impl Unpin for UndelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationsQuery"]],["impl Unpin for Withdraw",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Withdraw"]],["impl Unpin for DynamicMinGasPrice",1,["oasis_runtime_sdk::modules::core::DynamicMinGasPrice"]],["impl Unpin for GasCosts",1,["oasis_runtime_sdk::modules::core::GasCosts"]],["impl Unpin for Genesis",1,["oasis_runtime_sdk::modules::core::Genesis"]],["impl Unpin for LocalConfig",1,["oasis_runtime_sdk::modules::core::LocalConfig"]],["impl Unpin for Parameters",1,["oasis_runtime_sdk::modules::core::Parameters"]],["impl Unpin for TxSimulationFailure",1,["oasis_runtime_sdk::modules::core::TxSimulationFailure"]],["impl Unpin for CallDataPublicKeyQueryResponse",1,["oasis_runtime_sdk::modules::core::types::CallDataPublicKeyQueryResponse"]],["impl Unpin for EstimateGasQuery",1,["oasis_runtime_sdk::modules::core::types::EstimateGasQuery"]],["impl Unpin for ExecuteReadOnlyTxQuery",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxQuery"]],["impl Unpin for ExecuteReadOnlyTxResponse",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxResponse"]],["impl Unpin for Metadata",1,["oasis_runtime_sdk::modules::core::types::Metadata"]],["impl Unpin for MethodHandlerInfo",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerInfo"]],["impl Unpin for ModuleInfo",1,["oasis_runtime_sdk::modules::core::types::ModuleInfo"]],["impl Unpin for RuntimeInfoResponse",1,["oasis_runtime_sdk::modules::core::types::RuntimeInfoResponse"]],["impl Unpin for Genesis",1,["oasis_runtime_sdk::modules::rewards::Genesis"]],["impl Unpin for Module",1,["oasis_runtime_sdk::modules::rewards::Module"]],["impl Unpin for Parameters",1,["oasis_runtime_sdk::modules::rewards::Parameters"]],["impl Unpin for EpochRewards",1,["oasis_runtime_sdk::modules::rewards::types::EpochRewards"]],["impl Unpin for RewardSchedule",1,["oasis_runtime_sdk::modules::rewards::types::RewardSchedule"]],["impl Unpin for RewardStep",1,["oasis_runtime_sdk::modules::rewards::types::RewardStep"]],["impl Unpin for AppId",1,["oasis_runtime_sdk::modules::rofl::app_id::AppId"]],["impl Unpin for AppAuthPolicy",1,["oasis_runtime_sdk::modules::rofl::policy::AppAuthPolicy"]],["impl Unpin for KeyEndorsementInfo",1,["oasis_runtime_sdk::modules::rofl::state::KeyEndorsementInfo"]],["impl Unpin for Genesis",1,["oasis_runtime_sdk::modules::rofl::Genesis"]],["impl Unpin for Parameters",1,["oasis_runtime_sdk::modules::rofl::Parameters"]],["impl Unpin for AppConfig",1,["oasis_runtime_sdk::modules::rofl::types::AppConfig"]],["impl Unpin for AppInstanceQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppInstanceQuery"]],["impl Unpin for AppQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppQuery"]],["impl Unpin for Create",1,["oasis_runtime_sdk::modules::rofl::types::Create"]],["impl Unpin for Register",1,["oasis_runtime_sdk::modules::rofl::types::Register"]],["impl Unpin for Registration",1,["oasis_runtime_sdk::modules::rofl::types::Registration"]],["impl Unpin for Remove",1,["oasis_runtime_sdk::modules::rofl::types::Remove"]],["impl Unpin for StakeThresholds",1,["oasis_runtime_sdk::modules::rofl::types::StakeThresholds"]],["impl Unpin for Update",1,["oasis_runtime_sdk::modules::rofl::types::Update"]],["impl Unpin for SenderMeta",1,["oasis_runtime_sdk::sender::SenderMeta"]],["impl Unpin for CurrentState",1,["oasis_runtime_sdk::state::CurrentState"]],["impl Unpin for Environment",1,["oasis_runtime_sdk::state::Environment"]],["impl Unpin for Options",1,["oasis_runtime_sdk::state::Options"]],["impl Unpin for State",1,["oasis_runtime_sdk::state::State"]],["impl Unpin for TransactionWithMeta",1,["oasis_runtime_sdk::state::TransactionWithMeta"]],["impl Unpin for HostStore",1,["oasis_runtime_sdk::storage::host::HostStore"]],["impl Unpin for AllowAllValidator",1,["oasis_runtime_sdk::subcall::AllowAllValidator"]],["impl Unpin for SubcallInfo",1,["oasis_runtime_sdk::subcall::SubcallInfo"]],["impl Unpin for SubcallResult",1,["oasis_runtime_sdk::subcall::SubcallResult"]],["impl Unpin for MockKeyManagerClient",1,["oasis_runtime_sdk::testing::keymanager::MockKeyManagerClient"]],["impl Unpin for CallOptions",1,["oasis_runtime_sdk::testing::mock::CallOptions"]],["impl Unpin for Config",1,["oasis_runtime_sdk::testing::mock::Config"]],["impl Unpin for EmptyRuntime",1,["oasis_runtime_sdk::testing::mock::EmptyRuntime"]],["impl Unpin for Mock",1,["oasis_runtime_sdk::testing::mock::Mock"]],["impl Unpin for Signer",1,["oasis_runtime_sdk::testing::mock::Signer"]],["impl Unpin for Address",1,["oasis_runtime_sdk::types::address::Address"]],["impl Unpin for CallEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::CallEnvelopeX25519DeoxysII"]],["impl Unpin for ResultEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::ResultEnvelopeX25519DeoxysII"]],["impl Unpin for MessageEventHookInvocation",1,["oasis_runtime_sdk::types::message::MessageEventHookInvocation"]],["impl Unpin for MessageResult",1,["oasis_runtime_sdk::types::message::MessageResult"]],["impl Unpin for BaseUnits",1,["oasis_runtime_sdk::types::token::BaseUnits"]],["impl Unpin for Denomination",1,["oasis_runtime_sdk::types::token::Denomination"]],["impl Unpin for AuthInfo",1,["oasis_runtime_sdk::types::transaction::AuthInfo"]],["impl Unpin for Call",1,["oasis_runtime_sdk::types::transaction::Call"]],["impl Unpin for Fee",1,["oasis_runtime_sdk::types::transaction::Fee"]],["impl Unpin for FeeProxy",1,["oasis_runtime_sdk::types::transaction::FeeProxy"]],["impl Unpin for SignerInfo",1,["oasis_runtime_sdk::types::transaction::SignerInfo"]],["impl Unpin for Transaction",1,["oasis_runtime_sdk::types::transaction::Transaction"]],["impl Unpin for TransactionSigner",1,["oasis_runtime_sdk::types::transaction::TransactionSigner"]],["impl Unpin for UnverifiedTransaction",1,["oasis_runtime_sdk::types::transaction::UnverifiedTransaction"]],["impl<'a> Unpin for DispatchOptions<'a>",1,["oasis_runtime_sdk::dispatcher::DispatchOptions"]],["impl<'a, R> Unpin for RuntimeBatchContext<'a, R>
where\n R: Unpin,
",1,["oasis_runtime_sdk::context::RuntimeBatchContext"]],["impl<'a, V> Unpin for StateValue<'a, V>
where\n V: Unpin,
",1,["oasis_runtime_sdk::state::StateValue"]],["impl<A> Unpin for Client<A>",1,["oasis_runtime_sdk::modules::rofl::app::client::Client"]],["impl<A> Unpin for Environment<A>",1,["oasis_runtime_sdk::modules::rofl::app::env::Environment"]],["impl<B, R> Unpin for DispatchResult<B, R>
where\n R: Unpin,\n B: Unpin,
",1,["oasis_runtime_sdk::module::DispatchResult"]],["impl<Cfg> Unpin for Module<Cfg>
where\n Cfg: Unpin,
",1,["oasis_runtime_sdk::modules::access::Module"]],["impl<Cfg> Unpin for Module<Cfg>
where\n Cfg: Unpin,
",1,["oasis_runtime_sdk::modules::core::Module"]],["impl<Cfg> Unpin for Module<Cfg>
where\n Cfg: Unpin,
",1,["oasis_runtime_sdk::modules::rofl::Module"]],["impl<Consensus> Unpin for Module<Consensus>
where\n Consensus: Unpin,
",1,["oasis_runtime_sdk::modules::consensus_accounts::Module"]],["impl<M> Unpin for MKVSStore<M>
where\n M: Unpin,
",1,["oasis_runtime_sdk::storage::mkvs::MKVSStore"]],["impl<R> Unpin for Dispatcher<R>
where\n R: Unpin,
",1,["oasis_runtime_sdk::dispatcher::Dispatcher"]],["impl<S> Unpin for ConfidentialStore<S>
where\n S: Unpin,
",1,["oasis_runtime_sdk::storage::confidential::ConfidentialStore"]],["impl<S> Unpin for OverlayStore<S>
where\n S: Unpin,
",1,["oasis_runtime_sdk::storage::overlay::OverlayStore"]],["impl<S> Unpin for TypedStore<S>
where\n S: Unpin,
",1,["oasis_runtime_sdk::storage::typed::TypedStore"]],["impl<S, D> Unpin for HashedStore<S, D>
where\n S: Unpin,\n D: Unpin,
",1,["oasis_runtime_sdk::storage::hashed::HashedStore"]],["impl<S, P> Unpin for PrefixStore<S, P>
where\n S: Unpin,\n P: Unpin,
",1,["oasis_runtime_sdk::storage::prefix::PrefixStore"]],["impl<T> Unpin for TransactionResult<T>
where\n T: Unpin,
",1,["oasis_runtime_sdk::state::TransactionResult"]]], +"oasis_runtime_sdk_contracts":[["impl Unpin for Error",1,["oasis_runtime_sdk_contracts::Error"]],["impl Unpin for Event",1,["oasis_runtime_sdk_contracts::Event"]],["impl Unpin for ABI",1,["oasis_runtime_sdk_contracts::types::ABI"]],["impl Unpin for Policy",1,["oasis_runtime_sdk_contracts::types::Policy"]],["impl Unpin for PublicKeyKind",1,["oasis_runtime_sdk_contracts::types::PublicKeyKind"]],["impl Unpin for StoreKind",1,["oasis_runtime_sdk_contracts::types::StoreKind"]],["impl Unpin for GasCosts",1,["oasis_runtime_sdk_contracts::GasCosts"]],["impl Unpin for Genesis",1,["oasis_runtime_sdk_contracts::Genesis"]],["impl Unpin for LocalConfig",1,["oasis_runtime_sdk_contracts::LocalConfig"]],["impl Unpin for Parameters",1,["oasis_runtime_sdk_contracts::Parameters"]],["impl Unpin for Call",1,["oasis_runtime_sdk_contracts::types::Call"]],["impl Unpin for CallResult",1,["oasis_runtime_sdk_contracts::types::CallResult"]],["impl Unpin for ChangeUpgradePolicy",1,["oasis_runtime_sdk_contracts::types::ChangeUpgradePolicy"]],["impl Unpin for Code",1,["oasis_runtime_sdk_contracts::types::Code"]],["impl Unpin for CodeQuery",1,["oasis_runtime_sdk_contracts::types::CodeQuery"]],["impl Unpin for CodeStorageQuery",1,["oasis_runtime_sdk_contracts::types::CodeStorageQuery"]],["impl Unpin for CodeStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::CodeStorageQueryResult"]],["impl Unpin for ContractEvent",1,["oasis_runtime_sdk_contracts::types::ContractEvent"]],["impl Unpin for CustomQuery",1,["oasis_runtime_sdk_contracts::types::CustomQuery"]],["impl Unpin for CustomQueryResult",1,["oasis_runtime_sdk_contracts::types::CustomQueryResult"]],["impl Unpin for Instance",1,["oasis_runtime_sdk_contracts::types::Instance"]],["impl Unpin for InstanceQuery",1,["oasis_runtime_sdk_contracts::types::InstanceQuery"]],["impl Unpin for InstanceRawStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQuery"]],["impl Unpin for InstanceRawStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQueryResult"]],["impl Unpin for InstanceStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQuery"]],["impl Unpin for InstanceStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQueryResult"]],["impl Unpin for Instantiate",1,["oasis_runtime_sdk_contracts::types::Instantiate"]],["impl Unpin for InstantiateResult",1,["oasis_runtime_sdk_contracts::types::InstantiateResult"]],["impl Unpin for PublicKeyQuery",1,["oasis_runtime_sdk_contracts::types::PublicKeyQuery"]],["impl Unpin for PublicKeyQueryResult",1,["oasis_runtime_sdk_contracts::types::PublicKeyQueryResult"]],["impl Unpin for Upgrade",1,["oasis_runtime_sdk_contracts::types::Upgrade"]],["impl Unpin for Upload",1,["oasis_runtime_sdk_contracts::types::Upload"]],["impl Unpin for UploadResult",1,["oasis_runtime_sdk_contracts::types::UploadResult"]],["impl<Cfg> Unpin for Module<Cfg>
where\n Cfg: Unpin,
",1,["oasis_runtime_sdk_contracts::Module"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/arith/trait.Add.js b/rust/trait.impl/core/ops/arith/trait.Add.js new file mode 100644 index 0000000000..058eae3b06 --- /dev/null +++ b/rust/trait.impl/core/ops/arith/trait.Add.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Add for Quantity"],["impl Add<u64> for Quantity"],["impl<'a> Add<&'a Quantity> for Quantity"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/arith/trait.AddAssign.js b/rust/trait.impl/core/ops/arith/trait.AddAssign.js new file mode 100644 index 0000000000..f543b6f2f8 --- /dev/null +++ b/rust/trait.impl/core/ops/arith/trait.AddAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl AddAssign for Quantity"],["impl AddAssign<u64> for Quantity"],["impl<'a> AddAssign<&'a Quantity> for Quantity"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/arith/trait.Mul.js b/rust/trait.impl/core/ops/arith/trait.Mul.js new file mode 100644 index 0000000000..5b3b7d76a4 --- /dev/null +++ b/rust/trait.impl/core/ops/arith/trait.Mul.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Mul for Quantity"],["impl Mul<u64> for Quantity"],["impl<'a> Mul<&'a Quantity> for Quantity"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/arith/trait.MulAssign.js b/rust/trait.impl/core/ops/arith/trait.MulAssign.js new file mode 100644 index 0000000000..5974f0ec13 --- /dev/null +++ b/rust/trait.impl/core/ops/arith/trait.MulAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl MulAssign for Quantity"],["impl MulAssign<u64> for Quantity"],["impl<'a> MulAssign<&'a Quantity> for Quantity"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/arith/trait.Sub.js b/rust/trait.impl/core/ops/arith/trait.Sub.js new file mode 100644 index 0000000000..83c013e1a1 --- /dev/null +++ b/rust/trait.impl/core/ops/arith/trait.Sub.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Sub for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/arith/trait.SubAssign.js b/rust/trait.impl/core/ops/arith/trait.SubAssign.js new file mode 100644 index 0000000000..a232a53f7e --- /dev/null +++ b/rust/trait.impl/core/ops/arith/trait.SubAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl SubAssign for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/bit/trait.BitAnd.js b/rust/trait.impl/core/ops/bit/trait.BitAnd.js new file mode 100644 index 0000000000..d0fc7f320c --- /dev/null +++ b/rust/trait.impl/core/ops/bit/trait.BitAnd.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl BitAnd for TdAttributes"],["impl BitAnd for RolesMask"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/bit/trait.BitAndAssign.js b/rust/trait.impl/core/ops/bit/trait.BitAndAssign.js new file mode 100644 index 0000000000..f0b1eb5300 --- /dev/null +++ b/rust/trait.impl/core/ops/bit/trait.BitAndAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl BitAndAssign for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/bit/trait.BitOr.js b/rust/trait.impl/core/ops/bit/trait.BitOr.js new file mode 100644 index 0000000000..fb77cca956 --- /dev/null +++ b/rust/trait.impl/core/ops/bit/trait.BitOr.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl BitOr for TdAttributes"],["impl BitOr for RolesMask"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/bit/trait.BitOrAssign.js b/rust/trait.impl/core/ops/bit/trait.BitOrAssign.js new file mode 100644 index 0000000000..ee923f7330 --- /dev/null +++ b/rust/trait.impl/core/ops/bit/trait.BitOrAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl BitOrAssign for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/bit/trait.BitXor.js b/rust/trait.impl/core/ops/bit/trait.BitXor.js new file mode 100644 index 0000000000..900d40e08d --- /dev/null +++ b/rust/trait.impl/core/ops/bit/trait.BitXor.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl BitXor for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/bit/trait.BitXorAssign.js b/rust/trait.impl/core/ops/bit/trait.BitXorAssign.js new file mode 100644 index 0000000000..e06c07d186 --- /dev/null +++ b/rust/trait.impl/core/ops/bit/trait.BitXorAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl BitXorAssign for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/bit/trait.Not.js b/rust/trait.impl/core/ops/bit/trait.Not.js new file mode 100644 index 0000000000..4f33395022 --- /dev/null +++ b/rust/trait.impl/core/ops/bit/trait.Not.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Not for TdAttributes"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/deref/trait.Deref.js b/rust/trait.impl/core/ops/deref/trait.Deref.js new file mode 100644 index 0000000000..3c1695d20f --- /dev/null +++ b/rust/trait.impl/core/ops/deref/trait.Deref.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Deref for Nonce"],["impl Deref for COMMON_POOL_ADDRESS"],["impl Deref for FEE_ACC_ADDRESS"],["impl Deref for GOVERNANCE_DEPOSITS_ADDRESS"],["impl Deref for Prefix"],["impl Deref for RawProofEntry"],["impl Deref for BUILD_INFO"],["impl Deref for TxnBatch"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/deref/trait.DerefMut.js b/rust/trait.impl/core/ops/deref/trait.DerefMut.js new file mode 100644 index 0000000000..be2781443b --- /dev/null +++ b/rust/trait.impl/core/ops/deref/trait.DerefMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl DerefMut for Prefix"],["impl DerefMut for RawProofEntry"],["impl DerefMut for TxnBatch"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/ops/drop/trait.Drop.js b/rust/trait.impl/core/ops/drop/trait.Drop.js new file mode 100644 index 0000000000..979bb32bc9 --- /dev/null +++ b/rust/trait.impl/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Drop for PrivateKey"],["impl Drop for AbortOnPanic"],["impl Drop for RpcClient"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/rust/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 0000000000..56c38c9e53 --- /dev/null +++ b/rust/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,8 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl RefUnwindSafe for CryptoError",1,["oasis_contract_sdk::env::CryptoError"]],["impl RefUnwindSafe for HostRegion",1,["oasis_contract_sdk::memory::HostRegion"]],["impl RefUnwindSafe for MockContext",1,["oasis_contract_sdk::testing::MockContext"]],["impl RefUnwindSafe for MockEnv",1,["oasis_contract_sdk::testing::MockEnv"]],["impl RefUnwindSafe for MockStore",1,["oasis_contract_sdk::testing::MockStore"]],["impl<'a> RefUnwindSafe for HostRegionRef<'a>",1,["oasis_contract_sdk::memory::HostRegionRef"]]], +"oasis_contract_sdk_storage":[["impl<'key, K, V> RefUnwindSafe for ConfidentialMap<'key, K, V>
where\n K: RefUnwindSafe,\n V: RefUnwindSafe,
",1,["oasis_contract_sdk_storage::map::ConfidentialMap"]],["impl<'key, K, V> RefUnwindSafe for PublicMap<'key, K, V>
where\n K: RefUnwindSafe,\n V: RefUnwindSafe,
",1,["oasis_contract_sdk_storage::map::PublicMap"]],["impl<'key, T> RefUnwindSafe for ConfidentialCell<'key, T>
where\n T: RefUnwindSafe,
",1,["oasis_contract_sdk_storage::cell::ConfidentialCell"]],["impl<'key, T> RefUnwindSafe for PublicCell<'key, T>
where\n T: RefUnwindSafe,
",1,["oasis_contract_sdk_storage::cell::PublicCell"]],["impl<I> RefUnwindSafe for Int<I>
where\n <I as Integer>::Encoded: RefUnwindSafe,\n I: RefUnwindSafe,
",1,["oasis_contract_sdk_storage::map::Int"]]], +"oasis_contract_sdk_types":[["impl RefUnwindSafe for Error",1,["oasis_contract_sdk_types::address::Error"]],["impl RefUnwindSafe for SignatureKind",1,["oasis_contract_sdk_types::crypto::SignatureKind"]],["impl RefUnwindSafe for CallFormat",1,["oasis_contract_sdk_types::CallFormat"]],["impl RefUnwindSafe for ExecutionResult",1,["oasis_contract_sdk_types::ExecutionResult"]],["impl RefUnwindSafe for AccountsQuery",1,["oasis_contract_sdk_types::env::AccountsQuery"]],["impl RefUnwindSafe for AccountsResponse",1,["oasis_contract_sdk_types::env::AccountsResponse"]],["impl RefUnwindSafe for QueryRequest",1,["oasis_contract_sdk_types::env::QueryRequest"]],["impl RefUnwindSafe for QueryResponse",1,["oasis_contract_sdk_types::env::QueryResponse"]],["impl RefUnwindSafe for CallResult",1,["oasis_contract_sdk_types::message::CallResult"]],["impl RefUnwindSafe for Message",1,["oasis_contract_sdk_types::message::Message"]],["impl RefUnwindSafe for NotifyReply",1,["oasis_contract_sdk_types::message::NotifyReply"]],["impl RefUnwindSafe for Reply",1,["oasis_contract_sdk_types::message::Reply"]],["impl RefUnwindSafe for StoreKind",1,["oasis_contract_sdk_types::storage::StoreKind"]],["impl RefUnwindSafe for Error",1,["oasis_contract_sdk_types::token::Error"]],["impl RefUnwindSafe for Address",1,["oasis_contract_sdk_types::address::Address"]],["impl RefUnwindSafe for Event",1,["oasis_contract_sdk_types::event::Event"]],["impl RefUnwindSafe for InstantiateResult",1,["oasis_contract_sdk_types::modules::contracts::InstantiateResult"]],["impl RefUnwindSafe for CodeId",1,["oasis_contract_sdk_types::CodeId"]],["impl RefUnwindSafe for ExecutionContext",1,["oasis_contract_sdk_types::ExecutionContext"]],["impl RefUnwindSafe for ExecutionOk",1,["oasis_contract_sdk_types::ExecutionOk"]],["impl RefUnwindSafe for InstanceId",1,["oasis_contract_sdk_types::InstanceId"]],["impl RefUnwindSafe for BaseUnits",1,["oasis_contract_sdk_types::token::BaseUnits"]],["impl RefUnwindSafe for Denomination",1,["oasis_contract_sdk_types::token::Denomination"]]], +"oasis_core_runtime":[["impl !RefUnwindSafe for NodeBox",1,["oasis_core_runtime::storage::mkvs::tree::node::NodeBox"]],["impl !RefUnwindSafe for Cache",1,["oasis_core_runtime::cache::Cache"]],["impl !RefUnwindSafe for CacheSet",1,["oasis_core_runtime::cache::CacheSet"]],["impl !RefUnwindSafe for ConsensusState",1,["oasis_core_runtime::consensus::state::ConsensusState"]],["impl !RefUnwindSafe for NopVerifier",1,["oasis_core_runtime::consensus::tendermint::verifier::noop::NopVerifier"]],["impl !RefUnwindSafe for Verifier",1,["oasis_core_runtime::consensus::tendermint::verifier::Verifier"]],["impl !RefUnwindSafe for Dispatcher",1,["oasis_core_runtime::dispatcher::Dispatcher"]],["impl !RefUnwindSafe for PostInitState",1,["oasis_core_runtime::dispatcher::PostInitState"]],["impl !RefUnwindSafe for RpcClient",1,["oasis_core_runtime::enclave_rpc::client::RpcClient"]],["impl !RefUnwindSafe for Dispatcher",1,["oasis_core_runtime::enclave_rpc::dispatcher::Dispatcher"]],["impl !RefUnwindSafe for Method",1,["oasis_core_runtime::enclave_rpc::dispatcher::Method"]],["impl !RefUnwindSafe for Builder",1,["oasis_core_runtime::enclave_rpc::session::Builder"]],["impl !RefUnwindSafe for Session",1,["oasis_core_runtime::enclave_rpc::session::Session"]],["impl !RefUnwindSafe for PolicyVerifier",1,["oasis_core_runtime::policy::PolicyVerifier"]],["impl !RefUnwindSafe for Protocol",1,["oasis_core_runtime::protocol::Protocol"]],["impl !RefUnwindSafe for ProtocolUntrustedLocalStorage",1,["oasis_core_runtime::protocol::ProtocolUntrustedLocalStorage"]],["impl !RefUnwindSafe for NodePointer",1,["oasis_core_runtime::storage::mkvs::tree::node::NodePointer"]],["impl !RefUnwindSafe for Tree",1,["oasis_core_runtime::storage::mkvs::tree::Tree"]],["impl !RefUnwindSafe for HostReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::host::HostReadSyncer"]],["impl !RefUnwindSafe for StatsCollector",1,["oasis_core_runtime::storage::mkvs::sync::stats::StatsCollector"]],["impl !RefUnwindSafe for Tree",1,["oasis_core_runtime::transaction::tree::Tree"]],["impl RefUnwindSafe for Quote",1,["oasis_core_runtime::common::sgx::Quote"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::common::sgx::pcs::Error"]],["impl RefUnwindSafe for Event",1,["oasis_core_runtime::consensus::Event"]],["impl RefUnwindSafe for Vote",1,["oasis_core_runtime::consensus::governance::Vote"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::consensus::keymanager::churp::Error"]],["impl RefUnwindSafe for SuiteId",1,["oasis_core_runtime::consensus::keymanager::churp::SuiteId"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::consensus::keymanager::Error"]],["impl RefUnwindSafe for RuntimeGovernanceModel",1,["oasis_core_runtime::consensus::registry::RuntimeGovernanceModel"]],["impl RefUnwindSafe for RuntimeKind",1,["oasis_core_runtime::consensus::registry::RuntimeKind"]],["impl RefUnwindSafe for SGXAttestation",1,["oasis_core_runtime::consensus::registry::SGXAttestation"]],["impl RefUnwindSafe for SGXConstraints",1,["oasis_core_runtime::consensus::registry::SGXConstraints"]],["impl RefUnwindSafe for TEEHardware",1,["oasis_core_runtime::consensus::registry::TEEHardware"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::consensus::roothash::Error"]],["impl RefUnwindSafe for ExecutorCommitmentFailure",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentFailure"]],["impl RefUnwindSafe for GovernanceMessage",1,["oasis_core_runtime::consensus::roothash::message::GovernanceMessage"]],["impl RefUnwindSafe for HeaderType",1,["oasis_core_runtime::consensus::roothash::block::HeaderType"]],["impl RefUnwindSafe for Message",1,["oasis_core_runtime::consensus::roothash::message::Message"]],["impl RefUnwindSafe for RegistryMessage",1,["oasis_core_runtime::consensus::roothash::message::RegistryMessage"]],["impl RefUnwindSafe for StakingMessage",1,["oasis_core_runtime::consensus::roothash::message::StakingMessage"]],["impl RefUnwindSafe for CommitteeKind",1,["oasis_core_runtime::consensus::scheduler::CommitteeKind"]],["impl RefUnwindSafe for Role",1,["oasis_core_runtime::consensus::scheduler::Role"]],["impl RefUnwindSafe for EscrowEvent",1,["oasis_core_runtime::consensus::staking::EscrowEvent"]],["impl RefUnwindSafe for SlashReason",1,["oasis_core_runtime::consensus::staking::SlashReason"]],["impl RefUnwindSafe for ThresholdKind",1,["oasis_core_runtime::consensus::staking::ThresholdKind"]],["impl RefUnwindSafe for StateError",1,["oasis_core_runtime::consensus::state::StateError"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::consensus::verifier::Error"]],["impl RefUnwindSafe for RpcClientError",1,["oasis_core_runtime::enclave_rpc::client::RpcClientError"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::enclave_rpc::demux::Error"]],["impl RefUnwindSafe for RAKBinding",1,["oasis_core_runtime::enclave_rpc::session::RAKBinding"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::enclave_rpc::sessions::Error"]],["impl RefUnwindSafe for Body",1,["oasis_core_runtime::enclave_rpc::types::Body"]],["impl RefUnwindSafe for Kind",1,["oasis_core_runtime::enclave_rpc::types::Kind"]],["impl RefUnwindSafe for Message",1,["oasis_core_runtime::enclave_rpc::types::Message"]],["impl RefUnwindSafe for PeerFeedback",1,["oasis_core_runtime::enclave_rpc::types::PeerFeedback"]],["impl RefUnwindSafe for TeeType",1,["oasis_core_runtime::TeeType"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::host::Error"]],["impl RefUnwindSafe for PolicyVerifierError",1,["oasis_core_runtime::policy::PolicyVerifierError"]],["impl RefUnwindSafe for ProtocolError",1,["oasis_core_runtime::protocol::ProtocolError"]],["impl RefUnwindSafe for Stream",1,["oasis_core_runtime::protocol::Stream"]],["impl RefUnwindSafe for LogEntryKind",1,["oasis_core_runtime::storage::mkvs::LogEntryKind"]],["impl RefUnwindSafe for RootType",1,["oasis_core_runtime::storage::mkvs::tree::node::RootType"]],["impl RefUnwindSafe for SyncerError",1,["oasis_core_runtime::storage::mkvs::sync::errors::SyncerError"]],["impl RefUnwindSafe for Body",1,["oasis_core_runtime::types::Body"]],["impl RefUnwindSafe for EventKind",1,["oasis_core_runtime::types::EventKind"]],["impl RefUnwindSafe for ExecutionMode",1,["oasis_core_runtime::types::ExecutionMode"]],["impl RefUnwindSafe for HostStorageEndpoint",1,["oasis_core_runtime::types::HostStorageEndpoint"]],["impl RefUnwindSafe for MessageType",1,["oasis_core_runtime::types::MessageType"]],["impl RefUnwindSafe for StorageSyncRequest",1,["oasis_core_runtime::types::StorageSyncRequest"]],["impl RefUnwindSafe for StorageSyncResponse",1,["oasis_core_runtime::types::StorageSyncResponse"]],["impl RefUnwindSafe for NoopApp",1,["oasis_core_runtime::app::NoopApp"]],["impl RefUnwindSafe for Hash",1,["oasis_core_runtime::common::crypto::hash::Hash"]],["impl RefUnwindSafe for Nonce",1,["oasis_core_runtime::common::crypto::mrae::nonce::Nonce"]],["impl RefUnwindSafe for MultiSigned",1,["oasis_core_runtime::common::crypto::signature::MultiSigned"]],["impl RefUnwindSafe for PrivateKey",1,["oasis_core_runtime::common::crypto::signature::PrivateKey"]],["impl RefUnwindSafe for PublicKey",1,["oasis_core_runtime::common::crypto::signature::PublicKey"]],["impl RefUnwindSafe for Signature",1,["oasis_core_runtime::common::crypto::signature::Signature"]],["impl RefUnwindSafe for SignatureBundle",1,["oasis_core_runtime::common::crypto::signature::SignatureBundle"]],["impl RefUnwindSafe for Signed",1,["oasis_core_runtime::common::crypto::signature::Signed"]],["impl RefUnwindSafe for PrivateKey",1,["oasis_core_runtime::common::crypto::x25519::PrivateKey"]],["impl RefUnwindSafe for PublicKey",1,["oasis_core_runtime::common::crypto::x25519::PublicKey"]],["impl RefUnwindSafe for Namespace",1,["oasis_core_runtime::common::namespace::Namespace"]],["impl RefUnwindSafe for AbortOnPanic",1,["oasis_core_runtime::common::panic::AbortOnPanic"]],["impl RefUnwindSafe for Quantity",1,["oasis_core_runtime::common::quantity::Quantity"]],["impl RefUnwindSafe for AVR",1,["oasis_core_runtime::common::sgx::ias::AVR"]],["impl RefUnwindSafe for QuotePolicy",1,["oasis_core_runtime::common::sgx::ias::QuotePolicy"]],["impl RefUnwindSafe for QuoteBundle",1,["oasis_core_runtime::common::sgx::pcs::quote::QuoteBundle"]],["impl RefUnwindSafe for QuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::QuotePolicy"]],["impl RefUnwindSafe for TCBBundle",1,["oasis_core_runtime::common::sgx::pcs::tcb::TCBBundle"]],["impl RefUnwindSafe for TdAttributes",1,["oasis_core_runtime::common::sgx::pcs::report::TdAttributes"]],["impl RefUnwindSafe for TdReport",1,["oasis_core_runtime::common::sgx::pcs::report::TdReport"]],["impl RefUnwindSafe for TdxModulePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxModulePolicy"]],["impl RefUnwindSafe for TdxQuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxQuotePolicy"]],["impl RefUnwindSafe for EnclaveIdentity",1,["oasis_core_runtime::common::sgx::EnclaveIdentity"]],["impl RefUnwindSafe for MrEnclave",1,["oasis_core_runtime::common::sgx::MrEnclave"]],["impl RefUnwindSafe for MrSigner",1,["oasis_core_runtime::common::sgx::MrSigner"]],["impl RefUnwindSafe for QuotePolicy",1,["oasis_core_runtime::common::sgx::QuotePolicy"]],["impl RefUnwindSafe for VerifiedQuote",1,["oasis_core_runtime::common::sgx::VerifiedQuote"]],["impl RefUnwindSafe for ProtocolVersions",1,["oasis_core_runtime::common::version::ProtocolVersions"]],["impl RefUnwindSafe for Version",1,["oasis_core_runtime::common::version::Version"]],["impl RefUnwindSafe for Config",1,["oasis_core_runtime::config::Config"]],["impl RefUnwindSafe for Storage",1,["oasis_core_runtime::config::Storage"]],["impl RefUnwindSafe for Address",1,["oasis_core_runtime::consensus::address::Address"]],["impl RefUnwindSafe for COMMON_POOL_ADDRESS",1,["oasis_core_runtime::consensus::address::COMMON_POOL_ADDRESS"]],["impl RefUnwindSafe for FEE_ACC_ADDRESS",1,["oasis_core_runtime::consensus::address::FEE_ACC_ADDRESS"]],["impl RefUnwindSafe for GOVERNANCE_DEPOSITS_ADDRESS",1,["oasis_core_runtime::consensus::address::GOVERNANCE_DEPOSITS_ADDRESS"]],["impl RefUnwindSafe for EpochTimeState",1,["oasis_core_runtime::consensus::beacon::EpochTimeState"]],["impl RefUnwindSafe for CancelUpgradeProposal",1,["oasis_core_runtime::consensus::governance::CancelUpgradeProposal"]],["impl RefUnwindSafe for ChangeParametersProposal",1,["oasis_core_runtime::consensus::governance::ChangeParametersProposal"]],["impl RefUnwindSafe for ConsensusParameterChanges",1,["oasis_core_runtime::consensus::governance::ConsensusParameterChanges"]],["impl RefUnwindSafe for ProposalContent",1,["oasis_core_runtime::consensus::governance::ProposalContent"]],["impl RefUnwindSafe for ProposalVote",1,["oasis_core_runtime::consensus::governance::ProposalVote"]],["impl RefUnwindSafe for UpgradeProposal",1,["oasis_core_runtime::consensus::governance::UpgradeProposal"]],["impl RefUnwindSafe for Application",1,["oasis_core_runtime::consensus::keymanager::churp::Application"]],["impl RefUnwindSafe for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::PolicySGX"]],["impl RefUnwindSafe for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::SignedPolicySGX"]],["impl RefUnwindSafe for Status",1,["oasis_core_runtime::consensus::keymanager::churp::Status"]],["impl RefUnwindSafe for EnclavePolicySGX",1,["oasis_core_runtime::consensus::keymanager::EnclavePolicySGX"]],["impl RefUnwindSafe for EncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedEphemeralSecret"]],["impl RefUnwindSafe for EncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedMasterSecret"]],["impl RefUnwindSafe for EncryptedSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedSecret"]],["impl RefUnwindSafe for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::PolicySGX"]],["impl RefUnwindSafe for SignedEncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedEphemeralSecret"]],["impl RefUnwindSafe for SignedEncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedMasterSecret"]],["impl RefUnwindSafe for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::SignedPolicySGX"]],["impl RefUnwindSafe for AnyNodeRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::AnyNodeRuntimeAdmissionPolicy"]],["impl RefUnwindSafe for Capabilities",1,["oasis_core_runtime::consensus::registry::Capabilities"]],["impl RefUnwindSafe for CapabilityTEE",1,["oasis_core_runtime::consensus::registry::CapabilityTEE"]],["impl RefUnwindSafe for ConsensusAddress",1,["oasis_core_runtime::consensus::registry::ConsensusAddress"]],["impl RefUnwindSafe for ConsensusInfo",1,["oasis_core_runtime::consensus::registry::ConsensusInfo"]],["impl RefUnwindSafe for EndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::EndorsedCapabilityTEE"]],["impl RefUnwindSafe for EntityWhitelistConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistConfig"]],["impl RefUnwindSafe for EntityWhitelistRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleAdmissionPolicy"]],["impl RefUnwindSafe for EntityWhitelistRoleConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleConfig"]],["impl RefUnwindSafe for EntityWhitelistRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRuntimeAdmissionPolicy"]],["impl RefUnwindSafe for ExecutorParameters",1,["oasis_core_runtime::consensus::registry::ExecutorParameters"]],["impl RefUnwindSafe for MaxNodesConstraint",1,["oasis_core_runtime::consensus::registry::MaxNodesConstraint"]],["impl RefUnwindSafe for MinPoolSizeConstraint",1,["oasis_core_runtime::consensus::registry::MinPoolSizeConstraint"]],["impl RefUnwindSafe for Node",1,["oasis_core_runtime::consensus::registry::Node"]],["impl RefUnwindSafe for NodeRuntime",1,["oasis_core_runtime::consensus::registry::NodeRuntime"]],["impl RefUnwindSafe for P2PInfo",1,["oasis_core_runtime::consensus::registry::P2PInfo"]],["impl RefUnwindSafe for PerRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::PerRoleAdmissionPolicy"]],["impl RefUnwindSafe for RolesMask",1,["oasis_core_runtime::consensus::registry::RolesMask"]],["impl RefUnwindSafe for Runtime",1,["oasis_core_runtime::consensus::registry::Runtime"]],["impl RefUnwindSafe for RuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::RuntimeAdmissionPolicy"]],["impl RefUnwindSafe for RuntimeGenesis",1,["oasis_core_runtime::consensus::registry::RuntimeGenesis"]],["impl RefUnwindSafe for RuntimeStakingParameters",1,["oasis_core_runtime::consensus::registry::RuntimeStakingParameters"]],["impl RefUnwindSafe for SchedulingConstraints",1,["oasis_core_runtime::consensus::registry::SchedulingConstraints"]],["impl RefUnwindSafe for StorageParameters",1,["oasis_core_runtime::consensus::registry::StorageParameters"]],["impl RefUnwindSafe for TCPAddress",1,["oasis_core_runtime::consensus::registry::TCPAddress"]],["impl RefUnwindSafe for TLSAddress",1,["oasis_core_runtime::consensus::registry::TLSAddress"]],["impl RefUnwindSafe for TLSInfo",1,["oasis_core_runtime::consensus::registry::TLSInfo"]],["impl RefUnwindSafe for TxnSchedulerParameters",1,["oasis_core_runtime::consensus::registry::TxnSchedulerParameters"]],["impl RefUnwindSafe for VRFInfo",1,["oasis_core_runtime::consensus::registry::VRFInfo"]],["impl RefUnwindSafe for ValidatorSetConstraint",1,["oasis_core_runtime::consensus::registry::ValidatorSetConstraint"]],["impl RefUnwindSafe for VerifiedAttestation",1,["oasis_core_runtime::consensus::registry::VerifiedAttestation"]],["impl RefUnwindSafe for VerifiedEndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::VerifiedEndorsedCapabilityTEE"]],["impl RefUnwindSafe for VersionInfo",1,["oasis_core_runtime::consensus::registry::VersionInfo"]],["impl RefUnwindSafe for AnnotatedBlock",1,["oasis_core_runtime::consensus::roothash::AnnotatedBlock"]],["impl RefUnwindSafe for Block",1,["oasis_core_runtime::consensus::roothash::block::Block"]],["impl RefUnwindSafe for ComputeResultsHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ComputeResultsHeader"]],["impl RefUnwindSafe for ExecutorCommitment",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitment"]],["impl RefUnwindSafe for ExecutorCommitmentHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentHeader"]],["impl RefUnwindSafe for Header",1,["oasis_core_runtime::consensus::roothash::block::Header"]],["impl RefUnwindSafe for IncomingMessage",1,["oasis_core_runtime::consensus::roothash::message::IncomingMessage"]],["impl RefUnwindSafe for MessageEvent",1,["oasis_core_runtime::consensus::roothash::MessageEvent"]],["impl RefUnwindSafe for Pool",1,["oasis_core_runtime::consensus::roothash::commitment::pool::Pool"]],["impl RefUnwindSafe for RoundResults",1,["oasis_core_runtime::consensus::roothash::RoundResults"]],["impl RefUnwindSafe for RoundRoots",1,["oasis_core_runtime::consensus::roothash::RoundRoots"]],["impl RefUnwindSafe for Committee",1,["oasis_core_runtime::consensus::scheduler::Committee"]],["impl RefUnwindSafe for CommitteeNode",1,["oasis_core_runtime::consensus::scheduler::CommitteeNode"]],["impl RefUnwindSafe for Account",1,["oasis_core_runtime::consensus::staking::Account"]],["impl RefUnwindSafe for AddEscrowResult",1,["oasis_core_runtime::consensus::staking::AddEscrowResult"]],["impl RefUnwindSafe for AllowanceChangeEvent",1,["oasis_core_runtime::consensus::staking::AllowanceChangeEvent"]],["impl RefUnwindSafe for BurnEvent",1,["oasis_core_runtime::consensus::staking::BurnEvent"]],["impl RefUnwindSafe for CommissionRateBoundStep",1,["oasis_core_runtime::consensus::staking::CommissionRateBoundStep"]],["impl RefUnwindSafe for CommissionRateStep",1,["oasis_core_runtime::consensus::staking::CommissionRateStep"]],["impl RefUnwindSafe for CommissionSchedule",1,["oasis_core_runtime::consensus::staking::CommissionSchedule"]],["impl RefUnwindSafe for DebondingDelegation",1,["oasis_core_runtime::consensus::staking::DebondingDelegation"]],["impl RefUnwindSafe for Delegation",1,["oasis_core_runtime::consensus::staking::Delegation"]],["impl RefUnwindSafe for Escrow",1,["oasis_core_runtime::consensus::staking::Escrow"]],["impl RefUnwindSafe for EscrowAccount",1,["oasis_core_runtime::consensus::staking::EscrowAccount"]],["impl RefUnwindSafe for Event",1,["oasis_core_runtime::consensus::staking::Event"]],["impl RefUnwindSafe for GeneralAccount",1,["oasis_core_runtime::consensus::staking::GeneralAccount"]],["impl RefUnwindSafe for ReclaimEscrow",1,["oasis_core_runtime::consensus::staking::ReclaimEscrow"]],["impl RefUnwindSafe for ReclaimEscrowResult",1,["oasis_core_runtime::consensus::staking::ReclaimEscrowResult"]],["impl RefUnwindSafe for SharePool",1,["oasis_core_runtime::consensus::staking::SharePool"]],["impl RefUnwindSafe for Slash",1,["oasis_core_runtime::consensus::staking::Slash"]],["impl RefUnwindSafe for StakeAccumulator",1,["oasis_core_runtime::consensus::staking::StakeAccumulator"]],["impl RefUnwindSafe for StakeThreshold",1,["oasis_core_runtime::consensus::staking::StakeThreshold"]],["impl RefUnwindSafe for Transfer",1,["oasis_core_runtime::consensus::staking::Transfer"]],["impl RefUnwindSafe for TransferEvent",1,["oasis_core_runtime::consensus::staking::TransferEvent"]],["impl RefUnwindSafe for TransferResult",1,["oasis_core_runtime::consensus::staking::TransferResult"]],["impl RefUnwindSafe for Withdraw",1,["oasis_core_runtime::consensus::staking::Withdraw"]],["impl RefUnwindSafe for WithdrawResult",1,["oasis_core_runtime::consensus::staking::WithdrawResult"]],["impl RefUnwindSafe for MutableState",1,["oasis_core_runtime::consensus::state::beacon::MutableState"]],["impl RefUnwindSafe for Status",1,["oasis_core_runtime::consensus::state::keymanager::Status"]],["impl RefUnwindSafe for BlockMetadata",1,["oasis_core_runtime::consensus::BlockMetadata"]],["impl RefUnwindSafe for LightBlock",1,["oasis_core_runtime::consensus::LightBlock"]],["impl RefUnwindSafe for Proof",1,["oasis_core_runtime::consensus::tendermint::merkle::Proof"]],["impl RefUnwindSafe for LightBlockMeta",1,["oasis_core_runtime::consensus::tendermint::LightBlockMeta"]],["impl RefUnwindSafe for Fee",1,["oasis_core_runtime::consensus::transaction::Fee"]],["impl RefUnwindSafe for Proof",1,["oasis_core_runtime::consensus::transaction::Proof"]],["impl RefUnwindSafe for SignedTransactionWithProof",1,["oasis_core_runtime::consensus::transaction::SignedTransactionWithProof"]],["impl RefUnwindSafe for Transaction",1,["oasis_core_runtime::consensus::transaction::Transaction"]],["impl RefUnwindSafe for TrustRoot",1,["oasis_core_runtime::consensus::verifier::TrustRoot"]],["impl RefUnwindSafe for Context",1,["oasis_core_runtime::enclave_rpc::context::Context"]],["impl RefUnwindSafe for Demux",1,["oasis_core_runtime::enclave_rpc::demux::Demux"]],["impl RefUnwindSafe for MethodDescriptor",1,["oasis_core_runtime::enclave_rpc::dispatcher::MethodDescriptor"]],["impl RefUnwindSafe for SessionInfo",1,["oasis_core_runtime::enclave_rpc::session::SessionInfo"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::enclave_rpc::types::Error"]],["impl RefUnwindSafe for Frame",1,["oasis_core_runtime::enclave_rpc::types::Frame"]],["impl RefUnwindSafe for Request",1,["oasis_core_runtime::enclave_rpc::types::Request"]],["impl RefUnwindSafe for Response",1,["oasis_core_runtime::enclave_rpc::types::Response"]],["impl RefUnwindSafe for SessionID",1,["oasis_core_runtime::enclave_rpc::types::SessionID"]],["impl RefUnwindSafe for RegisterNotifyOpts",1,["oasis_core_runtime::host::RegisterNotifyOpts"]],["impl RefUnwindSafe for SubmitTxOpts",1,["oasis_core_runtime::host::SubmitTxOpts"]],["impl RefUnwindSafe for TxResult",1,["oasis_core_runtime::host::TxResult"]],["impl RefUnwindSafe for Identity",1,["oasis_core_runtime::identity::Identity"]],["impl RefUnwindSafe for HostInfo",1,["oasis_core_runtime::protocol::HostInfo"]],["impl RefUnwindSafe for LogEntry",1,["oasis_core_runtime::storage::mkvs::LogEntry"]],["impl RefUnwindSafe for Prefix",1,["oasis_core_runtime::storage::mkvs::Prefix"]],["impl RefUnwindSafe for Root",1,["oasis_core_runtime::storage::mkvs::tree::node::Root"]],["impl RefUnwindSafe for GetPrefixesRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetPrefixesRequest"]],["impl RefUnwindSafe for GetRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetRequest"]],["impl RefUnwindSafe for IterateRequest",1,["oasis_core_runtime::storage::mkvs::sync::IterateRequest"]],["impl RefUnwindSafe for NoopReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::noop::NoopReadSyncer"]],["impl RefUnwindSafe for Proof",1,["oasis_core_runtime::storage::mkvs::sync::proof::Proof"]],["impl RefUnwindSafe for ProofBuilder",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofBuilder"]],["impl RefUnwindSafe for ProofResponse",1,["oasis_core_runtime::storage::mkvs::sync::ProofResponse"]],["impl RefUnwindSafe for ProofVerifier",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofVerifier"]],["impl RefUnwindSafe for RawProofEntry",1,["oasis_core_runtime::storage::mkvs::sync::proof::RawProofEntry"]],["impl RefUnwindSafe for TreeID",1,["oasis_core_runtime::storage::mkvs::sync::TreeID"]],["impl RefUnwindSafe for UntrustedInMemoryStorage",1,["oasis_core_runtime::storage::UntrustedInMemoryStorage"]],["impl RefUnwindSafe for BUILD_INFO",1,["oasis_core_runtime::BUILD_INFO"]],["impl RefUnwindSafe for BuildInfo",1,["oasis_core_runtime::BuildInfo"]],["impl RefUnwindSafe for ExecuteBatchResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteBatchResult"]],["impl RefUnwindSafe for ExecuteTxResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteTxResult"]],["impl RefUnwindSafe for NoopDispatcher",1,["oasis_core_runtime::transaction::dispatcher::NoopDispatcher"]],["impl RefUnwindSafe for CoarsenedKey",1,["oasis_core_runtime::transaction::rwset::CoarsenedKey"]],["impl RefUnwindSafe for ReadWriteSet",1,["oasis_core_runtime::transaction::rwset::ReadWriteSet"]],["impl RefUnwindSafe for Tag",1,["oasis_core_runtime::transaction::tags::Tag"]],["impl RefUnwindSafe for TxnBatch",1,["oasis_core_runtime::transaction::types::TxnBatch"]],["impl RefUnwindSafe for CheckTxMetadata",1,["oasis_core_runtime::types::CheckTxMetadata"]],["impl RefUnwindSafe for CheckTxResult",1,["oasis_core_runtime::types::CheckTxResult"]],["impl RefUnwindSafe for ComputedBatch",1,["oasis_core_runtime::types::ComputedBatch"]],["impl RefUnwindSafe for Error",1,["oasis_core_runtime::types::Error"]],["impl RefUnwindSafe for FeatureScheduleControl",1,["oasis_core_runtime::types::FeatureScheduleControl"]],["impl RefUnwindSafe for Features",1,["oasis_core_runtime::types::Features"]],["impl RefUnwindSafe for HostFetchConsensusEventsRequest",1,["oasis_core_runtime::types::HostFetchConsensusEventsRequest"]],["impl RefUnwindSafe for HostFetchConsensusEventsResponse",1,["oasis_core_runtime::types::HostFetchConsensusEventsResponse"]],["impl RefUnwindSafe for Message",1,["oasis_core_runtime::types::Message"]],["impl RefUnwindSafe for RegisterNotifyRuntimeEvent",1,["oasis_core_runtime::types::RegisterNotifyRuntimeEvent"]],["impl RefUnwindSafe for RuntimeInfoRequest",1,["oasis_core_runtime::types::RuntimeInfoRequest"]],["impl RefUnwindSafe for RuntimeInfoResponse",1,["oasis_core_runtime::types::RuntimeInfoResponse"]],["impl RefUnwindSafe for RuntimeNotifyEvent",1,["oasis_core_runtime::types::RuntimeNotifyEvent"]],["impl RefUnwindSafe for StorageSyncRequestWithEndpoint",1,["oasis_core_runtime::types::StorageSyncRequestWithEndpoint"]],["impl<'a> !RefUnwindSafe for PreInitState<'a>",1,["oasis_core_runtime::dispatcher::PreInitState"]],["impl<'a> !RefUnwindSafe for Context<'a>",1,["oasis_core_runtime::transaction::context::Context"]],["impl<'a> RefUnwindSafe for Quote<'a>",1,["oasis_core_runtime::common::sgx::pcs::quote::Quote"]],["impl<'a, T> !RefUnwindSafe for Response<'a, T>",1,["oasis_core_runtime::enclave_rpc::client::Response"]],["impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::beacon::ImmutableState"]],["impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::keymanager::churp::ImmutableState"]],["impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::keymanager::ImmutableState"]],["impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::registry::ImmutableState"]],["impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::roothash::ImmutableState"]],["impl<'a, T> RefUnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::staking::ImmutableState"]],["impl<PeerID> !RefUnwindSafe for MultiplexedSession<PeerID>",1,["oasis_core_runtime::enclave_rpc::sessions::MultiplexedSession"]],["impl<PeerID> !RefUnwindSafe for SessionMeta<PeerID>",1,["oasis_core_runtime::enclave_rpc::sessions::SessionMeta"]],["impl<PeerID> !RefUnwindSafe for Sessions<PeerID>",1,["oasis_core_runtime::enclave_rpc::sessions::Sessions"]],["impl<T> RefUnwindSafe for Versioned<T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::common::versioned::Versioned"]],["impl<T> RefUnwindSafe for OverlayTree<T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::storage::mkvs::tree::overlay::OverlayTree"]]], +"oasis_runtime_sdk":[["impl !RefUnwindSafe for RootRng",1,["oasis_runtime_sdk::crypto::random::RootRng"]],["impl !RefUnwindSafe for KeyManagerClientWithContext",1,["oasis_runtime_sdk::keymanager::KeyManagerClientWithContext"]],["impl !RefUnwindSafe for State",1,["oasis_runtime_sdk::state::State"]],["impl !RefUnwindSafe for HostStore",1,["oasis_runtime_sdk::storage::host::HostStore"]],["impl !RefUnwindSafe for Mock",1,["oasis_runtime_sdk::testing::mock::Mock"]],["impl RefUnwindSafe for Metadata",1,["oasis_runtime_sdk::callformat::Metadata"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::crypto::multisig::Error"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::crypto::signature::Error"]],["impl RefUnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::MemorySigner"]],["impl RefUnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::PublicKey"]],["impl RefUnwindSafe for SignatureType",1,["oasis_runtime_sdk::crypto::signature::SignatureType"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::dispatcher::Error"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::history::Error"]],["impl RefUnwindSafe for AuthDecision",1,["oasis_runtime_sdk::module::AuthDecision"]],["impl RefUnwindSafe for CallResult",1,["oasis_runtime_sdk::module::CallResult"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::modules::access::Error"]],["impl RefUnwindSafe for Authorization",1,["oasis_runtime_sdk::modules::access::types::Authorization"]],["impl RefUnwindSafe for MethodAuthorization",1,["oasis_runtime_sdk::modules::access::types::MethodAuthorization"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::modules::accounts::Error"]],["impl RefUnwindSafe for Event",1,["oasis_runtime_sdk::modules::accounts::Event"]],["impl RefUnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::accounts::ParameterValidationError"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::modules::consensus::Error"]],["impl RefUnwindSafe for Event",1,["oasis_runtime_sdk::modules::consensus::Event"]],["impl RefUnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::consensus::ParameterValidationError"]],["impl RefUnwindSafe for RootKind",1,["oasis_runtime_sdk::modules::consensus::types::RootKind"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::modules::consensus_accounts::Error"]],["impl RefUnwindSafe for Event",1,["oasis_runtime_sdk::modules::consensus_accounts::Event"]],["impl RefUnwindSafe for ReceiptKind",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ReceiptKind"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::modules::core::Error"]],["impl RefUnwindSafe for Event",1,["oasis_runtime_sdk::modules::core::Event"]],["impl RefUnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::core::ParameterValidationError"]],["impl RefUnwindSafe for MethodHandlerKind",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerKind"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::modules::rewards::Error"]],["impl RefUnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::rewards::ParameterValidationError"]],["impl RefUnwindSafe for RewardAction",1,["oasis_runtime_sdk::modules::rewards::types::RewardAction"]],["impl RefUnwindSafe for RewardScheduleError",1,["oasis_runtime_sdk::modules::rewards::types::RewardScheduleError"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::modules::rofl::app_id::Error"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::modules::rofl::error::Error"]],["impl RefUnwindSafe for Event",1,["oasis_runtime_sdk::modules::rofl::event::Event"]],["impl RefUnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::rofl::ParameterValidationError"]],["impl RefUnwindSafe for AllowedEndorsement",1,["oasis_runtime_sdk::modules::rofl::policy::AllowedEndorsement"]],["impl RefUnwindSafe for FeePolicy",1,["oasis_runtime_sdk::modules::rofl::policy::FeePolicy"]],["impl RefUnwindSafe for IdentifierScheme",1,["oasis_runtime_sdk::modules::rofl::types::IdentifierScheme"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::schedule_control::Error"]],["impl RefUnwindSafe for Mode",1,["oasis_runtime_sdk::state::Mode"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::storage::confidential::Error"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::types::address::Error"]],["impl RefUnwindSafe for SignatureAddressSpec",1,["oasis_runtime_sdk::types::address::SignatureAddressSpec"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::types::token::Error"]],["impl RefUnwindSafe for AddressSpec",1,["oasis_runtime_sdk::types::transaction::AddressSpec"]],["impl RefUnwindSafe for AuthProof",1,["oasis_runtime_sdk::types::transaction::AuthProof"]],["impl RefUnwindSafe for CallFormat",1,["oasis_runtime_sdk::types::transaction::CallFormat"]],["impl RefUnwindSafe for CallResult",1,["oasis_runtime_sdk::types::transaction::CallResult"]],["impl RefUnwindSafe for CallerAddress",1,["oasis_runtime_sdk::types::transaction::CallerAddress"]],["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk::types::transaction::Error"]],["impl RefUnwindSafe for ScheduleControl",1,["oasis_runtime_sdk::config::ScheduleControl"]],["impl RefUnwindSafe for Config",1,["oasis_runtime_sdk::crypto::multisig::Config"]],["impl RefUnwindSafe for Signer",1,["oasis_runtime_sdk::crypto::multisig::Signer"]],["impl RefUnwindSafe for LeafRng",1,["oasis_runtime_sdk::crypto::random::LeafRng"]],["impl RefUnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::ed25519::MemorySigner"]],["impl RefUnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::ed25519::PublicKey"]],["impl RefUnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256k1::MemorySigner"]],["impl RefUnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256k1::PublicKey"]],["impl RefUnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256r1::MemorySigner"]],["impl RefUnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256r1::PublicKey"]],["impl RefUnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp384r1::MemorySigner"]],["impl RefUnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp384r1::PublicKey"]],["impl RefUnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::sr25519::PublicKey"]],["impl RefUnwindSafe for Signature",1,["oasis_runtime_sdk::crypto::signature::Signature"]],["impl RefUnwindSafe for DispatchResult",1,["oasis_runtime_sdk::dispatcher::DispatchResult"]],["impl RefUnwindSafe for QueryRequest",1,["oasis_runtime_sdk::enclave_rpc::QueryRequest"]],["impl RefUnwindSafe for EventTag",1,["oasis_runtime_sdk::event::EventTag"]],["impl RefUnwindSafe for FeeManager",1,["oasis_runtime_sdk::modules::accounts::fee::FeeManager"]],["impl RefUnwindSafe for FeeUpdates",1,["oasis_runtime_sdk::modules::accounts::fee::FeeUpdates"]],["impl RefUnwindSafe for TransactionFee",1,["oasis_runtime_sdk::modules::accounts::fee::TransactionFee"]],["impl RefUnwindSafe for GasCosts",1,["oasis_runtime_sdk::modules::accounts::GasCosts"]],["impl RefUnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::accounts::Genesis"]],["impl RefUnwindSafe for Module",1,["oasis_runtime_sdk::modules::accounts::Module"]],["impl RefUnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::accounts::Parameters"]],["impl RefUnwindSafe for Account",1,["oasis_runtime_sdk::modules::accounts::types::Account"]],["impl RefUnwindSafe for AccountBalances",1,["oasis_runtime_sdk::modules::accounts::types::AccountBalances"]],["impl RefUnwindSafe for AddressesQuery",1,["oasis_runtime_sdk::modules::accounts::types::AddressesQuery"]],["impl RefUnwindSafe for BalancesQuery",1,["oasis_runtime_sdk::modules::accounts::types::BalancesQuery"]],["impl RefUnwindSafe for DenominationInfo",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfo"]],["impl RefUnwindSafe for DenominationInfoQuery",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfoQuery"]],["impl RefUnwindSafe for NonceQuery",1,["oasis_runtime_sdk::modules::accounts::types::NonceQuery"]],["impl RefUnwindSafe for Transfer",1,["oasis_runtime_sdk::modules::accounts::types::Transfer"]],["impl RefUnwindSafe for GasCosts",1,["oasis_runtime_sdk::modules::consensus::GasCosts"]],["impl RefUnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::consensus::Genesis"]],["impl RefUnwindSafe for Module",1,["oasis_runtime_sdk::modules::consensus::Module"]],["impl RefUnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::consensus::Parameters"]],["impl RefUnwindSafe for RoundRootBody",1,["oasis_runtime_sdk::modules::consensus::types::RoundRootBody"]],["impl RefUnwindSafe for Undelegation",1,["oasis_runtime_sdk::modules::consensus_accounts::state::Undelegation"]],["impl RefUnwindSafe for GasCosts",1,["oasis_runtime_sdk::modules::consensus_accounts::GasCosts"]],["impl RefUnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::consensus_accounts::Genesis"]],["impl RefUnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::consensus_accounts::Parameters"]],["impl RefUnwindSafe for AccountBalance",1,["oasis_runtime_sdk::modules::consensus_accounts::types::AccountBalance"]],["impl RefUnwindSafe for BalanceQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::BalanceQuery"]],["impl RefUnwindSafe for ConsensusAccountQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusAccountQuery"]],["impl RefUnwindSafe for ConsensusDelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusDelegateContext"]],["impl RefUnwindSafe for ConsensusError",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusError"]],["impl RefUnwindSafe for ConsensusTransferContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusTransferContext"]],["impl RefUnwindSafe for ConsensusUndelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusUndelegateContext"]],["impl RefUnwindSafe for ConsensusWithdrawContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusWithdrawContext"]],["impl RefUnwindSafe for Delegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Delegate"]],["impl RefUnwindSafe for DelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationInfo"]],["impl RefUnwindSafe for DelegationQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationQuery"]],["impl RefUnwindSafe for DelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationsQuery"]],["impl RefUnwindSafe for Deposit",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Deposit"]],["impl RefUnwindSafe for ExtendedDelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ExtendedDelegationInfo"]],["impl RefUnwindSafe for Receipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Receipt"]],["impl RefUnwindSafe for TakeReceipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::TakeReceipt"]],["impl RefUnwindSafe for Undelegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Undelegate"]],["impl RefUnwindSafe for UndelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationInfo"]],["impl RefUnwindSafe for UndelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationsQuery"]],["impl RefUnwindSafe for Withdraw",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Withdraw"]],["impl RefUnwindSafe for DynamicMinGasPrice",1,["oasis_runtime_sdk::modules::core::DynamicMinGasPrice"]],["impl RefUnwindSafe for GasCosts",1,["oasis_runtime_sdk::modules::core::GasCosts"]],["impl RefUnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::core::Genesis"]],["impl RefUnwindSafe for LocalConfig",1,["oasis_runtime_sdk::modules::core::LocalConfig"]],["impl RefUnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::core::Parameters"]],["impl RefUnwindSafe for TxSimulationFailure",1,["oasis_runtime_sdk::modules::core::TxSimulationFailure"]],["impl RefUnwindSafe for CallDataPublicKeyQueryResponse",1,["oasis_runtime_sdk::modules::core::types::CallDataPublicKeyQueryResponse"]],["impl RefUnwindSafe for EstimateGasQuery",1,["oasis_runtime_sdk::modules::core::types::EstimateGasQuery"]],["impl RefUnwindSafe for ExecuteReadOnlyTxQuery",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxQuery"]],["impl RefUnwindSafe for ExecuteReadOnlyTxResponse",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxResponse"]],["impl RefUnwindSafe for Metadata",1,["oasis_runtime_sdk::modules::core::types::Metadata"]],["impl RefUnwindSafe for MethodHandlerInfo",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerInfo"]],["impl RefUnwindSafe for ModuleInfo",1,["oasis_runtime_sdk::modules::core::types::ModuleInfo"]],["impl RefUnwindSafe for RuntimeInfoResponse",1,["oasis_runtime_sdk::modules::core::types::RuntimeInfoResponse"]],["impl RefUnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::rewards::Genesis"]],["impl RefUnwindSafe for Module",1,["oasis_runtime_sdk::modules::rewards::Module"]],["impl RefUnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::rewards::Parameters"]],["impl RefUnwindSafe for EpochRewards",1,["oasis_runtime_sdk::modules::rewards::types::EpochRewards"]],["impl RefUnwindSafe for RewardSchedule",1,["oasis_runtime_sdk::modules::rewards::types::RewardSchedule"]],["impl RefUnwindSafe for RewardStep",1,["oasis_runtime_sdk::modules::rewards::types::RewardStep"]],["impl RefUnwindSafe for AppId",1,["oasis_runtime_sdk::modules::rofl::app_id::AppId"]],["impl RefUnwindSafe for AppAuthPolicy",1,["oasis_runtime_sdk::modules::rofl::policy::AppAuthPolicy"]],["impl RefUnwindSafe for KeyEndorsementInfo",1,["oasis_runtime_sdk::modules::rofl::state::KeyEndorsementInfo"]],["impl RefUnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::rofl::Genesis"]],["impl RefUnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::rofl::Parameters"]],["impl RefUnwindSafe for AppConfig",1,["oasis_runtime_sdk::modules::rofl::types::AppConfig"]],["impl RefUnwindSafe for AppInstanceQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppInstanceQuery"]],["impl RefUnwindSafe for AppQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppQuery"]],["impl RefUnwindSafe for Create",1,["oasis_runtime_sdk::modules::rofl::types::Create"]],["impl RefUnwindSafe for Register",1,["oasis_runtime_sdk::modules::rofl::types::Register"]],["impl RefUnwindSafe for Registration",1,["oasis_runtime_sdk::modules::rofl::types::Registration"]],["impl RefUnwindSafe for Remove",1,["oasis_runtime_sdk::modules::rofl::types::Remove"]],["impl RefUnwindSafe for StakeThresholds",1,["oasis_runtime_sdk::modules::rofl::types::StakeThresholds"]],["impl RefUnwindSafe for Update",1,["oasis_runtime_sdk::modules::rofl::types::Update"]],["impl RefUnwindSafe for SenderMeta",1,["oasis_runtime_sdk::sender::SenderMeta"]],["impl RefUnwindSafe for CurrentState",1,["oasis_runtime_sdk::state::CurrentState"]],["impl RefUnwindSafe for Environment",1,["oasis_runtime_sdk::state::Environment"]],["impl RefUnwindSafe for Options",1,["oasis_runtime_sdk::state::Options"]],["impl RefUnwindSafe for TransactionWithMeta",1,["oasis_runtime_sdk::state::TransactionWithMeta"]],["impl RefUnwindSafe for AllowAllValidator",1,["oasis_runtime_sdk::subcall::AllowAllValidator"]],["impl RefUnwindSafe for SubcallInfo",1,["oasis_runtime_sdk::subcall::SubcallInfo"]],["impl RefUnwindSafe for SubcallResult",1,["oasis_runtime_sdk::subcall::SubcallResult"]],["impl RefUnwindSafe for MockKeyManagerClient",1,["oasis_runtime_sdk::testing::keymanager::MockKeyManagerClient"]],["impl RefUnwindSafe for CallOptions",1,["oasis_runtime_sdk::testing::mock::CallOptions"]],["impl RefUnwindSafe for Config",1,["oasis_runtime_sdk::testing::mock::Config"]],["impl RefUnwindSafe for EmptyRuntime",1,["oasis_runtime_sdk::testing::mock::EmptyRuntime"]],["impl RefUnwindSafe for Signer",1,["oasis_runtime_sdk::testing::mock::Signer"]],["impl RefUnwindSafe for Address",1,["oasis_runtime_sdk::types::address::Address"]],["impl RefUnwindSafe for CallEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::CallEnvelopeX25519DeoxysII"]],["impl RefUnwindSafe for ResultEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::ResultEnvelopeX25519DeoxysII"]],["impl RefUnwindSafe for MessageEventHookInvocation",1,["oasis_runtime_sdk::types::message::MessageEventHookInvocation"]],["impl RefUnwindSafe for MessageResult",1,["oasis_runtime_sdk::types::message::MessageResult"]],["impl RefUnwindSafe for BaseUnits",1,["oasis_runtime_sdk::types::token::BaseUnits"]],["impl RefUnwindSafe for Denomination",1,["oasis_runtime_sdk::types::token::Denomination"]],["impl RefUnwindSafe for AuthInfo",1,["oasis_runtime_sdk::types::transaction::AuthInfo"]],["impl RefUnwindSafe for Call",1,["oasis_runtime_sdk::types::transaction::Call"]],["impl RefUnwindSafe for Fee",1,["oasis_runtime_sdk::types::transaction::Fee"]],["impl RefUnwindSafe for FeeProxy",1,["oasis_runtime_sdk::types::transaction::FeeProxy"]],["impl RefUnwindSafe for SignerInfo",1,["oasis_runtime_sdk::types::transaction::SignerInfo"]],["impl RefUnwindSafe for Transaction",1,["oasis_runtime_sdk::types::transaction::Transaction"]],["impl RefUnwindSafe for TransactionSigner",1,["oasis_runtime_sdk::types::transaction::TransactionSigner"]],["impl RefUnwindSafe for UnverifiedTransaction",1,["oasis_runtime_sdk::types::transaction::UnverifiedTransaction"]],["impl<'a> !RefUnwindSafe for DispatchOptions<'a>",1,["oasis_runtime_sdk::dispatcher::DispatchOptions"]],["impl<'a, R> !RefUnwindSafe for RuntimeBatchContext<'a, R>",1,["oasis_runtime_sdk::context::RuntimeBatchContext"]],["impl<'a, V> !RefUnwindSafe for StateValue<'a, V>",1,["oasis_runtime_sdk::state::StateValue"]],["impl<A> !RefUnwindSafe for Client<A>",1,["oasis_runtime_sdk::modules::rofl::app::client::Client"]],["impl<A> !RefUnwindSafe for Environment<A>",1,["oasis_runtime_sdk::modules::rofl::app::env::Environment"]],["impl<B, R> RefUnwindSafe for DispatchResult<B, R>
where\n R: RefUnwindSafe,\n B: RefUnwindSafe,
",1,["oasis_runtime_sdk::module::DispatchResult"]],["impl<Cfg> RefUnwindSafe for Module<Cfg>
where\n Cfg: RefUnwindSafe,
",1,["oasis_runtime_sdk::modules::access::Module"]],["impl<Cfg> RefUnwindSafe for Module<Cfg>
where\n Cfg: RefUnwindSafe,
",1,["oasis_runtime_sdk::modules::core::Module"]],["impl<Cfg> RefUnwindSafe for Module<Cfg>
where\n Cfg: RefUnwindSafe,
",1,["oasis_runtime_sdk::modules::rofl::Module"]],["impl<Consensus> RefUnwindSafe for Module<Consensus>
where\n Consensus: RefUnwindSafe,
",1,["oasis_runtime_sdk::modules::consensus_accounts::Module"]],["impl<M> RefUnwindSafe for MKVSStore<M>
where\n M: RefUnwindSafe,
",1,["oasis_runtime_sdk::storage::mkvs::MKVSStore"]],["impl<R> !RefUnwindSafe for Dispatcher<R>",1,["oasis_runtime_sdk::dispatcher::Dispatcher"]],["impl<S> RefUnwindSafe for ConfidentialStore<S>
where\n S: RefUnwindSafe,
",1,["oasis_runtime_sdk::storage::confidential::ConfidentialStore"]],["impl<S> RefUnwindSafe for OverlayStore<S>
where\n S: RefUnwindSafe,
",1,["oasis_runtime_sdk::storage::overlay::OverlayStore"]],["impl<S> RefUnwindSafe for TypedStore<S>
where\n S: RefUnwindSafe,
",1,["oasis_runtime_sdk::storage::typed::TypedStore"]],["impl<S, D> RefUnwindSafe for HashedStore<S, D>
where\n S: RefUnwindSafe,\n D: RefUnwindSafe,
",1,["oasis_runtime_sdk::storage::hashed::HashedStore"]],["impl<S, P> RefUnwindSafe for PrefixStore<S, P>
where\n S: RefUnwindSafe,\n P: RefUnwindSafe,
",1,["oasis_runtime_sdk::storage::prefix::PrefixStore"]],["impl<T> RefUnwindSafe for TransactionResult<T>
where\n T: RefUnwindSafe,
",1,["oasis_runtime_sdk::state::TransactionResult"]]], +"oasis_runtime_sdk_contracts":[["impl RefUnwindSafe for Error",1,["oasis_runtime_sdk_contracts::Error"]],["impl RefUnwindSafe for Event",1,["oasis_runtime_sdk_contracts::Event"]],["impl RefUnwindSafe for ABI",1,["oasis_runtime_sdk_contracts::types::ABI"]],["impl RefUnwindSafe for Policy",1,["oasis_runtime_sdk_contracts::types::Policy"]],["impl RefUnwindSafe for PublicKeyKind",1,["oasis_runtime_sdk_contracts::types::PublicKeyKind"]],["impl RefUnwindSafe for StoreKind",1,["oasis_runtime_sdk_contracts::types::StoreKind"]],["impl RefUnwindSafe for GasCosts",1,["oasis_runtime_sdk_contracts::GasCosts"]],["impl RefUnwindSafe for Genesis",1,["oasis_runtime_sdk_contracts::Genesis"]],["impl RefUnwindSafe for LocalConfig",1,["oasis_runtime_sdk_contracts::LocalConfig"]],["impl RefUnwindSafe for Parameters",1,["oasis_runtime_sdk_contracts::Parameters"]],["impl RefUnwindSafe for Call",1,["oasis_runtime_sdk_contracts::types::Call"]],["impl RefUnwindSafe for CallResult",1,["oasis_runtime_sdk_contracts::types::CallResult"]],["impl RefUnwindSafe for ChangeUpgradePolicy",1,["oasis_runtime_sdk_contracts::types::ChangeUpgradePolicy"]],["impl RefUnwindSafe for Code",1,["oasis_runtime_sdk_contracts::types::Code"]],["impl RefUnwindSafe for CodeQuery",1,["oasis_runtime_sdk_contracts::types::CodeQuery"]],["impl RefUnwindSafe for CodeStorageQuery",1,["oasis_runtime_sdk_contracts::types::CodeStorageQuery"]],["impl RefUnwindSafe for CodeStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::CodeStorageQueryResult"]],["impl RefUnwindSafe for ContractEvent",1,["oasis_runtime_sdk_contracts::types::ContractEvent"]],["impl RefUnwindSafe for CustomQuery",1,["oasis_runtime_sdk_contracts::types::CustomQuery"]],["impl RefUnwindSafe for CustomQueryResult",1,["oasis_runtime_sdk_contracts::types::CustomQueryResult"]],["impl RefUnwindSafe for Instance",1,["oasis_runtime_sdk_contracts::types::Instance"]],["impl RefUnwindSafe for InstanceQuery",1,["oasis_runtime_sdk_contracts::types::InstanceQuery"]],["impl RefUnwindSafe for InstanceRawStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQuery"]],["impl RefUnwindSafe for InstanceRawStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQueryResult"]],["impl RefUnwindSafe for InstanceStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQuery"]],["impl RefUnwindSafe for InstanceStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQueryResult"]],["impl RefUnwindSafe for Instantiate",1,["oasis_runtime_sdk_contracts::types::Instantiate"]],["impl RefUnwindSafe for InstantiateResult",1,["oasis_runtime_sdk_contracts::types::InstantiateResult"]],["impl RefUnwindSafe for PublicKeyQuery",1,["oasis_runtime_sdk_contracts::types::PublicKeyQuery"]],["impl RefUnwindSafe for PublicKeyQueryResult",1,["oasis_runtime_sdk_contracts::types::PublicKeyQueryResult"]],["impl RefUnwindSafe for Upgrade",1,["oasis_runtime_sdk_contracts::types::Upgrade"]],["impl RefUnwindSafe for Upload",1,["oasis_runtime_sdk_contracts::types::Upload"]],["impl RefUnwindSafe for UploadResult",1,["oasis_runtime_sdk_contracts::types::UploadResult"]],["impl<Cfg> RefUnwindSafe for Module<Cfg>
where\n Cfg: RefUnwindSafe,
",1,["oasis_runtime_sdk_contracts::Module"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/rust/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 0000000000..8f6c5f8206 --- /dev/null +++ b/rust/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,8 @@ +(function() {var implementors = { +"oasis_contract_sdk":[["impl UnwindSafe for CryptoError",1,["oasis_contract_sdk::env::CryptoError"]],["impl UnwindSafe for HostRegion",1,["oasis_contract_sdk::memory::HostRegion"]],["impl UnwindSafe for MockContext",1,["oasis_contract_sdk::testing::MockContext"]],["impl UnwindSafe for MockEnv",1,["oasis_contract_sdk::testing::MockEnv"]],["impl UnwindSafe for MockStore",1,["oasis_contract_sdk::testing::MockStore"]],["impl<'a> UnwindSafe for HostRegionRef<'a>",1,["oasis_contract_sdk::memory::HostRegionRef"]]], +"oasis_contract_sdk_storage":[["impl<'key, K, V> UnwindSafe for ConfidentialMap<'key, K, V>
where\n K: UnwindSafe,\n V: UnwindSafe,
",1,["oasis_contract_sdk_storage::map::ConfidentialMap"]],["impl<'key, K, V> UnwindSafe for PublicMap<'key, K, V>
where\n K: UnwindSafe,\n V: UnwindSafe,
",1,["oasis_contract_sdk_storage::map::PublicMap"]],["impl<'key, T> UnwindSafe for ConfidentialCell<'key, T>
where\n T: UnwindSafe,
",1,["oasis_contract_sdk_storage::cell::ConfidentialCell"]],["impl<'key, T> UnwindSafe for PublicCell<'key, T>
where\n T: UnwindSafe,
",1,["oasis_contract_sdk_storage::cell::PublicCell"]],["impl<I> UnwindSafe for Int<I>
where\n <I as Integer>::Encoded: UnwindSafe,\n I: UnwindSafe,
",1,["oasis_contract_sdk_storage::map::Int"]]], +"oasis_contract_sdk_types":[["impl UnwindSafe for Error",1,["oasis_contract_sdk_types::address::Error"]],["impl UnwindSafe for SignatureKind",1,["oasis_contract_sdk_types::crypto::SignatureKind"]],["impl UnwindSafe for CallFormat",1,["oasis_contract_sdk_types::CallFormat"]],["impl UnwindSafe for ExecutionResult",1,["oasis_contract_sdk_types::ExecutionResult"]],["impl UnwindSafe for AccountsQuery",1,["oasis_contract_sdk_types::env::AccountsQuery"]],["impl UnwindSafe for AccountsResponse",1,["oasis_contract_sdk_types::env::AccountsResponse"]],["impl UnwindSafe for QueryRequest",1,["oasis_contract_sdk_types::env::QueryRequest"]],["impl UnwindSafe for QueryResponse",1,["oasis_contract_sdk_types::env::QueryResponse"]],["impl UnwindSafe for CallResult",1,["oasis_contract_sdk_types::message::CallResult"]],["impl UnwindSafe for Message",1,["oasis_contract_sdk_types::message::Message"]],["impl UnwindSafe for NotifyReply",1,["oasis_contract_sdk_types::message::NotifyReply"]],["impl UnwindSafe for Reply",1,["oasis_contract_sdk_types::message::Reply"]],["impl UnwindSafe for StoreKind",1,["oasis_contract_sdk_types::storage::StoreKind"]],["impl UnwindSafe for Error",1,["oasis_contract_sdk_types::token::Error"]],["impl UnwindSafe for Address",1,["oasis_contract_sdk_types::address::Address"]],["impl UnwindSafe for Event",1,["oasis_contract_sdk_types::event::Event"]],["impl UnwindSafe for InstantiateResult",1,["oasis_contract_sdk_types::modules::contracts::InstantiateResult"]],["impl UnwindSafe for CodeId",1,["oasis_contract_sdk_types::CodeId"]],["impl UnwindSafe for ExecutionContext",1,["oasis_contract_sdk_types::ExecutionContext"]],["impl UnwindSafe for ExecutionOk",1,["oasis_contract_sdk_types::ExecutionOk"]],["impl UnwindSafe for InstanceId",1,["oasis_contract_sdk_types::InstanceId"]],["impl UnwindSafe for BaseUnits",1,["oasis_contract_sdk_types::token::BaseUnits"]],["impl UnwindSafe for Denomination",1,["oasis_contract_sdk_types::token::Denomination"]]], +"oasis_core_runtime":[["impl !UnwindSafe for NodeBox",1,["oasis_core_runtime::storage::mkvs::tree::node::NodeBox"]],["impl !UnwindSafe for Cache",1,["oasis_core_runtime::cache::Cache"]],["impl !UnwindSafe for CacheSet",1,["oasis_core_runtime::cache::CacheSet"]],["impl !UnwindSafe for ConsensusState",1,["oasis_core_runtime::consensus::state::ConsensusState"]],["impl !UnwindSafe for NopVerifier",1,["oasis_core_runtime::consensus::tendermint::verifier::noop::NopVerifier"]],["impl !UnwindSafe for Verifier",1,["oasis_core_runtime::consensus::tendermint::verifier::Verifier"]],["impl !UnwindSafe for Dispatcher",1,["oasis_core_runtime::dispatcher::Dispatcher"]],["impl !UnwindSafe for PostInitState",1,["oasis_core_runtime::dispatcher::PostInitState"]],["impl !UnwindSafe for RpcClient",1,["oasis_core_runtime::enclave_rpc::client::RpcClient"]],["impl !UnwindSafe for Dispatcher",1,["oasis_core_runtime::enclave_rpc::dispatcher::Dispatcher"]],["impl !UnwindSafe for Method",1,["oasis_core_runtime::enclave_rpc::dispatcher::Method"]],["impl !UnwindSafe for Builder",1,["oasis_core_runtime::enclave_rpc::session::Builder"]],["impl !UnwindSafe for Session",1,["oasis_core_runtime::enclave_rpc::session::Session"]],["impl !UnwindSafe for PolicyVerifier",1,["oasis_core_runtime::policy::PolicyVerifier"]],["impl !UnwindSafe for Protocol",1,["oasis_core_runtime::protocol::Protocol"]],["impl !UnwindSafe for ProtocolUntrustedLocalStorage",1,["oasis_core_runtime::protocol::ProtocolUntrustedLocalStorage"]],["impl !UnwindSafe for NodePointer",1,["oasis_core_runtime::storage::mkvs::tree::node::NodePointer"]],["impl !UnwindSafe for Tree",1,["oasis_core_runtime::storage::mkvs::tree::Tree"]],["impl !UnwindSafe for HostReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::host::HostReadSyncer"]],["impl !UnwindSafe for StatsCollector",1,["oasis_core_runtime::storage::mkvs::sync::stats::StatsCollector"]],["impl !UnwindSafe for Tree",1,["oasis_core_runtime::transaction::tree::Tree"]],["impl UnwindSafe for Quote",1,["oasis_core_runtime::common::sgx::Quote"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::common::sgx::pcs::Error"]],["impl UnwindSafe for Event",1,["oasis_core_runtime::consensus::Event"]],["impl UnwindSafe for Vote",1,["oasis_core_runtime::consensus::governance::Vote"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::consensus::keymanager::churp::Error"]],["impl UnwindSafe for SuiteId",1,["oasis_core_runtime::consensus::keymanager::churp::SuiteId"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::consensus::keymanager::Error"]],["impl UnwindSafe for RuntimeGovernanceModel",1,["oasis_core_runtime::consensus::registry::RuntimeGovernanceModel"]],["impl UnwindSafe for RuntimeKind",1,["oasis_core_runtime::consensus::registry::RuntimeKind"]],["impl UnwindSafe for SGXAttestation",1,["oasis_core_runtime::consensus::registry::SGXAttestation"]],["impl UnwindSafe for SGXConstraints",1,["oasis_core_runtime::consensus::registry::SGXConstraints"]],["impl UnwindSafe for TEEHardware",1,["oasis_core_runtime::consensus::registry::TEEHardware"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::consensus::roothash::Error"]],["impl UnwindSafe for ExecutorCommitmentFailure",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentFailure"]],["impl UnwindSafe for GovernanceMessage",1,["oasis_core_runtime::consensus::roothash::message::GovernanceMessage"]],["impl UnwindSafe for HeaderType",1,["oasis_core_runtime::consensus::roothash::block::HeaderType"]],["impl UnwindSafe for Message",1,["oasis_core_runtime::consensus::roothash::message::Message"]],["impl UnwindSafe for RegistryMessage",1,["oasis_core_runtime::consensus::roothash::message::RegistryMessage"]],["impl UnwindSafe for StakingMessage",1,["oasis_core_runtime::consensus::roothash::message::StakingMessage"]],["impl UnwindSafe for CommitteeKind",1,["oasis_core_runtime::consensus::scheduler::CommitteeKind"]],["impl UnwindSafe for Role",1,["oasis_core_runtime::consensus::scheduler::Role"]],["impl UnwindSafe for EscrowEvent",1,["oasis_core_runtime::consensus::staking::EscrowEvent"]],["impl UnwindSafe for SlashReason",1,["oasis_core_runtime::consensus::staking::SlashReason"]],["impl UnwindSafe for ThresholdKind",1,["oasis_core_runtime::consensus::staking::ThresholdKind"]],["impl UnwindSafe for StateError",1,["oasis_core_runtime::consensus::state::StateError"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::consensus::verifier::Error"]],["impl UnwindSafe for RpcClientError",1,["oasis_core_runtime::enclave_rpc::client::RpcClientError"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::enclave_rpc::demux::Error"]],["impl UnwindSafe for RAKBinding",1,["oasis_core_runtime::enclave_rpc::session::RAKBinding"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::enclave_rpc::sessions::Error"]],["impl UnwindSafe for Body",1,["oasis_core_runtime::enclave_rpc::types::Body"]],["impl UnwindSafe for Kind",1,["oasis_core_runtime::enclave_rpc::types::Kind"]],["impl UnwindSafe for Message",1,["oasis_core_runtime::enclave_rpc::types::Message"]],["impl UnwindSafe for PeerFeedback",1,["oasis_core_runtime::enclave_rpc::types::PeerFeedback"]],["impl UnwindSafe for TeeType",1,["oasis_core_runtime::TeeType"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::host::Error"]],["impl UnwindSafe for PolicyVerifierError",1,["oasis_core_runtime::policy::PolicyVerifierError"]],["impl UnwindSafe for ProtocolError",1,["oasis_core_runtime::protocol::ProtocolError"]],["impl UnwindSafe for Stream",1,["oasis_core_runtime::protocol::Stream"]],["impl UnwindSafe for LogEntryKind",1,["oasis_core_runtime::storage::mkvs::LogEntryKind"]],["impl UnwindSafe for RootType",1,["oasis_core_runtime::storage::mkvs::tree::node::RootType"]],["impl UnwindSafe for SyncerError",1,["oasis_core_runtime::storage::mkvs::sync::errors::SyncerError"]],["impl UnwindSafe for Body",1,["oasis_core_runtime::types::Body"]],["impl UnwindSafe for EventKind",1,["oasis_core_runtime::types::EventKind"]],["impl UnwindSafe for ExecutionMode",1,["oasis_core_runtime::types::ExecutionMode"]],["impl UnwindSafe for HostStorageEndpoint",1,["oasis_core_runtime::types::HostStorageEndpoint"]],["impl UnwindSafe for MessageType",1,["oasis_core_runtime::types::MessageType"]],["impl UnwindSafe for StorageSyncRequest",1,["oasis_core_runtime::types::StorageSyncRequest"]],["impl UnwindSafe for StorageSyncResponse",1,["oasis_core_runtime::types::StorageSyncResponse"]],["impl UnwindSafe for NoopApp",1,["oasis_core_runtime::app::NoopApp"]],["impl UnwindSafe for Hash",1,["oasis_core_runtime::common::crypto::hash::Hash"]],["impl UnwindSafe for Nonce",1,["oasis_core_runtime::common::crypto::mrae::nonce::Nonce"]],["impl UnwindSafe for MultiSigned",1,["oasis_core_runtime::common::crypto::signature::MultiSigned"]],["impl UnwindSafe for PrivateKey",1,["oasis_core_runtime::common::crypto::signature::PrivateKey"]],["impl UnwindSafe for PublicKey",1,["oasis_core_runtime::common::crypto::signature::PublicKey"]],["impl UnwindSafe for Signature",1,["oasis_core_runtime::common::crypto::signature::Signature"]],["impl UnwindSafe for SignatureBundle",1,["oasis_core_runtime::common::crypto::signature::SignatureBundle"]],["impl UnwindSafe for Signed",1,["oasis_core_runtime::common::crypto::signature::Signed"]],["impl UnwindSafe for PrivateKey",1,["oasis_core_runtime::common::crypto::x25519::PrivateKey"]],["impl UnwindSafe for PublicKey",1,["oasis_core_runtime::common::crypto::x25519::PublicKey"]],["impl UnwindSafe for Namespace",1,["oasis_core_runtime::common::namespace::Namespace"]],["impl UnwindSafe for AbortOnPanic",1,["oasis_core_runtime::common::panic::AbortOnPanic"]],["impl UnwindSafe for Quantity",1,["oasis_core_runtime::common::quantity::Quantity"]],["impl UnwindSafe for AVR",1,["oasis_core_runtime::common::sgx::ias::AVR"]],["impl UnwindSafe for QuotePolicy",1,["oasis_core_runtime::common::sgx::ias::QuotePolicy"]],["impl UnwindSafe for QuoteBundle",1,["oasis_core_runtime::common::sgx::pcs::quote::QuoteBundle"]],["impl UnwindSafe for QuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::QuotePolicy"]],["impl UnwindSafe for TCBBundle",1,["oasis_core_runtime::common::sgx::pcs::tcb::TCBBundle"]],["impl UnwindSafe for TdAttributes",1,["oasis_core_runtime::common::sgx::pcs::report::TdAttributes"]],["impl UnwindSafe for TdReport",1,["oasis_core_runtime::common::sgx::pcs::report::TdReport"]],["impl UnwindSafe for TdxModulePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxModulePolicy"]],["impl UnwindSafe for TdxQuotePolicy",1,["oasis_core_runtime::common::sgx::pcs::policy::TdxQuotePolicy"]],["impl UnwindSafe for EnclaveIdentity",1,["oasis_core_runtime::common::sgx::EnclaveIdentity"]],["impl UnwindSafe for MrEnclave",1,["oasis_core_runtime::common::sgx::MrEnclave"]],["impl UnwindSafe for MrSigner",1,["oasis_core_runtime::common::sgx::MrSigner"]],["impl UnwindSafe for QuotePolicy",1,["oasis_core_runtime::common::sgx::QuotePolicy"]],["impl UnwindSafe for VerifiedQuote",1,["oasis_core_runtime::common::sgx::VerifiedQuote"]],["impl UnwindSafe for ProtocolVersions",1,["oasis_core_runtime::common::version::ProtocolVersions"]],["impl UnwindSafe for Version",1,["oasis_core_runtime::common::version::Version"]],["impl UnwindSafe for Config",1,["oasis_core_runtime::config::Config"]],["impl UnwindSafe for Storage",1,["oasis_core_runtime::config::Storage"]],["impl UnwindSafe for Address",1,["oasis_core_runtime::consensus::address::Address"]],["impl UnwindSafe for COMMON_POOL_ADDRESS",1,["oasis_core_runtime::consensus::address::COMMON_POOL_ADDRESS"]],["impl UnwindSafe for FEE_ACC_ADDRESS",1,["oasis_core_runtime::consensus::address::FEE_ACC_ADDRESS"]],["impl UnwindSafe for GOVERNANCE_DEPOSITS_ADDRESS",1,["oasis_core_runtime::consensus::address::GOVERNANCE_DEPOSITS_ADDRESS"]],["impl UnwindSafe for EpochTimeState",1,["oasis_core_runtime::consensus::beacon::EpochTimeState"]],["impl UnwindSafe for CancelUpgradeProposal",1,["oasis_core_runtime::consensus::governance::CancelUpgradeProposal"]],["impl UnwindSafe for ChangeParametersProposal",1,["oasis_core_runtime::consensus::governance::ChangeParametersProposal"]],["impl UnwindSafe for ConsensusParameterChanges",1,["oasis_core_runtime::consensus::governance::ConsensusParameterChanges"]],["impl UnwindSafe for ProposalContent",1,["oasis_core_runtime::consensus::governance::ProposalContent"]],["impl UnwindSafe for ProposalVote",1,["oasis_core_runtime::consensus::governance::ProposalVote"]],["impl UnwindSafe for UpgradeProposal",1,["oasis_core_runtime::consensus::governance::UpgradeProposal"]],["impl UnwindSafe for Application",1,["oasis_core_runtime::consensus::keymanager::churp::Application"]],["impl UnwindSafe for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::PolicySGX"]],["impl UnwindSafe for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::churp::SignedPolicySGX"]],["impl UnwindSafe for Status",1,["oasis_core_runtime::consensus::keymanager::churp::Status"]],["impl UnwindSafe for EnclavePolicySGX",1,["oasis_core_runtime::consensus::keymanager::EnclavePolicySGX"]],["impl UnwindSafe for EncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedEphemeralSecret"]],["impl UnwindSafe for EncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedMasterSecret"]],["impl UnwindSafe for EncryptedSecret",1,["oasis_core_runtime::consensus::keymanager::EncryptedSecret"]],["impl UnwindSafe for PolicySGX",1,["oasis_core_runtime::consensus::keymanager::PolicySGX"]],["impl UnwindSafe for SignedEncryptedEphemeralSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedEphemeralSecret"]],["impl UnwindSafe for SignedEncryptedMasterSecret",1,["oasis_core_runtime::consensus::keymanager::SignedEncryptedMasterSecret"]],["impl UnwindSafe for SignedPolicySGX",1,["oasis_core_runtime::consensus::keymanager::SignedPolicySGX"]],["impl UnwindSafe for AnyNodeRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::AnyNodeRuntimeAdmissionPolicy"]],["impl UnwindSafe for Capabilities",1,["oasis_core_runtime::consensus::registry::Capabilities"]],["impl UnwindSafe for CapabilityTEE",1,["oasis_core_runtime::consensus::registry::CapabilityTEE"]],["impl UnwindSafe for ConsensusAddress",1,["oasis_core_runtime::consensus::registry::ConsensusAddress"]],["impl UnwindSafe for ConsensusInfo",1,["oasis_core_runtime::consensus::registry::ConsensusInfo"]],["impl UnwindSafe for EndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::EndorsedCapabilityTEE"]],["impl UnwindSafe for EntityWhitelistConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistConfig"]],["impl UnwindSafe for EntityWhitelistRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleAdmissionPolicy"]],["impl UnwindSafe for EntityWhitelistRoleConfig",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRoleConfig"]],["impl UnwindSafe for EntityWhitelistRuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::EntityWhitelistRuntimeAdmissionPolicy"]],["impl UnwindSafe for ExecutorParameters",1,["oasis_core_runtime::consensus::registry::ExecutorParameters"]],["impl UnwindSafe for MaxNodesConstraint",1,["oasis_core_runtime::consensus::registry::MaxNodesConstraint"]],["impl UnwindSafe for MinPoolSizeConstraint",1,["oasis_core_runtime::consensus::registry::MinPoolSizeConstraint"]],["impl UnwindSafe for Node",1,["oasis_core_runtime::consensus::registry::Node"]],["impl UnwindSafe for NodeRuntime",1,["oasis_core_runtime::consensus::registry::NodeRuntime"]],["impl UnwindSafe for P2PInfo",1,["oasis_core_runtime::consensus::registry::P2PInfo"]],["impl UnwindSafe for PerRoleAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::PerRoleAdmissionPolicy"]],["impl UnwindSafe for RolesMask",1,["oasis_core_runtime::consensus::registry::RolesMask"]],["impl UnwindSafe for Runtime",1,["oasis_core_runtime::consensus::registry::Runtime"]],["impl UnwindSafe for RuntimeAdmissionPolicy",1,["oasis_core_runtime::consensus::registry::RuntimeAdmissionPolicy"]],["impl UnwindSafe for RuntimeGenesis",1,["oasis_core_runtime::consensus::registry::RuntimeGenesis"]],["impl UnwindSafe for RuntimeStakingParameters",1,["oasis_core_runtime::consensus::registry::RuntimeStakingParameters"]],["impl UnwindSafe for SchedulingConstraints",1,["oasis_core_runtime::consensus::registry::SchedulingConstraints"]],["impl UnwindSafe for StorageParameters",1,["oasis_core_runtime::consensus::registry::StorageParameters"]],["impl UnwindSafe for TCPAddress",1,["oasis_core_runtime::consensus::registry::TCPAddress"]],["impl UnwindSafe for TLSAddress",1,["oasis_core_runtime::consensus::registry::TLSAddress"]],["impl UnwindSafe for TLSInfo",1,["oasis_core_runtime::consensus::registry::TLSInfo"]],["impl UnwindSafe for TxnSchedulerParameters",1,["oasis_core_runtime::consensus::registry::TxnSchedulerParameters"]],["impl UnwindSafe for VRFInfo",1,["oasis_core_runtime::consensus::registry::VRFInfo"]],["impl UnwindSafe for ValidatorSetConstraint",1,["oasis_core_runtime::consensus::registry::ValidatorSetConstraint"]],["impl UnwindSafe for VerifiedAttestation",1,["oasis_core_runtime::consensus::registry::VerifiedAttestation"]],["impl UnwindSafe for VerifiedEndorsedCapabilityTEE",1,["oasis_core_runtime::consensus::registry::VerifiedEndorsedCapabilityTEE"]],["impl UnwindSafe for VersionInfo",1,["oasis_core_runtime::consensus::registry::VersionInfo"]],["impl UnwindSafe for AnnotatedBlock",1,["oasis_core_runtime::consensus::roothash::AnnotatedBlock"]],["impl UnwindSafe for Block",1,["oasis_core_runtime::consensus::roothash::block::Block"]],["impl UnwindSafe for ComputeResultsHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ComputeResultsHeader"]],["impl UnwindSafe for ExecutorCommitment",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitment"]],["impl UnwindSafe for ExecutorCommitmentHeader",1,["oasis_core_runtime::consensus::roothash::commitment::executor::ExecutorCommitmentHeader"]],["impl UnwindSafe for Header",1,["oasis_core_runtime::consensus::roothash::block::Header"]],["impl UnwindSafe for IncomingMessage",1,["oasis_core_runtime::consensus::roothash::message::IncomingMessage"]],["impl UnwindSafe for MessageEvent",1,["oasis_core_runtime::consensus::roothash::MessageEvent"]],["impl UnwindSafe for Pool",1,["oasis_core_runtime::consensus::roothash::commitment::pool::Pool"]],["impl UnwindSafe for RoundResults",1,["oasis_core_runtime::consensus::roothash::RoundResults"]],["impl UnwindSafe for RoundRoots",1,["oasis_core_runtime::consensus::roothash::RoundRoots"]],["impl UnwindSafe for Committee",1,["oasis_core_runtime::consensus::scheduler::Committee"]],["impl UnwindSafe for CommitteeNode",1,["oasis_core_runtime::consensus::scheduler::CommitteeNode"]],["impl UnwindSafe for Account",1,["oasis_core_runtime::consensus::staking::Account"]],["impl UnwindSafe for AddEscrowResult",1,["oasis_core_runtime::consensus::staking::AddEscrowResult"]],["impl UnwindSafe for AllowanceChangeEvent",1,["oasis_core_runtime::consensus::staking::AllowanceChangeEvent"]],["impl UnwindSafe for BurnEvent",1,["oasis_core_runtime::consensus::staking::BurnEvent"]],["impl UnwindSafe for CommissionRateBoundStep",1,["oasis_core_runtime::consensus::staking::CommissionRateBoundStep"]],["impl UnwindSafe for CommissionRateStep",1,["oasis_core_runtime::consensus::staking::CommissionRateStep"]],["impl UnwindSafe for CommissionSchedule",1,["oasis_core_runtime::consensus::staking::CommissionSchedule"]],["impl UnwindSafe for DebondingDelegation",1,["oasis_core_runtime::consensus::staking::DebondingDelegation"]],["impl UnwindSafe for Delegation",1,["oasis_core_runtime::consensus::staking::Delegation"]],["impl UnwindSafe for Escrow",1,["oasis_core_runtime::consensus::staking::Escrow"]],["impl UnwindSafe for EscrowAccount",1,["oasis_core_runtime::consensus::staking::EscrowAccount"]],["impl UnwindSafe for Event",1,["oasis_core_runtime::consensus::staking::Event"]],["impl UnwindSafe for GeneralAccount",1,["oasis_core_runtime::consensus::staking::GeneralAccount"]],["impl UnwindSafe for ReclaimEscrow",1,["oasis_core_runtime::consensus::staking::ReclaimEscrow"]],["impl UnwindSafe for ReclaimEscrowResult",1,["oasis_core_runtime::consensus::staking::ReclaimEscrowResult"]],["impl UnwindSafe for SharePool",1,["oasis_core_runtime::consensus::staking::SharePool"]],["impl UnwindSafe for Slash",1,["oasis_core_runtime::consensus::staking::Slash"]],["impl UnwindSafe for StakeAccumulator",1,["oasis_core_runtime::consensus::staking::StakeAccumulator"]],["impl UnwindSafe for StakeThreshold",1,["oasis_core_runtime::consensus::staking::StakeThreshold"]],["impl UnwindSafe for Transfer",1,["oasis_core_runtime::consensus::staking::Transfer"]],["impl UnwindSafe for TransferEvent",1,["oasis_core_runtime::consensus::staking::TransferEvent"]],["impl UnwindSafe for TransferResult",1,["oasis_core_runtime::consensus::staking::TransferResult"]],["impl UnwindSafe for Withdraw",1,["oasis_core_runtime::consensus::staking::Withdraw"]],["impl UnwindSafe for WithdrawResult",1,["oasis_core_runtime::consensus::staking::WithdrawResult"]],["impl UnwindSafe for MutableState",1,["oasis_core_runtime::consensus::state::beacon::MutableState"]],["impl UnwindSafe for Status",1,["oasis_core_runtime::consensus::state::keymanager::Status"]],["impl UnwindSafe for BlockMetadata",1,["oasis_core_runtime::consensus::BlockMetadata"]],["impl UnwindSafe for LightBlock",1,["oasis_core_runtime::consensus::LightBlock"]],["impl UnwindSafe for Proof",1,["oasis_core_runtime::consensus::tendermint::merkle::Proof"]],["impl UnwindSafe for LightBlockMeta",1,["oasis_core_runtime::consensus::tendermint::LightBlockMeta"]],["impl UnwindSafe for Fee",1,["oasis_core_runtime::consensus::transaction::Fee"]],["impl UnwindSafe for Proof",1,["oasis_core_runtime::consensus::transaction::Proof"]],["impl UnwindSafe for SignedTransactionWithProof",1,["oasis_core_runtime::consensus::transaction::SignedTransactionWithProof"]],["impl UnwindSafe for Transaction",1,["oasis_core_runtime::consensus::transaction::Transaction"]],["impl UnwindSafe for TrustRoot",1,["oasis_core_runtime::consensus::verifier::TrustRoot"]],["impl UnwindSafe for Context",1,["oasis_core_runtime::enclave_rpc::context::Context"]],["impl UnwindSafe for Demux",1,["oasis_core_runtime::enclave_rpc::demux::Demux"]],["impl UnwindSafe for MethodDescriptor",1,["oasis_core_runtime::enclave_rpc::dispatcher::MethodDescriptor"]],["impl UnwindSafe for SessionInfo",1,["oasis_core_runtime::enclave_rpc::session::SessionInfo"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::enclave_rpc::types::Error"]],["impl UnwindSafe for Frame",1,["oasis_core_runtime::enclave_rpc::types::Frame"]],["impl UnwindSafe for Request",1,["oasis_core_runtime::enclave_rpc::types::Request"]],["impl UnwindSafe for Response",1,["oasis_core_runtime::enclave_rpc::types::Response"]],["impl UnwindSafe for SessionID",1,["oasis_core_runtime::enclave_rpc::types::SessionID"]],["impl UnwindSafe for RegisterNotifyOpts",1,["oasis_core_runtime::host::RegisterNotifyOpts"]],["impl UnwindSafe for SubmitTxOpts",1,["oasis_core_runtime::host::SubmitTxOpts"]],["impl UnwindSafe for TxResult",1,["oasis_core_runtime::host::TxResult"]],["impl UnwindSafe for Identity",1,["oasis_core_runtime::identity::Identity"]],["impl UnwindSafe for HostInfo",1,["oasis_core_runtime::protocol::HostInfo"]],["impl UnwindSafe for LogEntry",1,["oasis_core_runtime::storage::mkvs::LogEntry"]],["impl UnwindSafe for Prefix",1,["oasis_core_runtime::storage::mkvs::Prefix"]],["impl UnwindSafe for Root",1,["oasis_core_runtime::storage::mkvs::tree::node::Root"]],["impl UnwindSafe for GetPrefixesRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetPrefixesRequest"]],["impl UnwindSafe for GetRequest",1,["oasis_core_runtime::storage::mkvs::sync::GetRequest"]],["impl UnwindSafe for IterateRequest",1,["oasis_core_runtime::storage::mkvs::sync::IterateRequest"]],["impl UnwindSafe for NoopReadSyncer",1,["oasis_core_runtime::storage::mkvs::sync::noop::NoopReadSyncer"]],["impl UnwindSafe for Proof",1,["oasis_core_runtime::storage::mkvs::sync::proof::Proof"]],["impl UnwindSafe for ProofBuilder",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofBuilder"]],["impl UnwindSafe for ProofResponse",1,["oasis_core_runtime::storage::mkvs::sync::ProofResponse"]],["impl UnwindSafe for ProofVerifier",1,["oasis_core_runtime::storage::mkvs::sync::proof::ProofVerifier"]],["impl UnwindSafe for RawProofEntry",1,["oasis_core_runtime::storage::mkvs::sync::proof::RawProofEntry"]],["impl UnwindSafe for TreeID",1,["oasis_core_runtime::storage::mkvs::sync::TreeID"]],["impl UnwindSafe for UntrustedInMemoryStorage",1,["oasis_core_runtime::storage::UntrustedInMemoryStorage"]],["impl UnwindSafe for BUILD_INFO",1,["oasis_core_runtime::BUILD_INFO"]],["impl UnwindSafe for BuildInfo",1,["oasis_core_runtime::BuildInfo"]],["impl UnwindSafe for ExecuteBatchResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteBatchResult"]],["impl UnwindSafe for ExecuteTxResult",1,["oasis_core_runtime::transaction::dispatcher::ExecuteTxResult"]],["impl UnwindSafe for NoopDispatcher",1,["oasis_core_runtime::transaction::dispatcher::NoopDispatcher"]],["impl UnwindSafe for CoarsenedKey",1,["oasis_core_runtime::transaction::rwset::CoarsenedKey"]],["impl UnwindSafe for ReadWriteSet",1,["oasis_core_runtime::transaction::rwset::ReadWriteSet"]],["impl UnwindSafe for Tag",1,["oasis_core_runtime::transaction::tags::Tag"]],["impl UnwindSafe for TxnBatch",1,["oasis_core_runtime::transaction::types::TxnBatch"]],["impl UnwindSafe for CheckTxMetadata",1,["oasis_core_runtime::types::CheckTxMetadata"]],["impl UnwindSafe for CheckTxResult",1,["oasis_core_runtime::types::CheckTxResult"]],["impl UnwindSafe for ComputedBatch",1,["oasis_core_runtime::types::ComputedBatch"]],["impl UnwindSafe for Error",1,["oasis_core_runtime::types::Error"]],["impl UnwindSafe for FeatureScheduleControl",1,["oasis_core_runtime::types::FeatureScheduleControl"]],["impl UnwindSafe for Features",1,["oasis_core_runtime::types::Features"]],["impl UnwindSafe for HostFetchConsensusEventsRequest",1,["oasis_core_runtime::types::HostFetchConsensusEventsRequest"]],["impl UnwindSafe for HostFetchConsensusEventsResponse",1,["oasis_core_runtime::types::HostFetchConsensusEventsResponse"]],["impl UnwindSafe for Message",1,["oasis_core_runtime::types::Message"]],["impl UnwindSafe for RegisterNotifyRuntimeEvent",1,["oasis_core_runtime::types::RegisterNotifyRuntimeEvent"]],["impl UnwindSafe for RuntimeInfoRequest",1,["oasis_core_runtime::types::RuntimeInfoRequest"]],["impl UnwindSafe for RuntimeInfoResponse",1,["oasis_core_runtime::types::RuntimeInfoResponse"]],["impl UnwindSafe for RuntimeNotifyEvent",1,["oasis_core_runtime::types::RuntimeNotifyEvent"]],["impl UnwindSafe for StorageSyncRequestWithEndpoint",1,["oasis_core_runtime::types::StorageSyncRequestWithEndpoint"]],["impl<'a> !UnwindSafe for PreInitState<'a>",1,["oasis_core_runtime::dispatcher::PreInitState"]],["impl<'a> !UnwindSafe for Context<'a>",1,["oasis_core_runtime::transaction::context::Context"]],["impl<'a> UnwindSafe for Quote<'a>",1,["oasis_core_runtime::common::sgx::pcs::quote::Quote"]],["impl<'a, T> !UnwindSafe for Response<'a, T>",1,["oasis_core_runtime::enclave_rpc::client::Response"]],["impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::beacon::ImmutableState"]],["impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::keymanager::churp::ImmutableState"]],["impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::keymanager::ImmutableState"]],["impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::registry::ImmutableState"]],["impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::roothash::ImmutableState"]],["impl<'a, T> UnwindSafe for ImmutableState<'a, T>
where\n T: RefUnwindSafe,
",1,["oasis_core_runtime::consensus::state::staking::ImmutableState"]],["impl<PeerID> !UnwindSafe for MultiplexedSession<PeerID>",1,["oasis_core_runtime::enclave_rpc::sessions::MultiplexedSession"]],["impl<PeerID> !UnwindSafe for SessionMeta<PeerID>",1,["oasis_core_runtime::enclave_rpc::sessions::SessionMeta"]],["impl<PeerID> !UnwindSafe for Sessions<PeerID>",1,["oasis_core_runtime::enclave_rpc::sessions::Sessions"]],["impl<T> UnwindSafe for Versioned<T>
where\n T: UnwindSafe,
",1,["oasis_core_runtime::common::versioned::Versioned"]],["impl<T> UnwindSafe for OverlayTree<T>
where\n T: UnwindSafe,
",1,["oasis_core_runtime::storage::mkvs::tree::overlay::OverlayTree"]]], +"oasis_runtime_sdk":[["impl !UnwindSafe for KeyManagerClientWithContext",1,["oasis_runtime_sdk::keymanager::KeyManagerClientWithContext"]],["impl !UnwindSafe for State",1,["oasis_runtime_sdk::state::State"]],["impl !UnwindSafe for HostStore",1,["oasis_runtime_sdk::storage::host::HostStore"]],["impl !UnwindSafe for Mock",1,["oasis_runtime_sdk::testing::mock::Mock"]],["impl UnwindSafe for Metadata",1,["oasis_runtime_sdk::callformat::Metadata"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::crypto::multisig::Error"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::crypto::signature::Error"]],["impl UnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::MemorySigner"]],["impl UnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::PublicKey"]],["impl UnwindSafe for SignatureType",1,["oasis_runtime_sdk::crypto::signature::SignatureType"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::dispatcher::Error"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::history::Error"]],["impl UnwindSafe for AuthDecision",1,["oasis_runtime_sdk::module::AuthDecision"]],["impl UnwindSafe for CallResult",1,["oasis_runtime_sdk::module::CallResult"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::modules::access::Error"]],["impl UnwindSafe for Authorization",1,["oasis_runtime_sdk::modules::access::types::Authorization"]],["impl UnwindSafe for MethodAuthorization",1,["oasis_runtime_sdk::modules::access::types::MethodAuthorization"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::modules::accounts::Error"]],["impl UnwindSafe for Event",1,["oasis_runtime_sdk::modules::accounts::Event"]],["impl UnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::accounts::ParameterValidationError"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::modules::consensus::Error"]],["impl UnwindSafe for Event",1,["oasis_runtime_sdk::modules::consensus::Event"]],["impl UnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::consensus::ParameterValidationError"]],["impl UnwindSafe for RootKind",1,["oasis_runtime_sdk::modules::consensus::types::RootKind"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::modules::consensus_accounts::Error"]],["impl UnwindSafe for Event",1,["oasis_runtime_sdk::modules::consensus_accounts::Event"]],["impl UnwindSafe for ReceiptKind",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ReceiptKind"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::modules::core::Error"]],["impl UnwindSafe for Event",1,["oasis_runtime_sdk::modules::core::Event"]],["impl UnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::core::ParameterValidationError"]],["impl UnwindSafe for MethodHandlerKind",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerKind"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::modules::rewards::Error"]],["impl UnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::rewards::ParameterValidationError"]],["impl UnwindSafe for RewardAction",1,["oasis_runtime_sdk::modules::rewards::types::RewardAction"]],["impl UnwindSafe for RewardScheduleError",1,["oasis_runtime_sdk::modules::rewards::types::RewardScheduleError"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::modules::rofl::app_id::Error"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::modules::rofl::error::Error"]],["impl UnwindSafe for Event",1,["oasis_runtime_sdk::modules::rofl::event::Event"]],["impl UnwindSafe for ParameterValidationError",1,["oasis_runtime_sdk::modules::rofl::ParameterValidationError"]],["impl UnwindSafe for AllowedEndorsement",1,["oasis_runtime_sdk::modules::rofl::policy::AllowedEndorsement"]],["impl UnwindSafe for FeePolicy",1,["oasis_runtime_sdk::modules::rofl::policy::FeePolicy"]],["impl UnwindSafe for IdentifierScheme",1,["oasis_runtime_sdk::modules::rofl::types::IdentifierScheme"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::schedule_control::Error"]],["impl UnwindSafe for Mode",1,["oasis_runtime_sdk::state::Mode"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::storage::confidential::Error"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::types::address::Error"]],["impl UnwindSafe for SignatureAddressSpec",1,["oasis_runtime_sdk::types::address::SignatureAddressSpec"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::types::token::Error"]],["impl UnwindSafe for AddressSpec",1,["oasis_runtime_sdk::types::transaction::AddressSpec"]],["impl UnwindSafe for AuthProof",1,["oasis_runtime_sdk::types::transaction::AuthProof"]],["impl UnwindSafe for CallFormat",1,["oasis_runtime_sdk::types::transaction::CallFormat"]],["impl UnwindSafe for CallResult",1,["oasis_runtime_sdk::types::transaction::CallResult"]],["impl UnwindSafe for CallerAddress",1,["oasis_runtime_sdk::types::transaction::CallerAddress"]],["impl UnwindSafe for Error",1,["oasis_runtime_sdk::types::transaction::Error"]],["impl UnwindSafe for ScheduleControl",1,["oasis_runtime_sdk::config::ScheduleControl"]],["impl UnwindSafe for Config",1,["oasis_runtime_sdk::crypto::multisig::Config"]],["impl UnwindSafe for Signer",1,["oasis_runtime_sdk::crypto::multisig::Signer"]],["impl UnwindSafe for LeafRng",1,["oasis_runtime_sdk::crypto::random::LeafRng"]],["impl UnwindSafe for RootRng",1,["oasis_runtime_sdk::crypto::random::RootRng"]],["impl UnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::ed25519::MemorySigner"]],["impl UnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::ed25519::PublicKey"]],["impl UnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256k1::MemorySigner"]],["impl UnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256k1::PublicKey"]],["impl UnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp256r1::MemorySigner"]],["impl UnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp256r1::PublicKey"]],["impl UnwindSafe for MemorySigner",1,["oasis_runtime_sdk::crypto::signature::secp384r1::MemorySigner"]],["impl UnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::secp384r1::PublicKey"]],["impl UnwindSafe for PublicKey",1,["oasis_runtime_sdk::crypto::signature::sr25519::PublicKey"]],["impl UnwindSafe for Signature",1,["oasis_runtime_sdk::crypto::signature::Signature"]],["impl UnwindSafe for DispatchResult",1,["oasis_runtime_sdk::dispatcher::DispatchResult"]],["impl UnwindSafe for QueryRequest",1,["oasis_runtime_sdk::enclave_rpc::QueryRequest"]],["impl UnwindSafe for EventTag",1,["oasis_runtime_sdk::event::EventTag"]],["impl UnwindSafe for FeeManager",1,["oasis_runtime_sdk::modules::accounts::fee::FeeManager"]],["impl UnwindSafe for FeeUpdates",1,["oasis_runtime_sdk::modules::accounts::fee::FeeUpdates"]],["impl UnwindSafe for TransactionFee",1,["oasis_runtime_sdk::modules::accounts::fee::TransactionFee"]],["impl UnwindSafe for GasCosts",1,["oasis_runtime_sdk::modules::accounts::GasCosts"]],["impl UnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::accounts::Genesis"]],["impl UnwindSafe for Module",1,["oasis_runtime_sdk::modules::accounts::Module"]],["impl UnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::accounts::Parameters"]],["impl UnwindSafe for Account",1,["oasis_runtime_sdk::modules::accounts::types::Account"]],["impl UnwindSafe for AccountBalances",1,["oasis_runtime_sdk::modules::accounts::types::AccountBalances"]],["impl UnwindSafe for AddressesQuery",1,["oasis_runtime_sdk::modules::accounts::types::AddressesQuery"]],["impl UnwindSafe for BalancesQuery",1,["oasis_runtime_sdk::modules::accounts::types::BalancesQuery"]],["impl UnwindSafe for DenominationInfo",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfo"]],["impl UnwindSafe for DenominationInfoQuery",1,["oasis_runtime_sdk::modules::accounts::types::DenominationInfoQuery"]],["impl UnwindSafe for NonceQuery",1,["oasis_runtime_sdk::modules::accounts::types::NonceQuery"]],["impl UnwindSafe for Transfer",1,["oasis_runtime_sdk::modules::accounts::types::Transfer"]],["impl UnwindSafe for GasCosts",1,["oasis_runtime_sdk::modules::consensus::GasCosts"]],["impl UnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::consensus::Genesis"]],["impl UnwindSafe for Module",1,["oasis_runtime_sdk::modules::consensus::Module"]],["impl UnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::consensus::Parameters"]],["impl UnwindSafe for RoundRootBody",1,["oasis_runtime_sdk::modules::consensus::types::RoundRootBody"]],["impl UnwindSafe for Undelegation",1,["oasis_runtime_sdk::modules::consensus_accounts::state::Undelegation"]],["impl UnwindSafe for GasCosts",1,["oasis_runtime_sdk::modules::consensus_accounts::GasCosts"]],["impl UnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::consensus_accounts::Genesis"]],["impl UnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::consensus_accounts::Parameters"]],["impl UnwindSafe for AccountBalance",1,["oasis_runtime_sdk::modules::consensus_accounts::types::AccountBalance"]],["impl UnwindSafe for BalanceQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::BalanceQuery"]],["impl UnwindSafe for ConsensusAccountQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusAccountQuery"]],["impl UnwindSafe for ConsensusDelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusDelegateContext"]],["impl UnwindSafe for ConsensusError",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusError"]],["impl UnwindSafe for ConsensusTransferContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusTransferContext"]],["impl UnwindSafe for ConsensusUndelegateContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusUndelegateContext"]],["impl UnwindSafe for ConsensusWithdrawContext",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ConsensusWithdrawContext"]],["impl UnwindSafe for Delegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Delegate"]],["impl UnwindSafe for DelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationInfo"]],["impl UnwindSafe for DelegationQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationQuery"]],["impl UnwindSafe for DelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::DelegationsQuery"]],["impl UnwindSafe for Deposit",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Deposit"]],["impl UnwindSafe for ExtendedDelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::ExtendedDelegationInfo"]],["impl UnwindSafe for Receipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Receipt"]],["impl UnwindSafe for TakeReceipt",1,["oasis_runtime_sdk::modules::consensus_accounts::types::TakeReceipt"]],["impl UnwindSafe for Undelegate",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Undelegate"]],["impl UnwindSafe for UndelegationInfo",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationInfo"]],["impl UnwindSafe for UndelegationsQuery",1,["oasis_runtime_sdk::modules::consensus_accounts::types::UndelegationsQuery"]],["impl UnwindSafe for Withdraw",1,["oasis_runtime_sdk::modules::consensus_accounts::types::Withdraw"]],["impl UnwindSafe for DynamicMinGasPrice",1,["oasis_runtime_sdk::modules::core::DynamicMinGasPrice"]],["impl UnwindSafe for GasCosts",1,["oasis_runtime_sdk::modules::core::GasCosts"]],["impl UnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::core::Genesis"]],["impl UnwindSafe for LocalConfig",1,["oasis_runtime_sdk::modules::core::LocalConfig"]],["impl UnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::core::Parameters"]],["impl UnwindSafe for TxSimulationFailure",1,["oasis_runtime_sdk::modules::core::TxSimulationFailure"]],["impl UnwindSafe for CallDataPublicKeyQueryResponse",1,["oasis_runtime_sdk::modules::core::types::CallDataPublicKeyQueryResponse"]],["impl UnwindSafe for EstimateGasQuery",1,["oasis_runtime_sdk::modules::core::types::EstimateGasQuery"]],["impl UnwindSafe for ExecuteReadOnlyTxQuery",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxQuery"]],["impl UnwindSafe for ExecuteReadOnlyTxResponse",1,["oasis_runtime_sdk::modules::core::types::ExecuteReadOnlyTxResponse"]],["impl UnwindSafe for Metadata",1,["oasis_runtime_sdk::modules::core::types::Metadata"]],["impl UnwindSafe for MethodHandlerInfo",1,["oasis_runtime_sdk::modules::core::types::MethodHandlerInfo"]],["impl UnwindSafe for ModuleInfo",1,["oasis_runtime_sdk::modules::core::types::ModuleInfo"]],["impl UnwindSafe for RuntimeInfoResponse",1,["oasis_runtime_sdk::modules::core::types::RuntimeInfoResponse"]],["impl UnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::rewards::Genesis"]],["impl UnwindSafe for Module",1,["oasis_runtime_sdk::modules::rewards::Module"]],["impl UnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::rewards::Parameters"]],["impl UnwindSafe for EpochRewards",1,["oasis_runtime_sdk::modules::rewards::types::EpochRewards"]],["impl UnwindSafe for RewardSchedule",1,["oasis_runtime_sdk::modules::rewards::types::RewardSchedule"]],["impl UnwindSafe for RewardStep",1,["oasis_runtime_sdk::modules::rewards::types::RewardStep"]],["impl UnwindSafe for AppId",1,["oasis_runtime_sdk::modules::rofl::app_id::AppId"]],["impl UnwindSafe for AppAuthPolicy",1,["oasis_runtime_sdk::modules::rofl::policy::AppAuthPolicy"]],["impl UnwindSafe for KeyEndorsementInfo",1,["oasis_runtime_sdk::modules::rofl::state::KeyEndorsementInfo"]],["impl UnwindSafe for Genesis",1,["oasis_runtime_sdk::modules::rofl::Genesis"]],["impl UnwindSafe for Parameters",1,["oasis_runtime_sdk::modules::rofl::Parameters"]],["impl UnwindSafe for AppConfig",1,["oasis_runtime_sdk::modules::rofl::types::AppConfig"]],["impl UnwindSafe for AppInstanceQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppInstanceQuery"]],["impl UnwindSafe for AppQuery",1,["oasis_runtime_sdk::modules::rofl::types::AppQuery"]],["impl UnwindSafe for Create",1,["oasis_runtime_sdk::modules::rofl::types::Create"]],["impl UnwindSafe for Register",1,["oasis_runtime_sdk::modules::rofl::types::Register"]],["impl UnwindSafe for Registration",1,["oasis_runtime_sdk::modules::rofl::types::Registration"]],["impl UnwindSafe for Remove",1,["oasis_runtime_sdk::modules::rofl::types::Remove"]],["impl UnwindSafe for StakeThresholds",1,["oasis_runtime_sdk::modules::rofl::types::StakeThresholds"]],["impl UnwindSafe for Update",1,["oasis_runtime_sdk::modules::rofl::types::Update"]],["impl UnwindSafe for SenderMeta",1,["oasis_runtime_sdk::sender::SenderMeta"]],["impl UnwindSafe for CurrentState",1,["oasis_runtime_sdk::state::CurrentState"]],["impl UnwindSafe for Environment",1,["oasis_runtime_sdk::state::Environment"]],["impl UnwindSafe for Options",1,["oasis_runtime_sdk::state::Options"]],["impl UnwindSafe for TransactionWithMeta",1,["oasis_runtime_sdk::state::TransactionWithMeta"]],["impl UnwindSafe for AllowAllValidator",1,["oasis_runtime_sdk::subcall::AllowAllValidator"]],["impl UnwindSafe for SubcallInfo",1,["oasis_runtime_sdk::subcall::SubcallInfo"]],["impl UnwindSafe for SubcallResult",1,["oasis_runtime_sdk::subcall::SubcallResult"]],["impl UnwindSafe for MockKeyManagerClient",1,["oasis_runtime_sdk::testing::keymanager::MockKeyManagerClient"]],["impl UnwindSafe for CallOptions",1,["oasis_runtime_sdk::testing::mock::CallOptions"]],["impl UnwindSafe for Config",1,["oasis_runtime_sdk::testing::mock::Config"]],["impl UnwindSafe for EmptyRuntime",1,["oasis_runtime_sdk::testing::mock::EmptyRuntime"]],["impl UnwindSafe for Signer",1,["oasis_runtime_sdk::testing::mock::Signer"]],["impl UnwindSafe for Address",1,["oasis_runtime_sdk::types::address::Address"]],["impl UnwindSafe for CallEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::CallEnvelopeX25519DeoxysII"]],["impl UnwindSafe for ResultEnvelopeX25519DeoxysII",1,["oasis_runtime_sdk::types::callformat::ResultEnvelopeX25519DeoxysII"]],["impl UnwindSafe for MessageEventHookInvocation",1,["oasis_runtime_sdk::types::message::MessageEventHookInvocation"]],["impl UnwindSafe for MessageResult",1,["oasis_runtime_sdk::types::message::MessageResult"]],["impl UnwindSafe for BaseUnits",1,["oasis_runtime_sdk::types::token::BaseUnits"]],["impl UnwindSafe for Denomination",1,["oasis_runtime_sdk::types::token::Denomination"]],["impl UnwindSafe for AuthInfo",1,["oasis_runtime_sdk::types::transaction::AuthInfo"]],["impl UnwindSafe for Call",1,["oasis_runtime_sdk::types::transaction::Call"]],["impl UnwindSafe for Fee",1,["oasis_runtime_sdk::types::transaction::Fee"]],["impl UnwindSafe for FeeProxy",1,["oasis_runtime_sdk::types::transaction::FeeProxy"]],["impl UnwindSafe for SignerInfo",1,["oasis_runtime_sdk::types::transaction::SignerInfo"]],["impl UnwindSafe for Transaction",1,["oasis_runtime_sdk::types::transaction::Transaction"]],["impl UnwindSafe for TransactionSigner",1,["oasis_runtime_sdk::types::transaction::TransactionSigner"]],["impl UnwindSafe for UnverifiedTransaction",1,["oasis_runtime_sdk::types::transaction::UnverifiedTransaction"]],["impl<'a> !UnwindSafe for DispatchOptions<'a>",1,["oasis_runtime_sdk::dispatcher::DispatchOptions"]],["impl<'a, R> !UnwindSafe for RuntimeBatchContext<'a, R>",1,["oasis_runtime_sdk::context::RuntimeBatchContext"]],["impl<'a, V> !UnwindSafe for StateValue<'a, V>",1,["oasis_runtime_sdk::state::StateValue"]],["impl<A> !UnwindSafe for Client<A>",1,["oasis_runtime_sdk::modules::rofl::app::client::Client"]],["impl<A> !UnwindSafe for Environment<A>",1,["oasis_runtime_sdk::modules::rofl::app::env::Environment"]],["impl<B, R> UnwindSafe for DispatchResult<B, R>
where\n R: UnwindSafe,\n B: UnwindSafe,
",1,["oasis_runtime_sdk::module::DispatchResult"]],["impl<Cfg> UnwindSafe for Module<Cfg>
where\n Cfg: UnwindSafe,
",1,["oasis_runtime_sdk::modules::access::Module"]],["impl<Cfg> UnwindSafe for Module<Cfg>
where\n Cfg: UnwindSafe,
",1,["oasis_runtime_sdk::modules::core::Module"]],["impl<Cfg> UnwindSafe for Module<Cfg>
where\n Cfg: UnwindSafe,
",1,["oasis_runtime_sdk::modules::rofl::Module"]],["impl<Consensus> UnwindSafe for Module<Consensus>
where\n Consensus: UnwindSafe,
",1,["oasis_runtime_sdk::modules::consensus_accounts::Module"]],["impl<M> UnwindSafe for MKVSStore<M>
where\n M: UnwindSafe,
",1,["oasis_runtime_sdk::storage::mkvs::MKVSStore"]],["impl<R> !UnwindSafe for Dispatcher<R>",1,["oasis_runtime_sdk::dispatcher::Dispatcher"]],["impl<S> UnwindSafe for ConfidentialStore<S>
where\n S: UnwindSafe,
",1,["oasis_runtime_sdk::storage::confidential::ConfidentialStore"]],["impl<S> UnwindSafe for OverlayStore<S>
where\n S: UnwindSafe,
",1,["oasis_runtime_sdk::storage::overlay::OverlayStore"]],["impl<S> UnwindSafe for TypedStore<S>
where\n S: UnwindSafe,
",1,["oasis_runtime_sdk::storage::typed::TypedStore"]],["impl<S, D> UnwindSafe for HashedStore<S, D>
where\n S: UnwindSafe,\n D: UnwindSafe,
",1,["oasis_runtime_sdk::storage::hashed::HashedStore"]],["impl<S, P> UnwindSafe for PrefixStore<S, P>
where\n S: UnwindSafe,\n P: UnwindSafe,
",1,["oasis_runtime_sdk::storage::prefix::PrefixStore"]],["impl<T> UnwindSafe for TransactionResult<T>
where\n T: UnwindSafe,
",1,["oasis_runtime_sdk::state::TransactionResult"]]], +"oasis_runtime_sdk_contracts":[["impl UnwindSafe for Error",1,["oasis_runtime_sdk_contracts::Error"]],["impl UnwindSafe for Event",1,["oasis_runtime_sdk_contracts::Event"]],["impl UnwindSafe for ABI",1,["oasis_runtime_sdk_contracts::types::ABI"]],["impl UnwindSafe for Policy",1,["oasis_runtime_sdk_contracts::types::Policy"]],["impl UnwindSafe for PublicKeyKind",1,["oasis_runtime_sdk_contracts::types::PublicKeyKind"]],["impl UnwindSafe for StoreKind",1,["oasis_runtime_sdk_contracts::types::StoreKind"]],["impl UnwindSafe for GasCosts",1,["oasis_runtime_sdk_contracts::GasCosts"]],["impl UnwindSafe for Genesis",1,["oasis_runtime_sdk_contracts::Genesis"]],["impl UnwindSafe for LocalConfig",1,["oasis_runtime_sdk_contracts::LocalConfig"]],["impl UnwindSafe for Parameters",1,["oasis_runtime_sdk_contracts::Parameters"]],["impl UnwindSafe for Call",1,["oasis_runtime_sdk_contracts::types::Call"]],["impl UnwindSafe for CallResult",1,["oasis_runtime_sdk_contracts::types::CallResult"]],["impl UnwindSafe for ChangeUpgradePolicy",1,["oasis_runtime_sdk_contracts::types::ChangeUpgradePolicy"]],["impl UnwindSafe for Code",1,["oasis_runtime_sdk_contracts::types::Code"]],["impl UnwindSafe for CodeQuery",1,["oasis_runtime_sdk_contracts::types::CodeQuery"]],["impl UnwindSafe for CodeStorageQuery",1,["oasis_runtime_sdk_contracts::types::CodeStorageQuery"]],["impl UnwindSafe for CodeStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::CodeStorageQueryResult"]],["impl UnwindSafe for ContractEvent",1,["oasis_runtime_sdk_contracts::types::ContractEvent"]],["impl UnwindSafe for CustomQuery",1,["oasis_runtime_sdk_contracts::types::CustomQuery"]],["impl UnwindSafe for CustomQueryResult",1,["oasis_runtime_sdk_contracts::types::CustomQueryResult"]],["impl UnwindSafe for Instance",1,["oasis_runtime_sdk_contracts::types::Instance"]],["impl UnwindSafe for InstanceQuery",1,["oasis_runtime_sdk_contracts::types::InstanceQuery"]],["impl UnwindSafe for InstanceRawStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQuery"]],["impl UnwindSafe for InstanceRawStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceRawStorageQueryResult"]],["impl UnwindSafe for InstanceStorageQuery",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQuery"]],["impl UnwindSafe for InstanceStorageQueryResult",1,["oasis_runtime_sdk_contracts::types::InstanceStorageQueryResult"]],["impl UnwindSafe for Instantiate",1,["oasis_runtime_sdk_contracts::types::Instantiate"]],["impl UnwindSafe for InstantiateResult",1,["oasis_runtime_sdk_contracts::types::InstantiateResult"]],["impl UnwindSafe for PublicKeyQuery",1,["oasis_runtime_sdk_contracts::types::PublicKeyQuery"]],["impl UnwindSafe for PublicKeyQueryResult",1,["oasis_runtime_sdk_contracts::types::PublicKeyQueryResult"]],["impl UnwindSafe for Upgrade",1,["oasis_runtime_sdk_contracts::types::Upgrade"]],["impl UnwindSafe for Upload",1,["oasis_runtime_sdk_contracts::types::Upload"]],["impl UnwindSafe for UploadResult",1,["oasis_runtime_sdk_contracts::types::UploadResult"]],["impl<Cfg> UnwindSafe for Module<Cfg>
where\n Cfg: UnwindSafe,
",1,["oasis_runtime_sdk_contracts::Module"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/core/str/traits/trait.FromStr.js b/rust/trait.impl/core/str/traits/trait.FromStr.js new file mode 100644 index 0000000000..82f2f8ca8f --- /dev/null +++ b/rust/trait.impl/core/str/traits/trait.FromStr.js @@ -0,0 +1,5 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl FromStr for Denomination"]], +"oasis_core_runtime":[["impl FromStr for Hash"],["impl FromStr for PublicKey"],["impl FromStr for Signature"],["impl FromStr for Namespace"],["impl FromStr for MrEnclave"],["impl FromStr for MrSigner"],["impl FromStr for SessionID"]], +"oasis_runtime_sdk":[["impl FromStr for Denomination"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/lazy_static/trait.LazyStatic.js b/rust/trait.impl/lazy_static/trait.LazyStatic.js new file mode 100644 index 0000000000..4dee28e94d --- /dev/null +++ b/rust/trait.impl/lazy_static/trait.LazyStatic.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl LazyStatic for COMMON_POOL_ADDRESS"],["impl LazyStatic for FEE_ACC_ADDRESS"],["impl LazyStatic for GOVERNANCE_DEPOSITS_ADDRESS"],["impl LazyStatic for BUILD_INFO"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/num_traits/identities/trait.Zero.js b/rust/trait.impl/num_traits/identities/trait.Zero.js new file mode 100644 index 0000000000..dc184320b4 --- /dev/null +++ b/rust/trait.impl/num_traits/identities/trait.Zero.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Zero for Quantity"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_cbor/decode/trait.Decode.js b/rust/trait.impl/oasis_cbor/decode/trait.Decode.js new file mode 100644 index 0000000000..408cfc0802 --- /dev/null +++ b/rust/trait.impl/oasis_cbor/decode/trait.Decode.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl Decode for CallFormat"],["impl Decode for ExecutionResult"],["impl Decode for AccountsQuery"],["impl Decode for AccountsResponse"],["impl Decode for QueryRequest"],["impl Decode for QueryResponse"],["impl Decode for CallResult"],["impl Decode for Message"],["impl Decode for NotifyReply"],["impl Decode for Reply"],["impl Decode for Address"],["impl Decode for Event"],["impl Decode for InstantiateResult"],["impl Decode for CodeId"],["impl Decode for ExecutionContext"],["impl Decode for ExecutionOk"],["impl Decode for InstanceId"],["impl Decode for BaseUnits"],["impl Decode for Denomination"]], +"oasis_core_runtime":[["impl Decode for Quote"],["impl Decode for Event"],["impl Decode for Vote"],["impl Decode for SuiteId"],["impl Decode for RuntimeGovernanceModel"],["impl Decode for RuntimeKind"],["impl Decode for SGXAttestation"],["impl Decode for SGXConstraints"],["impl Decode for TEEHardware"],["impl Decode for ExecutorCommitmentFailure"],["impl Decode for GovernanceMessage"],["impl Decode for HeaderType"],["impl Decode for Message"],["impl Decode for RegistryMessage"],["impl Decode for StakingMessage"],["impl Decode for CommitteeKind"],["impl Decode for Role"],["impl Decode for EscrowEvent"],["impl Decode for SlashReason"],["impl Decode for ThresholdKind"],["impl Decode for RAKBinding"],["impl Decode for Body"],["impl Decode for Kind"],["impl Decode for Message"],["impl Decode for PeerFeedback"],["impl Decode for RootType"],["impl Decode for Body"],["impl Decode for EventKind"],["impl Decode for ExecutionMode"],["impl Decode for HostStorageEndpoint"],["impl Decode for MessageType"],["impl Decode for StorageSyncRequest"],["impl Decode for StorageSyncResponse"],["impl Decode for Hash"],["impl Decode for MultiSigned"],["impl Decode for PublicKey"],["impl Decode for Signature"],["impl Decode for SignatureBundle"],["impl Decode for Signed"],["impl Decode for PrivateKey"],["impl Decode for PublicKey"],["impl Decode for Namespace"],["impl Decode for Quantity"],["impl Decode for AVR"],["impl Decode for QuotePolicy"],["impl Decode for QuoteBundle"],["impl Decode for QuotePolicy"],["impl Decode for TCBBundle"],["impl Decode for TdxModulePolicy"],["impl Decode for TdxQuotePolicy"],["impl Decode for EnclaveIdentity"],["impl Decode for MrEnclave"],["impl Decode for MrSigner"],["impl Decode for QuotePolicy"],["impl Decode for ProtocolVersions"],["impl Decode for Version"],["impl Decode for Address"],["impl Decode for EpochTimeState"],["impl Decode for CancelUpgradeProposal"],["impl Decode for ChangeParametersProposal"],["impl Decode for ConsensusParameterChanges"],["impl Decode for ProposalContent"],["impl Decode for ProposalVote"],["impl Decode for UpgradeProposal"],["impl Decode for Application"],["impl Decode for PolicySGX"],["impl Decode for SignedPolicySGX"],["impl Decode for Status"],["impl Decode for EnclavePolicySGX"],["impl Decode for EncryptedEphemeralSecret"],["impl Decode for EncryptedMasterSecret"],["impl Decode for EncryptedSecret"],["impl Decode for PolicySGX"],["impl Decode for SignedEncryptedEphemeralSecret"],["impl Decode for SignedEncryptedMasterSecret"],["impl Decode for SignedPolicySGX"],["impl Decode for AnyNodeRuntimeAdmissionPolicy"],["impl Decode for Capabilities"],["impl Decode for CapabilityTEE"],["impl Decode for ConsensusAddress"],["impl Decode for ConsensusInfo"],["impl Decode for EndorsedCapabilityTEE"],["impl Decode for EntityWhitelistConfig"],["impl Decode for EntityWhitelistRoleAdmissionPolicy"],["impl Decode for EntityWhitelistRoleConfig"],["impl Decode for EntityWhitelistRuntimeAdmissionPolicy"],["impl Decode for ExecutorParameters"],["impl Decode for MaxNodesConstraint"],["impl Decode for MinPoolSizeConstraint"],["impl Decode for Node"],["impl Decode for NodeRuntime"],["impl Decode for P2PInfo"],["impl Decode for PerRoleAdmissionPolicy"],["impl Decode for RolesMask"],["impl Decode for Runtime"],["impl Decode for RuntimeAdmissionPolicy"],["impl Decode for RuntimeGenesis"],["impl Decode for RuntimeStakingParameters"],["impl Decode for SchedulingConstraints"],["impl Decode for StorageParameters"],["impl Decode for TCPAddress"],["impl Decode for TLSAddress"],["impl Decode for TLSInfo"],["impl Decode for TxnSchedulerParameters"],["impl Decode for VRFInfo"],["impl Decode for ValidatorSetConstraint"],["impl Decode for VersionInfo"],["impl Decode for AnnotatedBlock"],["impl Decode for Block"],["impl Decode for ComputeResultsHeader"],["impl Decode for ExecutorCommitment"],["impl Decode for ExecutorCommitmentHeader"],["impl Decode for Header"],["impl Decode for IncomingMessage"],["impl Decode for MessageEvent"],["impl Decode for RoundResults"],["impl Decode for RoundRoots"],["impl Decode for Account"],["impl Decode for AddEscrowResult"],["impl Decode for AllowanceChangeEvent"],["impl Decode for BurnEvent"],["impl Decode for CommissionRateBoundStep"],["impl Decode for CommissionRateStep"],["impl Decode for CommissionSchedule"],["impl Decode for DebondingDelegation"],["impl Decode for Delegation"],["impl Decode for Escrow"],["impl Decode for EscrowAccount"],["impl Decode for Event"],["impl Decode for GeneralAccount"],["impl Decode for ReclaimEscrow"],["impl Decode for ReclaimEscrowResult"],["impl Decode for SharePool"],["impl Decode for Slash"],["impl Decode for StakeAccumulator"],["impl Decode for StakeThreshold"],["impl Decode for Transfer"],["impl Decode for TransferEvent"],["impl Decode for TransferResult"],["impl Decode for Withdraw"],["impl Decode for WithdrawResult"],["impl Decode for Status"],["impl Decode for BlockMetadata"],["impl Decode for LightBlock"],["impl Decode for Proof"],["impl Decode for Fee"],["impl Decode for Proof"],["impl Decode for SignedTransactionWithProof"],["impl Decode for Transaction"],["impl Decode for TrustRoot"],["impl Decode for Error"],["impl Decode for Frame"],["impl Decode for Request"],["impl Decode for Response"],["impl Decode for SessionID"],["impl Decode for LogEntry"],["impl Decode for Prefix"],["impl Decode for Root"],["impl Decode for GetPrefixesRequest"],["impl Decode for GetRequest"],["impl Decode for IterateRequest"],["impl Decode for Proof"],["impl Decode for ProofResponse"],["impl Decode for RawProofEntry"],["impl Decode for TreeID"],["impl Decode for CoarsenedKey"],["impl Decode for ReadWriteSet"],["impl Decode for TxnBatch"],["impl Decode for CheckTxMetadata"],["impl Decode for CheckTxResult"],["impl Decode for ComputedBatch"],["impl Decode for Error"],["impl Decode for FeatureScheduleControl"],["impl Decode for Features"],["impl Decode for HostFetchConsensusEventsRequest"],["impl Decode for HostFetchConsensusEventsResponse"],["impl Decode for Message"],["impl Decode for RegisterNotifyRuntimeEvent"],["impl Decode for RuntimeInfoRequest"],["impl Decode for RuntimeInfoResponse"],["impl Decode for RuntimeNotifyEvent"],["impl Decode for StorageSyncRequestWithEndpoint"],["impl<T: Decode> Decode for Versioned<T>"]], +"oasis_runtime_sdk":[["impl Decode for PublicKey"],["impl Decode for SignatureType"],["impl Decode for RootKind"],["impl Decode for ReceiptKind"],["impl Decode for MethodHandlerKind"],["impl Decode for RewardAction"],["impl Decode for AllowedEndorsement"],["impl Decode for FeePolicy"],["impl Decode for IdentifierScheme"],["impl Decode for SignatureAddressSpec"],["impl Decode for AddressSpec"],["impl Decode for AuthProof"],["impl Decode for CallFormat"],["impl Decode for CallResult"],["impl Decode for CallerAddress"],["impl Decode for Config"],["impl Decode for Signer"],["impl Decode for PublicKey"],["impl Decode for PublicKey"],["impl Decode for PublicKey"],["impl Decode for PublicKey"],["impl Decode for PublicKey"],["impl Decode for Signature"],["impl Decode for QueryRequest"],["impl Decode for GasCosts"],["impl Decode for Genesis"],["impl Decode for Parameters"],["impl Decode for Account"],["impl Decode for AccountBalances"],["impl Decode for AddressesQuery"],["impl Decode for BalancesQuery"],["impl Decode for DenominationInfo"],["impl Decode for DenominationInfoQuery"],["impl Decode for NonceQuery"],["impl Decode for Transfer"],["impl Decode for GasCosts"],["impl Decode for Genesis"],["impl Decode for Parameters"],["impl Decode for RoundRootBody"],["impl Decode for GasCosts"],["impl Decode for Genesis"],["impl Decode for Parameters"],["impl Decode for AccountBalance"],["impl Decode for BalanceQuery"],["impl Decode for ConsensusAccountQuery"],["impl Decode for ConsensusDelegateContext"],["impl Decode for ConsensusError"],["impl Decode for ConsensusTransferContext"],["impl Decode for ConsensusUndelegateContext"],["impl Decode for ConsensusWithdrawContext"],["impl Decode for Delegate"],["impl Decode for DelegationInfo"],["impl Decode for DelegationQuery"],["impl Decode for DelegationsQuery"],["impl Decode for Deposit"],["impl Decode for ExtendedDelegationInfo"],["impl Decode for Receipt"],["impl Decode for TakeReceipt"],["impl Decode for Undelegate"],["impl Decode for UndelegationInfo"],["impl Decode for UndelegationsQuery"],["impl Decode for Withdraw"],["impl Decode for DynamicMinGasPrice"],["impl Decode for GasCosts"],["impl Decode for Genesis"],["impl Decode for LocalConfig"],["impl Decode for Parameters"],["impl Decode for CallDataPublicKeyQueryResponse"],["impl Decode for EstimateGasQuery"],["impl Decode for ExecuteReadOnlyTxQuery"],["impl Decode for ExecuteReadOnlyTxResponse"],["impl Decode for Metadata"],["impl Decode for MethodHandlerInfo"],["impl Decode for ModuleInfo"],["impl Decode for RuntimeInfoResponse"],["impl Decode for Genesis"],["impl Decode for Parameters"],["impl Decode for EpochRewards"],["impl Decode for RewardSchedule"],["impl Decode for RewardStep"],["impl Decode for AppId"],["impl Decode for AppAuthPolicy"],["impl Decode for KeyEndorsementInfo"],["impl Decode for Genesis"],["impl Decode for Parameters"],["impl Decode for AppConfig"],["impl Decode for AppInstanceQuery"],["impl Decode for AppQuery"],["impl Decode for Create"],["impl Decode for Register"],["impl Decode for Registration"],["impl Decode for Remove"],["impl Decode for StakeThresholds"],["impl Decode for Update"],["impl Decode for Address"],["impl Decode for CallEnvelopeX25519DeoxysII"],["impl Decode for ResultEnvelopeX25519DeoxysII"],["impl Decode for MessageEventHookInvocation"],["impl Decode for BaseUnits"],["impl Decode for Denomination"],["impl Decode for AuthInfo"],["impl Decode for Call"],["impl Decode for Fee"],["impl Decode for FeeProxy"],["impl Decode for SignerInfo"],["impl Decode for Transaction"],["impl Decode for UnverifiedTransaction"]], +"oasis_runtime_sdk_contracts":[["impl Decode for ABI"],["impl Decode for Policy"],["impl Decode for PublicKeyKind"],["impl Decode for StoreKind"],["impl Decode for GasCosts"],["impl Decode for Genesis"],["impl Decode for LocalConfig"],["impl Decode for Parameters"],["impl Decode for Call"],["impl Decode for CallResult"],["impl Decode for ChangeUpgradePolicy"],["impl Decode for Code"],["impl Decode for CodeQuery"],["impl Decode for CodeStorageQuery"],["impl Decode for CodeStorageQueryResult"],["impl Decode for ContractEvent"],["impl Decode for CustomQuery"],["impl Decode for CustomQueryResult"],["impl Decode for Instance"],["impl Decode for InstanceQuery"],["impl Decode for InstanceRawStorageQuery"],["impl Decode for InstanceRawStorageQueryResult"],["impl Decode for InstanceStorageQuery"],["impl Decode for InstanceStorageQueryResult"],["impl Decode for Instantiate"],["impl Decode for InstantiateResult"],["impl Decode for PublicKeyQuery"],["impl Decode for PublicKeyQueryResult"],["impl Decode for Upgrade"],["impl Decode for Upload"],["impl Decode for UploadResult"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_cbor/encode/trait.Encode.js b/rust/trait.impl/oasis_cbor/encode/trait.Encode.js new file mode 100644 index 0000000000..0eeadc2d4f --- /dev/null +++ b/rust/trait.impl/oasis_cbor/encode/trait.Encode.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl Encode for CallFormat"],["impl Encode for ExecutionResult"],["impl Encode for AccountsQuery"],["impl Encode for AccountsResponse"],["impl Encode for QueryRequest"],["impl Encode for QueryResponse"],["impl Encode for CallResult"],["impl Encode for Message"],["impl Encode for NotifyReply"],["impl Encode for Reply"],["impl Encode for Address"],["impl Encode for Event"],["impl Encode for InstantiateResult"],["impl Encode for CodeId"],["impl Encode for ExecutionContext"],["impl Encode for ExecutionOk"],["impl Encode for InstanceId"],["impl Encode for BaseUnits"],["impl Encode for Denomination"]], +"oasis_core_runtime":[["impl Encode for Quote"],["impl Encode for Event"],["impl Encode for Vote"],["impl Encode for SuiteId"],["impl Encode for RuntimeGovernanceModel"],["impl Encode for RuntimeKind"],["impl Encode for SGXAttestation"],["impl Encode for SGXConstraints"],["impl Encode for TEEHardware"],["impl Encode for ExecutorCommitmentFailure"],["impl Encode for GovernanceMessage"],["impl Encode for HeaderType"],["impl Encode for Message"],["impl Encode for RegistryMessage"],["impl Encode for StakingMessage"],["impl Encode for CommitteeKind"],["impl Encode for Role"],["impl Encode for EscrowEvent"],["impl Encode for SlashReason"],["impl Encode for ThresholdKind"],["impl Encode for RAKBinding"],["impl Encode for Body"],["impl Encode for Kind"],["impl Encode for Message"],["impl Encode for PeerFeedback"],["impl Encode for RootType"],["impl Encode for Body"],["impl Encode for EventKind"],["impl Encode for ExecutionMode"],["impl Encode for HostStorageEndpoint"],["impl Encode for MessageType"],["impl Encode for StorageSyncRequest"],["impl Encode for StorageSyncResponse"],["impl Encode for Hash"],["impl Encode for MultiSigned"],["impl Encode for PublicKey"],["impl Encode for Signature"],["impl Encode for SignatureBundle"],["impl Encode for Signed"],["impl Encode for PrivateKey"],["impl Encode for PublicKey"],["impl Encode for Namespace"],["impl Encode for Quantity"],["impl Encode for AVR"],["impl Encode for QuotePolicy"],["impl Encode for QuoteBundle"],["impl Encode for QuotePolicy"],["impl Encode for TCBBundle"],["impl Encode for TdxModulePolicy"],["impl Encode for TdxQuotePolicy"],["impl Encode for EnclaveIdentity"],["impl Encode for MrEnclave"],["impl Encode for MrSigner"],["impl Encode for QuotePolicy"],["impl Encode for ProtocolVersions"],["impl Encode for Version"],["impl Encode for Address"],["impl Encode for EpochTimeState"],["impl Encode for CancelUpgradeProposal"],["impl Encode for ChangeParametersProposal"],["impl Encode for ConsensusParameterChanges"],["impl Encode for ProposalContent"],["impl Encode for ProposalVote"],["impl Encode for UpgradeProposal"],["impl Encode for Application"],["impl Encode for PolicySGX"],["impl Encode for SignedPolicySGX"],["impl Encode for Status"],["impl Encode for EnclavePolicySGX"],["impl Encode for EncryptedEphemeralSecret"],["impl Encode for EncryptedMasterSecret"],["impl Encode for EncryptedSecret"],["impl Encode for PolicySGX"],["impl Encode for SignedEncryptedEphemeralSecret"],["impl Encode for SignedEncryptedMasterSecret"],["impl Encode for SignedPolicySGX"],["impl Encode for AnyNodeRuntimeAdmissionPolicy"],["impl Encode for Capabilities"],["impl Encode for CapabilityTEE"],["impl Encode for ConsensusAddress"],["impl Encode for ConsensusInfo"],["impl Encode for EndorsedCapabilityTEE"],["impl Encode for EntityWhitelistConfig"],["impl Encode for EntityWhitelistRoleAdmissionPolicy"],["impl Encode for EntityWhitelistRoleConfig"],["impl Encode for EntityWhitelistRuntimeAdmissionPolicy"],["impl Encode for ExecutorParameters"],["impl Encode for MaxNodesConstraint"],["impl Encode for MinPoolSizeConstraint"],["impl Encode for Node"],["impl Encode for NodeRuntime"],["impl Encode for P2PInfo"],["impl Encode for PerRoleAdmissionPolicy"],["impl Encode for RolesMask"],["impl Encode for Runtime"],["impl Encode for RuntimeAdmissionPolicy"],["impl Encode for RuntimeGenesis"],["impl Encode for RuntimeStakingParameters"],["impl Encode for SchedulingConstraints"],["impl Encode for StorageParameters"],["impl Encode for TCPAddress"],["impl Encode for TLSAddress"],["impl Encode for TLSInfo"],["impl Encode for TxnSchedulerParameters"],["impl Encode for VRFInfo"],["impl Encode for ValidatorSetConstraint"],["impl Encode for VersionInfo"],["impl Encode for AnnotatedBlock"],["impl Encode for Block"],["impl Encode for ComputeResultsHeader"],["impl Encode for ExecutorCommitment"],["impl Encode for ExecutorCommitmentHeader"],["impl Encode for Header"],["impl Encode for IncomingMessage"],["impl Encode for MessageEvent"],["impl Encode for RoundResults"],["impl Encode for RoundRoots"],["impl Encode for Account"],["impl Encode for AddEscrowResult"],["impl Encode for AllowanceChangeEvent"],["impl Encode for BurnEvent"],["impl Encode for CommissionRateBoundStep"],["impl Encode for CommissionRateStep"],["impl Encode for CommissionSchedule"],["impl Encode for DebondingDelegation"],["impl Encode for Delegation"],["impl Encode for Escrow"],["impl Encode for EscrowAccount"],["impl Encode for Event"],["impl Encode for GeneralAccount"],["impl Encode for ReclaimEscrow"],["impl Encode for ReclaimEscrowResult"],["impl Encode for SharePool"],["impl Encode for Slash"],["impl Encode for StakeAccumulator"],["impl Encode for StakeThreshold"],["impl Encode for Transfer"],["impl Encode for TransferEvent"],["impl Encode for TransferResult"],["impl Encode for Withdraw"],["impl Encode for WithdrawResult"],["impl Encode for Status"],["impl Encode for BlockMetadata"],["impl Encode for LightBlock"],["impl Encode for Proof"],["impl Encode for Fee"],["impl Encode for Proof"],["impl Encode for SignedTransactionWithProof"],["impl Encode for Transaction"],["impl Encode for TrustRoot"],["impl Encode for Error"],["impl Encode for Frame"],["impl Encode for Request"],["impl Encode for Response"],["impl Encode for SessionID"],["impl Encode for LogEntry"],["impl Encode for Prefix"],["impl Encode for Root"],["impl Encode for GetPrefixesRequest"],["impl Encode for GetRequest"],["impl Encode for IterateRequest"],["impl Encode for Proof"],["impl Encode for ProofResponse"],["impl Encode for RawProofEntry"],["impl Encode for TreeID"],["impl Encode for CoarsenedKey"],["impl Encode for ReadWriteSet"],["impl Encode for TxnBatch"],["impl Encode for CheckTxMetadata"],["impl Encode for CheckTxResult"],["impl Encode for ComputedBatch"],["impl Encode for Error"],["impl Encode for FeatureScheduleControl"],["impl Encode for Features"],["impl Encode for HostFetchConsensusEventsRequest"],["impl Encode for HostFetchConsensusEventsResponse"],["impl Encode for Message"],["impl Encode for RegisterNotifyRuntimeEvent"],["impl Encode for RuntimeInfoRequest"],["impl Encode for RuntimeInfoResponse"],["impl Encode for RuntimeNotifyEvent"],["impl Encode for StorageSyncRequestWithEndpoint"],["impl<T: EncodeAsMap> Encode for Versioned<T>"]], +"oasis_runtime_sdk":[["impl Encode for PublicKey"],["impl Encode for SignatureType"],["impl Encode for Event"],["impl Encode for Event"],["impl Encode for RootKind"],["impl Encode for Event"],["impl Encode for ReceiptKind"],["impl Encode for Event"],["impl Encode for MethodHandlerKind"],["impl Encode for RewardAction"],["impl Encode for Event"],["impl Encode for AllowedEndorsement"],["impl Encode for FeePolicy"],["impl Encode for IdentifierScheme"],["impl Encode for SignatureAddressSpec"],["impl Encode for AddressSpec"],["impl Encode for AuthProof"],["impl Encode for CallFormat"],["impl Encode for CallResult"],["impl Encode for CallerAddress"],["impl Encode for Config"],["impl Encode for Signer"],["impl Encode for PublicKey"],["impl Encode for PublicKey"],["impl Encode for PublicKey"],["impl Encode for PublicKey"],["impl Encode for PublicKey"],["impl Encode for Signature"],["impl Encode for QueryRequest"],["impl Encode for GasCosts"],["impl Encode for Genesis"],["impl Encode for Parameters"],["impl Encode for Account"],["impl Encode for AccountBalances"],["impl Encode for AddressesQuery"],["impl Encode for BalancesQuery"],["impl Encode for DenominationInfo"],["impl Encode for DenominationInfoQuery"],["impl Encode for NonceQuery"],["impl Encode for Transfer"],["impl Encode for GasCosts"],["impl Encode for Genesis"],["impl Encode for Parameters"],["impl Encode for RoundRootBody"],["impl Encode for GasCosts"],["impl Encode for Genesis"],["impl Encode for Parameters"],["impl Encode for AccountBalance"],["impl Encode for BalanceQuery"],["impl Encode for ConsensusAccountQuery"],["impl Encode for ConsensusDelegateContext"],["impl Encode for ConsensusError"],["impl Encode for ConsensusTransferContext"],["impl Encode for ConsensusUndelegateContext"],["impl Encode for ConsensusWithdrawContext"],["impl Encode for Delegate"],["impl Encode for DelegationInfo"],["impl Encode for DelegationQuery"],["impl Encode for DelegationsQuery"],["impl Encode for Deposit"],["impl Encode for ExtendedDelegationInfo"],["impl Encode for Receipt"],["impl Encode for TakeReceipt"],["impl Encode for Undelegate"],["impl Encode for UndelegationInfo"],["impl Encode for UndelegationsQuery"],["impl Encode for Withdraw"],["impl Encode for DynamicMinGasPrice"],["impl Encode for GasCosts"],["impl Encode for Genesis"],["impl Encode for LocalConfig"],["impl Encode for Parameters"],["impl Encode for CallDataPublicKeyQueryResponse"],["impl Encode for EstimateGasQuery"],["impl Encode for ExecuteReadOnlyTxQuery"],["impl Encode for ExecuteReadOnlyTxResponse"],["impl Encode for Metadata"],["impl Encode for MethodHandlerInfo"],["impl Encode for ModuleInfo"],["impl Encode for RuntimeInfoResponse"],["impl Encode for Genesis"],["impl Encode for Parameters"],["impl Encode for EpochRewards"],["impl Encode for RewardSchedule"],["impl Encode for RewardStep"],["impl Encode for AppId"],["impl Encode for AppAuthPolicy"],["impl Encode for KeyEndorsementInfo"],["impl Encode for Genesis"],["impl Encode for Parameters"],["impl Encode for AppConfig"],["impl Encode for AppInstanceQuery"],["impl Encode for AppQuery"],["impl Encode for Create"],["impl Encode for Register"],["impl Encode for Registration"],["impl Encode for Remove"],["impl Encode for StakeThresholds"],["impl Encode for Update"],["impl Encode for Address"],["impl Encode for CallEnvelopeX25519DeoxysII"],["impl Encode for ResultEnvelopeX25519DeoxysII"],["impl Encode for MessageEventHookInvocation"],["impl Encode for BaseUnits"],["impl Encode for Denomination"],["impl Encode for AuthInfo"],["impl Encode for Call"],["impl Encode for Fee"],["impl Encode for FeeProxy"],["impl Encode for SignerInfo"],["impl Encode for Transaction"],["impl Encode for UnverifiedTransaction"]], +"oasis_runtime_sdk_contracts":[["impl Encode for Event"],["impl Encode for ABI"],["impl Encode for Policy"],["impl Encode for PublicKeyKind"],["impl Encode for StoreKind"],["impl Encode for GasCosts"],["impl Encode for Genesis"],["impl Encode for LocalConfig"],["impl Encode for Parameters"],["impl Encode for Call"],["impl Encode for CallResult"],["impl Encode for ChangeUpgradePolicy"],["impl Encode for Code"],["impl Encode for CodeQuery"],["impl Encode for CodeStorageQuery"],["impl Encode for CodeStorageQueryResult"],["impl Encode for ContractEvent"],["impl Encode for CustomQuery"],["impl Encode for CustomQueryResult"],["impl Encode for Instance"],["impl Encode for InstanceQuery"],["impl Encode for InstanceRawStorageQuery"],["impl Encode for InstanceRawStorageQueryResult"],["impl Encode for InstanceStorageQuery"],["impl Encode for InstanceStorageQueryResult"],["impl Encode for Instantiate"],["impl Encode for InstantiateResult"],["impl Encode for PublicKeyQuery"],["impl Encode for PublicKeyQueryResult"],["impl Encode for Upgrade"],["impl Encode for Upload"],["impl Encode for UploadResult"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_cbor/encode/trait.EncodeAsMap.js b/rust/trait.impl/oasis_cbor/encode/trait.EncodeAsMap.js new file mode 100644 index 0000000000..a0368b7d81 --- /dev/null +++ b/rust/trait.impl/oasis_cbor/encode/trait.EncodeAsMap.js @@ -0,0 +1,6 @@ +(function() {var implementors = { +"oasis_contract_sdk_types":[["impl EncodeAsMap for ExecutionResult"],["impl EncodeAsMap for AccountsQuery"],["impl EncodeAsMap for AccountsResponse"],["impl EncodeAsMap for QueryResponse"],["impl EncodeAsMap for CallResult"],["impl EncodeAsMap for Message"],["impl EncodeAsMap for Reply"],["impl EncodeAsMap for Event"],["impl EncodeAsMap for InstantiateResult"],["impl EncodeAsMap for ExecutionContext"],["impl EncodeAsMap for ExecutionOk"]], +"oasis_core_runtime":[["impl EncodeAsMap for Quote"],["impl EncodeAsMap for Event"],["impl EncodeAsMap for SGXAttestation"],["impl EncodeAsMap for SGXConstraints"],["impl EncodeAsMap for GovernanceMessage"],["impl EncodeAsMap for Message"],["impl EncodeAsMap for RegistryMessage"],["impl EncodeAsMap for StakingMessage"],["impl EncodeAsMap for EscrowEvent"],["impl EncodeAsMap for RAKBinding"],["impl EncodeAsMap for Body"],["impl EncodeAsMap for Body"],["impl EncodeAsMap for StorageSyncRequest"],["impl EncodeAsMap for StorageSyncResponse"],["impl EncodeAsMap for MultiSigned"],["impl EncodeAsMap for SignatureBundle"],["impl EncodeAsMap for Signed"],["impl EncodeAsMap for AVR"],["impl EncodeAsMap for QuotePolicy"],["impl EncodeAsMap for QuoteBundle"],["impl EncodeAsMap for QuotePolicy"],["impl EncodeAsMap for TCBBundle"],["impl EncodeAsMap for TdxModulePolicy"],["impl EncodeAsMap for TdxQuotePolicy"],["impl EncodeAsMap for EnclaveIdentity"],["impl EncodeAsMap for QuotePolicy"],["impl EncodeAsMap for ProtocolVersions"],["impl EncodeAsMap for Version"],["impl EncodeAsMap for EpochTimeState"],["impl EncodeAsMap for CancelUpgradeProposal"],["impl EncodeAsMap for ChangeParametersProposal"],["impl EncodeAsMap for ConsensusParameterChanges"],["impl EncodeAsMap for ProposalContent"],["impl EncodeAsMap for ProposalVote"],["impl EncodeAsMap for UpgradeProposal"],["impl EncodeAsMap for Application"],["impl EncodeAsMap for PolicySGX"],["impl EncodeAsMap for SignedPolicySGX"],["impl EncodeAsMap for Status"],["impl EncodeAsMap for EnclavePolicySGX"],["impl EncodeAsMap for EncryptedEphemeralSecret"],["impl EncodeAsMap for EncryptedMasterSecret"],["impl EncodeAsMap for EncryptedSecret"],["impl EncodeAsMap for PolicySGX"],["impl EncodeAsMap for SignedEncryptedEphemeralSecret"],["impl EncodeAsMap for SignedEncryptedMasterSecret"],["impl EncodeAsMap for SignedPolicySGX"],["impl EncodeAsMap for AnyNodeRuntimeAdmissionPolicy"],["impl EncodeAsMap for Capabilities"],["impl EncodeAsMap for CapabilityTEE"],["impl EncodeAsMap for ConsensusAddress"],["impl EncodeAsMap for ConsensusInfo"],["impl EncodeAsMap for EndorsedCapabilityTEE"],["impl EncodeAsMap for EntityWhitelistConfig"],["impl EncodeAsMap for EntityWhitelistRoleAdmissionPolicy"],["impl EncodeAsMap for EntityWhitelistRoleConfig"],["impl EncodeAsMap for EntityWhitelistRuntimeAdmissionPolicy"],["impl EncodeAsMap for ExecutorParameters"],["impl EncodeAsMap for MaxNodesConstraint"],["impl EncodeAsMap for MinPoolSizeConstraint"],["impl EncodeAsMap for Node"],["impl EncodeAsMap for NodeRuntime"],["impl EncodeAsMap for P2PInfo"],["impl EncodeAsMap for PerRoleAdmissionPolicy"],["impl EncodeAsMap for Runtime"],["impl EncodeAsMap for RuntimeAdmissionPolicy"],["impl EncodeAsMap for RuntimeGenesis"],["impl EncodeAsMap for RuntimeStakingParameters"],["impl EncodeAsMap for SchedulingConstraints"],["impl EncodeAsMap for StorageParameters"],["impl EncodeAsMap for TCPAddress"],["impl EncodeAsMap for TLSAddress"],["impl EncodeAsMap for TLSInfo"],["impl EncodeAsMap for TxnSchedulerParameters"],["impl EncodeAsMap for VRFInfo"],["impl EncodeAsMap for ValidatorSetConstraint"],["impl EncodeAsMap for VersionInfo"],["impl EncodeAsMap for AnnotatedBlock"],["impl EncodeAsMap for Block"],["impl EncodeAsMap for ComputeResultsHeader"],["impl EncodeAsMap for ExecutorCommitment"],["impl EncodeAsMap for ExecutorCommitmentHeader"],["impl EncodeAsMap for Header"],["impl EncodeAsMap for IncomingMessage"],["impl EncodeAsMap for MessageEvent"],["impl EncodeAsMap for RoundResults"],["impl EncodeAsMap for Account"],["impl EncodeAsMap for AddEscrowResult"],["impl EncodeAsMap for AllowanceChangeEvent"],["impl EncodeAsMap for BurnEvent"],["impl EncodeAsMap for CommissionRateBoundStep"],["impl EncodeAsMap for CommissionRateStep"],["impl EncodeAsMap for CommissionSchedule"],["impl EncodeAsMap for DebondingDelegation"],["impl EncodeAsMap for Delegation"],["impl EncodeAsMap for Escrow"],["impl EncodeAsMap for EscrowAccount"],["impl EncodeAsMap for Event"],["impl EncodeAsMap for GeneralAccount"],["impl EncodeAsMap for ReclaimEscrow"],["impl EncodeAsMap for ReclaimEscrowResult"],["impl EncodeAsMap for SharePool"],["impl EncodeAsMap for Slash"],["impl EncodeAsMap for StakeAccumulator"],["impl EncodeAsMap for StakeThreshold"],["impl EncodeAsMap for Transfer"],["impl EncodeAsMap for TransferEvent"],["impl EncodeAsMap for TransferResult"],["impl EncodeAsMap for Withdraw"],["impl EncodeAsMap for WithdrawResult"],["impl EncodeAsMap for Status"],["impl EncodeAsMap for BlockMetadata"],["impl EncodeAsMap for LightBlock"],["impl EncodeAsMap for Proof"],["impl EncodeAsMap for Fee"],["impl EncodeAsMap for Proof"],["impl EncodeAsMap for SignedTransactionWithProof"],["impl EncodeAsMap for Transaction"],["impl EncodeAsMap for TrustRoot"],["impl EncodeAsMap for Error"],["impl EncodeAsMap for Frame"],["impl EncodeAsMap for Request"],["impl EncodeAsMap for Response"],["impl EncodeAsMap for Root"],["impl EncodeAsMap for GetPrefixesRequest"],["impl EncodeAsMap for GetRequest"],["impl EncodeAsMap for IterateRequest"],["impl EncodeAsMap for Proof"],["impl EncodeAsMap for ProofResponse"],["impl EncodeAsMap for TreeID"],["impl EncodeAsMap for ReadWriteSet"],["impl EncodeAsMap for CheckTxMetadata"],["impl EncodeAsMap for CheckTxResult"],["impl EncodeAsMap for ComputedBatch"],["impl EncodeAsMap for Error"],["impl EncodeAsMap for FeatureScheduleControl"],["impl EncodeAsMap for Features"],["impl EncodeAsMap for HostFetchConsensusEventsRequest"],["impl EncodeAsMap for HostFetchConsensusEventsResponse"],["impl EncodeAsMap for Message"],["impl EncodeAsMap for RegisterNotifyRuntimeEvent"],["impl EncodeAsMap for RuntimeInfoRequest"],["impl EncodeAsMap for RuntimeInfoResponse"],["impl EncodeAsMap for RuntimeNotifyEvent"]], +"oasis_runtime_sdk":[["impl EncodeAsMap for PublicKey"],["impl EncodeAsMap for AllowedEndorsement"],["impl EncodeAsMap for SignatureAddressSpec"],["impl EncodeAsMap for AddressSpec"],["impl EncodeAsMap for AuthProof"],["impl EncodeAsMap for CallResult"],["impl EncodeAsMap for CallerAddress"],["impl EncodeAsMap for Config"],["impl EncodeAsMap for Signer"],["impl EncodeAsMap for QueryRequest"],["impl EncodeAsMap for GasCosts"],["impl EncodeAsMap for Genesis"],["impl EncodeAsMap for Parameters"],["impl EncodeAsMap for Account"],["impl EncodeAsMap for AccountBalances"],["impl EncodeAsMap for AddressesQuery"],["impl EncodeAsMap for BalancesQuery"],["impl EncodeAsMap for DenominationInfo"],["impl EncodeAsMap for DenominationInfoQuery"],["impl EncodeAsMap for NonceQuery"],["impl EncodeAsMap for Transfer"],["impl EncodeAsMap for GasCosts"],["impl EncodeAsMap for Genesis"],["impl EncodeAsMap for Parameters"],["impl EncodeAsMap for RoundRootBody"],["impl EncodeAsMap for GasCosts"],["impl EncodeAsMap for Genesis"],["impl EncodeAsMap for Parameters"],["impl EncodeAsMap for AccountBalance"],["impl EncodeAsMap for BalanceQuery"],["impl EncodeAsMap for ConsensusAccountQuery"],["impl EncodeAsMap for ConsensusDelegateContext"],["impl EncodeAsMap for ConsensusError"],["impl EncodeAsMap for ConsensusTransferContext"],["impl EncodeAsMap for ConsensusUndelegateContext"],["impl EncodeAsMap for ConsensusWithdrawContext"],["impl EncodeAsMap for Delegate"],["impl EncodeAsMap for DelegationInfo"],["impl EncodeAsMap for DelegationQuery"],["impl EncodeAsMap for DelegationsQuery"],["impl EncodeAsMap for Deposit"],["impl EncodeAsMap for ExtendedDelegationInfo"],["impl EncodeAsMap for Receipt"],["impl EncodeAsMap for TakeReceipt"],["impl EncodeAsMap for Undelegate"],["impl EncodeAsMap for UndelegationInfo"],["impl EncodeAsMap for UndelegationsQuery"],["impl EncodeAsMap for Withdraw"],["impl EncodeAsMap for DynamicMinGasPrice"],["impl EncodeAsMap for GasCosts"],["impl EncodeAsMap for Genesis"],["impl EncodeAsMap for LocalConfig"],["impl EncodeAsMap for Parameters"],["impl EncodeAsMap for CallDataPublicKeyQueryResponse"],["impl EncodeAsMap for EstimateGasQuery"],["impl EncodeAsMap for ExecuteReadOnlyTxQuery"],["impl EncodeAsMap for ExecuteReadOnlyTxResponse"],["impl EncodeAsMap for Metadata"],["impl EncodeAsMap for MethodHandlerInfo"],["impl EncodeAsMap for ModuleInfo"],["impl EncodeAsMap for RuntimeInfoResponse"],["impl EncodeAsMap for Genesis"],["impl EncodeAsMap for Parameters"],["impl EncodeAsMap for EpochRewards"],["impl EncodeAsMap for RewardSchedule"],["impl EncodeAsMap for RewardStep"],["impl EncodeAsMap for AppAuthPolicy"],["impl EncodeAsMap for Genesis"],["impl EncodeAsMap for Parameters"],["impl EncodeAsMap for AppConfig"],["impl EncodeAsMap for AppInstanceQuery"],["impl EncodeAsMap for AppQuery"],["impl EncodeAsMap for Create"],["impl EncodeAsMap for Register"],["impl EncodeAsMap for Registration"],["impl EncodeAsMap for Remove"],["impl EncodeAsMap for StakeThresholds"],["impl EncodeAsMap for Update"],["impl EncodeAsMap for CallEnvelopeX25519DeoxysII"],["impl EncodeAsMap for ResultEnvelopeX25519DeoxysII"],["impl EncodeAsMap for MessageEventHookInvocation"],["impl EncodeAsMap for AuthInfo"],["impl EncodeAsMap for Call"],["impl EncodeAsMap for Fee"],["impl EncodeAsMap for FeeProxy"],["impl EncodeAsMap for SignerInfo"],["impl EncodeAsMap for Transaction"]], +"oasis_runtime_sdk_contracts":[["impl EncodeAsMap for Policy"],["impl EncodeAsMap for GasCosts"],["impl EncodeAsMap for Genesis"],["impl EncodeAsMap for LocalConfig"],["impl EncodeAsMap for Parameters"],["impl EncodeAsMap for Call"],["impl EncodeAsMap for ChangeUpgradePolicy"],["impl EncodeAsMap for Code"],["impl EncodeAsMap for CodeQuery"],["impl EncodeAsMap for CodeStorageQuery"],["impl EncodeAsMap for CodeStorageQueryResult"],["impl EncodeAsMap for ContractEvent"],["impl EncodeAsMap for CustomQuery"],["impl EncodeAsMap for Instance"],["impl EncodeAsMap for InstanceQuery"],["impl EncodeAsMap for InstanceRawStorageQuery"],["impl EncodeAsMap for InstanceRawStorageQueryResult"],["impl EncodeAsMap for InstanceStorageQuery"],["impl EncodeAsMap for InstanceStorageQueryResult"],["impl EncodeAsMap for Instantiate"],["impl EncodeAsMap for InstantiateResult"],["impl EncodeAsMap for PublicKeyQuery"],["impl EncodeAsMap for PublicKeyQueryResult"],["impl EncodeAsMap for Upgrade"],["impl EncodeAsMap for Upload"],["impl EncodeAsMap for UploadResult"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk/context/trait.Context.js b/rust/trait.impl/oasis_contract_sdk/context/trait.Context.js new file mode 100644 index 0000000000..d7bd3661e8 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk/context/trait.Context.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk/env/trait.Crypto.js b/rust/trait.impl/oasis_contract_sdk/env/trait.Crypto.js new file mode 100644 index 0000000000..d7bd3661e8 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk/env/trait.Crypto.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk/env/trait.Env.js b/rust/trait.impl/oasis_contract_sdk/env/trait.Env.js new file mode 100644 index 0000000000..d7bd3661e8 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk/env/trait.Env.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk/error/trait.Error.js b/rust/trait.impl/oasis_contract_sdk/error/trait.Error.js new file mode 100644 index 0000000000..d7bd3661e8 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk/error/trait.Error.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk/event/trait.Event.js b/rust/trait.impl/oasis_contract_sdk/event/trait.Event.js new file mode 100644 index 0000000000..d7bd3661e8 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk/event/trait.Event.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk/storage/trait.ConfidentialStore.js b/rust/trait.impl/oasis_contract_sdk/storage/trait.ConfidentialStore.js new file mode 100644 index 0000000000..d7bd3661e8 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk/storage/trait.ConfidentialStore.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk/storage/trait.PublicStore.js b/rust/trait.impl/oasis_contract_sdk/storage/trait.PublicStore.js new file mode 100644 index 0000000000..d7bd3661e8 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk/storage/trait.PublicStore.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk/storage/trait.Store.js b/rust/trait.impl/oasis_contract_sdk/storage/trait.Store.js new file mode 100644 index 0000000000..d7bd3661e8 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk/storage/trait.Store.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk_storage/map/trait.Integer.js b/rust/trait.impl/oasis_contract_sdk_storage/map/trait.Integer.js new file mode 100644 index 0000000000..847cc3e005 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk_storage/map/trait.Integer.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk_storage":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_contract_sdk_storage/map/trait.MapKey.js b/rust/trait.impl/oasis_contract_sdk_storage/map/trait.MapKey.js new file mode 100644 index 0000000000..847cc3e005 --- /dev/null +++ b/rust/trait.impl/oasis_contract_sdk_storage/map/trait.MapKey.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_contract_sdk_storage":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/app/trait.App.js b/rust/trait.impl/oasis_core_runtime/app/trait.App.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/app/trait.App.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/common/crypto/mrae/deoxysii/trait.Opener.js b/rust/trait.impl/oasis_core_runtime/common/crypto/mrae/deoxysii/trait.Opener.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/common/crypto/mrae/deoxysii/trait.Opener.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/common/crypto/signature/trait.Signer.js b/rust/trait.impl/oasis_core_runtime/common/crypto/signature/trait.Signer.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/common/crypto/signature/trait.Signer.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/common/key_format/trait.KeyFormatAtom.js b/rust/trait.impl/oasis_core_runtime/common/key_format/trait.KeyFormatAtom.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/common/key_format/trait.KeyFormatAtom.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/consensus/roothash/commitment/pool/trait.MessageValidator.js b/rust/trait.impl/oasis_core_runtime/consensus/roothash/commitment/pool/trait.MessageValidator.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/consensus/roothash/commitment/pool/trait.MessageValidator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/consensus/roothash/commitment/trait.OpenCommitment.js b/rust/trait.impl/oasis_core_runtime/consensus/roothash/commitment/trait.OpenCommitment.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/consensus/roothash/commitment/trait.OpenCommitment.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/consensus/verifier/trait.Verifier.js b/rust/trait.impl/oasis_core_runtime/consensus/verifier/trait.Verifier.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/consensus/verifier/trait.Verifier.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/dispatcher/trait.Initializer.js b/rust/trait.impl/oasis_core_runtime/dispatcher/trait.Initializer.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/dispatcher/trait.Initializer.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandler.js b/rust/trait.impl/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandler.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/enclave_rpc/dispatcher/trait.MethodHandler.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/host/trait.Host.js b/rust/trait.impl/oasis_core_runtime/host/trait.Host.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/host/trait.Host.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/storage/mkvs/marshal/trait.Marshal.js b/rust/trait.impl/oasis_core_runtime/storage/mkvs/marshal/trait.Marshal.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/storage/mkvs/marshal/trait.Marshal.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/storage/mkvs/sync/trait.ReadSync.js b/rust/trait.impl/oasis_core_runtime/storage/mkvs/sync/trait.ReadSync.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/storage/mkvs/sync/trait.ReadSync.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.FallibleMKVS.js b/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.FallibleMKVS.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.FallibleMKVS.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.ImmutableMKVS.js b/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.ImmutableMKVS.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.ImmutableMKVS.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.MKVS.js b/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.MKVS.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/storage/mkvs/trait.MKVS.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/storage/trait.KeyValue.js b/rust/trait.impl/oasis_core_runtime/storage/trait.KeyValue.js new file mode 100644 index 0000000000..31577b9ca6 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/storage/trait.KeyValue.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_core_runtime/transaction/dispatcher/trait.Dispatcher.js b/rust/trait.impl/oasis_core_runtime/transaction/dispatcher/trait.Dispatcher.js new file mode 100644 index 0000000000..71f9149b31 --- /dev/null +++ b/rust/trait.impl/oasis_core_runtime/transaction/dispatcher/trait.Dispatcher.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_core_runtime":[], +"oasis_runtime_sdk":[["impl<R: Runtime + Send + Sync> Dispatcher for Dispatcher<R>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/context/trait.Context.js b/rust/trait.impl/oasis_runtime_sdk/context/trait.Context.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/context/trait.Context.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/crypto/signature/trait.Signer.js b/rust/trait.impl/oasis_runtime_sdk/crypto/signature/trait.Signer.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/crypto/signature/trait.Signer.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/error/trait.Error.js b/rust/trait.impl/oasis_runtime_sdk/error/trait.Error.js new file mode 100644 index 0000000000..c1eb206b29 --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/error/trait.Error.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl Error for Error"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/event/trait.Event.js b/rust/trait.impl/oasis_runtime_sdk/event/trait.Event.js new file mode 100644 index 0000000000..736dc14cd1 --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/event/trait.Event.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl Event for Event"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/event/trait.IntoTags.js b/rust/trait.impl/oasis_runtime_sdk/event/trait.IntoTags.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/event/trait.IntoTags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/history/trait.HistoryHost.js b/rust/trait.impl/oasis_runtime_sdk/history/trait.HistoryHost.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/history/trait.HistoryHost.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/keymanager/trait.KeyManager.js b/rust/trait.impl/oasis_runtime_sdk/keymanager/trait.KeyManager.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/keymanager/trait.KeyManager.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.BlockHandler.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.BlockHandler.js new file mode 100644 index 0000000000..6a4b28bb43 --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.BlockHandler.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl<Cfg: Config> BlockHandler for Module<Cfg>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.FeeProxyHandler.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.FeeProxyHandler.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.FeeProxyHandler.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.InvariantHandler.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.InvariantHandler.js new file mode 100644 index 0000000000..b9dd5d089e --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.InvariantHandler.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl<Cfg: Config> InvariantHandler for Module<Cfg>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.MethodHandler.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.MethodHandler.js new file mode 100644 index 0000000000..4227a75d84 --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.MethodHandler.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl<Cfg: Config> MethodHandler for Module<Cfg>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.MigrationHandler.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.MigrationHandler.js new file mode 100644 index 0000000000..7eb560d4a3 --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.MigrationHandler.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl<Cfg: Config> MigrationHandler for Module<Cfg>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.Module.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.Module.js new file mode 100644 index 0000000000..960e0293e3 --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.Module.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl<Cfg: Config> Module for Module<Cfg>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.ModuleInfoHandler.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.ModuleInfoHandler.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.ModuleInfoHandler.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.Parameters.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.Parameters.js new file mode 100644 index 0000000000..16d94698a1 --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.Parameters.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl Parameters for Parameters"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/module/trait.TransactionHandler.js b/rust/trait.impl/oasis_runtime_sdk/module/trait.TransactionHandler.js new file mode 100644 index 0000000000..7273d48b4e --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/module/trait.TransactionHandler.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[], +"oasis_runtime_sdk_contracts":[["impl<Cfg: Config> TransactionHandler for Module<Cfg>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/modules/accounts/trait.API.js b/rust/trait.impl/oasis_runtime_sdk/modules/accounts/trait.API.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/modules/accounts/trait.API.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/modules/consensus/trait.API.js b/rust/trait.impl/oasis_runtime_sdk/modules/consensus/trait.API.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/modules/consensus/trait.API.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/modules/consensus_accounts/trait.API.js b/rust/trait.impl/oasis_runtime_sdk/modules/consensus_accounts/trait.API.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/modules/consensus_accounts/trait.API.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/modules/core/trait.API.js b/rust/trait.impl/oasis_runtime_sdk/modules/core/trait.API.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/modules/core/trait.API.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/modules/core/trait.Config.js b/rust/trait.impl/oasis_runtime_sdk/modules/core/trait.Config.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/modules/core/trait.Config.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/modules/rofl/trait.API.js b/rust/trait.impl/oasis_runtime_sdk/modules/rofl/trait.API.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/modules/rofl/trait.API.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/runtime/trait.Runtime.js b/rust/trait.impl/oasis_runtime_sdk/runtime/trait.Runtime.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/runtime/trait.Runtime.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/schedule_control/trait.ScheduleControlHost.js b/rust/trait.impl/oasis_runtime_sdk/schedule_control/trait.ScheduleControlHost.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/schedule_control/trait.ScheduleControlHost.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/storage/trait.NestedStore.js b/rust/trait.impl/oasis_runtime_sdk/storage/trait.NestedStore.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/storage/trait.NestedStore.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/storage/trait.Store.js b/rust/trait.impl/oasis_runtime_sdk/storage/trait.Store.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/storage/trait.Store.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/oasis_runtime_sdk/subcall/trait.Validator.js b/rust/trait.impl/oasis_runtime_sdk/subcall/trait.Validator.js new file mode 100644 index 0000000000..a4a057cacd --- /dev/null +++ b/rust/trait.impl/oasis_runtime_sdk/subcall/trait.Validator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/rand_core/trait.CryptoRng.js b/rust/trait.impl/rand_core/trait.CryptoRng.js new file mode 100644 index 0000000000..3af14ded1c --- /dev/null +++ b/rust/trait.impl/rand_core/trait.CryptoRng.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[["impl CryptoRng for LeafRng"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/rand_core/trait.RngCore.js b/rust/trait.impl/rand_core/trait.RngCore.js new file mode 100644 index 0000000000..f050f75662 --- /dev/null +++ b/rust/trait.impl/rand_core/trait.RngCore.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[["impl RngCore for LeafRng"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/slog/trait.Value.js b/rust/trait.impl/slog/trait.Value.js new file mode 100644 index 0000000000..8959efb186 --- /dev/null +++ b/rust/trait.impl/slog/trait.Value.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_runtime_sdk":[["impl Value for AppId"],["impl Value for Address"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/std/io/trait.Read.js b/rust/trait.impl/std/io/trait.Read.js new file mode 100644 index 0000000000..a3b7ea9183 --- /dev/null +++ b/rust/trait.impl/std/io/trait.Read.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Read for &Stream"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/std/io/trait.Write.js b/rust/trait.impl/std/io/trait.Write.js new file mode 100644 index 0000000000..8f18944431 --- /dev/null +++ b/rust/trait.impl/std/io/trait.Write.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Write for &Stream"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/tendermint_proto/trait.Protobuf.js b/rust/trait.impl/tendermint_proto/trait.Protobuf.js new file mode 100644 index 0000000000..fd7d361003 --- /dev/null +++ b/rust/trait.impl/tendermint_proto/trait.Protobuf.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Protobuf<LightBlock> for LightBlockMeta"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/trait.impl/zeroize/trait.Zeroize.js b/rust/trait.impl/zeroize/trait.Zeroize.js new file mode 100644 index 0000000000..a52595c8ca --- /dev/null +++ b/rust/trait.impl/zeroize/trait.Zeroize.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"oasis_core_runtime":[["impl Zeroize for Hash"],["impl Zeroize for PublicKey"],["impl Zeroize for Signature"],["impl Zeroize for PrivateKey"],["impl Zeroize for Namespace"],["impl Zeroize for MrEnclave"],["impl Zeroize for MrSigner"],["impl Zeroize for SessionID"]], +"oasis_runtime_sdk":[["impl<S: Store> Zeroize for ConfidentialStore<S>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/rust/type.impl/alloc/collections/btree/map/struct.BTreeMap.js b/rust/type.impl/alloc/collections/btree/map/struct.BTreeMap.js new file mode 100644 index 0000000000..592e30c241 --- /dev/null +++ b/rust/type.impl/alloc/collections/btree/map/struct.BTreeMap.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_runtime_sdk":[["
§

impl<K, V> AggregatePublicKey for BTreeMap<K, V>
where\n K: Borrow<PublicKey> + Ord,

§

fn weighting(&self, choice: &PublicKey) -> Option<Scalar>

👎Deprecated since 0.11.0: This module will be replaced in the future
Return delinearization weighting for one of many public keys being aggregated.
§

fn public_key(&self) -> PublicKey

👎Deprecated since 0.11.0: This module will be replaced in the future
Returns aggregated public key.
","AggregatePublicKey","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
§

impl<'a, K, V> Arbitrary<'a> for BTreeMap<K, V>
where\n K: Arbitrary<'a> + Ord,\n V: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<BTreeMap<K, V>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<BTreeMap<K, V>, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
§

fn size_hint(_depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
","Arbitrary<'a>","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
source§

impl<K, V> BTreeMap<K, V>

1.0.0 (const: 1.66.0) · source

pub const fn new() -> BTreeMap<K, V>

Makes a new, empty BTreeMap.

\n

Does not allocate anything on its own.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
\n
",0,"oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn iter(&self) -> Iter<'_, K, V>

Gets an iterator over the entries of the map, sorted by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"c\");\nmap.insert(2, \"b\");\nmap.insert(1, \"a\");\n\nfor (key, value) in map.iter() {\n    println!(\"{key}: {value}\");\n}\n\nlet (first_key, first_value) = map.iter().next().unwrap();\nassert_eq!((*first_key, *first_value), (1, \"a\"));
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, K, V>

Gets a mutable iterator over the entries of the map, sorted by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::from([\n   (\"a\", 1),\n   (\"b\", 2),\n   (\"c\", 3),\n]);\n\n// add 10 to the value if the key isn't \"a\"\nfor (key, value) in map.iter_mut() {\n    if key != &\"a\" {\n        *value += 10;\n    }\n}
\n
1.0.0 · source

pub fn keys(&self) -> Keys<'_, K, V>

Gets an iterator over the keys of the map, in sorted order.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<_> = a.keys().cloned().collect();\nassert_eq!(keys, [1, 2]);
\n
1.0.0 · source

pub fn values(&self) -> Values<'_, K, V>

Gets an iterator over the values of the map, in order by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.values().cloned().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
\n
1.10.0 · source

pub fn values_mut(&mut self) -> ValuesMut<'_, K, V>

Gets a mutable iterator over the values of the map, in order by key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, String::from(\"hello\"));\na.insert(2, String::from(\"goodbye\"));\n\nfor value in a.values_mut() {\n    value.push_str(\"!\");\n}\n\nlet values: Vec<String> = a.values().cloned().collect();\nassert_eq!(values, [String::from(\"hello!\"),\n                    String::from(\"goodbye!\")]);
\n
1.0.0 (const: unstable) · source

pub fn len(&self) -> usize

Returns the number of elements in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\nassert_eq!(a.len(), 0);\na.insert(1, \"a\");\nassert_eq!(a.len(), 1);
\n
1.0.0 (const: unstable) · source

pub fn is_empty(&self) -> bool

Returns true if the map contains no elements.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\nassert!(a.is_empty());\na.insert(1, \"a\");\nassert!(!a.is_empty());
\n
source

pub fn lower_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a Cursor pointing at the gap before the smallest key\ngreater than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.lower_bound(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &\"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &\"b\")));\n\nlet cursor = map.lower_bound(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.lower_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &\"a\")));
\n
source

pub fn lower_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a CursorMut pointing at the gap before the smallest key\ngreater than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap before the smallest key greater than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap before the smallest key greater than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap before the smallest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.lower_bound_mut(Bound::Included(&2));\nassert_eq!(cursor.peek_prev(), Some((&1, &mut \"a\")));\nassert_eq!(cursor.peek_next(), Some((&2, &mut \"b\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Excluded(&2));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.lower_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), None);\nassert_eq!(cursor.peek_next(), Some((&1, &mut \"a\")));
\n
source

pub fn upper_bound<Q>(&self, bound: Bound<&Q>) -> Cursor<'_, K, V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a Cursor pointing at the gap after the greatest key\nsmaller than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet cursor = map.upper_bound(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &\"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &\"d\")));\n\nlet cursor = map.upper_bound(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &\"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &\"c\")));\n\nlet cursor = map.upper_bound(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &\"d\")));\nassert_eq!(cursor.peek_next(), None);
\n
source

pub fn upper_bound_mut<Q>(&mut self, bound: Bound<&Q>) -> CursorMut<'_, K, V, A>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

🔬This is a nightly-only experimental API. (btree_cursors)

Returns a CursorMut pointing at the gap after the greatest key\nsmaller than the given bound.

\n

Passing Bound::Included(x) will return a cursor pointing to the\ngap after the greatest key smaller than or equal to x.

\n

Passing Bound::Excluded(x) will return a cursor pointing to the\ngap after the greatest key smaller than x.

\n

Passing Bound::Unbounded will return a cursor pointing to the\ngap after the greatest key in the map.

\n
§Examples
\n
#![feature(btree_cursors)]\n\nuse std::collections::BTreeMap;\nuse std::ops::Bound;\n\nlet mut map = BTreeMap::from([\n    (1, \"a\"),\n    (2, \"b\"),\n    (3, \"c\"),\n    (4, \"d\"),\n]);\n\nlet mut cursor = map.upper_bound_mut(Bound::Included(&3));\nassert_eq!(cursor.peek_prev(), Some((&3, &mut \"c\")));\nassert_eq!(cursor.peek_next(), Some((&4, &mut \"d\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Excluded(&3));\nassert_eq!(cursor.peek_prev(), Some((&2, &mut \"b\")));\nassert_eq!(cursor.peek_next(), Some((&3, &mut \"c\")));\n\nlet mut cursor = map.upper_bound_mut(Bound::Unbounded);\nassert_eq!(cursor.peek_prev(), Some((&4, &mut \"d\")));\nassert_eq!(cursor.peek_next(), None);
\n
",0,"oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn clear(&mut self)

Clears the map, removing all elements.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.clear();\nassert!(a.is_empty());
\n
source

pub const fn new_in(alloc: A) -> BTreeMap<K, V, A>

🔬This is a nightly-only experimental API. (btreemap_alloc)

Makes a new empty BTreeMap with a reasonable choice for B.

\n
§Examples
\n
use std::collections::BTreeMap;\nuse std::alloc::Global;\n\nlet mut map = BTreeMap::new_in(Global);\n\n// entries can now be inserted into the empty map\nmap.insert(1, \"a\");
\n
",0,"oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
source§

impl<K, V, A> BTreeMap<K, V, A>
where\n A: Allocator + Clone,

1.0.0 · source

pub fn get<Q>(&self, key: &Q) -> Option<&V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns a reference to the value corresponding to the key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.get(&1), Some(&\"a\"));\nassert_eq!(map.get(&2), None);
\n
1.40.0 · source

pub fn get_key_value<Q>(&self, k: &Q) -> Option<(&K, &V)>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns the key-value pair corresponding to the supplied key.

\n

The supplied key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.get_key_value(&1), Some((&1, &\"a\")));\nassert_eq!(map.get_key_value(&2), None);
\n
1.66.0 · source

pub fn first_key_value(&self) -> Option<(&K, &V)>
where\n K: Ord,

Returns the first key-value pair in the map.\nThe key in this pair is the minimum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.first_key_value(), None);\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.first_key_value(), Some((&1, &\"b\")));
\n
1.66.0 · source

pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
where\n K: Ord,

Returns the first entry in the map for in-place manipulation.\nThe key of this entry is the minimum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.first_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"first\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"first\");\nassert_eq!(*map.get(&2).unwrap(), \"b\");
\n
1.66.0 · source

pub fn pop_first(&mut self) -> Option<(K, V)>
where\n K: Ord,

Removes and returns the first element in the map.\nThe key of this element is the minimum key that was in the map.

\n
§Examples
\n

Draining elements in ascending order, while keeping a usable map each iteration.

\n\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_first() {\n    assert!(map.iter().all(|(k, _v)| *k > key));\n}\nassert!(map.is_empty());
\n
1.66.0 · source

pub fn last_key_value(&self) -> Option<(&K, &V)>
where\n K: Ord,

Returns the last key-value pair in the map.\nThe key in this pair is the maximum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"b\");\nmap.insert(2, \"a\");\nassert_eq!(map.last_key_value(), Some((&2, &\"a\")));
\n
1.66.0 · source

pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V, A>>
where\n K: Ord,

Returns the last entry in the map for in-place manipulation.\nThe key of this entry is the maximum key in the map.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nif let Some(mut entry) = map.last_entry() {\n    if *entry.key() > 0 {\n        entry.insert(\"last\");\n    }\n}\nassert_eq!(*map.get(&1).unwrap(), \"a\");\nassert_eq!(*map.get(&2).unwrap(), \"last\");
\n
1.66.0 · source

pub fn pop_last(&mut self) -> Option<(K, V)>
where\n K: Ord,

Removes and returns the last element in the map.\nThe key of this element is the maximum key that was in the map.

\n
§Examples
\n

Draining elements in descending order, while keeping a usable map each iteration.

\n\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nmap.insert(2, \"b\");\nwhile let Some((key, _val)) = map.pop_last() {\n    assert!(map.iter().all(|(k, _v)| *k < key));\n}\nassert!(map.is_empty());
\n
1.0.0 · source

pub fn contains_key<Q>(&self, key: &Q) -> bool
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns true if the map contains a value for the specified key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.contains_key(&1), true);\nassert_eq!(map.contains_key(&2), false);
\n
1.0.0 · source

pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns a mutable reference to the value corresponding to the key.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nif let Some(x) = map.get_mut(&1) {\n    *x = \"b\";\n}\nassert_eq!(map[&1], \"b\");
\n
1.0.0 · source

pub fn insert(&mut self, key: K, value: V) -> Option<V>
where\n K: Ord,

Inserts a key-value pair into the map.

\n

If the map did not have this key present, None is returned.

\n

If the map did have this key present, the value is updated, and the old\nvalue is returned. The key is not updated, though; this matters for\ntypes that can be == without being identical. See the module-level\ndocumentation for more.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.insert(37, \"a\"), None);\nassert_eq!(map.is_empty(), false);\n\nmap.insert(37, \"b\");\nassert_eq!(map.insert(37, \"c\"), Some(\"b\"));\nassert_eq!(map[&37], \"c\");
\n
source

pub fn try_insert(\n &mut self,\n key: K,\n value: V,\n) -> Result<&mut V, OccupiedError<'_, K, V, A>>
where\n K: Ord,

🔬This is a nightly-only experimental API. (map_try_insert)

Tries to insert a key-value pair into the map, and returns\na mutable reference to the value in the entry.

\n

If the map already had this key present, nothing is updated, and\nan error containing the occupied entry and the value is returned.

\n
§Examples
\n
#![feature(map_try_insert)]\n\nuse std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nassert_eq!(map.try_insert(37, \"a\").unwrap(), &\"a\");\n\nlet err = map.try_insert(37, \"b\").unwrap_err();\nassert_eq!(err.entry.key(), &37);\nassert_eq!(err.entry.get(), &\"a\");\nassert_eq!(err.value, \"b\");
\n
1.0.0 · source

pub fn remove<Q>(&mut self, key: &Q) -> Option<V>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Removes a key from the map, returning the value at the key if the key\nwas previously in the map.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.remove(&1), Some(\"a\"));\nassert_eq!(map.remove(&1), None);
\n
1.45.0 · source

pub fn remove_entry<Q>(&mut self, key: &Q) -> Option<(K, V)>
where\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Removes a key from the map, returning the stored key and value if the key\nwas previously in the map.

\n

The key may be any borrowed form of the map’s key type, but the ordering\non the borrowed form must match the ordering on the key type.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map = BTreeMap::new();\nmap.insert(1, \"a\");\nassert_eq!(map.remove_entry(&1), Some((1, \"a\")));\nassert_eq!(map.remove_entry(&1), None);
\n
1.53.0 · source

pub fn retain<F>(&mut self, f: F)
where\n K: Ord,\n F: FnMut(&K, &mut V) -> bool,

Retains only the elements specified by the predicate.

\n

In other words, remove all pairs (k, v) for which f(&k, &mut v) returns false.\nThe elements are visited in ascending key order.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();\n// Keep only the elements with even-numbered keys.\nmap.retain(|&k, _| k % 2 == 0);\nassert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
\n
1.11.0 · source

pub fn append(&mut self, other: &mut BTreeMap<K, V, A>)
where\n K: Ord,\n A: Clone,

Moves all elements from other into self, leaving other empty.

\n

If a key from other is already present in self, the respective\nvalue from self will be overwritten with the respective value from other.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\"); // Note: Key (3) also present in b.\n\nlet mut b = BTreeMap::new();\nb.insert(3, \"d\"); // Note: Key (3) also present in a.\nb.insert(4, \"e\");\nb.insert(5, \"f\");\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\nassert_eq!(a[&3], \"d\"); // Note: \"c\" has been overwritten.\nassert_eq!(a[&4], \"e\");\nassert_eq!(a[&5], \"f\");
\n
1.17.0 · source

pub fn range<T, R>(&self, range: R) -> Range<'_, K, V>
where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

Constructs a double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

\n
§Panics
\n

Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

\n
§Examples
\n
use std::collections::BTreeMap;\nuse std::ops::Bound::Included;\n\nlet mut map = BTreeMap::new();\nmap.insert(3, \"a\");\nmap.insert(5, \"b\");\nmap.insert(8, \"c\");\nfor (&key, &value) in map.range((Included(&4), Included(&8))) {\n    println!(\"{key}: {value}\");\n}\nassert_eq!(Some((&5, &\"b\")), map.range(4..).next());
\n
1.17.0 · source

pub fn range_mut<T, R>(&mut self, range: R) -> RangeMut<'_, K, V>
where\n T: Ord + ?Sized,\n K: Borrow<T> + Ord,\n R: RangeBounds<T>,

Constructs a mutable double-ended iterator over a sub-range of elements in the map.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

\n
§Panics
\n

Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut map: BTreeMap<&str, i32> =\n    [(\"Alice\", 0), (\"Bob\", 0), (\"Carol\", 0), (\"Cheryl\", 0)].into();\nfor (_, balance) in map.range_mut(\"B\"..\"Cheryl\") {\n    *balance += 100;\n}\nfor (name, balance) in &map {\n    println!(\"{name} => {balance}\");\n}
\n
1.0.0 · source

pub fn entry(&mut self, key: K) -> Entry<'_, K, V, A>
where\n K: Ord,

Gets the given key’s corresponding entry in the map for in-place manipulation.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut count: BTreeMap<&str, usize> = BTreeMap::new();\n\n// count the number of occurrences of letters in the vec\nfor x in [\"a\", \"b\", \"a\", \"c\", \"a\", \"b\"] {\n    count.entry(x).and_modify(|curr| *curr += 1).or_insert(1);\n}\n\nassert_eq!(count[\"a\"], 3);\nassert_eq!(count[\"b\"], 2);\nassert_eq!(count[\"c\"], 1);
\n
1.11.0 · source

pub fn split_off<Q>(&mut self, key: &Q) -> BTreeMap<K, V, A>
where\n Q: Ord + ?Sized,\n K: Borrow<Q> + Ord,\n A: Clone,

Splits the collection into two at the given key. Returns everything after the given key,\nincluding the key.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"a\");\na.insert(2, \"b\");\na.insert(3, \"c\");\na.insert(17, \"d\");\na.insert(41, \"e\");\n\nlet b = a.split_off(&3);\n\nassert_eq!(a.len(), 2);\nassert_eq!(b.len(), 3);\n\nassert_eq!(a[&1], \"a\");\nassert_eq!(a[&2], \"b\");\n\nassert_eq!(b[&3], \"c\");\nassert_eq!(b[&17], \"d\");\nassert_eq!(b[&41], \"e\");
\n
source

pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A>
where\n K: Ord,\n F: FnMut(&K, &mut V) -> bool,

🔬This is a nightly-only experimental API. (btree_extract_if)

Creates an iterator that visits all elements (key-value pairs) in\nascending key order and uses a closure to determine if an element should\nbe removed. If the closure returns true, the element is removed from\nthe map and yielded. If the closure returns false, or panics, the\nelement remains in the map and will not be yielded.

\n

The iterator also lets you mutate the value of each element in the\nclosure, regardless of whether you choose to keep or remove it.

\n

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating\nor the iteration short-circuits, then the remaining elements will be retained.\nUse retain with a negated predicate if you do not need the returned iterator.

\n
§Examples
\n

Splitting a map into even and odd keys, reusing the original map:

\n\n
#![feature(btree_extract_if)]\nuse std::collections::BTreeMap;\n\nlet mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x)).collect();\nlet evens: BTreeMap<_, _> = map.extract_if(|k, _v| k % 2 == 0).collect();\nlet odds = map;\nassert_eq!(evens.keys().copied().collect::<Vec<_>>(), [0, 2, 4, 6]);\nassert_eq!(odds.keys().copied().collect::<Vec<_>>(), [1, 3, 5, 7]);
\n
1.54.0 · source

pub fn into_keys(self) -> IntoKeys<K, V, A>

Creates a consuming iterator visiting all the keys, in sorted order.\nThe map cannot be used after calling this.\nThe iterator element type is K.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(2, \"b\");\na.insert(1, \"a\");\n\nlet keys: Vec<i32> = a.into_keys().collect();\nassert_eq!(keys, [1, 2]);
\n
1.54.0 · source

pub fn into_values(self) -> IntoValues<K, V, A>

Creates a consuming iterator visiting all the values, in order by key.\nThe map cannot be used after calling this.\nThe iterator element type is V.

\n
§Examples
\n
use std::collections::BTreeMap;\n\nlet mut a = BTreeMap::new();\na.insert(1, \"hello\");\na.insert(2, \"goodbye\");\n\nlet values: Vec<&str> = a.into_values().collect();\nassert_eq!(values, [\"hello\", \"goodbye\"]);
\n
",0,"oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> Clone for BTreeMap<K, V, A>
where\n K: Clone,\n V: Clone,\n A: Allocator + Clone,

source§

fn clone(&self) -> BTreeMap<K, V, A>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> Debug for BTreeMap<K, V, A>
where\n K: Debug,\n V: Debug,\n A: Allocator + Clone,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
§

impl<K, V> Decode for BTreeMap<K, V>
where\n K: Decode + Ord,\n V: Decode,

§

fn try_default() -> Result<BTreeMap<K, V>, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<BTreeMap<K, V>, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V> Default for BTreeMap<K, V>

source§

fn default() -> BTreeMap<K, V>

Creates an empty BTreeMap.

\n
","Default","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
source§

impl<'de, K, V> Deserialize<'de> for BTreeMap<K, V>
where\n K: Deserialize<'de> + Ord,\n V: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<BTreeMap<K, V>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.7.0 · source§

impl<K, V, A> Drop for BTreeMap<K, V, A>
where\n A: Allocator + Clone,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
","Drop","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
§

impl<K, V> Encode for BTreeMap<K, V>
where\n K: Encode,\n V: Encode,

§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
","Encode","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
§

impl<K, V> EncodeAsMap for BTreeMap<K, V>
where\n K: Encode,\n V: Encode,

§

fn into_cbor_value_map(self) -> Value
where\n Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where\n Self: Sized,

Encode the type into a CBOR Map, returning the map items.
","EncodeAsMap","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.2.0 · source§

impl<'a, K, V, A> Extend<(&'a K, &'a V)> for BTreeMap<K, V, A>
where\n K: Ord + Copy,\n V: Copy,\n A: Allocator + Clone,

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = (&'a K, &'a V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: (&'a K, &'a V))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(&'a K, &'a V)>","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> Extend<(K, V)> for BTreeMap<K, V, A>
where\n K: Ord,\n A: Allocator + Clone,

source§

fn extend<T>(&mut self, iter: T)
where\n T: IntoIterator<Item = (K, V)>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: (K, V))

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<(K, V)>","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.56.0 · source§

impl<K, V, const N: usize> From<[(K, V); N]> for BTreeMap<K, V>
where\n K: Ord,

source§

fn from(arr: [(K, V); N]) -> BTreeMap<K, V>

Converts a [(K, V); N] into a BTreeMap<(K, V)>.

\n\n
use std::collections::BTreeMap;\n\nlet map1 = BTreeMap::from([(1, 2), (3, 4)]);\nlet map2: BTreeMap<_, _> = [(1, 2), (3, 4)].into();\nassert_eq!(map1, map2);
\n
","From<[(K, V); N]>","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V> FromIterator<(K, V)> for BTreeMap<K, V>
where\n K: Ord,

source§

fn from_iter<T>(iter: T) -> BTreeMap<K, V>
where\n T: IntoIterator<Item = (K, V)>,

Creates a value from an iterator. Read more
","FromIterator<(K, V)>","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> Hash for BTreeMap<K, V, A>
where\n K: Hash,\n V: Hash,\n A: Allocator + Clone,

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, Q, V, A> Index<&Q> for BTreeMap<K, V, A>
where\n A: Allocator + Clone,\n K: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

source§

fn index(&self, key: &Q) -> &V

Returns a reference to the value corresponding to the supplied key.

\n
§Panics
\n

Panics if the key is not present in the BTreeMap.

\n
§

type Output = V

The returned type after indexing.
","Index<&Q>","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
source§

impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap<K, V>
where\n K: IntoDeserializer<'de, E> + Eq + Ord,\n V: IntoDeserializer<'de, E>,\n E: Error,

§

type Deserializer = MapDeserializer<'de, <BTreeMap<K, V> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
source§

fn into_deserializer(\n self,\n) -> <BTreeMap<K, V> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> IntoIterator for BTreeMap<K, V, A>
where\n A: Allocator + Clone,

source§

fn into_iter(self) -> IntoIter<K, V, A>

Gets an owning iterator over the entries of the map, sorted by key.

\n
§

type Item = (K, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<K, V, A>

Which kind of iterator are we turning this into?
","IntoIterator","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> Ord for BTreeMap<K, V, A>
where\n K: Ord,\n V: Ord,\n A: Allocator + Clone,

source§

fn cmp(&self, other: &BTreeMap<K, V, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> PartialEq for BTreeMap<K, V, A>
where\n K: PartialEq,\n V: PartialEq,\n A: Allocator + Clone,

source§

fn eq(&self, other: &BTreeMap<K, V, A>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> PartialOrd for BTreeMap<K, V, A>
where\n K: PartialOrd,\n V: PartialOrd,\n A: Allocator + Clone,

source§

fn partial_cmp(&self, other: &BTreeMap<K, V, A>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
source§

impl<K, V> Serialize for BTreeMap<K, V>
where\n K: Serialize,\n V: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.0.0 · source§

impl<K, V, A> Eq for BTreeMap<K, V, A>
where\n K: Eq,\n V: Eq,\n A: Allocator + Clone,

","Eq","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"],["
1.64.0 · source§

impl<K, V, A> UnwindSafe for BTreeMap<K, V, A>

","UnwindSafe","oasis_runtime_sdk::event::EventTags","oasis_runtime_sdk::modules::access::types::Methods"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/alloc/collections/btree/set/struct.BTreeSet.js b/rust/type.impl/alloc/collections/btree/set/struct.BTreeSet.js new file mode 100644 index 0000000000..7b4bbd4449 --- /dev/null +++ b/rust/type.impl/alloc/collections/btree/set/struct.BTreeSet.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_runtime_sdk":[["
§

impl<'a, A> Arbitrary<'a> for BTreeSet<A>
where\n A: Arbitrary<'a> + Ord,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<BTreeSet<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<BTreeSet<A>, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
§

fn size_hint(_depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
","Arbitrary<'a>","oasis_runtime_sdk::modules::access::types::Addresses"],["
source§

impl<T> BTreeSet<T>

1.0.0 (const: 1.66.0) · source

pub const fn new() -> BTreeSet<T>

Makes a new, empty BTreeSet.

\n

Does not allocate anything on its own.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut set: BTreeSet<i32> = BTreeSet::new();
\n
",0,"oasis_runtime_sdk::modules::access::types::Addresses"],["
source§

impl<T, A> BTreeSet<T, A>
where\n A: Allocator + Clone,

source

pub const fn new_in(alloc: A) -> BTreeSet<T, A>

🔬This is a nightly-only experimental API. (btreemap_alloc)

Makes a new BTreeSet with a reasonable choice of B.

\n
§Examples
\n
use std::collections::BTreeSet;\nuse std::alloc::Global;\n\nlet mut set: BTreeSet<i32> = BTreeSet::new_in(Global);
\n
1.17.0 · source

pub fn range<K, R>(&self, range: R) -> Range<'_, T>
where\n K: Ord + ?Sized,\n T: Borrow<K> + Ord,\n R: RangeBounds<K>,

Constructs a double-ended iterator over a sub-range of elements in the set.\nThe simplest way is to use the range syntax min..max, thus range(min..max) will\nyield elements from min (inclusive) to max (exclusive).\nThe range may also be entered as (Bound<T>, Bound<T>), so for example\nrange((Excluded(4), Included(10))) will yield a left-exclusive, right-inclusive\nrange from 4 to 10.

\n
§Panics
\n

Panics if range start > end.\nPanics if range start == end and both bounds are Excluded.

\n
§Examples
\n
use std::collections::BTreeSet;\nuse std::ops::Bound::Included;\n\nlet mut set = BTreeSet::new();\nset.insert(3);\nset.insert(5);\nset.insert(8);\nfor &elem in set.range((Included(&4), Included(&8))) {\n    println!(\"{elem}\");\n}\nassert_eq!(Some(&5), set.range(4..).next());
\n
1.0.0 · source

pub fn difference<'a>(\n &'a self,\n other: &'a BTreeSet<T, A>,\n) -> Difference<'a, T, A>
where\n T: Ord,

Visits the elements representing the difference,\ni.e., the elements that are in self but not in other,\nin ascending order.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut a = BTreeSet::new();\na.insert(1);\na.insert(2);\n\nlet mut b = BTreeSet::new();\nb.insert(2);\nb.insert(3);\n\nlet diff: Vec<_> = a.difference(&b).cloned().collect();\nassert_eq!(diff, [1]);
\n
1.0.0 · source

pub fn symmetric_difference<'a>(\n &'a self,\n other: &'a BTreeSet<T, A>,\n) -> SymmetricDifference<'a, T>
where\n T: Ord,

Visits the elements representing the symmetric difference,\ni.e., the elements that are in self or in other but not in both,\nin ascending order.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut a = BTreeSet::new();\na.insert(1);\na.insert(2);\n\nlet mut b = BTreeSet::new();\nb.insert(2);\nb.insert(3);\n\nlet sym_diff: Vec<_> = a.symmetric_difference(&b).cloned().collect();\nassert_eq!(sym_diff, [1, 3]);
\n
1.0.0 · source

pub fn intersection<'a>(\n &'a self,\n other: &'a BTreeSet<T, A>,\n) -> Intersection<'a, T, A>
where\n T: Ord,

Visits the elements representing the intersection,\ni.e., the elements that are both in self and other,\nin ascending order.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut a = BTreeSet::new();\na.insert(1);\na.insert(2);\n\nlet mut b = BTreeSet::new();\nb.insert(2);\nb.insert(3);\n\nlet intersection: Vec<_> = a.intersection(&b).cloned().collect();\nassert_eq!(intersection, [2]);
\n
1.0.0 · source

pub fn union<'a>(&'a self, other: &'a BTreeSet<T, A>) -> Union<'a, T>
where\n T: Ord,

Visits the elements representing the union,\ni.e., all the elements in self or other, without duplicates,\nin ascending order.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut a = BTreeSet::new();\na.insert(1);\n\nlet mut b = BTreeSet::new();\nb.insert(2);\n\nlet union: Vec<_> = a.union(&b).cloned().collect();\nassert_eq!(union, [1, 2]);
\n
1.0.0 · source

pub fn clear(&mut self)
where\n A: Clone,

Clears the set, removing all elements.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut v = BTreeSet::new();\nv.insert(1);\nv.clear();\nassert!(v.is_empty());
\n
1.0.0 · source

pub fn contains<Q>(&self, value: &Q) -> bool
where\n T: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns true if the set contains an element equal to the value.

\n

The value may be any borrowed form of the set’s element type,\nbut the ordering on the borrowed form must match the\nordering on the element type.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet set = BTreeSet::from([1, 2, 3]);\nassert_eq!(set.contains(&1), true);\nassert_eq!(set.contains(&4), false);
\n
1.9.0 · source

pub fn get<Q>(&self, value: &Q) -> Option<&T>
where\n T: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Returns a reference to the element in the set, if any, that is equal to\nthe value.

\n

The value may be any borrowed form of the set’s element type,\nbut the ordering on the borrowed form must match the\nordering on the element type.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet set = BTreeSet::from([1, 2, 3]);\nassert_eq!(set.get(&2), Some(&2));\nassert_eq!(set.get(&4), None);
\n
1.0.0 · source

pub fn is_disjoint(&self, other: &BTreeSet<T, A>) -> bool
where\n T: Ord,

Returns true if self has no elements in common with other.\nThis is equivalent to checking for an empty intersection.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet a = BTreeSet::from([1, 2, 3]);\nlet mut b = BTreeSet::new();\n\nassert_eq!(a.is_disjoint(&b), true);\nb.insert(4);\nassert_eq!(a.is_disjoint(&b), true);\nb.insert(1);\nassert_eq!(a.is_disjoint(&b), false);
\n
1.0.0 · source

pub fn is_subset(&self, other: &BTreeSet<T, A>) -> bool
where\n T: Ord,

Returns true if the set is a subset of another,\ni.e., other contains at least all the elements in self.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet sup = BTreeSet::from([1, 2, 3]);\nlet mut set = BTreeSet::new();\n\nassert_eq!(set.is_subset(&sup), true);\nset.insert(2);\nassert_eq!(set.is_subset(&sup), true);\nset.insert(4);\nassert_eq!(set.is_subset(&sup), false);
\n
1.0.0 · source

pub fn is_superset(&self, other: &BTreeSet<T, A>) -> bool
where\n T: Ord,

Returns true if the set is a superset of another,\ni.e., self contains at least all the elements in other.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet sub = BTreeSet::from([1, 2]);\nlet mut set = BTreeSet::new();\n\nassert_eq!(set.is_superset(&sub), false);\n\nset.insert(0);\nset.insert(1);\nassert_eq!(set.is_superset(&sub), false);\n\nset.insert(2);\nassert_eq!(set.is_superset(&sub), true);
\n
1.66.0 · source

pub fn first(&self) -> Option<&T>
where\n T: Ord,

Returns a reference to the first element in the set, if any.\nThis element is always the minimum of all elements in the set.

\n
§Examples
\n

Basic usage:

\n\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::new();\nassert_eq!(set.first(), None);\nset.insert(1);\nassert_eq!(set.first(), Some(&1));\nset.insert(2);\nassert_eq!(set.first(), Some(&1));
\n
1.66.0 · source

pub fn last(&self) -> Option<&T>
where\n T: Ord,

Returns a reference to the last element in the set, if any.\nThis element is always the maximum of all elements in the set.

\n
§Examples
\n

Basic usage:

\n\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::new();\nassert_eq!(set.last(), None);\nset.insert(1);\nassert_eq!(set.last(), Some(&1));\nset.insert(2);\nassert_eq!(set.last(), Some(&2));
\n
1.66.0 · source

pub fn pop_first(&mut self) -> Option<T>
where\n T: Ord,

Removes the first element from the set and returns it, if any.\nThe first element is always the minimum element in the set.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::new();\n\nset.insert(1);\nwhile let Some(n) = set.pop_first() {\n    assert_eq!(n, 1);\n}\nassert!(set.is_empty());
\n
1.66.0 · source

pub fn pop_last(&mut self) -> Option<T>
where\n T: Ord,

Removes the last element from the set and returns it, if any.\nThe last element is always the maximum element in the set.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::new();\n\nset.insert(1);\nwhile let Some(n) = set.pop_last() {\n    assert_eq!(n, 1);\n}\nassert!(set.is_empty());
\n
1.0.0 · source

pub fn insert(&mut self, value: T) -> bool
where\n T: Ord,

Adds a value to the set.

\n

Returns whether the value was newly inserted. That is:

\n
    \n
  • If the set did not previously contain an equal value, true is\nreturned.
  • \n
  • If the set already contained an equal value, false is returned, and\nthe entry is not updated.
  • \n
\n

See the module-level documentation for more.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::new();\n\nassert_eq!(set.insert(2), true);\nassert_eq!(set.insert(2), false);\nassert_eq!(set.len(), 1);
\n
1.9.0 · source

pub fn replace(&mut self, value: T) -> Option<T>
where\n T: Ord,

Adds a value to the set, replacing the existing element, if any, that is\nequal to the value. Returns the replaced element.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::new();\nset.insert(Vec::<i32>::new());\n\nassert_eq!(set.get(&[][..]).unwrap().capacity(), 0);\nset.replace(Vec::with_capacity(10));\nassert_eq!(set.get(&[][..]).unwrap().capacity(), 10);
\n
1.0.0 · source

pub fn remove<Q>(&mut self, value: &Q) -> bool
where\n T: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

If the set contains an element equal to the value, removes it from the\nset and drops it. Returns whether such an element was present.

\n

The value may be any borrowed form of the set’s element type,\nbut the ordering on the borrowed form must match the\nordering on the element type.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::new();\n\nset.insert(2);\nassert_eq!(set.remove(&2), true);\nassert_eq!(set.remove(&2), false);
\n
1.9.0 · source

pub fn take<Q>(&mut self, value: &Q) -> Option<T>
where\n T: Borrow<Q> + Ord,\n Q: Ord + ?Sized,

Removes and returns the element in the set, if any, that is equal to\nthe value.

\n

The value may be any borrowed form of the set’s element type,\nbut the ordering on the borrowed form must match the\nordering on the element type.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::from([1, 2, 3]);\nassert_eq!(set.take(&2), Some(2));\nassert_eq!(set.take(&2), None);
\n
1.53.0 · source

pub fn retain<F>(&mut self, f: F)
where\n T: Ord,\n F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

\n

In other words, remove all elements e for which f(&e) returns false.\nThe elements are visited in ascending order.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut set = BTreeSet::from([1, 2, 3, 4, 5, 6]);\n// Keep only the even numbers.\nset.retain(|&k| k % 2 == 0);\nassert!(set.iter().eq([2, 4, 6].iter()));
\n
1.11.0 · source

pub fn append(&mut self, other: &mut BTreeSet<T, A>)
where\n T: Ord,\n A: Clone,

Moves all elements from other into self, leaving other empty.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut a = BTreeSet::new();\na.insert(1);\na.insert(2);\na.insert(3);\n\nlet mut b = BTreeSet::new();\nb.insert(3);\nb.insert(4);\nb.insert(5);\n\na.append(&mut b);\n\nassert_eq!(a.len(), 5);\nassert_eq!(b.len(), 0);\n\nassert!(a.contains(&1));\nassert!(a.contains(&2));\nassert!(a.contains(&3));\nassert!(a.contains(&4));\nassert!(a.contains(&5));
\n
1.11.0 · source

pub fn split_off<Q>(&mut self, value: &Q) -> BTreeSet<T, A>
where\n Q: Ord + ?Sized,\n T: Borrow<Q> + Ord,\n A: Clone,

Splits the collection into two at the value. Returns a new collection\nwith all elements greater than or equal to the value.

\n
§Examples
\n

Basic usage:

\n\n
use std::collections::BTreeSet;\n\nlet mut a = BTreeSet::new();\na.insert(1);\na.insert(2);\na.insert(3);\na.insert(17);\na.insert(41);\n\nlet b = a.split_off(&3);\n\nassert_eq!(a.len(), 2);\nassert_eq!(b.len(), 3);\n\nassert!(a.contains(&1));\nassert!(a.contains(&2));\n\nassert!(b.contains(&3));\nassert!(b.contains(&17));\nassert!(b.contains(&41));
\n
source

pub fn extract_if<'a, F>(&'a mut self, pred: F) -> ExtractIf<'a, T, F, A>
where\n T: Ord,\n F: 'a + FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (btree_extract_if)

Creates an iterator that visits all elements in ascending order and\nuses a closure to determine if an element should be removed.

\n

If the closure returns true, the element is removed from the set and\nyielded. If the closure returns false, or panics, the element remains\nin the set and will not be yielded.

\n

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating\nor the iteration short-circuits, then the remaining elements will be retained.\nUse retain with a negated predicate if you do not need the returned iterator.

\n
§Examples
\n

Splitting a set into even and odd values, reusing the original set:

\n\n
#![feature(btree_extract_if)]\nuse std::collections::BTreeSet;\n\nlet mut set: BTreeSet<i32> = (0..8).collect();\nlet evens: BTreeSet<_> = set.extract_if(|v| v % 2 == 0).collect();\nlet odds = set;\nassert_eq!(evens.into_iter().collect::<Vec<_>>(), vec![0, 2, 4, 6]);\nassert_eq!(odds.into_iter().collect::<Vec<_>>(), vec![1, 3, 5, 7]);
\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Gets an iterator that visits the elements in the BTreeSet in ascending\norder.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet set = BTreeSet::from([3, 1, 2]);\nlet mut set_iter = set.iter();\nassert_eq!(set_iter.next(), Some(&1));\nassert_eq!(set_iter.next(), Some(&2));\nassert_eq!(set_iter.next(), Some(&3));\nassert_eq!(set_iter.next(), None);
\n
1.0.0 (const: unstable) · source

pub fn len(&self) -> usize

Returns the number of elements in the set.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut v = BTreeSet::new();\nassert_eq!(v.len(), 0);\nv.insert(1);\nassert_eq!(v.len(), 1);
\n
1.0.0 (const: unstable) · source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet mut v = BTreeSet::new();\nassert!(v.is_empty());\nv.insert(1);\nassert!(!v.is_empty());
\n
",0,"oasis_runtime_sdk::modules::access::types::Addresses"],["
§

impl<T> CheckDerConstraints for BTreeSet<T>
where\n T: CheckDerConstraints,

§

fn check_constraints(any: &Any<'_>) -> Result<(), Error>

","CheckDerConstraints","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> Clone for BTreeSet<T, A>
where\n T: Clone,\n A: Allocator + Clone,

source§

fn clone(&self) -> BTreeSet<T, A>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &BTreeSet<T, A>)

Performs copy-assignment from source. Read more
","Clone","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> Debug for BTreeSet<T, A>
where\n T: Debug,\n A: Allocator + Clone,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_runtime_sdk::modules::access::types::Addresses"],["
§

impl<T> Decode for BTreeSet<T>
where\n T: Decode + Ord,

§

fn try_default() -> Result<BTreeSet<T>, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<BTreeSet<T>, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T> Default for BTreeSet<T>

source§

fn default() -> BTreeSet<T>

Creates an empty BTreeSet.

\n
","Default","oasis_runtime_sdk::modules::access::types::Addresses"],["
source§

impl<'de, T> Deserialize<'de> for BTreeSet<T>
where\n T: Deserialize<'de> + Eq + Ord,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<BTreeSet<T>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_runtime_sdk::modules::access::types::Addresses"],["
§

impl<V> Encode for BTreeSet<V>
where\n V: Encode,

§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
","Encode","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.2.0 · source§

impl<'a, T, A> Extend<&'a T> for BTreeSet<T, A>
where\n T: 'a + Ord + Copy,\n A: Allocator + Clone,

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: &'a T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<&'a T>","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> Extend<T> for BTreeSet<T, A>
where\n T: Ord,\n A: Allocator + Clone,

source§

fn extend<Iter>(&mut self, iter: Iter)
where\n Iter: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, elem: T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.56.0 · source§

impl<T, const N: usize> From<[T; N]> for BTreeSet<T>
where\n T: Ord,

source§

fn from(arr: [T; N]) -> BTreeSet<T>

Converts a [T; N] into a BTreeSet<T>.

\n\n
use std::collections::BTreeSet;\n\nlet set1 = BTreeSet::from([1, 2, 3, 4]);\nlet set2: BTreeSet<_> = [1, 2, 3, 4].into();\nassert_eq!(set1, set2);
\n
","From<[T; N]>","oasis_runtime_sdk::modules::access::types::Addresses"],["
§

impl<'a, T, E> FromDer<'a, E> for BTreeSet<T>
where\n T: FromDer<'a, E> + Ord,\n E: From<Error> + Debug,

manual impl of FromDer, so we do not need to require TryFrom<Any> + CheckDerConstraints

\n
§

fn from_der(bytes: &'a [u8]) -> Result<(&'a [u8], BTreeSet<T>), Err<E>>

Attempt to parse input bytes into a DER object (enforcing constraints)
","FromDer<'a, E>","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T> FromIterator<T> for BTreeSet<T>
where\n T: Ord,

source§

fn from_iter<I>(iter: I) -> BTreeSet<T>
where\n I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
","FromIterator","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> Hash for BTreeSet<T, A>
where\n T: Hash,\n A: Allocator + Clone,

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_runtime_sdk::modules::access::types::Addresses"],["
source§

impl<'de, T, E> IntoDeserializer<'de, E> for BTreeSet<T>
where\n T: IntoDeserializer<'de, E> + Eq + Ord,\n E: Error,

§

type Deserializer = SeqDeserializer<<BTreeSet<T> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
source§

fn into_deserializer(\n self,\n) -> <BTreeSet<T> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> IntoIterator for BTreeSet<T, A>
where\n A: Allocator + Clone,

source§

fn into_iter(self) -> IntoIter<T, A>

Gets an iterator for moving out the BTreeSet’s contents in ascending order.

\n
§Examples
\n
use std::collections::BTreeSet;\n\nlet set = BTreeSet::from([1, 2, 3, 4]);\n\nlet v: Vec<_> = set.into_iter().collect();\nassert_eq!(v, [1, 2, 3, 4]);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, A>

Which kind of iterator are we turning this into?
","IntoIterator","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> Ord for BTreeSet<T, A>
where\n T: Ord,\n A: Allocator + Clone,

source§

fn cmp(&self, other: &BTreeSet<T, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> PartialEq for BTreeSet<T, A>
where\n T: PartialEq,\n A: Allocator + Clone,

source§

fn eq(&self, other: &BTreeSet<T, A>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> PartialOrd for BTreeSet<T, A>
where\n T: PartialOrd,\n A: Allocator + Clone,

source§

fn partial_cmp(&self, other: &BTreeSet<T, A>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_runtime_sdk::modules::access::types::Addresses"],["
source§

impl<T> Serialize for BTreeSet<T>
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_runtime_sdk::modules::access::types::Addresses"],["
§

impl<T> Tagged for BTreeSet<T>

§

const TAG: Tag = Tag::Set

","Tagged","oasis_runtime_sdk::modules::access::types::Addresses"],["
§

impl<T> ToDer for BTreeSet<T>
where\n T: ToDer,

§

fn to_der_len(&self) -> Result<usize, Error>

Get the length of the object (including the header), when encoded
§

fn write_der_header(\n &self,\n writer: &mut dyn Write,\n) -> Result<usize, SerializeError>

Attempt to write the DER header to this writer.
§

fn write_der_content(\n &self,\n writer: &mut dyn Write,\n) -> Result<usize, SerializeError>

Attempt to write the DER content (all except header) to this writer.
§

fn to_der_vec(&self) -> Result<Vec<u8>, SerializeError>

Write the DER encoded representation to a newly allocated Vec<u8>.
§

fn to_der_vec_raw(&self) -> Result<Vec<u8>, SerializeError>

Similar to using to_vec, but uses provided values without changes.\nThis can generate an invalid encoding for a DER object.
§

fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>

Attempt to write the DER encoded representation (header and content) into this writer. Read more
§

fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>

Similar to using to_der, but uses provided values without changes.\nThis can generate an invalid encoding for a DER object.
","ToDer","oasis_runtime_sdk::modules::access::types::Addresses"],["
§

impl<'a, T> TryFrom<Any<'a>> for BTreeSet<T>
where\n T: FromBer<'a> + Ord,

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(any: Any<'a>) -> Result<BTreeSet<T>, Error>

Performs the conversion.
","TryFrom>","oasis_runtime_sdk::modules::access::types::Addresses"],["
1.0.0 · source§

impl<T, A> Eq for BTreeSet<T, A>
where\n T: Eq,\n A: Allocator + Clone,

","Eq","oasis_runtime_sdk::modules::access::types::Addresses"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/alloc/rc/struct.Rc.js b/rust/type.impl/alloc/rc/struct.Rc.js new file mode 100644 index 0000000000..beea0eada8 --- /dev/null +++ b/rust/type.impl/alloc/rc/struct.Rc.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
§

impl<'a, A> Arbitrary<'a> for Rc<A>
where\n A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Rc<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
","Arbitrary<'a>","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.69.0 · source§

impl<T> AsFd for Rc<T>
where\n T: AsFd + ?Sized,

source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
","AsFd","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.69.0 · source§

impl<T> AsRawFd for Rc<T>
where\n T: AsRawFd,

source§

fn as_raw_fd(&self) -> i32

Extracts the raw file descriptor. Read more
","AsRawFd","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.5.0 · source§

impl<T, A> AsRef<T> for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Borrow<T> for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
","Borrow","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Clone for Rc<T, A>
where\n A: Allocator + Clone,\n T: ?Sized,

source§

fn clone(&self) -> Rc<T, A>

Makes a clone of the Rc pointer.

\n

This creates another pointer to the same allocation, increasing the\nstrong reference count.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nlet _ = Rc::clone(&five);
\n
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Debug for Rc<T, A>
where\n T: Debug + ?Sized,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T> Default for Rc<T>
where\n T: Default,

source§

fn default() -> Rc<T>

Creates a new Rc<T>, with the Default value for T.

\n
§Examples
\n
use std::rc::Rc;\n\nlet x: Rc<i32> = Default::default();\nassert_eq!(*x, 0);
\n
","Default","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Display for Rc<T, A>
where\n T: Display + ?Sized,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Drop for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn drop(&mut self)

Drops the Rc.

\n

This will decrement the strong reference count. If the strong reference\ncount reaches zero then the only other references (if any) are\nWeak, so we drop the inner value.

\n
§Examples
\n
use std::rc::Rc;\n\nstruct Foo;\n\nimpl Drop for Foo {\n    fn drop(&mut self) {\n        println!(\"dropped!\");\n    }\n}\n\nlet foo  = Rc::new(Foo);\nlet foo2 = Rc::clone(&foo);\n\ndrop(foo);    // Doesn't print anything\ndrop(foo2);   // Prints \"dropped!\"
\n
","Drop","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.21.0 · source§

impl<T, A> From<Box<T, A>> for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn from(v: Box<T, A>) -> Rc<T, A>

Move a boxed object to a new, reference counted, allocation.

\n
§Example
\n
let original: Box<i32> = Box::new(1);\nlet shared: Rc<i32> = Rc::from(original);\nassert_eq!(1, *shared);
\n
","From>","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.45.0 · source§

impl<'a, B> From<Cow<'a, B>> for Rc<B>
where\n B: ToOwned + ?Sized,\n Rc<B>: From<&'a B> + From<<B as ToOwned>::Owned>,

source§

fn from(cow: Cow<'a, B>) -> Rc<B>

Create a reference-counted pointer from\na clone-on-write pointer by copying its content.

\n
§Example
\n
let cow: Cow<'_, str> = Cow::Borrowed(\"eggplant\");\nlet shared: Rc<str> = Rc::from(cow);\nassert_eq!(\"eggplant\", &shared[..]);
\n
","From>","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.6.0 · source§

impl<T> From<T> for Rc<T>

source§

fn from(t: T) -> Rc<T>

Converts a generic type T into an Rc<T>

\n

The conversion allocates on the heap and moves t\nfrom the stack into it.

\n
§Example
\n
let x = 5;\nlet rc = Rc::new(5);\n\nassert_eq!(Rc::from(x), rc);
\n
","From","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Hash for Rc<T, A>
where\n T: Hash + ?Sized,\n A: Allocator,

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
§

impl<Sp> LocalSpawn for Rc<Sp>
where\n Sp: LocalSpawn + ?Sized,

§

fn spawn_local_obj(\n &self,\n future: LocalFutureObj<'static, ()>,\n) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status_local(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
","LocalSpawn","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Ord for Rc<T, A>
where\n T: Ord + ?Sized,\n A: Allocator,

source§

fn cmp(&self, other: &Rc<T, A>) -> Ordering

Comparison for two Rcs.

\n

The two are compared by calling cmp() on their inner values.

\n
§Examples
\n
use std::rc::Rc;\nuse std::cmp::Ordering;\n\nlet five = Rc::new(5);\n\nassert_eq!(Ordering::Less, five.cmp(&Rc::new(6)));
\n
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> PartialEq for Rc<T, A>
where\n T: PartialEq + ?Sized,\n A: Allocator,

source§

fn eq(&self, other: &Rc<T, A>) -> bool

Equality for two Rcs.

\n

Two Rcs are equal if their inner values are equal, even if they are\nstored in different allocation.

\n

If T also implements Eq (implying reflexivity of equality),\ntwo Rcs that point to the same allocation are\nalways equal.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nassert!(five == Rc::new(5));
\n
source§

fn ne(&self, other: &Rc<T, A>) -> bool

Inequality for two Rcs.

\n

Two Rcs are not equal if their inner values are not equal.

\n

If T also implements Eq (implying reflexivity of equality),\ntwo Rcs that point to the same allocation are\nalways equal.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nassert!(five != Rc::new(6));
\n
","PartialEq","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> PartialOrd for Rc<T, A>
where\n T: PartialOrd + ?Sized,\n A: Allocator,

source§

fn partial_cmp(&self, other: &Rc<T, A>) -> Option<Ordering>

Partial comparison for two Rcs.

\n

The two are compared by calling partial_cmp() on their inner values.

\n
§Examples
\n
use std::rc::Rc;\nuse std::cmp::Ordering;\n\nlet five = Rc::new(5);\n\nassert_eq!(Some(Ordering::Less), five.partial_cmp(&Rc::new(6)));
\n
source§

fn lt(&self, other: &Rc<T, A>) -> bool

Less-than comparison for two Rcs.

\n

The two are compared by calling < on their inner values.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nassert!(five < Rc::new(6));
\n
source§

fn le(&self, other: &Rc<T, A>) -> bool

‘Less than or equal to’ comparison for two Rcs.

\n

The two are compared by calling <= on their inner values.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nassert!(five <= Rc::new(5));
\n
source§

fn gt(&self, other: &Rc<T, A>) -> bool

Greater-than comparison for two Rcs.

\n

The two are compared by calling > on their inner values.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nassert!(five > Rc::new(4));
\n
source§

fn ge(&self, other: &Rc<T, A>) -> bool

‘Greater than or equal to’ comparison for two Rcs.

\n

The two are compared by calling >= on their inner values.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nassert!(five >= Rc::new(5));
\n
","PartialOrd","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Pointer for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Pointer","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T> Rc<T>
where\n T: ?Sized,

1.17.0 · source

pub unsafe fn from_raw(ptr: *const T) -> Rc<T>

Constructs an Rc<T> from a raw pointer.

\n

The raw pointer must have been previously returned by a call to\nRc<U>::into_raw with the following requirements:

\n
    \n
  • If U is sized, it must have the same size and alignment as T. This\nis trivially true if U is T.
  • \n
  • If U is unsized, its data pointer must have the same size and\nalignment as T. This is trivially true if Rc<U> was constructed\nthrough Rc<T> and then converted to Rc<U> through an unsized\ncoercion.
  • \n
\n

Note that if U or U’s data pointer is not T but has the same size\nand alignment, this is basically like transmuting references of\ndifferent types. See mem::transmute for more information\non what restrictions apply in this case.

\n

The raw pointer must point to a block of memory allocated by the global allocator

\n

The user of from_raw has to make sure a specific value of T is only\ndropped once.

\n

This function is unsafe because improper use may lead to memory unsafety,\neven if the returned Rc<T> is never accessed.

\n
§Examples
\n
use std::rc::Rc;\n\nlet x = Rc::new(\"hello\".to_owned());\nlet x_ptr = Rc::into_raw(x);\n\nunsafe {\n    // Convert back to an `Rc` to prevent leak.\n    let x = Rc::from_raw(x_ptr);\n    assert_eq!(&*x, \"hello\");\n\n    // Further calls to `Rc::from_raw(x_ptr)` would be memory-unsafe.\n}\n\n// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
\n

Convert a slice back into its original array:

\n\n
use std::rc::Rc;\n\nlet x: Rc<[u32]> = Rc::new([1, 2, 3]);\nlet x_ptr: *const [u32] = Rc::into_raw(x);\n\nunsafe {\n    let x: Rc<[u32; 3]> = Rc::from_raw(x_ptr.cast::<[u32; 3]>());\n    assert_eq!(&*x, &[1, 2, 3]);\n}
\n
1.53.0 · source

pub unsafe fn increment_strong_count(ptr: *const T)

Increments the strong reference count on the Rc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Rc::into_raw, the\nassociated Rc instance must be valid (i.e. the strong count must be at\nleast 1) for the duration of this method, and ptr must point to a block of memory\nallocated by the global allocator.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nunsafe {\n    let ptr = Rc::into_raw(five);\n    Rc::increment_strong_count(ptr);\n\n    let five = Rc::from_raw(ptr);\n    assert_eq!(2, Rc::strong_count(&five));\n}
\n
1.53.0 · source

pub unsafe fn decrement_strong_count(ptr: *const T)

Decrements the strong reference count on the Rc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Rc::into_raw, the\nassociated Rc instance must be valid (i.e. the strong count must be at\nleast 1) when invoking this method, and ptr must point to a block of memory\nallocated by the global allocator. This method can be used to release the final Rc and\nbacking storage, but should not be called after the final Rc has been released.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nunsafe {\n    let ptr = Rc::into_raw(five);\n    Rc::increment_strong_count(ptr);\n\n    let five = Rc::from_raw(ptr);\n    assert_eq!(2, Rc::strong_count(&five));\n    Rc::decrement_strong_count(ptr);\n    assert_eq!(1, Rc::strong_count(&five));\n}
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T> Rc<T>

1.0.0 · source

pub fn new(value: T) -> Rc<T>

Constructs a new Rc<T>.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);
\n
1.60.0 · source

pub fn new_cyclic<F>(data_fn: F) -> Rc<T>
where\n F: FnOnce(&Weak<T>) -> T,

Constructs a new Rc<T> while giving you a Weak<T> to the allocation,\nto allow you to construct a T which holds a weak pointer to itself.

\n

Generally, a structure circularly referencing itself, either directly or\nindirectly, should not hold a strong reference to itself to prevent a memory leak.\nUsing this function, you get access to the weak pointer during the\ninitialization of T, before the Rc<T> is created, such that you can\nclone and store it inside the T.

\n

new_cyclic first allocates the managed allocation for the Rc<T>,\nthen calls your closure, giving it a Weak<T> to this allocation,\nand only afterwards completes the construction of the Rc<T> by placing\nthe T returned from your closure into the allocation.

\n

Since the new Rc<T> is not fully-constructed until Rc<T>::new_cyclic\nreturns, calling upgrade on the weak reference inside your closure will\nfail and result in a None value.

\n
§Panics
\n

If data_fn panics, the panic is propagated to the caller, and the\ntemporary Weak<T> is dropped normally.

\n
§Examples
\n
use std::rc::{Rc, Weak};\n\nstruct Gadget {\n    me: Weak<Gadget>,\n}\n\nimpl Gadget {\n    /// Construct a reference counted Gadget.\n    fn new() -> Rc<Self> {\n        // `me` is a `Weak<Gadget>` pointing at the new allocation of the\n        // `Rc` we're constructing.\n        Rc::new_cyclic(|me| {\n            // Create the actual struct here.\n            Gadget { me: me.clone() }\n        })\n    }\n\n    /// Return a reference counted pointer to Self.\n    fn me(&self) -> Rc<Self> {\n        self.me.upgrade().unwrap()\n    }\n}
\n
source

pub fn new_uninit() -> Rc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Rc with uninitialized contents.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(get_mut_unchecked)]\n\nuse std::rc::Rc;\n\nlet mut five = Rc::<u32>::new_uninit();\n\n// Deferred initialization:\nRc::get_mut(&mut five).unwrap().write(5);\n\nlet five = unsafe { five.assume_init() };\n\nassert_eq!(*five, 5)
\n
source

pub fn new_zeroed() -> Rc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Rc with uninitialized contents, with the memory\nbeing filled with 0 bytes.

\n

See MaybeUninit::zeroed for examples of correct and\nincorrect usage of this method.

\n
§Examples
\n
#![feature(new_uninit)]\n\nuse std::rc::Rc;\n\nlet zero = Rc::<u32>::new_zeroed();\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0)
\n
source

pub fn try_new(value: T) -> Result<Rc<T>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc<T>, returning an error if the allocation fails

\n
§Examples
\n
#![feature(allocator_api)]\nuse std::rc::Rc;\n\nlet five = Rc::try_new(5);
\n
source

pub fn try_new_uninit() -> Result<Rc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc with uninitialized contents, returning an error if the allocation fails

\n
§Examples
\n
#![feature(allocator_api, new_uninit)]\n#![feature(get_mut_unchecked)]\n\nuse std::rc::Rc;\n\nlet mut five = Rc::<u32>::try_new_uninit()?;\n\n// Deferred initialization:\nRc::get_mut(&mut five).unwrap().write(5);\n\nlet five = unsafe { five.assume_init() };\n\nassert_eq!(*five, 5);
\n
source

pub fn try_new_zeroed() -> Result<Rc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc with uninitialized contents, with the memory\nbeing filled with 0 bytes, returning an error if the allocation fails

\n

See MaybeUninit::zeroed for examples of correct and\nincorrect usage of this method.

\n
§Examples
\n
#![feature(allocator_api, new_uninit)]\n\nuse std::rc::Rc;\n\nlet zero = Rc::<u32>::try_new_zeroed()?;\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0);
\n
1.33.0 · source

pub fn pin(value: T) -> Pin<Rc<T>>

Constructs a new Pin<Rc<T>>. If T does not implement Unpin, then\nvalue will be pinned in memory and unable to be moved.

\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T, A> Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

1.17.0 · source

pub fn into_raw(this: Rc<T, A>) -> *const T

Consumes the Rc, returning the wrapped pointer.

\n

To avoid a memory leak the pointer must be converted back to an Rc using\nRc::from_raw.

\n
§Examples
\n
use std::rc::Rc;\n\nlet x = Rc::new(\"hello\".to_owned());\nlet x_ptr = Rc::into_raw(x);\nassert_eq!(unsafe { &*x_ptr }, \"hello\");
\n
source

pub fn into_raw_with_allocator(this: Rc<T, A>) -> (*const T, A)

🔬This is a nightly-only experimental API. (allocator_api)

Consumes the Rc, returning the wrapped pointer and allocator.

\n

To avoid a memory leak the pointer must be converted back to an Rc using\nRc::from_raw_in.

\n
§Examples
\n
#![feature(allocator_api)]\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet x = Rc::new_in(\"hello\".to_owned(), System);\nlet (ptr, alloc) = Rc::into_raw_with_allocator(x);\nassert_eq!(unsafe { &*ptr }, \"hello\");\nlet x = unsafe { Rc::from_raw_in(ptr, alloc) };\nassert_eq!(&*x, \"hello\");
\n
1.45.0 · source

pub fn as_ptr(this: &Rc<T, A>) -> *const T

Provides a raw pointer to the data.

\n

The counts are not affected in any way and the Rc is not consumed. The pointer is valid\nfor as long there are strong counts in the Rc.

\n
§Examples
\n
use std::rc::Rc;\n\nlet x = Rc::new(\"hello\".to_owned());\nlet y = Rc::clone(&x);\nlet x_ptr = Rc::as_ptr(&x);\nassert_eq!(x_ptr, Rc::as_ptr(&y));\nassert_eq!(unsafe { &*x_ptr }, \"hello\");
\n
source

pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Rc<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs an Rc<T, A> from a raw pointer in the provided allocator.

\n

The raw pointer must have been previously returned by a call to Rc<U, A>::into_raw with the following requirements:

\n
    \n
  • If U is sized, it must have the same size and alignment as T. This\nis trivially true if U is T.
  • \n
  • If U is unsized, its data pointer must have the same size and\nalignment as T. This is trivially true if Rc<U> was constructed\nthrough Rc<T> and then converted to Rc<U> through an unsized\ncoercion.
  • \n
\n

Note that if U or U’s data pointer is not T but has the same size\nand alignment, this is basically like transmuting references of\ndifferent types. See mem::transmute for more information\non what restrictions apply in this case.

\n

The raw pointer must point to a block of memory allocated by alloc

\n

The user of from_raw has to make sure a specific value of T is only\ndropped once.

\n

This function is unsafe because improper use may lead to memory unsafety,\neven if the returned Rc<T> is never accessed.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet x = Rc::new_in(\"hello\".to_owned(), System);\nlet x_ptr = Rc::into_raw(x);\n\nunsafe {\n    // Convert back to an `Rc` to prevent leak.\n    let x = Rc::from_raw_in(x_ptr, System);\n    assert_eq!(&*x, \"hello\");\n\n    // Further calls to `Rc::from_raw(x_ptr)` would be memory-unsafe.\n}\n\n// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
\n

Convert a slice back into its original array:

\n\n
#![feature(allocator_api)]\n\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet x: Rc<[u32], _> = Rc::new_in([1, 2, 3], System);\nlet x_ptr: *const [u32] = Rc::into_raw(x);\n\nunsafe {\n    let x: Rc<[u32; 3], _> = Rc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);\n    assert_eq!(&*x, &[1, 2, 3]);\n}
\n
1.4.0 · source

pub fn downgrade(this: &Rc<T, A>) -> Weak<T, A>
where\n A: Clone,

Creates a new Weak pointer to this allocation.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\n\nlet weak_five = Rc::downgrade(&five);
\n
1.15.0 · source

pub fn weak_count(this: &Rc<T, A>) -> usize

Gets the number of Weak pointers to this allocation.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\nlet _weak_five = Rc::downgrade(&five);\n\nassert_eq!(1, Rc::weak_count(&five));
\n
1.15.0 · source

pub fn strong_count(this: &Rc<T, A>) -> usize

Gets the number of strong (Rc) pointers to this allocation.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\nlet _also_five = Rc::clone(&five);\n\nassert_eq!(2, Rc::strong_count(&five));
\n
source

pub unsafe fn increment_strong_count_in(ptr: *const T, alloc: A)
where\n A: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Increments the strong reference count on the Rc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Rc::into_raw, the\nassociated Rc instance must be valid (i.e. the strong count must be at\nleast 1) for the duration of this method, and ptr must point to a block of memory\nallocated by alloc

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet five = Rc::new_in(5, System);\n\nunsafe {\n    let ptr = Rc::into_raw(five);\n    Rc::increment_strong_count_in(ptr, System);\n\n    let five = Rc::from_raw_in(ptr, System);\n    assert_eq!(2, Rc::strong_count(&five));\n}
\n
source

pub unsafe fn decrement_strong_count_in(ptr: *const T, alloc: A)

🔬This is a nightly-only experimental API. (allocator_api)

Decrements the strong reference count on the Rc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Rc::into_raw, the\nassociated Rc instance must be valid (i.e. the strong count must be at\nleast 1) when invoking this method, and ptr must point to a block of memory\nallocated by alloc. This method can be used to release the final Rc and backing storage,\nbut should not be called after the final Rc has been released.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet five = Rc::new_in(5, System);\n\nunsafe {\n    let ptr = Rc::into_raw(five);\n    Rc::increment_strong_count_in(ptr, System);\n\n    let five = Rc::from_raw_in(ptr, System);\n    assert_eq!(2, Rc::strong_count(&five));\n    Rc::decrement_strong_count_in(ptr, System);\n    assert_eq!(1, Rc::strong_count(&five));\n}
\n
1.4.0 · source

pub fn get_mut(this: &mut Rc<T, A>) -> Option<&mut T>

Returns a mutable reference into the given Rc, if there are\nno other Rc or Weak pointers to the same allocation.

\n

Returns None otherwise, because it is not safe to\nmutate a shared value.

\n

See also make_mut, which will clone\nthe inner value when there are other Rc pointers.

\n
§Examples
\n
use std::rc::Rc;\n\nlet mut x = Rc::new(3);\n*Rc::get_mut(&mut x).unwrap() = 4;\nassert_eq!(*x, 4);\n\nlet _y = Rc::clone(&x);\nassert!(Rc::get_mut(&mut x).is_none());
\n
source

pub unsafe fn get_mut_unchecked(this: &mut Rc<T, A>) -> &mut T

🔬This is a nightly-only experimental API. (get_mut_unchecked)

Returns a mutable reference into the given Rc,\nwithout any check.

\n

See also get_mut, which is safe and does appropriate checks.

\n
§Safety
\n

If any other Rc or Weak pointers to the same allocation exist, then\nthey must not be dereferenced or have active borrows for the duration\nof the returned borrow, and their inner type must be exactly the same as the\ninner type of this Rc (including lifetimes). This is trivially the case if no\nsuch pointers exist, for example immediately after Rc::new.

\n
§Examples
\n
#![feature(get_mut_unchecked)]\n\nuse std::rc::Rc;\n\nlet mut x = Rc::new(String::new());\nunsafe {\n    Rc::get_mut_unchecked(&mut x).push_str(\"foo\")\n}\nassert_eq!(*x, \"foo\");
\n

Other Rc pointers to the same allocation must be to the same type.

\n\n
#![feature(get_mut_unchecked)]\n\nuse std::rc::Rc;\n\nlet x: Rc<str> = Rc::from(\"Hello, world!\");\nlet mut y: Rc<[u8]> = x.clone().into();\nunsafe {\n    // this is Undefined Behavior, because x's inner type is str, not [u8]\n    Rc::get_mut_unchecked(&mut y).fill(0xff); // 0xff is invalid in UTF-8\n}\nprintln!(\"{}\", &*x); // Invalid UTF-8 in a str
\n

Other Rc pointers to the same allocation must be to the exact same type, including lifetimes.

\n\n
#![feature(get_mut_unchecked)]\n\nuse std::rc::Rc;\n\nlet x: Rc<&str> = Rc::new(\"Hello, world!\");\n{\n    let s = String::from(\"Oh, no!\");\n    let mut y: Rc<&str> = x.clone().into();\n    unsafe {\n        // this is Undefined Behavior, because x's inner type\n        // is &'long str, not &'short str\n        *Rc::get_mut_unchecked(&mut y) = &s;\n    }\n}\nprintln!(\"{}\", &*x); // Use-after-free
\n
1.17.0 · source

pub fn ptr_eq(this: &Rc<T, A>, other: &Rc<T, A>) -> bool

Returns true if the two Rcs point to the same allocation in a vein similar to\nptr::eq. This function ignores the metadata of dyn Trait pointers.

\n
§Examples
\n
use std::rc::Rc;\n\nlet five = Rc::new(5);\nlet same_five = Rc::clone(&five);\nlet other_five = Rc::new(5);\n\nassert!(Rc::ptr_eq(&five, &same_five));\nassert!(!Rc::ptr_eq(&five, &other_five));
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T, A> Rc<T, A>
where\n T: CloneToUninit + ?Sized,\n A: Allocator + Clone,

1.4.0 · source

pub fn make_mut(this: &mut Rc<T, A>) -> &mut T

Makes a mutable reference into the given Rc.

\n

If there are other Rc pointers to the same allocation, then make_mut will\nclone the inner value to a new allocation to ensure unique ownership. This is also\nreferred to as clone-on-write.

\n

However, if there are no other Rc pointers to this allocation, but some Weak\npointers, then the Weak pointers will be disassociated and the inner value will not\nbe cloned.

\n

See also get_mut, which will fail rather than cloning the inner value\nor disassociating Weak pointers.

\n
§Examples
\n
use std::rc::Rc;\n\nlet mut data = Rc::new(5);\n\n*Rc::make_mut(&mut data) += 1;         // Won't clone anything\nlet mut other_data = Rc::clone(&data); // Won't clone inner data\n*Rc::make_mut(&mut data) += 1;         // Clones inner data\n*Rc::make_mut(&mut data) += 1;         // Won't clone anything\n*Rc::make_mut(&mut other_data) *= 2;   // Won't clone anything\n\n// Now `data` and `other_data` point to different allocations.\nassert_eq!(*data, 8);\nassert_eq!(*other_data, 12);
\n

Weak pointers will be disassociated:

\n\n
use std::rc::Rc;\n\nlet mut data = Rc::new(75);\nlet weak = Rc::downgrade(&data);\n\nassert!(75 == *data);\nassert!(75 == *weak.upgrade().unwrap());\n\n*Rc::make_mut(&mut data) += 1;\n\nassert!(76 == *data);\nassert!(weak.upgrade().is_none());
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T, A> Rc<T, A>
where\n T: Clone,\n A: Allocator,

1.76.0 · source

pub fn unwrap_or_clone(this: Rc<T, A>) -> T

If we have the only reference to T then unwrap it. Otherwise, clone T and return the\nclone.

\n

Assuming rc_t is of type Rc<T>, this function is functionally equivalent to\n(*rc_t).clone(), but will avoid cloning the inner value where possible.

\n
§Examples
\n
let inner = String::from(\"test\");\nlet ptr = inner.as_ptr();\n\nlet rc = Rc::new(inner);\nlet inner = Rc::unwrap_or_clone(rc);\n// The inner value was not cloned\nassert!(ptr::eq(ptr, inner.as_ptr()));\n\nlet rc = Rc::new(inner);\nlet rc2 = rc.clone();\nlet inner = Rc::unwrap_or_clone(rc);\n// Because there were 2 references, we had to clone the inner value.\nassert!(!ptr::eq(ptr, inner.as_ptr()));\n// `rc2` is the last reference, so when we unwrap it we get back\n// the original `String`.\nlet inner = Rc::unwrap_or_clone(rc2);\nassert!(ptr::eq(ptr, inner.as_ptr()));
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T, A> Rc<T, A>
where\n A: Allocator,

source

pub fn allocator(this: &Rc<T, A>) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

\n

Note: this is an associated function, which means that you have\nto call it as Rc::allocator(&r) instead of r.allocator(). This\nis so that there is no conflict with a method on the inner type.

\n
source

pub fn new_in(value: T, alloc: A) -> Rc<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc in the provided allocator.

\n
§Examples
\n
#![feature(allocator_api)]\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet five = Rc::new_in(5, System);
\n
source

pub fn new_uninit_in(alloc: A) -> Rc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc with uninitialized contents in the provided allocator.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(get_mut_unchecked)]\n#![feature(allocator_api)]\n\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet mut five = Rc::<u32, _>::new_uninit_in(System);\n\nlet five = unsafe {\n    // Deferred initialization:\n    Rc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5)
\n
source

pub fn new_zeroed_in(alloc: A) -> Rc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc with uninitialized contents, with the memory\nbeing filled with 0 bytes, in the provided allocator.

\n

See MaybeUninit::zeroed for examples of correct and\nincorrect usage of this method.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(allocator_api)]\n\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet zero = Rc::<u32, _>::new_zeroed_in(System);\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0)
\n
source

pub fn try_new_in(value: T, alloc: A) -> Result<Rc<T, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc<T> in the provided allocator, returning an error if the allocation\nfails

\n
§Examples
\n
#![feature(allocator_api)]\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet five = Rc::try_new_in(5, System);
\n
source

pub fn try_new_uninit_in(alloc: A) -> Result<Rc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc with uninitialized contents, in the provided allocator, returning an\nerror if the allocation fails

\n
§Examples
\n
#![feature(allocator_api, new_uninit)]\n#![feature(get_mut_unchecked)]\n\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet mut five = Rc::<u32, _>::try_new_uninit_in(System)?;\n\nlet five = unsafe {\n    // Deferred initialization:\n    Rc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5);
\n
source

pub fn try_new_zeroed_in(alloc: A) -> Result<Rc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Rc with uninitialized contents, with the memory\nbeing filled with 0 bytes, in the provided allocator, returning an error if the allocation\nfails

\n

See MaybeUninit::zeroed for examples of correct and\nincorrect usage of this method.

\n
§Examples
\n
#![feature(allocator_api, new_uninit)]\n\nuse std::rc::Rc;\nuse std::alloc::System;\n\nlet zero = Rc::<u32, _>::try_new_zeroed_in(System)?;\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0);
\n
source

pub fn pin_in(value: T, alloc: A) -> Pin<Rc<T, A>>
where\n A: 'static,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Rc<T>> in the provided allocator. If T does not implement Unpin, then\nvalue will be pinned in memory and unable to be moved.

\n
1.4.0 · source

pub fn try_unwrap(this: Rc<T, A>) -> Result<T, Rc<T, A>>

Returns the inner value, if the Rc has exactly one strong reference.

\n

Otherwise, an Err is returned with the same Rc that was\npassed in.

\n

This will succeed even if there are outstanding weak references.

\n
§Examples
\n
use std::rc::Rc;\n\nlet x = Rc::new(3);\nassert_eq!(Rc::try_unwrap(x), Ok(3));\n\nlet x = Rc::new(4);\nlet _y = Rc::clone(&x);\nassert_eq!(*Rc::try_unwrap(x).unwrap_err(), 4);
\n
1.70.0 · source

pub fn into_inner(this: Rc<T, A>) -> Option<T>

Returns the inner value, if the Rc has exactly one strong reference.

\n

Otherwise, None is returned and the Rc is dropped.

\n

This will succeed even if there are outstanding weak references.

\n

If Rc::into_inner is called on every clone of this Rc,\nit is guaranteed that exactly one of the calls returns the inner value.\nThis means in particular that the inner value is not dropped.

\n

Rc::try_unwrap is conceptually similar to Rc::into_inner.\nAnd while they are meant for different use-cases, Rc::into_inner(this)\nis in fact equivalent to Rc::try_unwrap(this).ok().\n(Note that the same kind of equivalence does not hold true for\nArc, due to race conditions that do not apply to Rc!)

\n
§Examples
\n
use std::rc::Rc;\n\nlet x = Rc::new(3);\nassert_eq!(Rc::into_inner(x), Some(3));\n\nlet x = Rc::new(4);\nlet y = Rc::clone(&x);\n\nassert_eq!(Rc::into_inner(y), None);\nassert_eq!(Rc::into_inner(x), Some(4));
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
§

impl<T> RefCnt for Rc<T>

§

type Base = T

The base type the pointer points to.
§

fn into_ptr(me: Rc<T>) -> *mut T

Converts the smart pointer into a raw pointer, without affecting the reference count. Read more
§

fn as_ptr(me: &Rc<T>) -> *mut T

Provides a view into the smart pointer as a raw pointer. Read more
§

unsafe fn from_ptr(ptr: *const T) -> Rc<T>

Converts a raw pointer back into the smart pointer, without affecting the reference count. Read more
§

fn inc(me: &Self) -> *mut Self::Base

Increments the reference count by one. Read more
§

unsafe fn dec(ptr: *const Self::Base)

Decrements the reference count by one. Read more
","RefCnt","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
§

impl<Sp> Spawn for Rc<Sp>
where\n Sp: Spawn + ?Sized,

§

fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
","Spawn","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
§

impl<T> Value for Rc<T>
where\n T: Value,

§

fn serialize(\n &self,\n record: &Record<'_>,\n key: &'static str,\n serializer: &mut dyn Serializer,\n) -> Result<(), Error>

Serialize self into Serializer Read more
","Value","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Deref for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
","Deref","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T, U, A> CoerceUnsized<Rc<U, A>> for Rc<T, A>
where\n T: Unsize<U> + ?Sized,\n A: Allocator,\n U: ?Sized,

","CoerceUnsized>","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T, A> DerefPure for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

","DerefPure","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
source§

impl<T, U> DispatchFromDyn<Rc<U>> for Rc<T>
where\n T: Unsize<U> + ?Sized,\n U: ?Sized,

","DispatchFromDyn>","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> Eq for Rc<T, A>
where\n T: Eq + ?Sized,\n A: Allocator,

","Eq","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.58.0 · source§

impl<T, A> RefUnwindSafe for Rc<T, A>
where\n T: RefUnwindSafe + ?Sized,\n A: Allocator + UnwindSafe,

","RefUnwindSafe","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> !Send for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

","Send","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.0.0 · source§

impl<T, A> !Sync for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

","Sync","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.33.0 · source§

impl<T, A> Unpin for Rc<T, A>
where\n A: Allocator,\n T: ?Sized,

","Unpin","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"],["
1.9.0 · source§

impl<T, A> UnwindSafe for Rc<T, A>
where\n T: RefUnwindSafe + ?Sized,\n A: Allocator + UnwindSafe,

","UnwindSafe","oasis_core_runtime::storage::mkvs::tree::node::NodePtrRef"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/alloc/string/struct.String.js b/rust/type.impl/alloc/string/struct.String.js new file mode 100644 index 0000000000..0e8a1126be --- /dev/null +++ b/rust/type.impl/alloc/string/struct.String.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
1.0.0 · source§

impl Add<&str> for String

Implements the + operator for concatenating two strings.

\n

This consumes the String on the left-hand side and re-uses its buffer (growing it if\nnecessary). This is done to avoid allocating a new String and copying the entire contents on\nevery operation, which would lead to O(n^2) running time when building an n-byte string by\nrepeated concatenation.

\n

The string on the right-hand side is only borrowed; its contents are copied into the returned\nString.

\n

§Examples

\n

Concatenating two Strings takes the first by value and borrows the second:

\n\n
let a = String::from(\"hello\");\nlet b = String::from(\" world\");\nlet c = a + &b;\n// `a` is moved and can no longer be used here.
\n

If you want to keep using the first String, you can clone it and append to the clone instead:

\n\n
let a = String::from(\"hello\");\nlet b = String::from(\" world\");\nlet c = a.clone() + &b;\n// `a` is still valid here.
\n

Concatenating &str slices can be done by converting the first to a String:

\n\n
let a = \"hello\";\nlet b = \" world\";\nlet c = a.to_string() + b;
\n
§

type Output = String

The resulting type after applying the + operator.
source§

fn add(self, other: &str) -> String

Performs the + operation. Read more
","Add<&str>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.12.0 · source§

impl AddAssign<&str> for String

Implements the += operator for appending to a String.

\n

This has the same behavior as the push_str method.

\n
source§

fn add_assign(&mut self, other: &str)

Performs the += operation. Read more
","AddAssign<&str>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl<'a> Arbitrary<'a> for String

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<String, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<String, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
","Arbitrary<'a>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.43.0 · source§

impl AsMut<str> for String

source§

fn as_mut(&mut self) -> &mut str

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl AsRef<[u8]> for String

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[u8]>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl AsRef<OsStr> for String

source§

fn as_ref(&self) -> &OsStr

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl AsRef<Path> for String

source§

fn as_ref(&self) -> &Path

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl AsRef<str> for String

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl BERDecodable for String

§

fn decode_ber(reader: BERReader<'_, '_>) -> Result<String, ASN1Error>

Reads an ASN.1 value from BERReader and converts it to Self. Read more
","BERDecodable","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl BERDecodable for String

§

fn decode_ber(reader: BERReader<'_, '_>) -> Result<String, ASN1Error>

Reads an ASN.1 value from BERReader and converts it to Self. Read more
","BERDecodable","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Borrow<str> for String

source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
","Borrow","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.36.0 · source§

impl BorrowMut<str> for String

source§

fn borrow_mut(&mut self) -> &mut str

Mutably borrows from an owned value. Read more
","BorrowMut","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl CheckDerConstraints for String

§

fn check_constraints(any: &Any<'_>) -> Result<(), Error>

","CheckDerConstraints","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Clone for String

source§

fn clone_from(&mut self, source: &String)

Clones the contents of source into self.

\n

This method is preferred over simply assigning source.clone() to self,\nas it avoids reallocation if possible.

\n
source§

fn clone(&self) -> String

Returns a copy of the value. Read more
","Clone","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl DEREncodable for String

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl DEREncodable for String

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Debug for String

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl Decode for String

§

fn try_default() -> Result<String, DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<String, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl<'a> DecodeValue<'a> for String

§

fn decode_value<R>(reader: &mut R, header: Header) -> Result<String, Error>
where\n R: Reader<'a>,

Attempt to decode this message using the provided [Reader].
","DecodeValue<'a>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Default for String

source§

fn default() -> String

Creates an empty String.

\n
","Default","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.3.0 · source§

impl DerefMut for String

source§

fn deref_mut(&mut self) -> &mut str

Mutably dereferences the value.
","DerefMut","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl<'de> Deserialize<'de> for String

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<String, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Display for String

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl Encode for String

§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
","Encode","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl EncodeValue for String

§

fn value_len(&self) -> Result<Length, Error>

Compute the length of this value (sans [Tag]+[Length] header) when\nencoded as ASN.1 DER.
§

fn encode_value(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode value (sans [Tag]+[Length] header) as ASN.1 DER using the\nprovided [Writer].
§

fn header(&self) -> Result<Header, Error>
where\n Self: Tagged,

Get the [Header] used to encode this value.
","EncodeValue","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.2.0 · source§

impl<'a> Extend<&'a char> for String

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = &'a char>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: &'a char)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<&'a char>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl<'a> Extend<&'a str> for String

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = &'a str>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, s: &'a str)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<&'a str>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl<A> Extend<Box<str, A>> for String
where\n A: Allocator,

§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = Box<str, A>>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.45.0 · source§

impl<A> Extend<Box<str, A>> for String
where\n A: Allocator,

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = Box<str, A>>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.19.0 · source§

impl<'a> Extend<Cow<'a, str>> for String

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = Cow<'a, str>>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, s: Cow<'a, str>)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.4.0 · source§

impl Extend<String> for String

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = String>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, s: String)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Extend<char> for String

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = char>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, c: char)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl FixedTag for String

§

const TAG: Tag = Tag::Utf8String

ASN.1 tag
","FixedTag","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.35.0 · source§

impl From<&String> for String

source§

fn from(s: &String) -> String

Converts a &String into a String.

\n

This clones s and returns the clone.

\n
","From<&String>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.44.0 · source§

impl From<&mut str> for String

source§

fn from(s: &mut str) -> String

Converts a &mut str into a String.

\n

The result is allocated on the heap.

\n
","From<&mut str>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl From<&str> for String

source§

fn from(s: &str) -> String

Converts a &str into a String.

\n

The result is allocated on the heap.

\n
","From<&str>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.18.0 · source§

impl From<Box<str>> for String

source§

fn from(s: Box<str>) -> String

Converts the given boxed str slice to a String.\nIt is notable that the str slice is owned.

\n
§Examples
\n
let s1: String = String::from(\"hello world\");\nlet s2: Box<str> = s1.into_boxed_str();\nlet s3: String = String::from(s2);\n\nassert_eq!(\"hello world\", s3)
\n
","From>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.14.0 · source§

impl<'a> From<Cow<'a, str>> for String

source§

fn from(s: Cow<'a, str>) -> String

Converts a clone-on-write string to an owned\ninstance of String.

\n

This extracts the owned string,\nclones the string if it is not already owned.

\n
§Example
\n
// If the string is not owned...\nlet cow: Cow<'_, str> = Cow::Borrowed(\"eggplant\");\n// It will allocate on the heap and copy the string.\nlet owned: String = String::from(cow);\nassert_eq!(&owned[..], \"eggplant\");
\n
","From>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl From<Id> for String

§

fn from(value: Id) -> String

Converts to this type from the input type.
","From","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl From<Url> for String

String conversion.

\n
source§

fn from(value: Url) -> String

Converts to this type from the input type.
","From","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl<'a> From<Utf8StringRef<'a>> for String

§

fn from(s: Utf8StringRef<'a>) -> String

Converts to this type from the input type.
","From>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl From<Version> for String

§

fn from(value: Version) -> String

Converts to this type from the input type.
","From","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.46.0 · source§

impl From<char> for String

source§

fn from(c: char) -> String

Allocates an owned String from a single character.

\n
§Example
\n
let c: char = 'a';\nlet s: String = String::from(c);\nassert_eq!(\"a\", &s[..]);
\n
","From","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.17.0 · source§

impl<'a> FromIterator<&'a char> for String

source§

fn from_iter<I>(iter: I) -> String
where\n I: IntoIterator<Item = &'a char>,

Creates a value from an iterator. Read more
","FromIterator<&'a char>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl<'a> FromIterator<&'a str> for String

source§

fn from_iter<I>(iter: I) -> String
where\n I: IntoIterator<Item = &'a str>,

Creates a value from an iterator. Read more
","FromIterator<&'a str>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.45.0 · source§

impl<A> FromIterator<Box<str, A>> for String
where\n A: Allocator,

source§

fn from_iter<I>(iter: I) -> String
where\n I: IntoIterator<Item = Box<str, A>>,

Creates a value from an iterator. Read more
","FromIterator>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.19.0 · source§

impl<'a> FromIterator<Cow<'a, str>> for String

source§

fn from_iter<I>(iter: I) -> String
where\n I: IntoIterator<Item = Cow<'a, str>>,

Creates a value from an iterator. Read more
","FromIterator>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.4.0 · source§

impl FromIterator<String> for String

source§

fn from_iter<I>(iter: I) -> String
where\n I: IntoIterator<Item = String>,

Creates a value from an iterator. Read more
","FromIterator","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl FromIterator<char> for String

source§

fn from_iter<I>(iter: I) -> String
where\n I: IntoIterator<Item = char>,

Creates a value from an iterator. Read more
","FromIterator","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl FromStr for String

§

type Err = Infallible

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<String, <String as FromStr>::Err>

Parses a string s to return a value of this type. Read more
","FromStr","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Hash for String

source§

fn hash<H>(&self, hasher: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl<I> Index<I> for String
where\n I: SliceIndex<str>,

§

type Output = <I as SliceIndex<str>>::Output

The returned type after indexing.
source§

fn index(&self, index: I) -> &<I as SliceIndex<str>>::Output

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl<I> IndexMut<I> for String
where\n I: SliceIndex<str>,

source§

fn index_mut(&mut self, index: I) -> &mut <I as SliceIndex<str>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl<'de, E> IntoDeserializer<'de, E> for String
where\n E: Error,

§

type Deserializer = StringDeserializer<E>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> StringDeserializer<E>

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl Message for String

google.protobuf.StringValue

\n
source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where\n Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where\n Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited(\n &self,\n buf: &mut impl BufMut,\n) -> Result<(), EncodeError>
where\n Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where\n Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where\n Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where\n Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where\n Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where\n Self: Sized,

Decodes a length-delimited instance of the message from buffer, and\nmerges it into self.
","Message","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Ord for String

source§

fn cmp(&self, other: &String) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl<'a, 'b> PartialEq<&'a str> for String

source§

fn eq(&self, other: &&'a str) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&'a str) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&'a str>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl PartialEq<Bytes> for String

§

fn eq(&self, other: &Bytes) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl PartialEq<BytesMut> for String

§

fn eq(&self, other: &BytesMut) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl<'a, 'b> PartialEq<Cow<'a, str>> for String

source§

fn eq(&self, other: &Cow<'a, str>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &Cow<'a, str>) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl PartialEq<Value> for String

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl<'a, 'b> PartialEq<str> for String

source§

fn eq(&self, other: &str) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &str) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl PartialEq for String

source§

fn eq(&self, other: &String) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl PartialOrd<Bytes> for String

§

fn partial_cmp(&self, other: &Bytes) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl PartialOrd<BytesMut> for String

§

fn partial_cmp(&self, other: &BytesMut) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl PartialOrd for String

source§

fn partial_cmp(&self, other: &String) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl Replacer for String

§

fn replace_append(&mut self, caps: &Captures<'_>, dst: &mut String)

Appends possibly empty data to dst to replace the current match. Read more
§

fn no_expansion(&mut self) -> Option<Cow<'_, str>>

Return a fixed unchanging replacement string. Read more
§

fn by_ref<'r>(&'r mut self) -> ReplacerRef<'r, Self>

Returns a type that implements Replacer, but that borrows and wraps\nthis Replacer. Read more
","Replacer","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl Serialize for String

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl StrConsumer for String

Pushes the str onto the end of the String

\n
§

fn consume(&mut self, buf: &str)

Consume the base64 encoded data in buf
","StrConsumer","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl String

1.0.0 (const: 1.39.0) · source

pub const fn new() -> String

Creates a new empty String.

\n

Given that the String is empty, this will not allocate any initial\nbuffer. While that means that this initial operation is very\ninexpensive, it may cause excessive allocation later when you add\ndata. If you have an idea of how much data the String will hold,\nconsider the with_capacity method to prevent excessive\nre-allocation.

\n
§Examples
\n
let s = String::new();
\n
1.0.0 · source

pub fn with_capacity(capacity: usize) -> String

Creates a new empty String with at least the specified capacity.

\n

Strings have an internal buffer to hold their data. The capacity is\nthe length of that buffer, and can be queried with the capacity\nmethod. This method creates an empty String, but one with an initial\nbuffer that can hold at least capacity bytes. This is useful when you\nmay be appending a bunch of data to the String, reducing the number of\nreallocations it needs to do.

\n

If the given capacity is 0, no allocation will occur, and this method\nis identical to the new method.

\n
§Examples
\n
let mut s = String::with_capacity(10);\n\n// The String contains no chars, even though it has capacity for more\nassert_eq!(s.len(), 0);\n\n// These are all done without reallocating...\nlet cap = s.capacity();\nfor _ in 0..10 {\n    s.push('a');\n}\n\nassert_eq!(s.capacity(), cap);\n\n// ...but this may make the string reallocate\ns.push('a');
\n
source

pub fn try_with_capacity(capacity: usize) -> Result<String, TryReserveError>

🔬This is a nightly-only experimental API. (try_with_capacity)

Creates a new empty String with at least the specified capacity.

\n
§Errors
\n

Returns Err if the capacity exceeds isize::MAX bytes,\nor if the memory allocator reports failure.

\n
1.0.0 · source

pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error>

Converts a vector of bytes to a String.

\n

A string (String) is made of bytes (u8), and a vector of bytes\n(Vec<u8>) is made of bytes, so this function converts between the\ntwo. Not all byte slices are valid Strings, however: String\nrequires that it is valid UTF-8. from_utf8() checks to ensure that\nthe bytes are valid UTF-8, and then does the conversion.

\n

If you are sure that the byte slice is valid UTF-8, and you don’t want\nto incur the overhead of the validity check, there is an unsafe version\nof this function, from_utf8_unchecked, which has the same behavior\nbut skips the check.

\n

This method will take care to not copy the vector, for efficiency’s\nsake.

\n

If you need a &str instead of a String, consider\nstr::from_utf8.

\n

The inverse of this method is into_bytes.

\n
§Errors
\n

Returns Err if the slice is not UTF-8 with a description as to why the\nprovided bytes are not UTF-8. The vector you moved in is also included.

\n
§Examples
\n

Basic usage:

\n\n
// some bytes, in a vector\nlet sparkle_heart = vec![240, 159, 146, 150];\n\n// We know these bytes are valid, so we'll use `unwrap()`.\nlet sparkle_heart = String::from_utf8(sparkle_heart).unwrap();\n\nassert_eq!(\"💖\", sparkle_heart);
\n

Incorrect bytes:

\n\n
// some invalid bytes, in a vector\nlet sparkle_heart = vec![0, 159, 146, 150];\n\nassert!(String::from_utf8(sparkle_heart).is_err());
\n

See the docs for FromUtf8Error for more details on what you can do\nwith this error.

\n
1.0.0 · source

pub fn from_utf8_lossy(v: &[u8]) -> Cow<'_, str>

Converts a slice of bytes to a string, including invalid characters.

\n

Strings are made of bytes (u8), and a slice of bytes\n(&[u8]) is made of bytes, so this function converts\nbetween the two. Not all byte slices are valid strings, however: strings\nare required to be valid UTF-8. During this conversion,\nfrom_utf8_lossy() will replace any invalid UTF-8 sequences with\nU+FFFD REPLACEMENT CHARACTER, which looks like this: �

\n

If you are sure that the byte slice is valid UTF-8, and you don’t want\nto incur the overhead of the conversion, there is an unsafe version\nof this function, from_utf8_unchecked, which has the same behavior\nbut skips the checks.

\n

This function returns a Cow<'a, str>. If our byte slice is invalid\nUTF-8, then we need to insert the replacement characters, which will\nchange the size of the string, and hence, require a String. But if\nit’s already valid UTF-8, we don’t need a new allocation. This return\ntype allows us to handle both cases.

\n
§Examples
\n

Basic usage:

\n\n
// some bytes, in a vector\nlet sparkle_heart = vec![240, 159, 146, 150];\n\nlet sparkle_heart = String::from_utf8_lossy(&sparkle_heart);\n\nassert_eq!(\"💖\", sparkle_heart);
\n

Incorrect bytes:

\n\n
// some invalid bytes\nlet input = b\"Hello \\xF0\\x90\\x80World\";\nlet output = String::from_utf8_lossy(input);\n\nassert_eq!(\"Hello �World\", output);
\n
1.0.0 · source

pub fn from_utf16(v: &[u16]) -> Result<String, FromUtf16Error>

Decode a UTF-16–encoded vector v into a String, returning Err\nif v contains any invalid data.

\n
§Examples
\n
// 𝄞music\nlet v = &[0xD834, 0xDD1E, 0x006d, 0x0075,\n          0x0073, 0x0069, 0x0063];\nassert_eq!(String::from(\"𝄞music\"),\n           String::from_utf16(v).unwrap());\n\n// 𝄞mu<invalid>ic\nlet v = &[0xD834, 0xDD1E, 0x006d, 0x0075,\n          0xD800, 0x0069, 0x0063];\nassert!(String::from_utf16(v).is_err());
\n
1.0.0 · source

pub fn from_utf16_lossy(v: &[u16]) -> String

Decode a UTF-16–encoded slice v into a String, replacing\ninvalid data with the replacement character (U+FFFD).

\n

Unlike from_utf8_lossy which returns a Cow<'a, str>,\nfrom_utf16_lossy returns a String since the UTF-16 to UTF-8\nconversion requires a memory allocation.

\n
§Examples
\n
// 𝄞mus<invalid>ic<invalid>\nlet v = &[0xD834, 0xDD1E, 0x006d, 0x0075,\n          0x0073, 0xDD1E, 0x0069, 0x0063,\n          0xD834];\n\nassert_eq!(String::from(\"𝄞mus\\u{FFFD}ic\\u{FFFD}\"),\n           String::from_utf16_lossy(v));
\n
source

pub fn from_utf16le(v: &[u8]) -> Result<String, FromUtf16Error>

🔬This is a nightly-only experimental API. (str_from_utf16_endian)

Decode a UTF-16LE–encoded vector v into a String, returning Err\nif v contains any invalid data.

\n
§Examples
\n

Basic usage:

\n\n
#![feature(str_from_utf16_endian)]\n// 𝄞music\nlet v = &[0x34, 0xD8, 0x1E, 0xDD, 0x6d, 0x00, 0x75, 0x00,\n          0x73, 0x00, 0x69, 0x00, 0x63, 0x00];\nassert_eq!(String::from(\"𝄞music\"),\n           String::from_utf16le(v).unwrap());\n\n// 𝄞mu<invalid>ic\nlet v = &[0x34, 0xD8, 0x1E, 0xDD, 0x6d, 0x00, 0x75, 0x00,\n          0x00, 0xD8, 0x69, 0x00, 0x63, 0x00];\nassert!(String::from_utf16le(v).is_err());
\n
source

pub fn from_utf16le_lossy(v: &[u8]) -> String

🔬This is a nightly-only experimental API. (str_from_utf16_endian)

Decode a UTF-16LE–encoded slice v into a String, replacing\ninvalid data with the replacement character (U+FFFD).

\n

Unlike from_utf8_lossy which returns a Cow<'a, str>,\nfrom_utf16le_lossy returns a String since the UTF-16 to UTF-8\nconversion requires a memory allocation.

\n
§Examples
\n

Basic usage:

\n\n
#![feature(str_from_utf16_endian)]\n// 𝄞mus<invalid>ic<invalid>\nlet v = &[0x34, 0xD8, 0x1E, 0xDD, 0x6d, 0x00, 0x75, 0x00,\n          0x73, 0x00, 0x1E, 0xDD, 0x69, 0x00, 0x63, 0x00,\n          0x34, 0xD8];\n\nassert_eq!(String::from(\"𝄞mus\\u{FFFD}ic\\u{FFFD}\"),\n           String::from_utf16le_lossy(v));
\n
source

pub fn from_utf16be(v: &[u8]) -> Result<String, FromUtf16Error>

🔬This is a nightly-only experimental API. (str_from_utf16_endian)

Decode a UTF-16BE–encoded vector v into a String, returning Err\nif v contains any invalid data.

\n
§Examples
\n

Basic usage:

\n\n
#![feature(str_from_utf16_endian)]\n// 𝄞music\nlet v = &[0xD8, 0x34, 0xDD, 0x1E, 0x00, 0x6d, 0x00, 0x75,\n          0x00, 0x73, 0x00, 0x69, 0x00, 0x63];\nassert_eq!(String::from(\"𝄞music\"),\n           String::from_utf16be(v).unwrap());\n\n// 𝄞mu<invalid>ic\nlet v = &[0xD8, 0x34, 0xDD, 0x1E, 0x00, 0x6d, 0x00, 0x75,\n          0xD8, 0x00, 0x00, 0x69, 0x00, 0x63];\nassert!(String::from_utf16be(v).is_err());
\n
source

pub fn from_utf16be_lossy(v: &[u8]) -> String

🔬This is a nightly-only experimental API. (str_from_utf16_endian)

Decode a UTF-16BE–encoded slice v into a String, replacing\ninvalid data with the replacement character (U+FFFD).

\n

Unlike from_utf8_lossy which returns a Cow<'a, str>,\nfrom_utf16le_lossy returns a String since the UTF-16 to UTF-8\nconversion requires a memory allocation.

\n
§Examples
\n

Basic usage:

\n\n
#![feature(str_from_utf16_endian)]\n// 𝄞mus<invalid>ic<invalid>\nlet v = &[0xD8, 0x34, 0xDD, 0x1E, 0x00, 0x6d, 0x00, 0x75,\n          0x00, 0x73, 0xDD, 0x1E, 0x00, 0x69, 0x00, 0x63,\n          0xD8, 0x34];\n\nassert_eq!(String::from(\"𝄞mus\\u{FFFD}ic\\u{FFFD}\"),\n           String::from_utf16be_lossy(v));
\n
source

pub fn into_raw_parts(self) -> (*mut u8, usize, usize)

🔬This is a nightly-only experimental API. (vec_into_raw_parts)

Decomposes a String into its raw components: (pointer, length, capacity).

\n

Returns the raw pointer to the underlying data, the length of\nthe string (in bytes), and the allocated capacity of the data\n(in bytes). These are the same arguments in the same order as\nthe arguments to from_raw_parts.

\n

After calling this function, the caller is responsible for the\nmemory previously managed by the String. The only way to do\nthis is to convert the raw pointer, length, and capacity back\ninto a String with the from_raw_parts function, allowing\nthe destructor to perform the cleanup.

\n
§Examples
\n
#![feature(vec_into_raw_parts)]\nlet s = String::from(\"hello\");\n\nlet (ptr, len, cap) = s.into_raw_parts();\n\nlet rebuilt = unsafe { String::from_raw_parts(ptr, len, cap) };\nassert_eq!(rebuilt, \"hello\");
\n
1.0.0 · source

pub unsafe fn from_raw_parts(\n buf: *mut u8,\n length: usize,\n capacity: usize,\n) -> String

Creates a new String from a pointer, a length and a capacity.

\n
§Safety
\n

This is highly unsafe, due to the number of invariants that aren’t\nchecked:

\n
    \n
  • The memory at buf needs to have been previously allocated by the\nsame allocator the standard library uses, with a required alignment of exactly 1.
  • \n
  • length needs to be less than or equal to capacity.
  • \n
  • capacity needs to be the correct value.
  • \n
  • The first length bytes at buf need to be valid UTF-8.
  • \n
\n

Violating these may cause problems like corrupting the allocator’s\ninternal data structures. For example, it is normally not safe to\nbuild a String from a pointer to a C char array containing UTF-8\nunless you are certain that array was originally allocated by the\nRust standard library’s allocator.

\n

The ownership of buf is effectively transferred to the\nString which may then deallocate, reallocate or change the\ncontents of memory pointed to by the pointer at will. Ensure\nthat nothing else uses the pointer after calling this\nfunction.

\n
§Examples
\n
use std::mem;\n\nunsafe {\n    let s = String::from(\"hello\");\n\n    // Prevent automatically dropping the String's data\n    let mut s = mem::ManuallyDrop::new(s);\n\n    let ptr = s.as_mut_ptr();\n    let len = s.len();\n    let capacity = s.capacity();\n\n    let s = String::from_raw_parts(ptr, len, capacity);\n\n    assert_eq!(String::from(\"hello\"), s);\n}
\n
1.0.0 · source

pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> String

Converts a vector of bytes to a String without checking that the\nstring contains valid UTF-8.

\n

See the safe version, from_utf8, for more details.

\n
§Safety
\n

This function is unsafe because it does not check that the bytes passed\nto it are valid UTF-8. If this constraint is violated, it may cause\nmemory unsafety issues with future users of the String, as the rest of\nthe standard library assumes that Strings are valid UTF-8.

\n
§Examples
\n
// some bytes, in a vector\nlet sparkle_heart = vec![240, 159, 146, 150];\n\nlet sparkle_heart = unsafe {\n    String::from_utf8_unchecked(sparkle_heart)\n};\n\nassert_eq!(\"💖\", sparkle_heart);
\n
1.0.0 · source

pub fn into_bytes(self) -> Vec<u8>

Converts a String into a byte vector.

\n

This consumes the String, so we do not need to copy its contents.

\n
§Examples
\n
let s = String::from(\"hello\");\nlet bytes = s.into_bytes();\n\nassert_eq!(&[104, 101, 108, 108, 111][..], &bytes[..]);
\n
1.7.0 · source

pub fn as_str(&self) -> &str

Extracts a string slice containing the entire String.

\n
§Examples
\n
let s = String::from(\"foo\");\n\nassert_eq!(\"foo\", s.as_str());
\n
1.7.0 · source

pub fn as_mut_str(&mut self) -> &mut str

Converts a String into a mutable string slice.

\n
§Examples
\n
let mut s = String::from(\"foobar\");\nlet s_mut_str = s.as_mut_str();\n\ns_mut_str.make_ascii_uppercase();\n\nassert_eq!(\"FOOBAR\", s_mut_str);
\n
1.0.0 · source

pub fn push_str(&mut self, string: &str)

Appends a given string slice onto the end of this String.

\n
§Examples
\n
let mut s = String::from(\"foo\");\n\ns.push_str(\"bar\");\n\nassert_eq!(\"foobar\", s);
\n
source

pub fn extend_from_within<R>(&mut self, src: R)
where\n R: RangeBounds<usize>,

🔬This is a nightly-only experimental API. (string_extend_from_within)

Copies elements from src range to the end of the string.

\n
§Panics
\n

Panics if the starting point or end point do not lie on a char\nboundary, or if they’re out of bounds.

\n
§Examples
\n
#![feature(string_extend_from_within)]\nlet mut string = String::from(\"abcde\");\n\nstring.extend_from_within(2..);\nassert_eq!(string, \"abcdecde\");\n\nstring.extend_from_within(..2);\nassert_eq!(string, \"abcdecdeab\");\n\nstring.extend_from_within(4..8);\nassert_eq!(string, \"abcdecdeabecde\");
\n
1.0.0 · source

pub fn capacity(&self) -> usize

Returns this String’s capacity, in bytes.

\n
§Examples
\n
let s = String::with_capacity(10);\n\nassert!(s.capacity() >= 10);
\n
1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional bytes more than the\ncurrent length. The allocator may reserve more space to speculatively\navoid frequent allocations. After calling reserve,\ncapacity will be greater than or equal to self.len() + additional.\nDoes nothing if capacity is already sufficient.

\n
§Panics
\n

Panics if the new capacity overflows usize.

\n
§Examples
\n

Basic usage:

\n\n
let mut s = String::new();\n\ns.reserve(10);\n\nassert!(s.capacity() >= 10);
\n

This might not actually increase the capacity:

\n\n
let mut s = String::with_capacity(10);\ns.push('a');\ns.push('b');\n\n// s now has a length of 2 and a capacity of at least 10\nlet capacity = s.capacity();\nassert_eq!(2, s.len());\nassert!(capacity >= 10);\n\n// Since we already have at least an extra 8 capacity, calling this...\ns.reserve(8);\n\n// ... doesn't actually increase.\nassert_eq!(capacity, s.capacity());
\n
1.0.0 · source

pub fn reserve_exact(&mut self, additional: usize)

Reserves the minimum capacity for at least additional bytes more than\nthe current length. Unlike reserve, this will not\ndeliberately over-allocate to speculatively avoid frequent allocations.\nAfter calling reserve_exact, capacity will be greater than or equal to\nself.len() + additional. Does nothing if the capacity is already\nsufficient.

\n
§Panics
\n

Panics if the new capacity overflows usize.

\n
§Examples
\n

Basic usage:

\n\n
let mut s = String::new();\n\ns.reserve_exact(10);\n\nassert!(s.capacity() >= 10);
\n

This might not actually increase the capacity:

\n\n
let mut s = String::with_capacity(10);\ns.push('a');\ns.push('b');\n\n// s now has a length of 2 and a capacity of at least 10\nlet capacity = s.capacity();\nassert_eq!(2, s.len());\nassert!(capacity >= 10);\n\n// Since we already have at least an extra 8 capacity, calling this...\ns.reserve_exact(8);\n\n// ... doesn't actually increase.\nassert_eq!(capacity, s.capacity());
\n
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional bytes more than the\ncurrent length. The allocator may reserve more space to speculatively\navoid frequent allocations. After calling try_reserve, capacity will be\ngreater than or equal to self.len() + additional if it returns\nOk(()). Does nothing if capacity is already sufficient. This method\npreserves the contents even if an error occurs.

\n
§Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
§Examples
\n
use std::collections::TryReserveError;\n\nfn process_data(data: &str) -> Result<String, TryReserveError> {\n    let mut output = String::new();\n\n    // Pre-reserve the memory, exiting if we can't\n    output.try_reserve(data.len())?;\n\n    // Now we know this can't OOM in the middle of our complex work\n    output.push_str(data);\n\n    Ok(output)\n}
\n
1.57.0 · source

pub fn try_reserve_exact(\n &mut self,\n additional: usize,\n) -> Result<(), TryReserveError>

Tries to reserve the minimum capacity for at least additional bytes\nmore than the current length. Unlike try_reserve, this will not\ndeliberately over-allocate to speculatively avoid frequent allocations.\nAfter calling try_reserve_exact, capacity will be greater than or\nequal to self.len() + additional if it returns Ok(()).\nDoes nothing if the capacity is already sufficient.

\n

Note that the allocator may give the collection more space than it\nrequests. Therefore, capacity can not be relied upon to be precisely\nminimal. Prefer try_reserve if future insertions are expected.

\n
§Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
§Examples
\n
use std::collections::TryReserveError;\n\nfn process_data(data: &str) -> Result<String, TryReserveError> {\n    let mut output = String::new();\n\n    // Pre-reserve the memory, exiting if we can't\n    output.try_reserve_exact(data.len())?;\n\n    // Now we know this can't OOM in the middle of our complex work\n    output.push_str(data);\n\n    Ok(output)\n}
\n
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of this String to match its length.

\n
§Examples
\n
let mut s = String::from(\"foo\");\n\ns.reserve(100);\nassert!(s.capacity() >= 100);\n\ns.shrink_to_fit();\nassert_eq!(3, s.capacity());
\n
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of this String with a lower bound.

\n

The capacity will remain at least as large as both the length\nand the supplied value.

\n

If the current capacity is less than the lower limit, this is a no-op.

\n
§Examples
\n
let mut s = String::from(\"foo\");\n\ns.reserve(100);\nassert!(s.capacity() >= 100);\n\ns.shrink_to(10);\nassert!(s.capacity() >= 10);\ns.shrink_to(0);\nassert!(s.capacity() >= 3);
\n
1.0.0 · source

pub fn push(&mut self, ch: char)

Appends the given char to the end of this String.

\n
§Examples
\n
let mut s = String::from(\"abc\");\n\ns.push('1');\ns.push('2');\ns.push('3');\n\nassert_eq!(\"abc123\", s);
\n
1.0.0 · source

pub fn as_bytes(&self) -> &[u8]

Returns a byte slice of this String’s contents.

\n

The inverse of this method is from_utf8.

\n
§Examples
\n
let s = String::from(\"hello\");\n\nassert_eq!(&[104, 101, 108, 108, 111], s.as_bytes());
\n
1.0.0 · source

pub fn truncate(&mut self, new_len: usize)

Shortens this String to the specified length.

\n

If new_len is greater than or equal to the string’s current length, this has no\neffect.

\n

Note that this method has no effect on the allocated capacity\nof the string

\n
§Panics
\n

Panics if new_len does not lie on a char boundary.

\n
§Examples
\n
let mut s = String::from(\"hello\");\n\ns.truncate(2);\n\nassert_eq!(\"he\", s);
\n
1.0.0 · source

pub fn pop(&mut self) -> Option<char>

Removes the last character from the string buffer and returns it.

\n

Returns None if this String is empty.

\n
§Examples
\n
let mut s = String::from(\"abč\");\n\nassert_eq!(s.pop(), Some('č'));\nassert_eq!(s.pop(), Some('b'));\nassert_eq!(s.pop(), Some('a'));\n\nassert_eq!(s.pop(), None);
\n
1.0.0 · source

pub fn remove(&mut self, idx: usize) -> char

Removes a char from this String at a byte position and returns it.

\n

This is an O(n) operation, as it requires copying every element in the\nbuffer.

\n
§Panics
\n

Panics if idx is larger than or equal to the String’s length,\nor if it does not lie on a char boundary.

\n
§Examples
\n
let mut s = String::from(\"abç\");\n\nassert_eq!(s.remove(0), 'a');\nassert_eq!(s.remove(1), 'ç');\nassert_eq!(s.remove(0), 'b');
\n
source

pub fn remove_matches<'a, P>(&'a mut self, pat: P)
where\n P: for<'x> Pattern<'x>,

🔬This is a nightly-only experimental API. (string_remove_matches)

Remove all matches of pattern pat in the String.

\n
§Examples
\n
#![feature(string_remove_matches)]\nlet mut s = String::from(\"Trees are not green, the sky is not blue.\");\ns.remove_matches(\"not \");\nassert_eq!(\"Trees are green, the sky is blue.\", s);
\n

Matches will be detected and removed iteratively, so in cases where\npatterns overlap, only the first pattern will be removed:

\n\n
#![feature(string_remove_matches)]\nlet mut s = String::from(\"banana\");\ns.remove_matches(\"ana\");\nassert_eq!(\"bna\", s);
\n
1.26.0 · source

pub fn retain<F>(&mut self, f: F)
where\n F: FnMut(char) -> bool,

Retains only the characters specified by the predicate.

\n

In other words, remove all characters c such that f(c) returns false.\nThis method operates in place, visiting each character exactly once in the\noriginal order, and preserves the order of the retained characters.

\n
§Examples
\n
let mut s = String::from(\"f_o_ob_ar\");\n\ns.retain(|c| c != '_');\n\nassert_eq!(s, \"foobar\");
\n

Because the elements are visited exactly once in the original order,\nexternal state may be used to decide which elements to keep.

\n\n
let mut s = String::from(\"abcde\");\nlet keep = [false, true, true, false, true];\nlet mut iter = keep.iter();\ns.retain(|_| *iter.next().unwrap());\nassert_eq!(s, \"bce\");
\n
1.0.0 · source

pub fn insert(&mut self, idx: usize, ch: char)

Inserts a character into this String at a byte position.

\n

This is an O(n) operation as it requires copying every element in the\nbuffer.

\n
§Panics
\n

Panics if idx is larger than the String’s length, or if it does not\nlie on a char boundary.

\n
§Examples
\n
let mut s = String::with_capacity(3);\n\ns.insert(0, 'f');\ns.insert(1, 'o');\ns.insert(2, 'o');\n\nassert_eq!(\"foo\", s);
\n
1.16.0 · source

pub fn insert_str(&mut self, idx: usize, string: &str)

Inserts a string slice into this String at a byte position.

\n

This is an O(n) operation as it requires copying every element in the\nbuffer.

\n
§Panics
\n

Panics if idx is larger than the String’s length, or if it does not\nlie on a char boundary.

\n
§Examples
\n
let mut s = String::from(\"bar\");\n\ns.insert_str(0, \"foo\");\n\nassert_eq!(\"foobar\", s);
\n
1.0.0 · source

pub unsafe fn as_mut_vec(&mut self) -> &mut Vec<u8>

Returns a mutable reference to the contents of this String.

\n
§Safety
\n

This function is unsafe because the returned &mut Vec allows writing\nbytes which are not valid UTF-8. If this constraint is violated, using\nthe original String after dropping the &mut Vec may violate memory\nsafety, as the rest of the standard library assumes that Strings are\nvalid UTF-8.

\n
§Examples
\n
let mut s = String::from(\"hello\");\n\nunsafe {\n    let vec = s.as_mut_vec();\n    assert_eq!(&[104, 101, 108, 108, 111][..], &vec[..]);\n\n    vec.reverse();\n}\nassert_eq!(s, \"olleh\");
\n
1.0.0 · source

pub fn len(&self) -> usize

Returns the length of this String, in bytes, not chars or\ngraphemes. In other words, it might not be what a human considers the\nlength of the string.

\n
§Examples
\n
let a = String::from(\"foo\");\nassert_eq!(a.len(), 3);\n\nlet fancy_f = String::from(\"ƒoo\");\nassert_eq!(fancy_f.len(), 4);\nassert_eq!(fancy_f.chars().count(), 3);
\n
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if this String has a length of zero, and false otherwise.

\n
§Examples
\n
let mut v = String::new();\nassert!(v.is_empty());\n\nv.push('a');\nassert!(!v.is_empty());
\n
1.16.0 · source

pub fn split_off(&mut self, at: usize) -> String

Splits the string into two at the given byte index.

\n

Returns a newly allocated String. self contains bytes [0, at), and\nthe returned String contains bytes [at, len). at must be on the\nboundary of a UTF-8 code point.

\n

Note that the capacity of self does not change.

\n
§Panics
\n

Panics if at is not on a UTF-8 code point boundary, or if it is beyond the last\ncode point of the string.

\n
§Examples
\n
let mut hello = String::from(\"Hello, World!\");\nlet world = hello.split_off(7);\nassert_eq!(hello, \"Hello, \");\nassert_eq!(world, \"World!\");
\n
1.0.0 · source

pub fn clear(&mut self)

Truncates this String, removing all contents.

\n

While this means the String will have a length of zero, it does not\ntouch its capacity.

\n
§Examples
\n
let mut s = String::from(\"foo\");\n\ns.clear();\n\nassert!(s.is_empty());\nassert_eq!(0, s.len());\nassert_eq!(3, s.capacity());
\n
1.6.0 · source

pub fn drain<R>(&mut self, range: R) -> Drain<'_>
where\n R: RangeBounds<usize>,

Removes the specified range from the string in bulk, returning all\nremoved characters as an iterator.

\n

The returned iterator keeps a mutable borrow on the string to optimize\nits implementation.

\n
§Panics
\n

Panics if the starting point or end point do not lie on a char\nboundary, or if they’re out of bounds.

\n
§Leaking
\n

If the returned iterator goes out of scope without being dropped (due to\ncore::mem::forget, for example), the string may still contain a copy\nof any drained characters, or may have lost characters arbitrarily,\nincluding characters outside the range.

\n
§Examples
\n
let mut s = String::from(\"α is alpha, β is beta\");\nlet beta_offset = s.find('β').unwrap_or(s.len());\n\n// Remove the range up until the β from the string\nlet t: String = s.drain(..beta_offset).collect();\nassert_eq!(t, \"α is alpha, \");\nassert_eq!(s, \"β is beta\");\n\n// A full range clears the string, like `clear()` does\ns.drain(..);\nassert_eq!(s, \"\");
\n
1.27.0 · source

pub fn replace_range<R>(&mut self, range: R, replace_with: &str)
where\n R: RangeBounds<usize>,

Removes the specified range in the string,\nand replaces it with the given string.\nThe given string doesn’t need to be the same length as the range.

\n
§Panics
\n

Panics if the starting point or end point do not lie on a char\nboundary, or if they’re out of bounds.

\n
§Examples
\n
let mut s = String::from(\"α is alpha, β is beta\");\nlet beta_offset = s.find('β').unwrap_or(s.len());\n\n// Replace the range up until the β from the string\ns.replace_range(..beta_offset, \"Α is capital alpha; \");\nassert_eq!(s, \"Α is capital alpha; β is beta\");
\n
1.4.0 · source

pub fn into_boxed_str(self) -> Box<str>

Converts this String into a Box<str>.

\n

Before doing the conversion, this method discards excess capacity like shrink_to_fit.\nNote that this call may reallocate and copy the bytes of the string.

\n
§Examples
\n
let s = String::from(\"hello\");\n\nlet b = s.into_boxed_str();
\n
1.72.0 · source

pub fn leak<'a>(self) -> &'a mut str

Consumes and leaks the String, returning a mutable reference to the contents,\n&'a mut str.

\n

The caller has free choice over the returned lifetime, including 'static. Indeed,\nthis function is ideally used for data that lives for the remainder of the program’s life,\nas dropping the returned reference will cause a memory leak.

\n

It does not reallocate or shrink the String, so the leaked allocation may include unused\ncapacity that is not part of the returned slice. If you want to discard excess capacity,\ncall into_boxed_str, and then Box::leak instead. However, keep in mind that\ntrimming the capacity may result in a reallocation and copy.

\n
§Examples
\n
let x = String::from(\"bucket\");\nlet static_ref: &'static mut str = x.leak();\nassert_eq!(static_ref, \"bucket\");
\n
",0,"oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl Tagged for String

§

const TAG: Tag = Tag::Utf8String

","Tagged","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl Target for String

§

fn as_mut_string(&mut self) -> &mut String

§

fn finish(self) -> String

§

type Finished = String

","Target","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl ToDer for String

§

fn to_der_len(&self) -> Result<usize, Error>

Get the length of the object (including the header), when encoded
§

fn write_der_header(\n &self,\n writer: &mut dyn Write,\n) -> Result<usize, SerializeError>

Attempt to write the DER header to this writer.
§

fn write_der_content(\n &self,\n writer: &mut dyn Write,\n) -> Result<usize, SerializeError>

Attempt to write the DER content (all except header) to this writer.
§

fn to_der_vec(&self) -> Result<Vec<u8>, SerializeError>

Write the DER encoded representation to a newly allocated Vec<u8>.
§

fn to_der_vec_raw(&self) -> Result<Vec<u8>, SerializeError>

Similar to using to_vec, but uses provided values without changes.\nThis can generate an invalid encoding for a DER object.
§

fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>

Attempt to write the DER encoded representation (header and content) into this writer. Read more
§

fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>

Similar to using to_der, but uses provided values without changes.\nThis can generate an invalid encoding for a DER object.
","ToDer","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.16.0 · source§

impl ToSocketAddrs for String

§

type Iter = IntoIter<SocketAddr>

Returned iterator over socket addresses which this type may correspond\nto.
source§

fn to_socket_addrs(&self) -> Result<IntoIter<SocketAddr>, Error>

Converts this object to an iterator of resolved SocketAddrs. Read more
","ToSocketAddrs","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl<'a, 'b> TryFrom<&'b Any<'a>> for String

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(any: &'b Any<'a>) -> Result<String, Error>

Performs the conversion.
","TryFrom<&'b Any<'a>>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl<'a> TryFrom<Any<'a>> for String

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(any: Any<'a>) -> Result<String, Error>

Performs the conversion.
","TryFrom>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl<'a> TryFrom<AnyRef<'a>> for String

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(any: AnyRef<'a>) -> Result<String, Error>

Performs the conversion.
","TryFrom>","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl Value for String

§

fn serialize(\n &self,\n _record: &Record<'_>,\n key: &'static str,\n serializer: &mut dyn Serializer,\n) -> Result<(), Error>

Serialize self into Serializer Read more
","Value","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Write for String

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write\nsucceeded. Read more
source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more
","Write","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl Zeroize for String

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the\nzeroization operation is not “optimized away” by the compiler.
","Zeroize","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Deref for String

§

type Target = str

The resulting type after dereferencing.
source§

fn deref(&self) -> &str

Dereferences the value.
","Deref","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl DerAutoDerive for String

","DerAutoDerive","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl DerefPure for String

","DerefPure","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl Eq for String

","Eq","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
source§

impl Index for String

","Index","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
1.0.0 · source§

impl StructuralPartialEq for String

","StructuralPartialEq","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"],["
§

impl ToSocketAddrs for String

","ToSocketAddrs","oasis_core_runtime::consensus::staking::StakeClaim","oasis_core_runtime::consensus::transaction::MethodName"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/alloc/sync/struct.Arc.js b/rust/type.impl/alloc/sync/struct.Arc.js new file mode 100644 index 0000000000..7d613749f8 --- /dev/null +++ b/rust/type.impl/alloc/sync/struct.Arc.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
§

impl<'a, A> Arbitrary<'a> for Arc<A>
where\n A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Arc<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
","Arbitrary<'a>","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T> Arc<T>
where\n T: ?Sized,

1.17.0 · source

pub unsafe fn from_raw(ptr: *const T) -> Arc<T>

Constructs an Arc<T> from a raw pointer.

\n

The raw pointer must have been previously returned by a call to\nArc<U>::into_raw with the following requirements:

\n
    \n
  • If U is sized, it must have the same size and alignment as T. This\nis trivially true if U is T.
  • \n
  • If U is unsized, its data pointer must have the same size and\nalignment as T. This is trivially true if Arc<U> was constructed\nthrough Arc<T> and then converted to Arc<U> through an unsized\ncoercion.
  • \n
\n

Note that if U or U’s data pointer is not T but has the same size\nand alignment, this is basically like transmuting references of\ndifferent types. See mem::transmute for more information\non what restrictions apply in this case.

\n

The user of from_raw has to make sure a specific value of T is only\ndropped once.

\n

This function is unsafe because improper use may lead to memory unsafety,\neven if the returned Arc<T> is never accessed.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x = Arc::new(\"hello\".to_owned());\nlet x_ptr = Arc::into_raw(x);\n\nunsafe {\n    // Convert back to an `Arc` to prevent leak.\n    let x = Arc::from_raw(x_ptr);\n    assert_eq!(&*x, \"hello\");\n\n    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.\n}\n\n// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
\n

Convert a slice back into its original array:

\n\n
use std::sync::Arc;\n\nlet x: Arc<[u32]> = Arc::new([1, 2, 3]);\nlet x_ptr: *const [u32] = Arc::into_raw(x);\n\nunsafe {\n    let x: Arc<[u32; 3]> = Arc::from_raw(x_ptr.cast::<[u32; 3]>());\n    assert_eq!(&*x, &[1, 2, 3]);\n}
\n
1.51.0 · source

pub unsafe fn increment_strong_count(ptr: *const T)

Increments the strong reference count on the Arc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Arc::into_raw, and the\nassociated Arc instance must be valid (i.e. the strong count must be at\nleast 1) for the duration of this method.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nunsafe {\n    let ptr = Arc::into_raw(five);\n    Arc::increment_strong_count(ptr);\n\n    // This assertion is deterministic because we haven't shared\n    // the `Arc` between threads.\n    let five = Arc::from_raw(ptr);\n    assert_eq!(2, Arc::strong_count(&five));\n}
\n
1.51.0 · source

pub unsafe fn decrement_strong_count(ptr: *const T)

Decrements the strong reference count on the Arc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Arc::into_raw, and the\nassociated Arc instance must be valid (i.e. the strong count must be at\nleast 1) when invoking this method. This method can be used to release the final\nArc and backing storage, but should not be called after the final Arc has been\nreleased.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nunsafe {\n    let ptr = Arc::into_raw(five);\n    Arc::increment_strong_count(ptr);\n\n    // Those assertions are deterministic because we haven't shared\n    // the `Arc` between threads.\n    let five = Arc::from_raw(ptr);\n    assert_eq!(2, Arc::strong_count(&five));\n    Arc::decrement_strong_count(ptr);\n    assert_eq!(1, Arc::strong_count(&five));\n}
\n
",0,"oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T> Arc<T>

1.0.0 · source

pub fn new(data: T) -> Arc<T>

Constructs a new Arc<T>.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);
\n
1.60.0 · source

pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
where\n F: FnOnce(&Weak<T>) -> T,

Constructs a new Arc<T> while giving you a Weak<T> to the allocation,\nto allow you to construct a T which holds a weak pointer to itself.

\n

Generally, a structure circularly referencing itself, either directly or\nindirectly, should not hold a strong reference to itself to prevent a memory leak.\nUsing this function, you get access to the weak pointer during the\ninitialization of T, before the Arc<T> is created, such that you can\nclone and store it inside the T.

\n

new_cyclic first allocates the managed allocation for the Arc<T>,\nthen calls your closure, giving it a Weak<T> to this allocation,\nand only afterwards completes the construction of the Arc<T> by placing\nthe T returned from your closure into the allocation.

\n

Since the new Arc<T> is not fully-constructed until Arc<T>::new_cyclic\nreturns, calling upgrade on the weak reference inside your closure will\nfail and result in a None value.

\n
§Panics
\n

If data_fn panics, the panic is propagated to the caller, and the\ntemporary Weak<T> is dropped normally.

\n
§Example
\n
use std::sync::{Arc, Weak};\n\nstruct Gadget {\n    me: Weak<Gadget>,\n}\n\nimpl Gadget {\n    /// Construct a reference counted Gadget.\n    fn new() -> Arc<Self> {\n        // `me` is a `Weak<Gadget>` pointing at the new allocation of the\n        // `Arc` we're constructing.\n        Arc::new_cyclic(|me| {\n            // Create the actual struct here.\n            Gadget { me: me.clone() }\n        })\n    }\n\n    /// Return a reference counted pointer to Self.\n    fn me(&self) -> Arc<Self> {\n        self.me.upgrade().unwrap()\n    }\n}
\n
source

pub fn new_uninit() -> Arc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Arc with uninitialized contents.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet mut five = Arc::<u32>::new_uninit();\n\n// Deferred initialization:\nArc::get_mut(&mut five).unwrap().write(5);\n\nlet five = unsafe { five.assume_init() };\n\nassert_eq!(*five, 5)
\n
source

pub fn new_zeroed() -> Arc<MaybeUninit<T>>

🔬This is a nightly-only experimental API. (new_uninit)

Constructs a new Arc with uninitialized contents, with the memory\nbeing filled with 0 bytes.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
§Examples
\n
#![feature(new_uninit)]\n\nuse std::sync::Arc;\n\nlet zero = Arc::<u32>::new_zeroed();\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0)
\n
1.33.0 · source

pub fn pin(data: T) -> Pin<Arc<T>>

Constructs a new Pin<Arc<T>>. If T does not implement Unpin, then\ndata will be pinned in memory and unable to be moved.

\n
source

pub fn try_pin(data: T) -> Result<Pin<Arc<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T>>, return an error if allocation fails.

\n
source

pub fn try_new(data: T) -> Result<Arc<T>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T>, returning an error if allocation fails.

\n
§Examples
\n
#![feature(allocator_api)]\nuse std::sync::Arc;\n\nlet five = Arc::try_new(5)?;
\n
source

pub fn try_new_uninit() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, returning an error\nif allocation fails.

\n
§Examples
\n
#![feature(new_uninit, allocator_api)]\n#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet mut five = Arc::<u32>::try_new_uninit()?;\n\n// Deferred initialization:\nArc::get_mut(&mut five).unwrap().write(5);\n\nlet five = unsafe { five.assume_init() };\n\nassert_eq!(*five, 5);
\n
source

pub fn try_new_zeroed() -> Result<Arc<MaybeUninit<T>>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory\nbeing filled with 0 bytes, returning an error if allocation fails.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
§Examples
\n
#![feature(new_uninit, allocator_api)]\n\nuse std::sync::Arc;\n\nlet zero = Arc::<u32>::try_new_zeroed()?;\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0);
\n
",0,"oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T, A> Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

1.17.0 · source

pub fn into_raw(this: Arc<T, A>) -> *const T

Consumes the Arc, returning the wrapped pointer.

\n

To avoid a memory leak the pointer must be converted back to an Arc using\nArc::from_raw.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x = Arc::new(\"hello\".to_owned());\nlet x_ptr = Arc::into_raw(x);\nassert_eq!(unsafe { &*x_ptr }, \"hello\");
\n
source

pub fn into_raw_with_allocator(this: Arc<T, A>) -> (*const T, A)

🔬This is a nightly-only experimental API. (allocator_api)

Consumes the Arc, returning the wrapped pointer and allocator.

\n

To avoid a memory leak the pointer must be converted back to an Arc using\nArc::from_raw_in.

\n
§Examples
\n
#![feature(allocator_api)]\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet x = Arc::new_in(\"hello\".to_owned(), System);\nlet (ptr, alloc) = Arc::into_raw_with_allocator(x);\nassert_eq!(unsafe { &*ptr }, \"hello\");\nlet x = unsafe { Arc::from_raw_in(ptr, alloc) };\nassert_eq!(&*x, \"hello\");
\n
1.45.0 · source

pub fn as_ptr(this: &Arc<T, A>) -> *const T

Provides a raw pointer to the data.

\n

The counts are not affected in any way and the Arc is not consumed. The pointer is valid for\nas long as there are strong counts in the Arc.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x = Arc::new(\"hello\".to_owned());\nlet y = Arc::clone(&x);\nlet x_ptr = Arc::as_ptr(&x);\nassert_eq!(x_ptr, Arc::as_ptr(&y));\nassert_eq!(unsafe { &*x_ptr }, \"hello\");
\n
source

pub unsafe fn from_raw_in(ptr: *const T, alloc: A) -> Arc<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs an Arc<T, A> from a raw pointer.

\n

The raw pointer must have been previously returned by a call to Arc<U, A>::into_raw with the following requirements:

\n
    \n
  • If U is sized, it must have the same size and alignment as T. This\nis trivially true if U is T.
  • \n
  • If U is unsized, its data pointer must have the same size and\nalignment as T. This is trivially true if Arc<U> was constructed\nthrough Arc<T> and then converted to Arc<U> through an unsized\ncoercion.
  • \n
\n

Note that if U or U’s data pointer is not T but has the same size\nand alignment, this is basically like transmuting references of\ndifferent types. See mem::transmute for more information\non what restrictions apply in this case.

\n

The raw pointer must point to a block of memory allocated by alloc

\n

The user of from_raw has to make sure a specific value of T is only\ndropped once.

\n

This function is unsafe because improper use may lead to memory unsafety,\neven if the returned Arc<T> is never accessed.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet x = Arc::new_in(\"hello\".to_owned(), System);\nlet x_ptr = Arc::into_raw(x);\n\nunsafe {\n    // Convert back to an `Arc` to prevent leak.\n    let x = Arc::from_raw_in(x_ptr, System);\n    assert_eq!(&*x, \"hello\");\n\n    // Further calls to `Arc::from_raw(x_ptr)` would be memory-unsafe.\n}\n\n// The memory was freed when `x` went out of scope above, so `x_ptr` is now dangling!
\n

Convert a slice back into its original array:

\n\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet x: Arc<[u32], _> = Arc::new_in([1, 2, 3], System);\nlet x_ptr: *const [u32] = Arc::into_raw(x);\n\nunsafe {\n    let x: Arc<[u32; 3], _> = Arc::from_raw_in(x_ptr.cast::<[u32; 3]>(), System);\n    assert_eq!(&*x, &[1, 2, 3]);\n}
\n
1.4.0 · source

pub fn downgrade(this: &Arc<T, A>) -> Weak<T, A>
where\n A: Clone,

Creates a new Weak pointer to this allocation.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nlet weak_five = Arc::downgrade(&five);
\n
1.15.0 · source

pub fn weak_count(this: &Arc<T, A>) -> usize

Gets the number of Weak pointers to this allocation.

\n
§Safety
\n

This method by itself is safe, but using it correctly requires extra care.\nAnother thread can change the weak count at any time,\nincluding potentially between calling this method and acting on the result.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\nlet _weak_five = Arc::downgrade(&five);\n\n// This assertion is deterministic because we haven't shared\n// the `Arc` or `Weak` between threads.\nassert_eq!(1, Arc::weak_count(&five));
\n
1.15.0 · source

pub fn strong_count(this: &Arc<T, A>) -> usize

Gets the number of strong (Arc) pointers to this allocation.

\n
§Safety
\n

This method by itself is safe, but using it correctly requires extra care.\nAnother thread can change the strong count at any time,\nincluding potentially between calling this method and acting on the result.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\nlet _also_five = Arc::clone(&five);\n\n// This assertion is deterministic because we haven't shared\n// the `Arc` between threads.\nassert_eq!(2, Arc::strong_count(&five));
\n
source

pub unsafe fn increment_strong_count_in(ptr: *const T, alloc: A)
where\n A: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Increments the strong reference count on the Arc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Arc::into_raw, and the\nassociated Arc instance must be valid (i.e. the strong count must be at\nleast 1) for the duration of this method,, and ptr must point to a block of memory\nallocated by alloc.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet five = Arc::new_in(5, System);\n\nunsafe {\n    let ptr = Arc::into_raw(five);\n    Arc::increment_strong_count_in(ptr, System);\n\n    // This assertion is deterministic because we haven't shared\n    // the `Arc` between threads.\n    let five = Arc::from_raw_in(ptr, System);\n    assert_eq!(2, Arc::strong_count(&five));\n}
\n
source

pub unsafe fn decrement_strong_count_in(ptr: *const T, alloc: A)

🔬This is a nightly-only experimental API. (allocator_api)

Decrements the strong reference count on the Arc<T> associated with the\nprovided pointer by one.

\n
§Safety
\n

The pointer must have been obtained through Arc::into_raw, the\nassociated Arc instance must be valid (i.e. the strong count must be at\nleast 1) when invoking this method, and ptr must point to a block of memory\nallocated by alloc. This method can be used to release the final\nArc and backing storage, but should not be called after the final Arc has been\nreleased.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet five = Arc::new_in(5, System);\n\nunsafe {\n    let ptr = Arc::into_raw(five);\n    Arc::increment_strong_count_in(ptr, System);\n\n    // Those assertions are deterministic because we haven't shared\n    // the `Arc` between threads.\n    let five = Arc::from_raw_in(ptr, System);\n    assert_eq!(2, Arc::strong_count(&five));\n    Arc::decrement_strong_count_in(ptr, System);\n    assert_eq!(1, Arc::strong_count(&five));\n}
\n
1.17.0 · source

pub fn ptr_eq(this: &Arc<T, A>, other: &Arc<T, A>) -> bool

Returns true if the two Arcs point to the same allocation in a vein similar to\nptr::eq. This function ignores the metadata of dyn Trait pointers.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\nlet same_five = Arc::clone(&five);\nlet other_five = Arc::new(5);\n\nassert!(Arc::ptr_eq(&five, &same_five));\nassert!(!Arc::ptr_eq(&five, &other_five));
\n
",0,"oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T, A> Arc<T, A>
where\n T: CloneToUninit + ?Sized,\n A: Allocator + Clone,

1.4.0 · source

pub fn make_mut(this: &mut Arc<T, A>) -> &mut T

Makes a mutable reference into the given Arc.

\n

If there are other Arc pointers to the same allocation, then make_mut will\nclone the inner value to a new allocation to ensure unique ownership. This is also\nreferred to as clone-on-write.

\n

However, if there are no other Arc pointers to this allocation, but some Weak\npointers, then the Weak pointers will be dissociated and the inner value will not\nbe cloned.

\n

See also get_mut, which will fail rather than cloning the inner value\nor dissociating Weak pointers.

\n
§Examples
\n
use std::sync::Arc;\n\nlet mut data = Arc::new(5);\n\n*Arc::make_mut(&mut data) += 1;         // Won't clone anything\nlet mut other_data = Arc::clone(&data); // Won't clone inner data\n*Arc::make_mut(&mut data) += 1;         // Clones inner data\n*Arc::make_mut(&mut data) += 1;         // Won't clone anything\n*Arc::make_mut(&mut other_data) *= 2;   // Won't clone anything\n\n// Now `data` and `other_data` point to different allocations.\nassert_eq!(*data, 8);\nassert_eq!(*other_data, 12);
\n

Weak pointers will be dissociated:

\n\n
use std::sync::Arc;\n\nlet mut data = Arc::new(75);\nlet weak = Arc::downgrade(&data);\n\nassert!(75 == *data);\nassert!(75 == *weak.upgrade().unwrap());\n\n*Arc::make_mut(&mut data) += 1;\n\nassert!(76 == *data);\nassert!(weak.upgrade().is_none());
\n
",0,"oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T, A> Arc<T, A>
where\n T: Clone,\n A: Allocator,

1.76.0 · source

pub fn unwrap_or_clone(this: Arc<T, A>) -> T

If we have the only reference to T then unwrap it. Otherwise, clone T and return the\nclone.

\n

Assuming arc_t is of type Arc<T>, this function is functionally equivalent to\n(*arc_t).clone(), but will avoid cloning the inner value where possible.

\n
§Examples
\n
let inner = String::from(\"test\");\nlet ptr = inner.as_ptr();\n\nlet arc = Arc::new(inner);\nlet inner = Arc::unwrap_or_clone(arc);\n// The inner value was not cloned\nassert!(ptr::eq(ptr, inner.as_ptr()));\n\nlet arc = Arc::new(inner);\nlet arc2 = arc.clone();\nlet inner = Arc::unwrap_or_clone(arc);\n// Because there were 2 references, we had to clone the inner value.\nassert!(!ptr::eq(ptr, inner.as_ptr()));\n// `arc2` is the last reference, so when we unwrap it we get back\n// the original `String`.\nlet inner = Arc::unwrap_or_clone(arc2);\nassert!(ptr::eq(ptr, inner.as_ptr()));
\n
",0,"oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T, A> Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

1.4.0 · source

pub fn get_mut(this: &mut Arc<T, A>) -> Option<&mut T>

Returns a mutable reference into the given Arc, if there are\nno other Arc or Weak pointers to the same allocation.

\n

Returns None otherwise, because it is not safe to\nmutate a shared value.

\n

See also make_mut, which will clone\nthe inner value when there are other Arc pointers.

\n
§Examples
\n
use std::sync::Arc;\n\nlet mut x = Arc::new(3);\n*Arc::get_mut(&mut x).unwrap() = 4;\nassert_eq!(*x, 4);\n\nlet _y = Arc::clone(&x);\nassert!(Arc::get_mut(&mut x).is_none());
\n
source

pub unsafe fn get_mut_unchecked(this: &mut Arc<T, A>) -> &mut T

🔬This is a nightly-only experimental API. (get_mut_unchecked)

Returns a mutable reference into the given Arc,\nwithout any check.

\n

See also get_mut, which is safe and does appropriate checks.

\n
§Safety
\n

If any other Arc or Weak pointers to the same allocation exist, then\nthey must not be dereferenced or have active borrows for the duration\nof the returned borrow, and their inner type must be exactly the same as the\ninner type of this Rc (including lifetimes). This is trivially the case if no\nsuch pointers exist, for example immediately after Arc::new.

\n
§Examples
\n
#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet mut x = Arc::new(String::new());\nunsafe {\n    Arc::get_mut_unchecked(&mut x).push_str(\"foo\")\n}\nassert_eq!(*x, \"foo\");
\n

Other Arc pointers to the same allocation must be to the same type.

\n\n
#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet x: Arc<str> = Arc::from(\"Hello, world!\");\nlet mut y: Arc<[u8]> = x.clone().into();\nunsafe {\n    // this is Undefined Behavior, because x's inner type is str, not [u8]\n    Arc::get_mut_unchecked(&mut y).fill(0xff); // 0xff is invalid in UTF-8\n}\nprintln!(\"{}\", &*x); // Invalid UTF-8 in a str
\n

Other Arc pointers to the same allocation must be to the exact same type, including lifetimes.

\n\n
#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\n\nlet x: Arc<&str> = Arc::new(\"Hello, world!\");\n{\n    let s = String::from(\"Oh, no!\");\n    let mut y: Arc<&str> = x.clone().into();\n    unsafe {\n        // this is Undefined Behavior, because x's inner type\n        // is &'long str, not &'short str\n        *Arc::get_mut_unchecked(&mut y) = &s;\n    }\n}\nprintln!(\"{}\", &*x); // Use-after-free
\n
",0,"oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T, A> Arc<T, A>
where\n A: Allocator,

source

pub fn allocator(this: &Arc<T, A>) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

\n

Note: this is an associated function, which means that you have\nto call it as Arc::allocator(&a) instead of a.allocator(). This\nis so that there is no conflict with a method on the inner type.

\n
source

pub fn new_in(data: T, alloc: A) -> Arc<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T> in the provided allocator.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet five = Arc::new_in(5, System);
\n
source

pub fn new_uninit_in(alloc: A) -> Arc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents in the provided allocator.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(get_mut_unchecked)]\n#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet mut five = Arc::<u32, _>::new_uninit_in(System);\n\nlet five = unsafe {\n    // Deferred initialization:\n    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5)
\n
source

pub fn new_zeroed_in(alloc: A) -> Arc<MaybeUninit<T>, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory\nbeing filled with 0 bytes, in the provided allocator.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
§Examples
\n
#![feature(new_uninit)]\n#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet zero = Arc::<u32, _>::new_zeroed_in(System);\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0)
\n
source

pub fn pin_in(data: T, alloc: A) -> Pin<Arc<T, A>>
where\n A: 'static,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T, A>> in the provided allocator. If T does not implement Unpin,\nthen data will be pinned in memory and unable to be moved.

\n
source

pub fn try_pin_in(data: T, alloc: A) -> Result<Pin<Arc<T, A>>, AllocError>
where\n A: 'static,

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Pin<Arc<T, A>> in the provided allocator, return an error if allocation\nfails.

\n
source

pub fn try_new_in(data: T, alloc: A) -> Result<Arc<T, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc<T, A> in the provided allocator, returning an error if allocation fails.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet five = Arc::try_new_in(5, System)?;
\n
source

pub fn try_new_uninit_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, in the provided allocator, returning an\nerror if allocation fails.

\n
§Examples
\n
#![feature(new_uninit, allocator_api)]\n#![feature(get_mut_unchecked)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet mut five = Arc::<u32, _>::try_new_uninit_in(System)?;\n\nlet five = unsafe {\n    // Deferred initialization:\n    Arc::get_mut_unchecked(&mut five).as_mut_ptr().write(5);\n\n    five.assume_init()\n};\n\nassert_eq!(*five, 5);
\n
source

pub fn try_new_zeroed_in(alloc: A) -> Result<Arc<MaybeUninit<T>, A>, AllocError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new Arc with uninitialized contents, with the memory\nbeing filled with 0 bytes, in the provided allocator, returning an error if allocation\nfails.

\n

See MaybeUninit::zeroed for examples of correct and incorrect usage\nof this method.

\n
§Examples
\n
#![feature(new_uninit, allocator_api)]\n\nuse std::sync::Arc;\nuse std::alloc::System;\n\nlet zero = Arc::<u32, _>::try_new_zeroed_in(System)?;\nlet zero = unsafe { zero.assume_init() };\n\nassert_eq!(*zero, 0);
\n
1.4.0 · source

pub fn try_unwrap(this: Arc<T, A>) -> Result<T, Arc<T, A>>

Returns the inner value, if the Arc has exactly one strong reference.

\n

Otherwise, an Err is returned with the same Arc that was\npassed in.

\n

This will succeed even if there are outstanding weak references.

\n

It is strongly recommended to use Arc::into_inner instead if you don’t\nkeep the Arc in the Err case.\nImmediately dropping the Err-value, as the expression\nArc::try_unwrap(this).ok() does, can cause the strong count to\ndrop to zero and the inner value of the Arc to be dropped.\nFor instance, if two threads execute such an expression in parallel,\nthere is a race condition without the possibility of unsafety:\nThe threads could first both check whether they own the last instance\nin Arc::try_unwrap, determine that they both do not, and then both\ndiscard and drop their instance in the call to ok.\nIn this scenario, the value inside the Arc is safely destroyed\nby exactly one of the threads, but neither thread will ever be able\nto use the value.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x = Arc::new(3);\nassert_eq!(Arc::try_unwrap(x), Ok(3));\n\nlet x = Arc::new(4);\nlet _y = Arc::clone(&x);\nassert_eq!(*Arc::try_unwrap(x).unwrap_err(), 4);
\n
1.70.0 · source

pub fn into_inner(this: Arc<T, A>) -> Option<T>

Returns the inner value, if the Arc has exactly one strong reference.

\n

Otherwise, None is returned and the Arc is dropped.

\n

This will succeed even if there are outstanding weak references.

\n

If Arc::into_inner is called on every clone of this Arc,\nit is guaranteed that exactly one of the calls returns the inner value.\nThis means in particular that the inner value is not dropped.

\n

Arc::try_unwrap is conceptually similar to Arc::into_inner, but it\nis meant for different use-cases. If used as a direct replacement\nfor Arc::into_inner anyway, such as with the expression\nArc::try_unwrap(this).ok(), then it does\nnot give the same guarantee as described in the previous paragraph.\nFor more information, see the examples below and read the documentation\nof Arc::try_unwrap.

\n
§Examples
\n

Minimal example demonstrating the guarantee that Arc::into_inner gives.

\n\n
use std::sync::Arc;\n\nlet x = Arc::new(3);\nlet y = Arc::clone(&x);\n\n// Two threads calling `Arc::into_inner` on both clones of an `Arc`:\nlet x_thread = std::thread::spawn(|| Arc::into_inner(x));\nlet y_thread = std::thread::spawn(|| Arc::into_inner(y));\n\nlet x_inner_value = x_thread.join().unwrap();\nlet y_inner_value = y_thread.join().unwrap();\n\n// One of the threads is guaranteed to receive the inner value:\nassert!(matches!(\n    (x_inner_value, y_inner_value),\n    (None, Some(3)) | (Some(3), None)\n));\n// The result could also be `(None, None)` if the threads called\n// `Arc::try_unwrap(x).ok()` and `Arc::try_unwrap(y).ok()` instead.
\n

A more practical example demonstrating the need for Arc::into_inner:

\n\n
use std::sync::Arc;\n\n// Definition of a simple singly linked list using `Arc`:\n#[derive(Clone)]\nstruct LinkedList<T>(Option<Arc<Node<T>>>);\nstruct Node<T>(T, Option<Arc<Node<T>>>);\n\n// Dropping a long `LinkedList<T>` relying on the destructor of `Arc`\n// can cause a stack overflow. To prevent this, we can provide a\n// manual `Drop` implementation that does the destruction in a loop:\nimpl<T> Drop for LinkedList<T> {\n    fn drop(&mut self) {\n        let mut link = self.0.take();\n        while let Some(arc_node) = link.take() {\n            if let Some(Node(_value, next)) = Arc::into_inner(arc_node) {\n                link = next;\n            }\n        }\n    }\n}\n\n// Implementation of `new` and `push` omitted\nimpl<T> LinkedList<T> {\n    /* ... */\n}\n\n// The following code could have still caused a stack overflow\n// despite the manual `Drop` impl if that `Drop` impl had used\n// `Arc::try_unwrap(arc).ok()` instead of `Arc::into_inner(arc)`.\n\n// Create a long list and clone it\nlet mut x = LinkedList::new();\nlet size = 100000;\nfor i in 0..size {\n    x.push(i); // Adds i to the front of x\n}\nlet y = x.clone();\n\n// Drop the clones in parallel\nlet x_thread = std::thread::spawn(|| drop(x));\nlet y_thread = std::thread::spawn(|| drop(y));\nx_thread.join().unwrap();\ny_thread.join().unwrap();
\n
",0,"oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.64.0 · source§

impl<T> AsFd for Arc<T>
where\n T: AsFd + ?Sized,

This impl allows implementing traits that require AsFd on Arc.

\n\n
use std::net::UdpSocket;\nuse std::sync::Arc;\n\ntrait MyTrait: AsFd {}\nimpl MyTrait for Arc<UdpSocket> {}\nimpl MyTrait for Box<UdpSocket> {}
\n
source§

fn as_fd(&self) -> BorrowedFd<'_>

Borrows the file descriptor. Read more
","AsFd","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.63.0 · source§

impl<T> AsRawFd for Arc<T>
where\n T: AsRawFd,

This impl allows implementing traits that require AsRawFd on Arc.

\n\n
use std::net::UdpSocket;\nuse std::sync::Arc;\ntrait MyTrait: AsRawFd {\n}\nimpl MyTrait for Arc<UdpSocket> {}\nimpl MyTrait for Box<UdpSocket> {}
\n
source§

fn as_raw_fd(&self) -> i32

Extracts the raw file descriptor. Read more
","AsRawFd","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.5.0 · source§

impl<T, A> AsRef<T> for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Borrow<T> for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
","Borrow","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Clone for Arc<T, A>
where\n A: Allocator + Clone,\n T: ?Sized,

source§

fn clone(&self) -> Arc<T, A>

Makes a clone of the Arc pointer.

\n

This creates another pointer to the same allocation, increasing the\nstrong reference count.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nlet _ = Arc::clone(&five);
\n
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Debug for Arc<T, A>
where\n T: Debug + ?Sized,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T> Default for Arc<T>
where\n T: Default,

source§

fn default() -> Arc<T>

Creates a new Arc<T>, with the Default value for T.

\n
§Examples
\n
use std::sync::Arc;\n\nlet x: Arc<i32> = Default::default();\nassert_eq!(*x, 0);
\n
","Default","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T: Dispatcher + ?Sized> Dispatcher for Arc<T>

source§

fn execute_batch(\n &self,\n ctx: Context<'_>,\n batch: &TxnBatch,\n in_msgs: &[IncomingMessage],\n) -> Result<ExecuteBatchResult, RuntimeError>

Execute the transactions in the given batch. Read more
source§

fn schedule_and_execute_batch(\n &self,\n ctx: Context<'_>,\n initial_batch: &mut TxnBatch,\n in_msgs: &[IncomingMessage],\n) -> Result<ExecuteBatchResult, RuntimeError>

Schedule and execute transactions in the given batch. Read more
source§

fn check_batch(\n &self,\n ctx: Context<'_>,\n batch: &TxnBatch,\n) -> Result<Vec<CheckTxResult>, RuntimeError>

Check the transactions in the given batch for validity. Read more
source§

fn finalize(&self, new_storage_root: Hash)

Invoke the finalizer (if any).
source§

fn set_abort_batch_flag(&mut self, _abort_batch: Arc<AtomicBool>)

Configure abort batch flag.
source§

fn query(\n &self,\n ctx: Context<'_>,\n method: &str,\n args: Vec<u8>,\n) -> Result<Vec<u8>, RuntimeError>

Process a query. Read more
source§

fn is_supported(&self) -> bool

Whether dispatch is supported by this dispatcher.
","Dispatcher","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Display for Arc<T, A>
where\n T: Display + ?Sized,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Display","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
§

impl<D> Drain for Arc<D>
where\n D: Drain + ?Sized,

§

type Ok = <D as Drain>::Ok

Type returned by this drain Read more
§

type Err = <D as Drain>::Err

Type of potential errors that can be returned by this Drain
§

fn log(\n &self,\n record: &Record<'_>,\n o: &OwnedKVList,\n) -> Result<<Arc<D> as Drain>::Ok, <D as Drain>::Err>

Handle one logging statement (Record) Read more
§

fn is_enabled(&self, level: Level) -> bool

Avoid: Check if messages at the specified log level are maybe\nenabled for this logger. Read more
§

fn is_critical_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_error_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_warning_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_info_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_debug_enabled(&self) -> bool

Avoid: See is_enabled
§

fn is_trace_enabled(&self) -> bool

Avoid: See is_enabled
§

fn map<F, R>(self, f: F) -> R
where\n Self: Sized,\n F: FnOnce(Self) -> R,

Pass Drain through a closure, eg. to wrap\ninto another Drain. Read more
§

fn filter<F>(self, f: F) -> Filter<Self, F>
where\n Self: Sized,\n F: FilterFn,

Filter logging records passed to Drain Read more
§

fn filter_level(self, level: Level) -> LevelFilter<Self>
where\n Self: Sized,

Filter logging records passed to Drain (by level) Read more
§

fn map_err<F, E>(self, f: F) -> MapError<Self, E>
where\n Self: Sized,\n F: MapErrFn<Self::Err, E>,

Map logging errors returned by this drain Read more
§

fn ignore_res(self) -> IgnoreResult<Self>
where\n Self: Sized,

Ignore results returned by this drain Read more
","Drain","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Drop for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn drop(&mut self)

Drops the Arc.

\n

This will decrement the strong reference count. If the strong reference\ncount reaches zero then the only other references (if any) are\nWeak, so we drop the inner value.

\n
§Examples
\n
use std::sync::Arc;\n\nstruct Foo;\n\nimpl Drop for Foo {\n    fn drop(&mut self) {\n        println!(\"dropped!\");\n    }\n}\n\nlet foo  = Arc::new(Foo);\nlet foo2 = Arc::clone(&foo);\n\ndrop(foo);    // Doesn't print anything\ndrop(foo2);   // Prints \"dropped!\"
\n
","Drop","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.52.0 · source§

impl<T> Error for Arc<T>
where\n T: Error + ?Sized,

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn provide<'a>(&'a self, req: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
","Error","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.21.0 · source§

impl<T, A> From<Box<T, A>> for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn from(v: Box<T, A>) -> Arc<T, A>

Move a boxed object to a new, reference-counted allocation.

\n
§Example
\n
let unique: Box<str> = Box::from(\"eggplant\");\nlet shared: Arc<str> = Arc::from(unique);\nassert_eq!(\"eggplant\", &shared[..]);
\n
","From>","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.45.0 · source§

impl<'a, B> From<Cow<'a, B>> for Arc<B>
where\n B: ToOwned + ?Sized,\n Arc<B>: From<&'a B> + From<<B as ToOwned>::Owned>,

source§

fn from(cow: Cow<'a, B>) -> Arc<B>

Create an atomically reference-counted pointer from\na clone-on-write pointer by copying its content.

\n
§Example
\n
let cow: Cow<'_, str> = Cow::Borrowed(\"eggplant\");\nlet shared: Arc<str> = Arc::from(cow);\nassert_eq!(\"eggplant\", &shared[..]);
\n
","From>","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.6.0 · source§

impl<T> From<T> for Arc<T>

source§

fn from(t: T) -> Arc<T>

Converts a T into an Arc<T>

\n

The conversion moves the value into a\nnewly allocated Arc. It is equivalent to\ncalling Arc::new(t).

\n
§Example
\n
let x = 5;\nlet arc = Arc::new(5);\n\nassert_eq!(Arc::from(x), arc);
\n
","From","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Hash for Arc<T, A>
where\n T: Hash + ?Sized,\n A: Allocator,

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
§

impl<T> KV for Arc<T>
where\n T: KV + ?Sized,

§

fn serialize(\n &self,\n record: &Record<'_>,\n serializer: &mut dyn Serializer,\n) -> Result<(), Error>

Serialize self into Serializer Read more
","KV","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T: ?Sized + KeyValue> KeyValue for Arc<T>

source§

fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>

Fetch the value for a specific key.
source§

fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>

Store a specific key/value into storage.
","KeyValue","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
§

impl<Sp> LocalSpawn for Arc<Sp>
where\n Sp: LocalSpawn + ?Sized,

§

fn spawn_local_obj(\n &self,\n future: LocalFutureObj<'static, ()>,\n) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status_local(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
","LocalSpawn","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T> Log for Arc<T>
where\n T: Log + ?Sized,

source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a log message with the specified metadata would be\nlogged. Read more
source§

fn log(&self, record: &Record<'_>)

Logs the Record. Read more
source§

fn flush(&self)

Flushes any buffered records. Read more
","Log","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Ord for Arc<T, A>
where\n T: Ord + ?Sized,\n A: Allocator,

source§

fn cmp(&self, other: &Arc<T, A>) -> Ordering

Comparison for two Arcs.

\n

The two are compared by calling cmp() on their inner values.

\n
§Examples
\n
use std::sync::Arc;\nuse std::cmp::Ordering;\n\nlet five = Arc::new(5);\n\nassert_eq!(Ordering::Less, five.cmp(&Arc::new(6)));
\n
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> PartialEq for Arc<T, A>
where\n T: PartialEq + ?Sized,\n A: Allocator,

source§

fn eq(&self, other: &Arc<T, A>) -> bool

Equality for two Arcs.

\n

Two Arcs are equal if their inner values are equal, even if they are\nstored in different allocation.

\n

If T also implements Eq (implying reflexivity of equality),\ntwo Arcs that point to the same allocation are always equal.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five == Arc::new(5));
\n
source§

fn ne(&self, other: &Arc<T, A>) -> bool

Inequality for two Arcs.

\n

Two Arcs are not equal if their inner values are not equal.

\n

If T also implements Eq (implying reflexivity of equality),\ntwo Arcs that point to the same value are always equal.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five != Arc::new(6));
\n
","PartialEq","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> PartialOrd for Arc<T, A>
where\n T: PartialOrd + ?Sized,\n A: Allocator,

source§

fn partial_cmp(&self, other: &Arc<T, A>) -> Option<Ordering>

Partial comparison for two Arcs.

\n

The two are compared by calling partial_cmp() on their inner values.

\n
§Examples
\n
use std::sync::Arc;\nuse std::cmp::Ordering;\n\nlet five = Arc::new(5);\n\nassert_eq!(Some(Ordering::Less), five.partial_cmp(&Arc::new(6)));
\n
source§

fn lt(&self, other: &Arc<T, A>) -> bool

Less-than comparison for two Arcs.

\n

The two are compared by calling < on their inner values.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five < Arc::new(6));
\n
source§

fn le(&self, other: &Arc<T, A>) -> bool

‘Less than or equal to’ comparison for two Arcs.

\n

The two are compared by calling <= on their inner values.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five <= Arc::new(5));
\n
source§

fn gt(&self, other: &Arc<T, A>) -> bool

Greater-than comparison for two Arcs.

\n

The two are compared by calling > on their inner values.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five > Arc::new(4));
\n
source§

fn ge(&self, other: &Arc<T, A>) -> bool

‘Greater than or equal to’ comparison for two Arcs.

\n

The two are compared by calling >= on their inner values.

\n
§Examples
\n
use std::sync::Arc;\n\nlet five = Arc::new(5);\n\nassert!(five >= Arc::new(5));
\n
","PartialOrd","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Pointer for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Pointer","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
§

impl<T> RefCnt for Arc<T>

§

type Base = T

The base type the pointer points to.
§

fn into_ptr(me: Arc<T>) -> *mut T

Converts the smart pointer into a raw pointer, without affecting the reference count. Read more
§

fn as_ptr(me: &Arc<T>) -> *mut T

Provides a view into the smart pointer as a raw pointer. Read more
§

unsafe fn from_ptr(ptr: *const T) -> Arc<T>

Converts a raw pointer back into the smart pointer, without affecting the reference count. Read more
§

fn inc(me: &Self) -> *mut Self::Base

Increments the reference count by one. Read more
§

unsafe fn dec(ptr: *const Self::Base)

Decrements the reference count by one. Read more
","RefCnt","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
§

impl<Sp> Spawn for Arc<Sp>
where\n Sp: Spawn + ?Sized,

§

fn spawn_obj(&self, future: FutureObj<'static, ()>) -> Result<(), SpawnError>

Spawns a future that will be run to completion. Read more
§

fn status(&self) -> Result<(), SpawnError>

Determines whether the executor is able to spawn new tasks. Read more
","Spawn","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
§

impl<T> Value for Arc<T>
where\n T: Value + ?Sized,

§

fn serialize(\n &self,\n record: &Record<'_>,\n key: &'static str,\n serializer: &mut dyn Serializer,\n) -> Result<(), Error>

Serialize self into Serializer Read more
","Value","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T: ?Sized + Verifier> Verifier for Arc<T>

source§

fn sync<'life0, 'async_trait>(\n &'life0 self,\n height: u64,\n) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where\n Self: 'async_trait,\n 'life0: 'async_trait,

Synchronize the verifier state up to including the passed consensus height.
source§

fn verify<'life0, 'async_trait>(\n &'life0 self,\n consensus_block: LightBlock,\n runtime_header: Header,\n epoch: EpochTime,\n) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where\n Self: 'async_trait,\n 'life0: 'async_trait,

Verify that the given runtime header is valid at the given consensus layer block and return\nthe consensus layer state accessor for that block. Read more
source§

fn verify_for_query<'life0, 'async_trait>(\n &'life0 self,\n consensus_block: LightBlock,\n runtime_header: Header,\n epoch: EpochTime,\n) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where\n Self: 'async_trait,\n 'life0: 'async_trait,

Verify that the given runtime header is valid at the given consensus layer block and return\nthe consensus layer state accessor for that block. Read more
source§

fn unverified_state<'life0, 'async_trait>(\n &'life0 self,\n consensus_block: LightBlock,\n) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where\n Self: 'async_trait,\n 'life0: 'async_trait,

Return the consensus layer state accessor for the given consensus layer block WITHOUT\nperforming any verification. This method should only be used for operations that do not\nrequire integrity guarantees.
source§

fn latest_state<'life0, 'async_trait>(\n &'life0 self,\n) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where\n Self: 'async_trait,\n 'life0: 'async_trait,

Return the latest verified consensus layer state. Read more
source§

fn state_at<'life0, 'async_trait>(\n &'life0 self,\n height: u64,\n) -> Pin<Box<dyn Future<Output = Result<ConsensusState, Error>> + Send + 'async_trait>>
where\n Self: 'async_trait,\n 'life0: 'async_trait,

Return the verified consensus layer state for a given height. Read more
source§

fn events_at<'life0, 'async_trait>(\n &'life0 self,\n height: u64,\n kind: EventKind,\n) -> Pin<Box<dyn Future<Output = Result<Vec<Event>, Error>> + Send + 'async_trait>>
where\n Self: 'async_trait,\n 'life0: 'async_trait,

Return the consensus layer events at the given height. Read more
source§

fn latest_height<'life0, 'async_trait>(\n &'life0 self,\n) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where\n Self: 'async_trait,\n 'life0: 'async_trait,

Return the latest known consensus layer height.
","Verifier","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Deref for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
","Deref","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T, U, A> CoerceUnsized<Arc<U, A>> for Arc<T, A>
where\n T: Unsize<U> + ?Sized,\n A: Allocator,\n U: ?Sized,

","CoerceUnsized>","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T, A> DerefPure for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

","DerefPure","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
source§

impl<T, U> DispatchFromDyn<Arc<U>> for Arc<T>
where\n T: Unsize<U> + ?Sized,\n U: ?Sized,

","DispatchFromDyn>","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Eq for Arc<T, A>
where\n T: Eq + ?Sized,\n A: Allocator,

","Eq","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Send for Arc<T, A>
where\n T: Sync + Send + ?Sized,\n A: Allocator + Send,

","Send","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.0.0 · source§

impl<T, A> Sync for Arc<T, A>
where\n T: Sync + Send + ?Sized,\n A: Allocator + Sync,

","Sync","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.33.0 · source§

impl<T, A> Unpin for Arc<T, A>
where\n A: Allocator,\n T: ?Sized,

","Unpin","oasis_core_runtime::enclave_rpc::sessions::SharedSession"],["
1.9.0 · source§

impl<T, A> UnwindSafe for Arc<T, A>
where\n T: RefUnwindSafe + ?Sized,\n A: Allocator + UnwindSafe,

","UnwindSafe","oasis_core_runtime::enclave_rpc::sessions::SharedSession"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/alloc/vec/struct.Vec.js b/rust/type.impl/alloc/vec/struct.Vec.js new file mode 100644 index 0000000000..0ae97296c1 --- /dev/null +++ b/rust/type.impl/alloc/vec/struct.Vec.js @@ -0,0 +1,4 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
§

impl<'a, A> Arbitrary<'a> for Vec<A>
where\n A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Vec<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Vec<A>, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
§

fn size_hint(_depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
","Arbitrary<'a>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.5.0 · source§

impl<T, A> AsMut<[T]> for Vec<T, A>
where\n A: Allocator,

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut<[T]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.5.0 · source§

impl<T, A> AsMut<Vec<T, A>> for Vec<T, A>
where\n A: Allocator,

source§

fn as_mut(&mut self) -> &mut Vec<T, A>

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> AsRef<[T]> for Vec<T, A>
where\n A: Allocator,

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[T]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> AsRef<Vec<T, A>> for Vec<T, A>
where\n A: Allocator,

source§

fn as_ref(&self) -> &Vec<T, A>

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl AsyncWrite for Vec<u8>

§

fn poll_write(\n self: Pin<&mut Vec<u8>>,\n _: &mut Context<'_>,\n buf: &[u8],\n) -> Poll<Result<usize, Error>>

Attempt to write bytes from buf into the object. Read more
§

fn poll_write_vectored(\n self: Pin<&mut Vec<u8>>,\n _: &mut Context<'_>,\n bufs: &[IoSlice<'_>],\n) -> Poll<Result<usize, Error>>

Attempt to write bytes from bufs into the object using vectored\nIO operations. Read more
§

fn poll_flush(\n self: Pin<&mut Vec<u8>>,\n _: &mut Context<'_>,\n) -> Poll<Result<(), Error>>

Attempt to flush the object, ensuring that any buffered data reach\ntheir destination. Read more
§

fn poll_close(\n self: Pin<&mut Vec<u8>>,\n cx: &mut Context<'_>,\n) -> Poll<Result<(), Error>>

Attempt to close the object. Read more
","AsyncWrite","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl AsyncWrite for Vec<u8>

§

fn poll_write(\n self: Pin<&mut Vec<u8>>,\n _cx: &mut Context<'_>,\n buf: &[u8],\n) -> Poll<Result<usize, Error>>

Attempt to write bytes from buf into the object. Read more
§

fn poll_write_vectored(\n self: Pin<&mut Vec<u8>>,\n _: &mut Context<'_>,\n bufs: &[IoSlice<'_>],\n) -> Poll<Result<usize, Error>>

Like poll_write, except that it writes from a slice of buffers. Read more
§

fn is_write_vectored(&self) -> bool

Determines if this writer has an efficient poll_write_vectored\nimplementation. Read more
§

fn poll_flush(\n self: Pin<&mut Vec<u8>>,\n _cx: &mut Context<'_>,\n) -> Poll<Result<(), Error>>

Attempts to flush the object, ensuring that any buffered data reach\ntheir destination. Read more
§

fn poll_shutdown(\n self: Pin<&mut Vec<u8>>,\n _cx: &mut Context<'_>,\n) -> Poll<Result<(), Error>>

Initiates or attempts to shut down this writer, returning success when\nthe I/O connection has completely shut down. Read more
","AsyncWrite","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl<T> BERDecodable for Vec<T>
where\n T: BERDecodable,

§

fn decode_ber(reader: BERReader<'_, '_>) -> Result<Vec<T>, ASN1Error>

Reads an ASN.1 value from BERReader and converts it to Self. Read more
","BERDecodable","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> BERDecodable for Vec<T>
where\n T: BERDecodable,

§

fn decode_ber(reader: BERReader<'_, '_>) -> Result<Vec<T>, ASN1Error>

Reads an ASN.1 value from BERReader and converts it to Self. Read more
","BERDecodable","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl BERDecodable for Vec<u8>

§

fn decode_ber(reader: BERReader<'_, '_>) -> Result<Vec<u8>, ASN1Error>

Reads an ASN.1 value from BERReader and converts it to Self. Read more
","BERDecodable","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl BERDecodable for Vec<u8>

§

fn decode_ber(reader: BERReader<'_, '_>) -> Result<Vec<u8>, ASN1Error>

Reads an ASN.1 value from BERReader and converts it to Self. Read more
","BERDecodable","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.0.0 · source§

impl<T, A> Borrow<[T]> for Vec<T, A>
where\n A: Allocator,

source§

fn borrow(&self) -> &[T]

Immutably borrows from an owned value. Read more
","Borrow<[T]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> BorrowMut<[T]> for Vec<T, A>
where\n A: Allocator,

source§

fn borrow_mut(&mut self) -> &mut [T]

Mutably borrows from an owned value. Read more
","BorrowMut<[T]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl BufMut for Vec<u8>

§

fn remaining_mut(&self) -> usize

Returns the number of bytes that can be written from the current\nposition until the end of the buffer is reached. Read more
§

unsafe fn advance_mut(&mut self, cnt: usize)

Advance the internal cursor of the BufMut Read more
§

fn chunk_mut(&mut self) -> &mut UninitSlice

Returns a mutable slice starting at the current BufMut position and of\nlength between 0 and BufMut::remaining_mut(). Note that this can be shorter than the\nwhole remainder of the buffer (this allows non-continuous implementation). Read more
§

fn put<T>(&mut self, src: T)
where\n T: Buf,\n Vec<u8>: Sized,

Transfer bytes into self from src and advance the cursor by the\nnumber of bytes written. Read more
§

fn put_slice(&mut self, src: &[u8])

Transfer bytes into self from src and advance the cursor by the\nnumber of bytes written. Read more
§

fn put_bytes(&mut self, val: u8, cnt: usize)

Put cnt bytes val into self. Read more
§

fn has_remaining_mut(&self) -> bool

Returns true if there is space in self for more bytes. Read more
§

fn put_u8(&mut self, n: u8)

Writes an unsigned 8 bit integer to self. Read more
§

fn put_i8(&mut self, n: i8)

Writes a signed 8 bit integer to self. Read more
§

fn put_u16(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in big-endian byte order. Read more
§

fn put_u16_le(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in little-endian byte order. Read more
§

fn put_u16_ne(&mut self, n: u16)

Writes an unsigned 16 bit integer to self in native-endian byte order. Read more
§

fn put_i16(&mut self, n: i16)

Writes a signed 16 bit integer to self in big-endian byte order. Read more
§

fn put_i16_le(&mut self, n: i16)

Writes a signed 16 bit integer to self in little-endian byte order. Read more
§

fn put_i16_ne(&mut self, n: i16)

Writes a signed 16 bit integer to self in native-endian byte order. Read more
§

fn put_u32(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in big-endian byte order. Read more
§

fn put_u32_le(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in little-endian byte order. Read more
§

fn put_u32_ne(&mut self, n: u32)

Writes an unsigned 32 bit integer to self in native-endian byte order. Read more
§

fn put_i32(&mut self, n: i32)

Writes a signed 32 bit integer to self in big-endian byte order. Read more
§

fn put_i32_le(&mut self, n: i32)

Writes a signed 32 bit integer to self in little-endian byte order. Read more
§

fn put_i32_ne(&mut self, n: i32)

Writes a signed 32 bit integer to self in native-endian byte order. Read more
§

fn put_u64(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in the big-endian byte order. Read more
§

fn put_u64_le(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in little-endian byte order. Read more
§

fn put_u64_ne(&mut self, n: u64)

Writes an unsigned 64 bit integer to self in native-endian byte order. Read more
§

fn put_i64(&mut self, n: i64)

Writes a signed 64 bit integer to self in the big-endian byte order. Read more
§

fn put_i64_le(&mut self, n: i64)

Writes a signed 64 bit integer to self in little-endian byte order. Read more
§

fn put_i64_ne(&mut self, n: i64)

Writes a signed 64 bit integer to self in native-endian byte order. Read more
§

fn put_u128(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in the big-endian byte order. Read more
§

fn put_u128_le(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in little-endian byte order. Read more
§

fn put_u128_ne(&mut self, n: u128)

Writes an unsigned 128 bit integer to self in native-endian byte order. Read more
§

fn put_i128(&mut self, n: i128)

Writes a signed 128 bit integer to self in the big-endian byte order. Read more
§

fn put_i128_le(&mut self, n: i128)

Writes a signed 128 bit integer to self in little-endian byte order. Read more
§

fn put_i128_ne(&mut self, n: i128)

Writes a signed 128 bit integer to self in native-endian byte order. Read more
§

fn put_uint(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in big-endian byte order. Read more
§

fn put_uint_le(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in the little-endian byte order. Read more
§

fn put_uint_ne(&mut self, n: u64, nbytes: usize)

Writes an unsigned n-byte integer to self in the native-endian byte order. Read more
§

fn put_int(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in big-endian byte order. Read more
§

fn put_int_le(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in little-endian byte order. Read more
§

fn put_int_ne(&mut self, n: i64, nbytes: usize)

Writes low nbytes of a signed integer to self in native-endian byte order. Read more
§

fn put_f32(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to\nself in big-endian byte order. Read more
§

fn put_f32_le(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to\nself in little-endian byte order. Read more
§

fn put_f32_ne(&mut self, n: f32)

Writes an IEEE754 single-precision (4 bytes) floating point number to\nself in native-endian byte order. Read more
§

fn put_f64(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to\nself in big-endian byte order. Read more
§

fn put_f64_le(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to\nself in little-endian byte order. Read more
§

fn put_f64_ne(&mut self, n: f64)

Writes an IEEE754 double-precision (8 bytes) floating point number to\nself in native-endian byte order. Read more
§

fn limit(self, limit: usize) -> Limit<Self>
where\n Self: Sized,

Creates an adaptor which can write at most limit bytes to self. Read more
§

fn writer(self) -> Writer<Self>
where\n Self: Sized,

Creates an adaptor which implements the Write trait for self. Read more
§

fn chain_mut<U>(self, next: U) -> Chain<Self, U>
where\n U: BufMut,\n Self: Sized,

Creates an adapter which will chain this buffer with another. Read more
","BufMut","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl Buffer for Vec<u8>

§

fn extend_from_slice(&mut self, other: &[u8]) -> Result<(), Error>

Extend this buffer from the given slice
§

fn truncate(&mut self, len: usize)

Truncate this buffer to the given size
§

fn len(&self) -> usize

Get the length of the buffer
§

fn is_empty(&self) -> bool

Is the buffer empty?
","Buffer","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl<T> CheckDerConstraints for Vec<T>
where\n T: CheckDerConstraints,

§

fn check_constraints(any: &Any<'_>) -> Result<(), Error>

","CheckDerConstraints","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> Clone for Vec<T, A>
where\n T: Clone,\n A: Allocator + Clone,

source§

fn clone_from(&mut self, source: &Vec<T, A>)

Overwrites the contents of self with a clone of the contents of source.

\n

This method is preferred over simply assigning source.clone() to self,\nas it avoids reallocation if possible. Additionally, if the element type\nT overrides clone_from(), this will reuse the resources of self’s\nelements as well.

\n
§Examples
\n
let x = vec![5, 6, 7];\nlet mut y = vec![8, 9, 10];\nlet yp: *const i32 = y.as_ptr();\n\ny.clone_from(&x);\n\n// The value is the same\nassert_eq!(x, y);\n\n// And no reallocation occurred\nassert_eq!(yp, y.as_ptr());
\n
source§

fn clone(&self) -> Vec<T, A>

Returns a copy of the value. Read more
","Clone","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> DEREncodable for Vec<T>
where\n T: DEREncodable,

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> DEREncodable for Vec<T>
where\n T: DEREncodable,

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl DEREncodable for Vec<u8>

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl DEREncodable for Vec<u8>

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.0.0 · source§

impl<T, A> Debug for Vec<T, A>
where\n T: Debug,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Decode for Vec<T>
where\n T: Decode,

§

default fn try_default() -> Result<Vec<T>, DecodeError>

Try to decode from a missing/null/undefined value.
§

default fn try_from_cbor_value(value: Value) -> Result<Vec<T>, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl Decode for Vec<u8>

§

fn try_from_cbor_value(value: Value) -> Result<Vec<u8>, DecodeError>

Try to decode from a given CBOR value.
§

fn try_default() -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl<'a, T> DecodeValue<'a> for Vec<T>
where\n T: Decode<'a>,

§

fn decode_value<R>(reader: &mut R, header: Header) -> Result<Vec<T>, Error>
where\n R: Reader<'a>,

Attempt to decode this message using the provided [Reader].
","DecodeValue<'a>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T> Default for Vec<T>

source§

fn default() -> Vec<T>

Creates an empty Vec<T>.

\n

The vector will not allocate until elements are pushed onto it.

\n
","Default","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> DerefMut for Vec<T, A>
where\n A: Allocator,

source§

fn deref_mut(&mut self) -> &mut [T]

Mutably dereferences the value.
","DerefMut","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl<'de, T> Deserialize<'de> for Vec<T>
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<Vec<T>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> Drop for Vec<T, A>
where\n A: Allocator,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
","Drop","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Encode for Vec<T>
where\n T: Encode,

§

default fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

default fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
","Encode","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl Encode for Vec<u8>

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
","Encode","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl<T> EncodeValue for Vec<T>
where\n T: Encode,

§

fn value_len(&self) -> Result<Length, Error>

Compute the length of this value (sans [Tag]+[Length] header) when\nencoded as ASN.1 DER.
§

fn encode_value(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode value (sans [Tag]+[Length] header) as ASN.1 DER using the\nprovided [Writer].
§

fn header(&self) -> Result<Header, Error>
where\n Self: Tagged,

Get the [Header] used to encode this value.
","EncodeValue","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.2.0 · source§

impl<'a, T, A> Extend<&'a T> for Vec<T, A>
where\n T: Copy + 'a,\n A: Allocator,

Extend implementation that copies elements out of references before pushing them onto the Vec.

\n

This implementation is specialized for slice iterators, where it uses copy_from_slice to\nappend the entire slice at once.

\n
source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: &'a T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<&'a T>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> Extend<T> for Vec<T, A>
where\n A: Allocator,

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> FixedTag for Vec<T>

§

const TAG: Tag = Tag::Sequence

ASN.1 tag
","FixedTag","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T> From<&[T]> for Vec<T>
where\n T: Clone,

source§

fn from(s: &[T]) -> Vec<T>

Allocate a Vec<T> and fill it by cloning s’s items.

\n
§Examples
\n
assert_eq!(Vec::from(&[1, 2, 3][..]), vec![1, 2, 3]);
\n
","From<&[T]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.74.0 · source§

impl<T, const N: usize> From<&[T; N]> for Vec<T>
where\n T: Clone,

source§

fn from(s: &[T; N]) -> Vec<T>

Allocate a Vec<T> and fill it by cloning s’s items.

\n
§Examples
\n
assert_eq!(Vec::from(&[1, 2, 3]), vec![1, 2, 3]);
\n
","From<&[T; N]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.19.0 · source§

impl<T> From<&mut [T]> for Vec<T>
where\n T: Clone,

source§

fn from(s: &mut [T]) -> Vec<T>

Allocate a Vec<T> and fill it by cloning s’s items.

\n
§Examples
\n
assert_eq!(Vec::from(&mut [1, 2, 3][..]), vec![1, 2, 3]);
\n
","From<&mut [T]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.74.0 · source§

impl<T, const N: usize> From<&mut [T; N]> for Vec<T>
where\n T: Clone,

source§

fn from(s: &mut [T; N]) -> Vec<T>

Allocate a Vec<T> and fill it by cloning s’s items.

\n
§Examples
\n
assert_eq!(Vec::from(&mut [1, 2, 3]), vec![1, 2, 3]);
\n
","From<&mut [T; N]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl From<&str> for Vec<u8>

source§

fn from(s: &str) -> Vec<u8>

Allocate a Vec<u8> and fill it with a UTF-8 string.

\n
§Examples
\n
assert_eq!(Vec::from(\"123\"), vec![b'1', b'2', b'3']);
\n
","From<&str>","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.44.0 · source§

impl<T, const N: usize> From<[T; N]> for Vec<T>

source§

fn from(s: [T; N]) -> Vec<T>

Allocate a Vec<T> and move s’s items into it.

\n
§Examples
\n
assert_eq!(Vec::from([1, 2, 3]), vec![1, 2, 3]);
\n
","From<[T; N]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl From<AppHash> for Vec<u8>

§

fn from(value: AppHash) -> Vec<u8>

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.5.0 · source§

impl<T, A> From<BinaryHeap<T, A>> for Vec<T, A>
where\n A: Allocator,

source§

fn from(heap: BinaryHeap<T, A>) -> Vec<T, A>

Converts a BinaryHeap<T> into a Vec<T>.

\n

This conversion requires no data movement or allocation, and has\nconstant time complexity.

\n
","From>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.18.0 · source§

impl<T, A> From<Box<[T], A>> for Vec<T, A>
where\n A: Allocator,

source§

fn from(s: Box<[T], A>) -> Vec<T, A>

Convert a boxed slice into a vector by transferring ownership of\nthe existing heap allocation.

\n
§Examples
\n
let b: Box<[i32]> = vec![1, 2, 3].into_boxed_slice();\nassert_eq!(Vec::from(b), vec![1, 2, 3]);
\n
","From>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl From<Bytes> for Vec<u8>

§

fn from(bytes: Bytes) -> Vec<u8>

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl From<BytesMut> for Vec<u8>

§

fn from(bytes: BytesMut) -> Vec<u8>

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.7.0 · source§

impl From<CString> for Vec<u8>

source§

fn from(s: CString) -> Vec<u8>

Converts a CString into a Vec<u8>.

\n

The conversion consumes the CString, and removes the terminating NUL byte.

\n
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
source§

impl From<CoarsenedKey> for Vec<u8>

source§

fn from(val: CoarsenedKey) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.14.0 · source§

impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
where\n [T]: ToOwned<Owned = Vec<T>>,

source§

fn from(s: Cow<'a, [T]>) -> Vec<T>

Convert a clone-on-write slice into a vector.

\n

If s already owns a Vec<T>, it will be returned directly.\nIf s is borrowing a slice, a new Vec<T> will be allocated and\nfilled by cloning s’s items into it.

\n
§Examples
\n
let o: Cow<'_, [i32]> = Cow::Owned(vec![1, 2, 3]);\nlet b: Cow<'_, [i32]> = Cow::Borrowed(&[1, 2, 3]);\nassert_eq!(Vec::from(o), Vec::from(b));
\n
","From>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl From<Hash> for Vec<u8>

§

fn from(value: Hash) -> Vec<u8>

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl From<Id> for Vec<u8>

§

fn from(value: Id) -> Vec<u8>

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
source§

impl From<Prefix> for Vec<u8>

source§

fn from(val: Prefix) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
source§

impl From<RawProofEntry> for Vec<u8>

source§

fn from(val: RawProofEntry) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl<T> From<SequenceOf<T>> for Vec<T>

§

fn from(seq: SequenceOf<T>) -> Vec<T>

Converts to this type from the input type.
","From>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> From<SetOf<T>> for Vec<T>

§

fn from(set: SetOf<T>) -> Vec<T>

Converts to this type from the input type.
","From>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> From<SetOfVec<T>> for Vec<T>
where\n T: DerOrd,

§

fn from(set: SetOfVec<T>) -> Vec<T>

Converts to this type from the input type.
","From>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl From<Signature> for Vec<u8>

§

fn from(value: Signature) -> Vec<u8>

Converts to this type from the input type.
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.14.0 · source§

impl From<String> for Vec<u8>

source§

fn from(string: String) -> Vec<u8>

Converts the given String to a vector Vec that holds values of type u8.

\n
§Examples
\n
let s1 = String::from(\"hello world\");\nlet v1 = Vec::from(s1);\n\nfor b in v1 {\n    println!(\"{b}\");\n}
\n
","From","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.10.0 · source§

impl<T, A> From<VecDeque<T, A>> for Vec<T, A>
where\n A: Allocator,

source§

fn from(other: VecDeque<T, A>) -> Vec<T, A>

Turn a VecDeque<T> into a Vec<T>.

\n

This never needs to re-allocate, but does need to do O(n) data movement if\nthe circular buffer doesn’t happen to be at the beginning of the allocation.

\n
§Examples
\n
use std::collections::VecDeque;\n\n// This one is *O*(1).\nlet deque: VecDeque<_> = (1..5).collect();\nlet ptr = deque.as_slices().0.as_ptr();\nlet vec = Vec::from(deque);\nassert_eq!(vec, [1, 2, 3, 4]);\nassert_eq!(vec.as_ptr(), ptr);\n\n// This one needs data rearranging.\nlet mut deque: VecDeque<_> = (1..5).collect();\ndeque.push_front(9);\ndeque.push_front(8);\nlet ptr = deque.as_slices().1.as_ptr();\nlet vec = Vec::from(deque);\nassert_eq!(vec, [8, 9, 1, 2, 3, 4]);\nassert_eq!(vec.as_ptr(), ptr);
\n
","From>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<'a, T, E> FromDer<'a, E> for Vec<T>
where\n T: FromDer<'a, E>,\n E: From<Error> + Debug,

manual impl of FromDer, so we do not need to require TryFrom<Any> + CheckDerConstraints

\n
§

fn from_der(bytes: &'a [u8]) -> Result<(&'a [u8], Vec<T>), Err<E>>

Attempt to parse input bytes into a DER object (enforcing constraints)
","FromDer<'a, E>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl FromHex for Vec<u8>

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<Vec<u8>, <Vec<u8> as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.0.0 · source§

impl<T> FromIterator<T> for Vec<T>

Collects an iterator into a Vec, commonly called via Iterator::collect()

\n

§Allocation behavior

\n

In general Vec does not guarantee any particular growth or allocation strategy.\nThat also applies to this trait impl.

\n

Note: This section covers implementation details and is therefore exempt from\nstability guarantees.

\n

Vec may use any or none of the following strategies,\ndepending on the supplied iterator:

\n
    \n
  • preallocate based on Iterator::size_hint()\n
      \n
    • and panic if the number of items is outside the provided lower/upper bounds
    • \n
    \n
  • \n
  • use an amortized growth strategy similar to pushing one item at a time
  • \n
  • perform the iteration in-place on the original allocation backing the iterator
  • \n
\n

The last case warrants some attention. It is an optimization that in many cases reduces peak memory\nconsumption and improves cache locality. But when big, short-lived allocations are created,\nonly a small fraction of their items get collected, no further use is made of the spare capacity\nand the resulting Vec is moved into a longer-lived structure, then this can lead to the large\nallocations having their lifetimes unnecessarily extended which can result in increased memory\nfootprint.

\n

In cases where this is an issue, the excess capacity can be discarded with Vec::shrink_to(),\nVec::shrink_to_fit() or by collecting into Box<[T]> instead, which additionally reduces\nthe size of the long-lived struct.

\n\n
static LONG_LIVED: Mutex<Vec<Vec<u16>>> = Mutex::new(Vec::new());\n\nfor i in 0..10 {\n    let big_temporary: Vec<u16> = (0..1024).collect();\n    // discard most items\n    let mut result: Vec<_> = big_temporary.into_iter().filter(|i| i % 100 == 0).collect();\n    // without this a lot of unused capacity might be moved into the global\n    result.shrink_to_fit();\n    LONG_LIVED.lock().unwrap().push(result);\n}
\n
source§

fn from_iter<I>(iter: I) -> Vec<T>
where\n I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
","FromIterator","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> Hash for Vec<T, A>
where\n T: Hash,\n A: Allocator,

The hash of a vector is the same as that of the corresponding slice,\nas required by the core::borrow::Borrow implementation.

\n\n
use std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet v: Vec<u8> = vec![0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(v), b.hash_one(s));
\n
source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, I, A> Index<I> for Vec<T, A>
where\n I: SliceIndex<[T]>,\n A: Allocator,

§

type Output = <I as SliceIndex<[T]>>::Output

The returned type after indexing.
source§

fn index(&self, index: I) -> &<Vec<T, A> as Index<I>>::Output

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Index<PatternID> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: PatternID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Index<PatternID> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: PatternID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Index<SmallIndex> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: SmallIndex) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Index<SmallIndex> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: SmallIndex) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Index<StateID> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: StateID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Index<StateID> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: StateID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, I, A> IndexMut<I> for Vec<T, A>
where\n I: SliceIndex<[T]>,\n A: Allocator,

source§

fn index_mut(&mut self, index: I) -> &mut <Vec<T, A> as Index<I>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> IndexMut<PatternID> for Vec<T>

§

fn index_mut(&mut self, index: PatternID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> IndexMut<PatternID> for Vec<T>

§

fn index_mut(&mut self, index: PatternID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> IndexMut<SmallIndex> for Vec<T>

§

fn index_mut(&mut self, index: SmallIndex) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> IndexMut<SmallIndex> for Vec<T>

§

fn index_mut(&mut self, index: SmallIndex) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> IndexMut<StateID> for Vec<T>

§

fn index_mut(&mut self, index: StateID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> IndexMut<StateID> for Vec<T>

§

fn index_mut(&mut self, index: StateID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl<'de, T, E> IntoDeserializer<'de, E> for Vec<T>
where\n T: IntoDeserializer<'de, E>,\n E: Error,

§

type Deserializer = SeqDeserializer<<Vec<T> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> <Vec<T> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> IntoIterator for Vec<T, A>
where\n A: Allocator,

source§

fn into_iter(self) -> <Vec<T, A> as IntoIterator>::IntoIter

Creates a consuming iterator, that is, one that moves each value out of\nthe vector (from start to end). The vector cannot be used after calling\nthis.

\n
§Examples
\n
let v = vec![\"a\".to_string(), \"b\".to_string()];\nlet mut v_iter = v.into_iter();\n\nlet first_element: Option<String> = v_iter.next();\n\nassert_eq!(first_element, Some(\"a\".to_string()));\nassert_eq!(v_iter.next(), Some(\"b\".to_string()));\nassert_eq!(v_iter.next(), None);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, A>

Which kind of iterator are we turning this into?
","IntoIterator","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl Message for Vec<u8>

google.protobuf.BytesValue

\n
source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where\n Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where\n Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited(\n &self,\n buf: &mut impl BufMut,\n) -> Result<(), EncodeError>
where\n Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where\n Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where\n Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where\n Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where\n Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where\n Self: Sized,

Decodes a length-delimited instance of the message from buffer, and\nmerges it into self.
","Message","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.0.0 · source§

impl<T, A> Ord for Vec<T, A>
where\n T: Ord,\n A: Allocator,

Implements ordering of vectors, lexicographically.

\n
source§

fn cmp(&self, other: &Vec<T, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, U, A> PartialEq<&[U]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &&[U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&[U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&[U]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, U, A, const N: usize> PartialEq<&[U; N]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &&[U; N]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&[U; N]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&[U; N]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, U, A> PartialEq<&mut [U]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &&mut [U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&mut [U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&mut [U]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.48.0 · source§

impl<T, U, A> PartialEq<[U]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &[U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &[U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<[U]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, U, A, const N: usize> PartialEq<[U; N]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &[U; N]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &[U; N]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<[U; N]>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl PartialEq<Bytes> for Vec<u8>

§

fn eq(&self, other: &Bytes) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl PartialEq<BytesMut> for Vec<u8>

§

fn eq(&self, other: &BytesMut) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.0.0 · source§

impl<T, U, A1, A2> PartialEq<Vec<U, A2>> for Vec<T, A1>
where\n A1: Allocator,\n A2: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &Vec<U, A2>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &Vec<U, A2>) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl PartialOrd<Bytes> for Vec<u8>

§

fn partial_cmp(&self, other: &Bytes) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl PartialOrd<BytesMut> for Vec<u8>

§

fn partial_cmp(&self, other: &BytesMut) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
1.0.0 · source§

impl<T, A1, A2> PartialOrd<Vec<T, A2>> for Vec<T, A1>
where\n T: PartialOrd,\n A1: Allocator,\n A2: Allocator,

Implements comparison of vectors, lexicographically.

\n
source§

fn partial_cmp(&self, other: &Vec<T, A2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl Replacer for Vec<u8>

§

fn replace_append(&mut self, caps: &Captures<'_>, dst: &mut Vec<u8>)

Appends possibly empty data to dst to replace the current match. Read more
§

fn no_expansion(&mut self) -> Option<Cow<'_, [u8]>>

Return a fixed unchanging replacement byte string. Read more
§

fn by_ref<'r>(&'r mut self) -> ReplacerRef<'r, Self>

Returns a type that implements Replacer, but that borrows and wraps\nthis Replacer. Read more
","Replacer","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
source§

impl<T> Serialize for Vec<T>
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Sink<T> for Vec<T>

§

type Error = Infallible

The type of value produced by the sink when an error occurs.
§

fn poll_ready(\n self: Pin<&mut Vec<T>>,\n _: &mut Context<'_>,\n) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>

Attempts to prepare the Sink to receive a value. Read more
§

fn start_send(\n self: Pin<&mut Vec<T>>,\n item: T,\n) -> Result<(), <Vec<T> as Sink<T>>::Error>

Begin the process of sending a value to the sink.\nEach call to this function must be preceded by a successful call to\npoll_ready which returned Poll::Ready(Ok(())). Read more
§

fn poll_flush(\n self: Pin<&mut Vec<T>>,\n _: &mut Context<'_>,\n) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>

Flush any remaining output from this sink. Read more
§

fn poll_close(\n self: Pin<&mut Vec<T>>,\n _: &mut Context<'_>,\n) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>

Flush any remaining output and close this sink, if necessary. Read more
","Sink","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> Tagged for Vec<T>

§

const TAG: Tag = Tag::Sequence

","Tagged","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> ToDer for Vec<T>
where\n T: ToDer,

§

fn to_der_len(&self) -> Result<usize, Error>

Get the length of the object (including the header), when encoded
§

fn write_der_header(\n &self,\n writer: &mut dyn Write,\n) -> Result<usize, SerializeError>

Attempt to write the DER header to this writer.
§

fn write_der_content(\n &self,\n writer: &mut dyn Write,\n) -> Result<usize, SerializeError>

Attempt to write the DER content (all except header) to this writer.
§

fn to_der_vec(&self) -> Result<Vec<u8>, SerializeError>

Write the DER encoded representation to a newly allocated Vec<u8>.
§

fn to_der_vec_raw(&self) -> Result<Vec<u8>, SerializeError>

Similar to using to_vec, but uses provided values without changes.\nThis can generate an invalid encoding for a DER object.
§

fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>

Attempt to write the DER encoded representation (header and content) into this writer. Read more
§

fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>

Similar to using to_der, but uses provided values without changes.\nThis can generate an invalid encoding for a DER object.
","ToDer","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T, U> ToStatic for Vec<T>
where\n T: ToStatic<Owned = U>,\n U: 'static,

§

type Owned = Vec<U>

§

fn to_static(&self) -> <Vec<T> as ToStatic>::Owned

","ToStatic","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<'a, T> TryFrom<Any<'a>> for Vec<T>
where\n T: FromBer<'a>,

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(any: Any<'a>) -> Result<Vec<T>, Error>

Performs the conversion.
","TryFrom>","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl<T> ValueOrd for Vec<T>
where\n T: DerOrd,

§

fn value_cmp(&self, other: &Vec<T>) -> Result<Ordering, Error>

Return an Ordering between value portion of TLV-encoded self and\nother when serialized as ASN.1 DER.
","ValueOrd","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl<T> Vec<T>

1.0.0 (const: 1.39.0) · source

pub const fn new() -> Vec<T>

Constructs a new, empty Vec<T>.

\n

The vector will not allocate until elements are pushed onto it.

\n
§Examples
\n
let mut vec: Vec<i32> = Vec::new();
\n
1.0.0 · source

pub fn with_capacity(capacity: usize) -> Vec<T>

Constructs a new, empty Vec<T> with at least the specified capacity.

\n

The vector will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the vector will not allocate.

\n

It is important to note that although the returned vector has the\nminimum capacity specified, the vector will have a zero length. For\nan explanation of the difference between length and capacity, see\nCapacity and reallocation.

\n

If it is important to know the exact allocated capacity of a Vec,\nalways use the capacity method after construction.

\n

For Vec<T> where T is a zero-sized type, there will be no allocation\nand the capacity will always be usize::MAX.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = Vec::with_capacity(10);\n\n// The vector contains no items, even though it has capacity for more\nassert_eq!(vec.len(), 0);\nassert!(vec.capacity() >= 10);\n\n// These are all done without reallocating...\nfor i in 0..10 {\n    vec.push(i);\n}\nassert_eq!(vec.len(), 10);\nassert!(vec.capacity() >= 10);\n\n// ...but this may make the vector reallocate\nvec.push(11);\nassert_eq!(vec.len(), 11);\nassert!(vec.capacity() >= 11);\n\n// A vector of a zero-sized type will always over-allocate, since no\n// allocation is necessary\nlet vec_units = Vec::<()>::with_capacity(10);\nassert_eq!(vec_units.capacity(), usize::MAX);
\n
source

pub fn try_with_capacity(capacity: usize) -> Result<Vec<T>, TryReserveError>

🔬This is a nightly-only experimental API. (try_with_capacity)

Constructs a new, empty Vec<T> with at least the specified capacity.

\n

The vector will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the vector will not allocate.

\n
§Errors
\n

Returns an error if the capacity exceeds isize::MAX bytes,\nor if the allocator reports allocation failure.

\n
1.0.0 · source

pub unsafe fn from_raw_parts(\n ptr: *mut T,\n length: usize,\n capacity: usize,\n) -> Vec<T>

Creates a Vec<T> directly from a pointer, a length, and a capacity.

\n
§Safety
\n

This is highly unsafe, due to the number of invariants that aren’t\nchecked:

\n
    \n
  • ptr must have been allocated using the global allocator, such as via\nthe alloc::alloc function.
  • \n
  • T needs to have the same alignment as what ptr was allocated with.\n(T having a less strict alignment is not sufficient, the alignment really\nneeds to be equal to satisfy the dealloc requirement that memory must be\nallocated and deallocated with the same layout.)
  • \n
  • The size of T times the capacity (ie. the allocated size in bytes) needs\nto be the same size as the pointer was allocated with. (Because similar to\nalignment, dealloc must be called with the same layout size.)
  • \n
  • length needs to be less than or equal to capacity.
  • \n
  • The first length values must be properly initialized values of type T.
  • \n
  • capacity needs to be the capacity that the pointer was allocated with.
  • \n
  • The allocated size in bytes must be no larger than isize::MAX.\nSee the safety documentation of pointer::offset.
  • \n
\n

These requirements are always upheld by any ptr that has been allocated\nvia Vec<T>. Other allocation sources are allowed if the invariants are\nupheld.

\n

Violating these may cause problems like corrupting the allocator’s\ninternal data structures. For example it is normally not safe\nto build a Vec<u8> from a pointer to a C char array with length\nsize_t, doing so is only safe if the array was initially allocated by\na Vec or String.\nIt’s also not safe to build one from a Vec<u16> and its length, because\nthe allocator cares about the alignment, and these two types have different\nalignments. The buffer was allocated with alignment 2 (for u16), but after\nturning it into a Vec<u8> it’ll be deallocated with alignment 1. To avoid\nthese issues, it is often preferable to do casting/transmuting using\nslice::from_raw_parts instead.

\n

The ownership of ptr is effectively transferred to the\nVec<T> which may then deallocate, reallocate or change the\ncontents of memory pointed to by the pointer at will. Ensure\nthat nothing else uses the pointer after calling this\nfunction.

\n
§Examples
\n
use std::ptr;\nuse std::mem;\n\nlet v = vec![1, 2, 3];\n\n// Prevent running `v`'s destructor so we are in complete control\n// of the allocation.\nlet mut v = mem::ManuallyDrop::new(v);\n\n// Pull out the various important pieces of information about `v`\nlet p = v.as_mut_ptr();\nlet len = v.len();\nlet cap = v.capacity();\n\nunsafe {\n    // Overwrite memory with 4, 5, 6\n    for i in 0..len {\n        ptr::write(p.add(i), 4 + i);\n    }\n\n    // Put everything back together into a Vec\n    let rebuilt = Vec::from_raw_parts(p, len, cap);\n    assert_eq!(rebuilt, [4, 5, 6]);\n}
\n

Using memory that was allocated elsewhere:

\n\n
use std::alloc::{alloc, Layout};\n\nfn main() {\n    let layout = Layout::array::<u32>(16).expect(\"overflow cannot happen\");\n\n    let vec = unsafe {\n        let mem = alloc(layout).cast::<u32>();\n        if mem.is_null() {\n            return;\n        }\n\n        mem.write(1_000_000);\n\n        Vec::from_raw_parts(mem, 1, 16)\n    };\n\n    assert_eq!(vec, &[1_000_000]);\n    assert_eq!(vec.capacity(), 16);\n}
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl<T, A> Vec<T, A>
where\n T: Clone,\n A: Allocator,

1.5.0 · source

pub fn resize(&mut self, new_len: usize, value: T)

Resizes the Vec in-place so that len is equal to new_len.

\n

If new_len is greater than len, the Vec is extended by the\ndifference, with each additional slot filled with value.\nIf new_len is less than len, the Vec is simply truncated.

\n

This method requires T to implement Clone,\nin order to be able to clone the passed value.\nIf you need more flexibility (or want to rely on Default instead of\nClone), use Vec::resize_with.\nIf you only need to resize to a smaller size, use Vec::truncate.

\n
§Examples
\n
let mut vec = vec![\"hello\"];\nvec.resize(3, \"world\");\nassert_eq!(vec, [\"hello\", \"world\", \"world\"]);\n\nlet mut vec = vec![1, 2, 3, 4];\nvec.resize(2, 0);\nassert_eq!(vec, [1, 2]);
\n
1.6.0 · source

pub fn extend_from_slice(&mut self, other: &[T])

Clones and appends all elements in a slice to the Vec.

\n

Iterates over the slice other, clones each element, and then appends\nit to this Vec. The other slice is traversed in-order.

\n

Note that this function is same as extend except that it is\nspecialized to work with slices instead. If and when Rust gets\nspecialization this function will likely be deprecated (but still\navailable).

\n
§Examples
\n
let mut vec = vec![1];\nvec.extend_from_slice(&[2, 3, 4]);\nassert_eq!(vec, [1, 2, 3, 4]);
\n
1.53.0 · source

pub fn extend_from_within<R>(&mut self, src: R)
where\n R: RangeBounds<usize>,

Copies elements from src range to the end of the vector.

\n
§Panics
\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the vector.

\n
§Examples
\n
let mut vec = vec![0, 1, 2, 3, 4];\n\nvec.extend_from_within(2..);\nassert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);\n\nvec.extend_from_within(..2);\nassert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);\n\nvec.extend_from_within(4..8);\nassert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl<T, A> Vec<T, A>
where\n T: PartialEq,\n A: Allocator,

1.0.0 · source

pub fn dedup(&mut self)

Removes consecutive repeated elements in the vector according to the\nPartialEq trait implementation.

\n

If the vector is sorted, this removes all duplicates.

\n
§Examples
\n
let mut vec = vec![1, 2, 2, 3, 2];\n\nvec.dedup();\n\nassert_eq!(vec, [1, 2, 3, 2]);
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl<T, A> Vec<T, A>
where\n A: Allocator,

1.21.0 · source

pub fn splice<R, I>(\n &mut self,\n range: R,\n replace_with: I,\n) -> Splice<'_, <I as IntoIterator>::IntoIter, A>
where\n R: RangeBounds<usize>,\n I: IntoIterator<Item = T>,

Creates a splicing iterator that replaces the specified range in the vector\nwith the given replace_with iterator and yields the removed items.\nreplace_with does not need to be the same length as range.

\n

range is removed even if the iterator is not consumed until the end.

\n

It is unspecified how many elements are removed from the vector\nif the Splice value is leaked.

\n

The input iterator replace_with is only consumed when the Splice value is dropped.

\n

This is optimal if:

\n
    \n
  • The tail (elements in the vector after range) is empty,
  • \n
  • or replace_with yields fewer or equal elements than range’s length
  • \n
  • or the lower bound of its size_hint() is exact.
  • \n
\n

Otherwise, a temporary vector is allocated and the tail is moved twice.

\n
§Panics
\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the vector.

\n
§Examples
\n
let mut v = vec![1, 2, 3, 4];\nlet new = [7, 8, 9];\nlet u: Vec<_> = v.splice(1..3, new).collect();\nassert_eq!(v, &[1, 7, 8, 9, 4]);\nassert_eq!(u, &[2, 3]);
\n
source

pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
where\n F: FnMut(&mut T) -> bool,

🔬This is a nightly-only experimental API. (extract_if)

Creates an iterator which uses a closure to determine if an element should be removed.

\n

If the closure returns true, then the element is removed and yielded.\nIf the closure returns false, the element will remain in the vector and will not be yielded\nby the iterator.

\n

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating\nor the iteration short-circuits, then the remaining elements will be retained.\nUse retain with a negated predicate if you do not need the returned iterator.

\n

Using this method is equivalent to the following code:

\n\n
let mut i = 0;\nwhile i < vec.len() {\n    if some_predicate(&mut vec[i]) {\n        let val = vec.remove(i);\n        // your code here\n    } else {\n        i += 1;\n    }\n}\n
\n

But extract_if is easier to use. extract_if is also more efficient,\nbecause it can backshift the elements of the array in bulk.

\n

Note that extract_if also lets you mutate every element in the filter closure,\nregardless of whether you choose to keep or remove it.

\n
§Examples
\n

Splitting an array into evens and odds, reusing the original allocation:

\n\n
#![feature(extract_if)]\nlet mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15];\n\nlet evens = numbers.extract_if(|x| *x % 2 == 0).collect::<Vec<_>>();\nlet odds = numbers;\n\nassert_eq!(evens, vec![2, 4, 6, 8, 14]);\nassert_eq!(odds, vec![1, 3, 5, 9, 11, 13, 15]);
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl<T, A> Vec<T, A>
where\n A: Allocator,

source

pub const fn new_in(alloc: A) -> Vec<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new, empty Vec<T, A>.

\n

The vector will not allocate until elements are pushed onto it.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet mut vec: Vec<i32, _> = Vec::new_in(System);
\n
source

pub fn with_capacity_in(capacity: usize, alloc: A) -> Vec<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new, empty Vec<T, A> with at least the specified capacity\nwith the provided allocator.

\n

The vector will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the vector will not allocate.

\n

It is important to note that although the returned vector has the\nminimum capacity specified, the vector will have a zero length. For\nan explanation of the difference between length and capacity, see\nCapacity and reallocation.

\n

If it is important to know the exact allocated capacity of a Vec,\nalways use the capacity method after construction.

\n

For Vec<T, A> where T is a zero-sized type, there will be no allocation\nand the capacity will always be usize::MAX.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet mut vec = Vec::with_capacity_in(10, System);\n\n// The vector contains no items, even though it has capacity for more\nassert_eq!(vec.len(), 0);\nassert!(vec.capacity() >= 10);\n\n// These are all done without reallocating...\nfor i in 0..10 {\n    vec.push(i);\n}\nassert_eq!(vec.len(), 10);\nassert!(vec.capacity() >= 10);\n\n// ...but this may make the vector reallocate\nvec.push(11);\nassert_eq!(vec.len(), 11);\nassert!(vec.capacity() >= 11);\n\n// A vector of a zero-sized type will always over-allocate, since no\n// allocation is necessary\nlet vec_units = Vec::<(), System>::with_capacity_in(10, System);\nassert_eq!(vec_units.capacity(), usize::MAX);
\n
source

pub fn try_with_capacity_in(\n capacity: usize,\n alloc: A,\n) -> Result<Vec<T, A>, TryReserveError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new, empty Vec<T, A> with at least the specified capacity\nwith the provided allocator.

\n

The vector will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the vector will not allocate.

\n
§Errors
\n

Returns an error if the capacity exceeds isize::MAX bytes,\nor if the allocator reports allocation failure.

\n
source

pub unsafe fn from_raw_parts_in(\n ptr: *mut T,\n length: usize,\n capacity: usize,\n alloc: A,\n) -> Vec<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Creates a Vec<T, A> directly from a pointer, a length, a capacity,\nand an allocator.

\n
§Safety
\n

This is highly unsafe, due to the number of invariants that aren’t\nchecked:

\n
    \n
  • ptr must be currently allocated via the given allocator alloc.
  • \n
  • T needs to have the same alignment as what ptr was allocated with.\n(T having a less strict alignment is not sufficient, the alignment really\nneeds to be equal to satisfy the dealloc requirement that memory must be\nallocated and deallocated with the same layout.)
  • \n
  • The size of T times the capacity (ie. the allocated size in bytes) needs\nto be the same size as the pointer was allocated with. (Because similar to\nalignment, dealloc must be called with the same layout size.)
  • \n
  • length needs to be less than or equal to capacity.
  • \n
  • The first length values must be properly initialized values of type T.
  • \n
  • capacity needs to fit the layout size that the pointer was allocated with.
  • \n
  • The allocated size in bytes must be no larger than isize::MAX.\nSee the safety documentation of pointer::offset.
  • \n
\n

These requirements are always upheld by any ptr that has been allocated\nvia Vec<T, A>. Other allocation sources are allowed if the invariants are\nupheld.

\n

Violating these may cause problems like corrupting the allocator’s\ninternal data structures. For example it is not safe\nto build a Vec<u8> from a pointer to a C char array with length size_t.\nIt’s also not safe to build one from a Vec<u16> and its length, because\nthe allocator cares about the alignment, and these two types have different\nalignments. The buffer was allocated with alignment 2 (for u16), but after\nturning it into a Vec<u8> it’ll be deallocated with alignment 1.

\n

The ownership of ptr is effectively transferred to the\nVec<T> which may then deallocate, reallocate or change the\ncontents of memory pointed to by the pointer at will. Ensure\nthat nothing else uses the pointer after calling this\nfunction.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nuse std::ptr;\nuse std::mem;\n\nlet mut v = Vec::with_capacity_in(3, System);\nv.push(1);\nv.push(2);\nv.push(3);\n\n// Prevent running `v`'s destructor so we are in complete control\n// of the allocation.\nlet mut v = mem::ManuallyDrop::new(v);\n\n// Pull out the various important pieces of information about `v`\nlet p = v.as_mut_ptr();\nlet len = v.len();\nlet cap = v.capacity();\nlet alloc = v.allocator();\n\nunsafe {\n    // Overwrite memory with 4, 5, 6\n    for i in 0..len {\n        ptr::write(p.add(i), 4 + i);\n    }\n\n    // Put everything back together into a Vec\n    let rebuilt = Vec::from_raw_parts_in(p, len, cap, alloc.clone());\n    assert_eq!(rebuilt, [4, 5, 6]);\n}
\n

Using memory that was allocated elsewhere:

\n\n
#![feature(allocator_api)]\n\nuse std::alloc::{AllocError, Allocator, Global, Layout};\n\nfn main() {\n    let layout = Layout::array::<u32>(16).expect(\"overflow cannot happen\");\n\n    let vec = unsafe {\n        let mem = match Global.allocate(layout) {\n            Ok(mem) => mem.cast::<u32>().as_ptr(),\n            Err(AllocError) => return,\n        };\n\n        mem.write(1_000_000);\n\n        Vec::from_raw_parts_in(mem, 1, 16, Global)\n    };\n\n    assert_eq!(vec, &[1_000_000]);\n    assert_eq!(vec.capacity(), 16);\n}
\n
source

pub fn into_raw_parts(self) -> (*mut T, usize, usize)

🔬This is a nightly-only experimental API. (vec_into_raw_parts)

Decomposes a Vec<T> into its raw components: (pointer, length, capacity).

\n

Returns the raw pointer to the underlying data, the length of\nthe vector (in elements), and the allocated capacity of the\ndata (in elements). These are the same arguments in the same\norder as the arguments to from_raw_parts.

\n

After calling this function, the caller is responsible for the\nmemory previously managed by the Vec. The only way to do\nthis is to convert the raw pointer, length, and capacity back\ninto a Vec with the from_raw_parts function, allowing\nthe destructor to perform the cleanup.

\n
§Examples
\n
#![feature(vec_into_raw_parts)]\nlet v: Vec<i32> = vec![-1, 0, 1];\n\nlet (ptr, len, cap) = v.into_raw_parts();\n\nlet rebuilt = unsafe {\n    // We can now make changes to the components, such as\n    // transmuting the raw pointer to a compatible type.\n    let ptr = ptr as *mut u32;\n\n    Vec::from_raw_parts(ptr, len, cap)\n};\nassert_eq!(rebuilt, [4294967295, 0, 1]);
\n
source

pub fn into_raw_parts_with_alloc(self) -> (*mut T, usize, usize, A)

🔬This is a nightly-only experimental API. (allocator_api)

Decomposes a Vec<T> into its raw components: (pointer, length, capacity, allocator).

\n

Returns the raw pointer to the underlying data, the length of the vector (in elements),\nthe allocated capacity of the data (in elements), and the allocator. These are the same\narguments in the same order as the arguments to from_raw_parts_in.

\n

After calling this function, the caller is responsible for the\nmemory previously managed by the Vec. The only way to do\nthis is to convert the raw pointer, length, and capacity back\ninto a Vec with the from_raw_parts_in function, allowing\nthe destructor to perform the cleanup.

\n
§Examples
\n
#![feature(allocator_api, vec_into_raw_parts)]\n\nuse std::alloc::System;\n\nlet mut v: Vec<i32, System> = Vec::new_in(System);\nv.push(-1);\nv.push(0);\nv.push(1);\n\nlet (ptr, len, cap, alloc) = v.into_raw_parts_with_alloc();\n\nlet rebuilt = unsafe {\n    // We can now make changes to the components, such as\n    // transmuting the raw pointer to a compatible type.\n    let ptr = ptr as *mut u32;\n\n    Vec::from_raw_parts_in(ptr, len, cap, alloc)\n};\nassert_eq!(rebuilt, [4294967295, 0, 1]);
\n
1.0.0 · source

pub fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without\nreallocating.

\n
§Examples
\n
let mut vec: Vec<i32> = Vec::with_capacity(10);\nvec.push(42);\nassert!(vec.capacity() >= 10);
\n
1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more elements to be inserted\nin the given Vec<T>. The collection may reserve more space to\nspeculatively avoid frequent reallocations. After calling reserve,\ncapacity will be greater than or equal to self.len() + additional.\nDoes nothing if capacity is already sufficient.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = vec![1];\nvec.reserve(10);\nassert!(vec.capacity() >= 11);
\n
1.0.0 · source

pub fn reserve_exact(&mut self, additional: usize)

Reserves the minimum capacity for at least additional more elements to\nbe inserted in the given Vec<T>. Unlike reserve, this will not\ndeliberately over-allocate to speculatively avoid frequent allocations.\nAfter calling reserve_exact, capacity will be greater than or equal to\nself.len() + additional. Does nothing if the capacity is already\nsufficient.

\n

Note that the allocator may give the collection more space than it\nrequests. Therefore, capacity can not be relied upon to be precisely\nminimal. Prefer reserve if future insertions are expected.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = vec![1];\nvec.reserve_exact(10);\nassert!(vec.capacity() >= 11);
\n
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional more elements to be inserted\nin the given Vec<T>. The collection may reserve more space to speculatively avoid\nfrequent reallocations. After calling try_reserve, capacity will be\ngreater than or equal to self.len() + additional if it returns\nOk(()). Does nothing if capacity is already sufficient. This method\npreserves the contents even if an error occurs.

\n
§Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
§Examples
\n
use std::collections::TryReserveError;\n\nfn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {\n    let mut output = Vec::new();\n\n    // Pre-reserve the memory, exiting if we can't\n    output.try_reserve(data.len())?;\n\n    // Now we know this can't OOM in the middle of our complex work\n    output.extend(data.iter().map(|&val| {\n        val * 2 + 5 // very complicated\n    }));\n\n    Ok(output)\n}
\n
1.57.0 · source

pub fn try_reserve_exact(\n &mut self,\n additional: usize,\n) -> Result<(), TryReserveError>

Tries to reserve the minimum capacity for at least additional\nelements to be inserted in the given Vec<T>. Unlike try_reserve,\nthis will not deliberately over-allocate to speculatively avoid frequent\nallocations. After calling try_reserve_exact, capacity will be greater\nthan or equal to self.len() + additional if it returns Ok(()).\nDoes nothing if the capacity is already sufficient.

\n

Note that the allocator may give the collection more space than it\nrequests. Therefore, capacity can not be relied upon to be precisely\nminimal. Prefer try_reserve if future insertions are expected.

\n
§Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
§Examples
\n
use std::collections::TryReserveError;\n\nfn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {\n    let mut output = Vec::new();\n\n    // Pre-reserve the memory, exiting if we can't\n    output.try_reserve_exact(data.len())?;\n\n    // Now we know this can't OOM in the middle of our complex work\n    output.extend(data.iter().map(|&val| {\n        val * 2 + 5 // very complicated\n    }));\n\n    Ok(output)\n}
\n
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the vector as much as possible.

\n

The behavior of this method depends on the allocator, which may either shrink the vector\nin-place or reallocate. The resulting vector might still have some excess capacity, just as\nis the case for with_capacity. See Allocator::shrink for more details.

\n
§Examples
\n
let mut vec = Vec::with_capacity(10);\nvec.extend([1, 2, 3]);\nassert!(vec.capacity() >= 10);\nvec.shrink_to_fit();\nassert!(vec.capacity() >= 3);
\n
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of the vector with a lower bound.

\n

The capacity will remain at least as large as both the length\nand the supplied value.

\n

If the current capacity is less than the lower limit, this is a no-op.

\n
§Examples
\n
let mut vec = Vec::with_capacity(10);\nvec.extend([1, 2, 3]);\nassert!(vec.capacity() >= 10);\nvec.shrink_to(4);\nassert!(vec.capacity() >= 4);\nvec.shrink_to(0);\nassert!(vec.capacity() >= 3);
\n
1.0.0 · source

pub fn into_boxed_slice(self) -> Box<[T], A>

Converts the vector into Box<[T]>.

\n

Before doing the conversion, this method discards excess capacity like shrink_to_fit.

\n
§Examples
\n
let v = vec![1, 2, 3];\n\nlet slice = v.into_boxed_slice();
\n

Any excess capacity is removed:

\n\n
let mut vec = Vec::with_capacity(10);\nvec.extend([1, 2, 3]);\n\nassert!(vec.capacity() >= 10);\nlet slice = vec.into_boxed_slice();\nassert_eq!(slice.into_vec().capacity(), 3);
\n
1.0.0 · source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping\nthe rest.

\n

If len is greater or equal to the vector’s current length, this has\nno effect.

\n

The drain method can emulate truncate, but causes the excess\nelements to be returned instead of dropped.

\n

Note that this method has no effect on the allocated capacity\nof the vector.

\n
§Examples
\n

Truncating a five element vector to two elements:

\n\n
let mut vec = vec![1, 2, 3, 4, 5];\nvec.truncate(2);\nassert_eq!(vec, [1, 2]);
\n

No truncation occurs when len is greater than the vector’s current\nlength:

\n\n
let mut vec = vec![1, 2, 3];\nvec.truncate(8);\nassert_eq!(vec, [1, 2, 3]);
\n

Truncating when len == 0 is equivalent to calling the clear\nmethod.

\n\n
let mut vec = vec![1, 2, 3];\nvec.truncate(0);\nassert_eq!(vec, []);
\n
1.7.0 · source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

\n

Equivalent to &s[..].

\n
§Examples
\n
use std::io::{self, Write};\nlet buffer = vec![1, 2, 3, 5, 8];\nio::sink().write(buffer.as_slice()).unwrap();
\n
1.7.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Extracts a mutable slice of the entire vector.

\n

Equivalent to &mut s[..].

\n
§Examples
\n
use std::io::{self, Read};\nlet mut buffer = vec![0; 3];\nio::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
\n
1.37.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer\nvalid for zero sized reads if the vector didn’t allocate.

\n

The caller must ensure that the vector outlives the pointer this\nfunction returns, or else it will end up pointing to garbage.\nModifying the vector may cause its buffer to be reallocated,\nwhich would also make any pointers to it invalid.

\n

The caller must also ensure that the memory the pointer (non-transitively) points to\nis never written to (except inside an UnsafeCell) using this pointer or any pointer\nderived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

\n

This method guarantees that for the purpose of the aliasing model, this method\ndoes not materialize a reference to the underlying slice, and thus the returned pointer\nwill remain valid when mixed with other calls to as_ptr and as_mut_ptr.\nNote that calling other methods that materialize mutable references to the slice,\nor mutable references to specific elements you are planning on accessing through this pointer,\nas well as writing to those elements, may still invalidate this pointer.\nSee the second example below for how this guarantee can be used.

\n
§Examples
\n
let x = vec![1, 2, 4];\nlet x_ptr = x.as_ptr();\n\nunsafe {\n    for i in 0..x.len() {\n        assert_eq!(*x_ptr.add(i), 1 << i);\n    }\n}
\n

Due to the aliasing guarantee, the following code is legal:

\n\n
unsafe {\n    let mut v = vec![0, 1, 2];\n    let ptr1 = v.as_ptr();\n    let _ = ptr1.read();\n    let ptr2 = v.as_mut_ptr().offset(2);\n    ptr2.write(2);\n    // Notably, the write to `ptr2` did *not* invalidate `ptr1`\n    // because it mutated a different element:\n    let _ = ptr1.read();\n}
\n
1.37.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the vector’s buffer, or a dangling\nraw pointer valid for zero sized reads if the vector didn’t allocate.

\n

The caller must ensure that the vector outlives the pointer this\nfunction returns, or else it will end up pointing to garbage.\nModifying the vector may cause its buffer to be reallocated,\nwhich would also make any pointers to it invalid.

\n

This method guarantees that for the purpose of the aliasing model, this method\ndoes not materialize a reference to the underlying slice, and thus the returned pointer\nwill remain valid when mixed with other calls to as_ptr and as_mut_ptr.\nNote that calling other methods that materialize references to the slice,\nor references to specific elements you are planning on accessing through this pointer,\nmay still invalidate this pointer.\nSee the second example below for how this guarantee can be used.

\n
§Examples
\n
// Allocate vector big enough for 4 elements.\nlet size = 4;\nlet mut x: Vec<i32> = Vec::with_capacity(size);\nlet x_ptr = x.as_mut_ptr();\n\n// Initialize elements via raw pointer writes, then set length.\nunsafe {\n    for i in 0..size {\n        *x_ptr.add(i) = i as i32;\n    }\n    x.set_len(size);\n}\nassert_eq!(&*x, &[0, 1, 2, 3]);
\n

Due to the aliasing guarantee, the following code is legal:

\n\n
unsafe {\n    let mut v = vec![0];\n    let ptr1 = v.as_mut_ptr();\n    ptr1.write(1);\n    let ptr2 = v.as_mut_ptr();\n    ptr2.write(2);\n    // Notably, the write to `ptr2` did *not* invalidate `ptr1`:\n    ptr1.write(3);\n}
\n
source

pub fn allocator(&self) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

\n
1.0.0 · source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

\n

This is a low-level operation that maintains none of the normal\ninvariants of the type. Normally changing the length of a vector\nis done using one of the safe operations instead, such as\ntruncate, resize, extend, or clear.

\n
§Safety
\n
    \n
  • new_len must be less than or equal to capacity().
  • \n
  • The elements at old_len..new_len must be initialized.
  • \n
\n
§Examples
\n

This method can be useful for situations in which the vector\nis serving as a buffer for other code, particularly over FFI:

\n\n
pub fn get_dictionary(&self) -> Option<Vec<u8>> {\n    // Per the FFI method's docs, \"32768 bytes is always enough\".\n    let mut dict = Vec::with_capacity(32_768);\n    let mut dict_length = 0;\n    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:\n    // 1. `dict_length` elements were initialized.\n    // 2. `dict_length` <= the capacity (32_768)\n    // which makes `set_len` safe to call.\n    unsafe {\n        // Make the FFI call...\n        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);\n        if r == Z_OK {\n            // ...and update the length to what was initialized.\n            dict.set_len(dict_length);\n            Some(dict)\n        } else {\n            None\n        }\n    }\n}
\n

While the following example is sound, there is a memory leak since\nthe inner vectors were not freed prior to the set_len call:

\n\n
let mut vec = vec![vec![1, 0, 0],\n                   vec![0, 1, 0],\n                   vec![0, 0, 1]];\n// SAFETY:\n// 1. `old_len..0` is empty so no elements need to be initialized.\n// 2. `0 <= capacity` always holds whatever `capacity` is.\nunsafe {\n    vec.set_len(0);\n}
\n

Normally, here, one would use clear instead to correctly drop\nthe contents and thus not leak memory.

\n
1.0.0 · source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

\n

The removed element is replaced by the last element of the vector.

\n

This does not preserve ordering of the remaining elements, but is O(1).\nIf you need to preserve the element order, use remove instead.

\n
§Panics
\n

Panics if index is out of bounds.

\n
§Examples
\n
let mut v = vec![\"foo\", \"bar\", \"baz\", \"qux\"];\n\nassert_eq!(v.swap_remove(1), \"bar\");\nassert_eq!(v, [\"foo\", \"qux\", \"baz\"]);\n\nassert_eq!(v.swap_remove(0), \"foo\");\nassert_eq!(v, [\"baz\", \"qux\"]);
\n
1.0.0 · source

pub fn insert(&mut self, index: usize, element: T)

Inserts an element at position index within the vector, shifting all\nelements after it to the right.

\n
§Panics
\n

Panics if index > len.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nvec.insert(1, 4);\nassert_eq!(vec, [1, 4, 2, 3]);\nvec.insert(4, 5);\nassert_eq!(vec, [1, 4, 2, 3, 5]);
\n
§Time complexity
\n

Takes O(Vec::len) time. All items after the insertion index must be\nshifted to the right. In the worst case, all elements are shifted when\nthe insertion index is 0.

\n
1.0.0 · source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector,\nshifting all elements after it to the left.

\n

Note: Because this shifts over the remaining elements, it has a\nworst-case performance of O(n). If you don’t need the order of elements\nto be preserved, use swap_remove instead. If you’d like to remove\nelements from the beginning of the Vec, consider using\nVecDeque::pop_front instead.

\n
§Panics
\n

Panics if index is out of bounds.

\n
§Examples
\n
let mut v = vec![1, 2, 3];\nassert_eq!(v.remove(1), 2);\nassert_eq!(v, [1, 3]);
\n
1.0.0 · source

pub fn retain<F>(&mut self, f: F)
where\n F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

\n

In other words, remove all elements e for which f(&e) returns false.\nThis method operates in place, visiting each element exactly once in the\noriginal order, and preserves the order of the retained elements.

\n
§Examples
\n
let mut vec = vec![1, 2, 3, 4];\nvec.retain(|&x| x % 2 == 0);\nassert_eq!(vec, [2, 4]);
\n

Because the elements are visited exactly once in the original order,\nexternal state may be used to decide which elements to keep.

\n\n
let mut vec = vec![1, 2, 3, 4, 5];\nlet keep = [false, true, true, false, true];\nlet mut iter = keep.iter();\nvec.retain(|_| *iter.next().unwrap());\nassert_eq!(vec, [2, 3, 5]);
\n
1.61.0 · source

pub fn retain_mut<F>(&mut self, f: F)
where\n F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

\n

In other words, remove all elements e such that f(&mut e) returns false.\nThis method operates in place, visiting each element exactly once in the\noriginal order, and preserves the order of the retained elements.

\n
§Examples
\n
let mut vec = vec![1, 2, 3, 4];\nvec.retain_mut(|x| if *x <= 3 {\n    *x += 1;\n    true\n} else {\n    false\n});\nassert_eq!(vec, [2, 3, 4]);
\n
1.16.0 · source

pub fn dedup_by_key<F, K>(&mut self, key: F)
where\n F: FnMut(&mut T) -> K,\n K: PartialEq,

Removes all but the first of consecutive elements in the vector that resolve to the same\nkey.

\n

If the vector is sorted, this removes all duplicates.

\n
§Examples
\n
let mut vec = vec![10, 20, 21, 30, 20];\n\nvec.dedup_by_key(|i| *i / 10);\n\nassert_eq!(vec, [10, 20, 30, 20]);
\n
1.16.0 · source

pub fn dedup_by<F>(&mut self, same_bucket: F)
where\n F: FnMut(&mut T, &mut T) -> bool,

Removes all but the first of consecutive elements in the vector satisfying a given equality\nrelation.

\n

The same_bucket function is passed references to two elements from the vector and\nmust determine if the elements compare equal. The elements are passed in opposite order\nfrom their order in the slice, so if same_bucket(a, b) returns true, a is removed.

\n

If the vector is sorted, this removes all duplicates.

\n
§Examples
\n
let mut vec = vec![\"foo\", \"bar\", \"Bar\", \"baz\", \"bar\"];\n\nvec.dedup_by(|a, b| a.eq_ignore_ascii_case(b));\n\nassert_eq!(vec, [\"foo\", \"bar\", \"baz\", \"bar\"]);
\n
1.0.0 · source

pub fn push(&mut self, value: T)

Appends an element to the back of a collection.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = vec![1, 2];\nvec.push(3);\nassert_eq!(vec, [1, 2, 3]);
\n
§Time complexity
\n

Takes amortized O(1) time. If the vector’s length would exceed its\ncapacity after the push, O(capacity) time is taken to copy the\nvector’s elements to a larger allocation. This expensive operation is\noffset by the capacity O(1) insertions it allows.

\n
source

pub fn push_within_capacity(&mut self, value: T) -> Result<(), T>

🔬This is a nightly-only experimental API. (vec_push_within_capacity)

Appends an element if there is sufficient spare capacity, otherwise an error is returned\nwith the element.

\n

Unlike push this method will not reallocate when there’s insufficient capacity.\nThe caller should use reserve or try_reserve to ensure that there is enough capacity.

\n
§Examples
\n

A manual, panic-free alternative to FromIterator:

\n\n
#![feature(vec_push_within_capacity)]\n\nuse std::collections::TryReserveError;\nfn from_iter_fallible<T>(iter: impl Iterator<Item=T>) -> Result<Vec<T>, TryReserveError> {\n    let mut vec = Vec::new();\n    for value in iter {\n        if let Err(value) = vec.push_within_capacity(value) {\n            vec.try_reserve(1)?;\n            // this cannot fail, the previous line either returned or added at least 1 free slot\n            let _ = vec.push_within_capacity(value);\n        }\n    }\n    Ok(vec)\n}\nassert_eq!(from_iter_fallible(0..100), Ok(Vec::from_iter(0..100)));
\n
§Time complexity
\n

Takes O(1) time.

\n
1.0.0 · source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it\nis empty.

\n

If you’d like to pop the first element, consider using\nVecDeque::pop_front instead.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nassert_eq!(vec.pop(), Some(3));\nassert_eq!(vec, [1, 2]);
\n
§Time complexity
\n

Takes O(1) time.

\n
source

pub fn pop_if<F>(&mut self, f: F) -> Option<T>
where\n F: FnOnce(&mut T) -> bool,

🔬This is a nightly-only experimental API. (vec_pop_if)

Removes and returns the last element in a vector if the predicate\nreturns true, or None if the predicate returns false or the vector\nis empty.

\n
§Examples
\n
#![feature(vec_pop_if)]\n\nlet mut vec = vec![1, 2, 3, 4];\nlet pred = |x: &mut i32| *x % 2 == 0;\n\nassert_eq!(vec.pop_if(pred), Some(4));\nassert_eq!(vec, [1, 2, 3]);\nassert_eq!(vec.pop_if(pred), None);
\n
1.4.0 · source

pub fn append(&mut self, other: &mut Vec<T, A>)

Moves all the elements of other into self, leaving other empty.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nlet mut vec2 = vec![4, 5, 6];\nvec.append(&mut vec2);\nassert_eq!(vec, [1, 2, 3, 4, 5, 6]);\nassert_eq!(vec2, []);
\n
1.6.0 · source

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
where\n R: RangeBounds<usize>,

Removes the specified range from the vector in bulk, returning all\nremoved elements as an iterator. If the iterator is dropped before\nbeing fully consumed, it drops the remaining removed elements.

\n

The returned iterator keeps a mutable borrow on the vector to optimize\nits implementation.

\n
§Panics
\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the vector.

\n
§Leaking
\n

If the returned iterator goes out of scope without being dropped (due to\nmem::forget, for example), the vector may have lost and leaked\nelements arbitrarily, including elements outside the range.

\n
§Examples
\n
let mut v = vec![1, 2, 3];\nlet u: Vec<_> = v.drain(1..).collect();\nassert_eq!(v, &[1]);\nassert_eq!(u, &[2, 3]);\n\n// A full range clears the vector, like `clear()` does\nv.drain(..);\nassert_eq!(v, &[]);
\n
1.0.0 · source

pub fn clear(&mut self)

Clears the vector, removing all values.

\n

Note that this method has no effect on the allocated capacity\nof the vector.

\n
§Examples
\n
let mut v = vec![1, 2, 3];\n\nv.clear();\n\nassert!(v.is_empty());
\n
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to\nas its ‘length’.

\n
§Examples
\n
let a = vec![1, 2, 3];\nassert_eq!(a.len(), 3);
\n
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

\n
§Examples
\n
let mut v = Vec::new();\nassert!(v.is_empty());\n\nv.push(1);\nassert!(!v.is_empty());
\n
1.4.0 · source

pub fn split_off(&mut self, at: usize) -> Vec<T, A>
where\n A: Clone,

Splits the collection into two at the given index.

\n

Returns a newly allocated vector containing the elements in the range\n[at, len). After the call, the original vector will be left containing\nthe elements [0, at) with its previous capacity unchanged.

\n
    \n
  • If you want to take ownership of the entire contents and capacity of\nthe vector, see mem::take or mem::replace.
  • \n
  • If you don’t need the returned vector at all, see Vec::truncate.
  • \n
  • If you want to take ownership of an arbitrary subslice, or you don’t\nnecessarily want to store the removed items in a vector, see Vec::drain.
  • \n
\n
§Panics
\n

Panics if at > len.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nlet vec2 = vec.split_off(1);\nassert_eq!(vec, [1]);\nassert_eq!(vec2, [2, 3]);
\n
1.33.0 · source

pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where\n F: FnMut() -> T,

Resizes the Vec in-place so that len is equal to new_len.

\n

If new_len is greater than len, the Vec is extended by the\ndifference, with each additional slot filled with the result of\ncalling the closure f. The return values from f will end up\nin the Vec in the order they have been generated.

\n

If new_len is less than len, the Vec is simply truncated.

\n

This method uses a closure to create new values on every push. If\nyou’d rather Clone a given value, use Vec::resize. If you\nwant to use the Default trait to generate values, you can\npass Default::default as the second argument.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nvec.resize_with(5, Default::default);\nassert_eq!(vec, [1, 2, 3, 0, 0]);\n\nlet mut vec = vec![];\nlet mut p = 1;\nvec.resize_with(4, || { p *= 2; p });\nassert_eq!(vec, [2, 4, 8, 16]);
\n
1.47.0 · source

pub fn leak<'a>(self) -> &'a mut [T]
where\n A: 'a,

Consumes and leaks the Vec, returning a mutable reference to the contents,\n&'a mut [T]. Note that the type T must outlive the chosen lifetime\n'a. If the type has only static references, or none at all, then this\nmay be chosen to be 'static.

\n

As of Rust 1.57, this method does not reallocate or shrink the Vec,\nso the leaked allocation may include unused capacity that is not part\nof the returned slice.

\n

This function is mainly useful for data that lives for the remainder of\nthe program’s life. Dropping the returned reference will cause a memory\nleak.

\n
§Examples
\n

Simple usage:

\n\n
let x = vec![1, 2, 3];\nlet static_ref: &'static mut [usize] = x.leak();\nstatic_ref[0] += 1;\nassert_eq!(static_ref, &[2, 2, 3]);
\n
1.60.0 · source

pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]

Returns the remaining spare capacity of the vector as a slice of\nMaybeUninit<T>.

\n

The returned slice can be used to fill the vector with data (e.g. by\nreading from a file) before marking the data as initialized using the\nset_len method.

\n
§Examples
\n
// Allocate vector big enough for 10 elements.\nlet mut v = Vec::with_capacity(10);\n\n// Fill in the first 3 elements.\nlet uninit = v.spare_capacity_mut();\nuninit[0].write(0);\nuninit[1].write(1);\nuninit[2].write(2);\n\n// Mark the first 3 elements of the vector as being initialized.\nunsafe {\n    v.set_len(3);\n}\n\nassert_eq!(&v, &[0, 1, 2]);
\n
source

pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>])

🔬This is a nightly-only experimental API. (vec_split_at_spare)

Returns vector content as a slice of T, along with the remaining spare\ncapacity of the vector as a slice of MaybeUninit<T>.

\n

The returned spare capacity slice can be used to fill the vector with data\n(e.g. by reading from a file) before marking the data as initialized using\nthe set_len method.

\n

Note that this is a low-level API, which should be used with care for\noptimization purposes. If you need to append data to a Vec\nyou can use push, extend, extend_from_slice,\nextend_from_within, insert, append, resize or\nresize_with, depending on your exact needs.

\n
§Examples
\n
#![feature(vec_split_at_spare)]\n\nlet mut v = vec![1, 1, 2];\n\n// Reserve additional space big enough for 10 elements.\nv.reserve(10);\n\nlet (init, uninit) = v.split_at_spare_mut();\nlet sum = init.iter().copied().sum::<u32>();\n\n// Fill in the next 4 elements.\nuninit[0].write(sum);\nuninit[1].write(sum * 2);\nuninit[2].write(sum * 3);\nuninit[3].write(sum * 4);\n\n// Mark the 4 elements of the vector as being initialized.\nunsafe {\n    let len = v.len();\n    v.set_len(len + 4);\n}\n\nassert_eq!(&v, &[1, 1, 2, 4, 8, 12, 16]);
\n
",0,"oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<A> Write for Vec<u8, A>
where\n A: Allocator,

Write is implemented for Vec<u8> by appending to the vector.\nThe vector will grow as needed.

\n
source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Error>

Write a buffer into this writer, returning how many bytes were written. Read more
source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored\nimplementation. Read more
source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
source§

fn flush(&mut self) -> Result<(), Error>

Flush this output stream, ensuring that all intermediately buffered\ncontents reach their destination. Read more
source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error\nencountered. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where\n Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
","Write","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl<Z> Zeroize for Vec<Z>
where\n Z: Zeroize,

§

fn zeroize(&mut self)

“Best effort” zeroization for Vec.

\n

Ensures the entire capacity of the Vec is zeroed. Cannot ensure that\nprevious reallocations did not leave values on the heap.

\n
","Zeroize","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> Deref for Vec<T, A>
where\n A: Allocator,

§

type Target = [T]

The resulting type after dereferencing.
source§

fn deref(&self) -> &[T]

Dereferences the value.
","Deref","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
source§

impl<T, A> DerefPure for Vec<T, A>
where\n A: Allocator,

","DerefPure","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
1.0.0 · source§

impl<T, A> Eq for Vec<T, A>
where\n T: Eq,\n A: Allocator,

","Eq","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"],["
§

impl Write for Vec<u8>

","Write","oasis_core_runtime::storage::mkvs::tree::node::Key"],["
§

impl<Z> ZeroizeOnDrop for Vec<Z>
where\n Z: ZeroizeOnDrop,

","ZeroizeOnDrop","oasis_core_runtime::storage::mkvs::tree::node::Key","oasis_core_runtime::storage::mkvs::WriteLog","oasis_core_runtime::transaction::rwset::CoarsenedSet","oasis_core_runtime::transaction::tags::Tags"]], +"oasis_runtime_sdk":[["
§

impl<'a, A> Arbitrary<'a> for Vec<A>
where\n A: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Vec<A>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Vec<A>, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
§

fn size_hint(_depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
","Arbitrary<'a>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.5.0 · source§

impl<T, A> AsMut<[T]> for Vec<T, A>
where\n A: Allocator,

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut<[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.5.0 · source§

impl<T, A> AsMut<Vec<T, A>> for Vec<T, A>
where\n A: Allocator,

source§

fn as_mut(&mut self) -> &mut Vec<T, A>

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> AsRef<[T]> for Vec<T, A>
where\n A: Allocator,

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> AsRef<Vec<T, A>> for Vec<T, A>
where\n A: Allocator,

source§

fn as_ref(&self) -> &Vec<T, A>

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> BERDecodable for Vec<T>
where\n T: BERDecodable,

§

fn decode_ber(reader: BERReader<'_, '_>) -> Result<Vec<T>, ASN1Error>

Reads an ASN.1 value from BERReader and converts it to Self. Read more
","BERDecodable","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> BERDecodable for Vec<T>
where\n T: BERDecodable,

§

fn decode_ber(reader: BERReader<'_, '_>) -> Result<Vec<T>, ASN1Error>

Reads an ASN.1 value from BERReader and converts it to Self. Read more
","BERDecodable","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Borrow<[T]> for Vec<T, A>
where\n A: Allocator,

source§

fn borrow(&self) -> &[T]

Immutably borrows from an owned value. Read more
","Borrow<[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> BorrowMut<[T]> for Vec<T, A>
where\n A: Allocator,

source§

fn borrow_mut(&mut self) -> &mut [T]

Mutably borrows from an owned value. Read more
","BorrowMut<[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> CheckDerConstraints for Vec<T>
where\n T: CheckDerConstraints,

§

fn check_constraints(any: &Any<'_>) -> Result<(), Error>

","CheckDerConstraints","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Clone for Vec<T, A>
where\n T: Clone,\n A: Allocator + Clone,

source§

fn clone_from(&mut self, source: &Vec<T, A>)

Overwrites the contents of self with a clone of the contents of source.

\n

This method is preferred over simply assigning source.clone() to self,\nas it avoids reallocation if possible. Additionally, if the element type\nT overrides clone_from(), this will reuse the resources of self’s\nelements as well.

\n
§Examples
\n
let x = vec![5, 6, 7];\nlet mut y = vec![8, 9, 10];\nlet yp: *const i32 = y.as_ptr();\n\ny.clone_from(&x);\n\n// The value is the same\nassert_eq!(x, y);\n\n// And no reallocation occurred\nassert_eq!(yp, y.as_ptr());
\n
source§

fn clone(&self) -> Vec<T, A>

Returns a copy of the value. Read more
","Clone","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> DEREncodable for Vec<T>
where\n T: DEREncodable,

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> DEREncodable for Vec<T>
where\n T: DEREncodable,

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Debug for Vec<T, A>
where\n T: Debug,\n A: Allocator,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Decode for Vec<T>
where\n T: Decode,

§

default fn try_default() -> Result<Vec<T>, DecodeError>

Try to decode from a missing/null/undefined value.
§

default fn try_from_cbor_value(value: Value) -> Result<Vec<T>, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<'a, T> DecodeValue<'a> for Vec<T>
where\n T: Decode<'a>,

§

fn decode_value<R>(reader: &mut R, header: Header) -> Result<Vec<T>, Error>
where\n R: Reader<'a>,

Attempt to decode this message using the provided [Reader].
","DecodeValue<'a>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T> Default for Vec<T>

source§

fn default() -> Vec<T>

Creates an empty Vec<T>.

\n

The vector will not allocate until elements are pushed onto it.

\n
","Default","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Deref for Vec<T, A>
where\n A: Allocator,

§

type Target = [T]

The resulting type after dereferencing.
source§

fn deref(&self) -> &[T]

Dereferences the value.
","Deref","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> DerefMut for Vec<T, A>
where\n A: Allocator,

source§

fn deref_mut(&mut self) -> &mut [T]

Mutably dereferences the value.
","DerefMut","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<'de, T> Deserialize<'de> for Vec<T>
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<Vec<T>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Drop for Vec<T, A>
where\n A: Allocator,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
","Drop","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Encode for Vec<T>
where\n T: Encode,

§

default fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
§

default fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
","Encode","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> EncodeValue for Vec<T>
where\n T: Encode,

§

fn value_len(&self) -> Result<Length, Error>

Compute the length of this value (sans [Tag]+[Length] header) when\nencoded as ASN.1 DER.
§

fn encode_value(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode value (sans [Tag]+[Length] header) as ASN.1 DER using the\nprovided [Writer].
§

fn header(&self) -> Result<Header, Error>
where\n Self: Tagged,

Get the [Header] used to encode this value.
","EncodeValue","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.2.0 · source§

impl<'a, T, A> Extend<&'a T> for Vec<T, A>
where\n T: Copy + 'a,\n A: Allocator,

Extend implementation that copies elements out of references before pushing them onto the Vec.

\n

This implementation is specialized for slice iterators, where it uses copy_from_slice to\nappend the entire slice at once.

\n
source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = &'a T>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, _: &'a T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend<&'a T>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Extend<T> for Vec<T, A>
where\n A: Allocator,

source§

fn extend<I>(&mut self, iter: I)
where\n I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
","Extend","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> FixedTag for Vec<T>

§

const TAG: Tag = Tag::Sequence

ASN.1 tag
","FixedTag","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T> From<&[T]> for Vec<T>
where\n T: Clone,

source§

fn from(s: &[T]) -> Vec<T>

Allocate a Vec<T> and fill it by cloning s’s items.

\n
§Examples
\n
assert_eq!(Vec::from(&[1, 2, 3][..]), vec![1, 2, 3]);
\n
","From<&[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.74.0 · source§

impl<T, const N: usize> From<&[T; N]> for Vec<T>
where\n T: Clone,

source§

fn from(s: &[T; N]) -> Vec<T>

Allocate a Vec<T> and fill it by cloning s’s items.

\n
§Examples
\n
assert_eq!(Vec::from(&[1, 2, 3]), vec![1, 2, 3]);
\n
","From<&[T; N]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.19.0 · source§

impl<T> From<&mut [T]> for Vec<T>
where\n T: Clone,

source§

fn from(s: &mut [T]) -> Vec<T>

Allocate a Vec<T> and fill it by cloning s’s items.

\n
§Examples
\n
assert_eq!(Vec::from(&mut [1, 2, 3][..]), vec![1, 2, 3]);
\n
","From<&mut [T]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.74.0 · source§

impl<T, const N: usize> From<&mut [T; N]> for Vec<T>
where\n T: Clone,

source§

fn from(s: &mut [T; N]) -> Vec<T>

Allocate a Vec<T> and fill it by cloning s’s items.

\n
§Examples
\n
assert_eq!(Vec::from(&mut [1, 2, 3]), vec![1, 2, 3]);
\n
","From<&mut [T; N]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.44.0 · source§

impl<T, const N: usize> From<[T; N]> for Vec<T>

source§

fn from(s: [T; N]) -> Vec<T>

Allocate a Vec<T> and move s’s items into it.

\n
§Examples
\n
assert_eq!(Vec::from([1, 2, 3]), vec![1, 2, 3]);
\n
","From<[T; N]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.5.0 · source§

impl<T, A> From<BinaryHeap<T, A>> for Vec<T, A>
where\n A: Allocator,

source§

fn from(heap: BinaryHeap<T, A>) -> Vec<T, A>

Converts a BinaryHeap<T> into a Vec<T>.

\n

This conversion requires no data movement or allocation, and has\nconstant time complexity.

\n
","From>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.18.0 · source§

impl<T, A> From<Box<[T], A>> for Vec<T, A>
where\n A: Allocator,

source§

fn from(s: Box<[T], A>) -> Vec<T, A>

Convert a boxed slice into a vector by transferring ownership of\nthe existing heap allocation.

\n
§Examples
\n
let b: Box<[i32]> = vec![1, 2, 3].into_boxed_slice();\nassert_eq!(Vec::from(b), vec![1, 2, 3]);
\n
","From>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.14.0 · source§

impl<'a, T> From<Cow<'a, [T]>> for Vec<T>
where\n [T]: ToOwned<Owned = Vec<T>>,

source§

fn from(s: Cow<'a, [T]>) -> Vec<T>

Convert a clone-on-write slice into a vector.

\n

If s already owns a Vec<T>, it will be returned directly.\nIf s is borrowing a slice, a new Vec<T> will be allocated and\nfilled by cloning s’s items into it.

\n
§Examples
\n
let o: Cow<'_, [i32]> = Cow::Owned(vec![1, 2, 3]);\nlet b: Cow<'_, [i32]> = Cow::Borrowed(&[1, 2, 3]);\nassert_eq!(Vec::from(o), Vec::from(b));
\n
","From>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> From<SequenceOf<T>> for Vec<T>

§

fn from(seq: SequenceOf<T>) -> Vec<T>

Converts to this type from the input type.
","From>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> From<SetOf<T>> for Vec<T>

§

fn from(set: SetOf<T>) -> Vec<T>

Converts to this type from the input type.
","From>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> From<SetOfVec<T>> for Vec<T>
where\n T: DerOrd,

§

fn from(set: SetOfVec<T>) -> Vec<T>

Converts to this type from the input type.
","From>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.10.0 · source§

impl<T, A> From<VecDeque<T, A>> for Vec<T, A>
where\n A: Allocator,

source§

fn from(other: VecDeque<T, A>) -> Vec<T, A>

Turn a VecDeque<T> into a Vec<T>.

\n

This never needs to re-allocate, but does need to do O(n) data movement if\nthe circular buffer doesn’t happen to be at the beginning of the allocation.

\n
§Examples
\n
use std::collections::VecDeque;\n\n// This one is *O*(1).\nlet deque: VecDeque<_> = (1..5).collect();\nlet ptr = deque.as_slices().0.as_ptr();\nlet vec = Vec::from(deque);\nassert_eq!(vec, [1, 2, 3, 4]);\nassert_eq!(vec.as_ptr(), ptr);\n\n// This one needs data rearranging.\nlet mut deque: VecDeque<_> = (1..5).collect();\ndeque.push_front(9);\ndeque.push_front(8);\nlet ptr = deque.as_slices().1.as_ptr();\nlet vec = Vec::from(deque);\nassert_eq!(vec, [8, 9, 1, 2, 3, 4]);\nassert_eq!(vec.as_ptr(), ptr);
\n
","From>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<'a, T, E> FromDer<'a, E> for Vec<T>
where\n T: FromDer<'a, E>,\n E: From<Error> + Debug,

manual impl of FromDer, so we do not need to require TryFrom<Any> + CheckDerConstraints

\n
§

fn from_der(bytes: &'a [u8]) -> Result<(&'a [u8], Vec<T>), Err<E>>

Attempt to parse input bytes into a DER object (enforcing constraints)
","FromDer<'a, E>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T> FromIterator<T> for Vec<T>

Collects an iterator into a Vec, commonly called via Iterator::collect()

\n

§Allocation behavior

\n

In general Vec does not guarantee any particular growth or allocation strategy.\nThat also applies to this trait impl.

\n

Note: This section covers implementation details and is therefore exempt from\nstability guarantees.

\n

Vec may use any or none of the following strategies,\ndepending on the supplied iterator:

\n
    \n
  • preallocate based on Iterator::size_hint()\n
      \n
    • and panic if the number of items is outside the provided lower/upper bounds
    • \n
    \n
  • \n
  • use an amortized growth strategy similar to pushing one item at a time
  • \n
  • perform the iteration in-place on the original allocation backing the iterator
  • \n
\n

The last case warrants some attention. It is an optimization that in many cases reduces peak memory\nconsumption and improves cache locality. But when big, short-lived allocations are created,\nonly a small fraction of their items get collected, no further use is made of the spare capacity\nand the resulting Vec is moved into a longer-lived structure, then this can lead to the large\nallocations having their lifetimes unnecessarily extended which can result in increased memory\nfootprint.

\n

In cases where this is an issue, the excess capacity can be discarded with Vec::shrink_to(),\nVec::shrink_to_fit() or by collecting into Box<[T]> instead, which additionally reduces\nthe size of the long-lived struct.

\n\n
static LONG_LIVED: Mutex<Vec<Vec<u16>>> = Mutex::new(Vec::new());\n\nfor i in 0..10 {\n    let big_temporary: Vec<u16> = (0..1024).collect();\n    // discard most items\n    let mut result: Vec<_> = big_temporary.into_iter().filter(|i| i % 100 == 0).collect();\n    // without this a lot of unused capacity might be moved into the global\n    result.shrink_to_fit();\n    LONG_LIVED.lock().unwrap().push(result);\n}
\n
source§

fn from_iter<I>(iter: I) -> Vec<T>
where\n I: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
","FromIterator","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Hash for Vec<T, A>
where\n T: Hash,\n A: Allocator,

The hash of a vector is the same as that of the corresponding slice,\nas required by the core::borrow::Borrow implementation.

\n\n
use std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet v: Vec<u8> = vec![0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(v), b.hash_one(s));
\n
source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, I, A> Index<I> for Vec<T, A>
where\n I: SliceIndex<[T]>,\n A: Allocator,

§

type Output = <I as SliceIndex<[T]>>::Output

The returned type after indexing.
source§

fn index(&self, index: I) -> &<Vec<T, A> as Index<I>>::Output

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Index<PatternID> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: PatternID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Index<PatternID> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: PatternID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Index<SmallIndex> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: SmallIndex) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Index<SmallIndex> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: SmallIndex) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Index<StateID> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: StateID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Index<StateID> for Vec<T>

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: StateID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, I, A> IndexMut<I> for Vec<T, A>
where\n I: SliceIndex<[T]>,\n A: Allocator,

source§

fn index_mut(&mut self, index: I) -> &mut <Vec<T, A> as Index<I>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> IndexMut<PatternID> for Vec<T>

§

fn index_mut(&mut self, index: PatternID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> IndexMut<PatternID> for Vec<T>

§

fn index_mut(&mut self, index: PatternID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> IndexMut<SmallIndex> for Vec<T>

§

fn index_mut(&mut self, index: SmallIndex) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> IndexMut<SmallIndex> for Vec<T>

§

fn index_mut(&mut self, index: SmallIndex) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> IndexMut<StateID> for Vec<T>

§

fn index_mut(&mut self, index: StateID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> IndexMut<StateID> for Vec<T>

§

fn index_mut(&mut self, index: StateID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<'de, T, E> IntoDeserializer<'de, E> for Vec<T>
where\n T: IntoDeserializer<'de, E>,\n E: Error,

§

type Deserializer = SeqDeserializer<<Vec<T> as IntoIterator>::IntoIter, E>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> <Vec<T> as IntoDeserializer<'de, E>>::Deserializer

Convert this value into a deserializer.
","IntoDeserializer<'de, E>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> IntoIterator for Vec<T, A>
where\n A: Allocator,

source§

fn into_iter(self) -> <Vec<T, A> as IntoIterator>::IntoIter

Creates a consuming iterator, that is, one that moves each value out of\nthe vector (from start to end). The vector cannot be used after calling\nthis.

\n
§Examples
\n
let v = vec![\"a\".to_string(), \"b\".to_string()];\nlet mut v_iter = v.into_iter();\n\nlet first_element: Option<String> = v_iter.next();\n\nassert_eq!(first_element, Some(\"a\".to_string()));\nassert_eq!(v_iter.next(), Some(\"b\".to_string()));\nassert_eq!(v_iter.next(), None);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, A>

Which kind of iterator are we turning this into?
","IntoIterator","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Ord for Vec<T, A>
where\n T: Ord,\n A: Allocator,

Implements ordering of vectors, lexicographically.

\n
source§

fn cmp(&self, other: &Vec<T, A>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, U, A> PartialEq<&[U]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &&[U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&[U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&[U]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, U, A, const N: usize> PartialEq<&[U; N]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &&[U; N]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&[U; N]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&[U; N]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, U, A> PartialEq<&mut [U]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &&mut [U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&mut [U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&mut [U]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.48.0 · source§

impl<T, U, A> PartialEq<[U]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &[U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &[U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<[U]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, U, A, const N: usize> PartialEq<[U; N]> for Vec<T, A>
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &[U; N]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &[U; N]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<[U; N]>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, U, A1, A2> PartialEq<Vec<U, A2>> for Vec<T, A1>
where\n A1: Allocator,\n A2: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &Vec<U, A2>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &Vec<U, A2>) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A1, A2> PartialOrd<Vec<T, A2>> for Vec<T, A1>
where\n T: PartialOrd,\n A1: Allocator,\n A2: Allocator,

Implements comparison of vectors, lexicographically.

\n
source§

fn partial_cmp(&self, other: &Vec<T, A2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<T> Serialize for Vec<T>
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Sink<T> for Vec<T>

§

type Error = Infallible

The type of value produced by the sink when an error occurs.
§

fn poll_ready(\n self: Pin<&mut Vec<T>>,\n _: &mut Context<'_>,\n) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>

Attempts to prepare the Sink to receive a value. Read more
§

fn start_send(\n self: Pin<&mut Vec<T>>,\n item: T,\n) -> Result<(), <Vec<T> as Sink<T>>::Error>

Begin the process of sending a value to the sink.\nEach call to this function must be preceded by a successful call to\npoll_ready which returned Poll::Ready(Ok(())). Read more
§

fn poll_flush(\n self: Pin<&mut Vec<T>>,\n _: &mut Context<'_>,\n) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>

Flush any remaining output from this sink. Read more
§

fn poll_close(\n self: Pin<&mut Vec<T>>,\n _: &mut Context<'_>,\n) -> Poll<Result<(), <Vec<T> as Sink<T>>::Error>>

Flush any remaining output and close this sink, if necessary. Read more
","Sink","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> Tagged for Vec<T>

§

const TAG: Tag = Tag::Sequence

","Tagged","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> ToDer for Vec<T>
where\n T: ToDer,

§

fn to_der_len(&self) -> Result<usize, Error>

Get the length of the object (including the header), when encoded
§

fn write_der_header(\n &self,\n writer: &mut dyn Write,\n) -> Result<usize, SerializeError>

Attempt to write the DER header to this writer.
§

fn write_der_content(\n &self,\n writer: &mut dyn Write,\n) -> Result<usize, SerializeError>

Attempt to write the DER content (all except header) to this writer.
§

fn to_der_vec(&self) -> Result<Vec<u8>, SerializeError>

Write the DER encoded representation to a newly allocated Vec<u8>.
§

fn to_der_vec_raw(&self) -> Result<Vec<u8>, SerializeError>

Similar to using to_vec, but uses provided values without changes.\nThis can generate an invalid encoding for a DER object.
§

fn write_der(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>

Attempt to write the DER encoded representation (header and content) into this writer. Read more
§

fn write_der_raw(&self, writer: &mut dyn Write) -> Result<usize, SerializeError>

Similar to using to_der, but uses provided values without changes.\nThis can generate an invalid encoding for a DER object.
","ToDer","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T, U> ToStatic for Vec<T>
where\n T: ToStatic<Owned = U>,\n U: 'static,

§

type Owned = Vec<U>

§

fn to_static(&self) -> <Vec<T> as ToStatic>::Owned

","ToStatic","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<'a, T> TryFrom<Any<'a>> for Vec<T>
where\n T: FromBer<'a>,

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(any: Any<'a>) -> Result<Vec<T>, Error>

Performs the conversion.
","TryFrom>","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<T> ValueOrd for Vec<T>
where\n T: DerOrd,

§

fn value_cmp(&self, other: &Vec<T>) -> Result<Ordering, Error>

Return an Ordering between value portion of TLV-encoded self and\nother when serialized as ASN.1 DER.
","ValueOrd","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<T> Vec<T>

1.0.0 (const: 1.39.0) · source

pub const fn new() -> Vec<T>

Constructs a new, empty Vec<T>.

\n

The vector will not allocate until elements are pushed onto it.

\n
§Examples
\n
let mut vec: Vec<i32> = Vec::new();
\n
1.0.0 · source

pub fn with_capacity(capacity: usize) -> Vec<T>

Constructs a new, empty Vec<T> with at least the specified capacity.

\n

The vector will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the vector will not allocate.

\n

It is important to note that although the returned vector has the\nminimum capacity specified, the vector will have a zero length. For\nan explanation of the difference between length and capacity, see\nCapacity and reallocation.

\n

If it is important to know the exact allocated capacity of a Vec,\nalways use the capacity method after construction.

\n

For Vec<T> where T is a zero-sized type, there will be no allocation\nand the capacity will always be usize::MAX.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = Vec::with_capacity(10);\n\n// The vector contains no items, even though it has capacity for more\nassert_eq!(vec.len(), 0);\nassert!(vec.capacity() >= 10);\n\n// These are all done without reallocating...\nfor i in 0..10 {\n    vec.push(i);\n}\nassert_eq!(vec.len(), 10);\nassert!(vec.capacity() >= 10);\n\n// ...but this may make the vector reallocate\nvec.push(11);\nassert_eq!(vec.len(), 11);\nassert!(vec.capacity() >= 11);\n\n// A vector of a zero-sized type will always over-allocate, since no\n// allocation is necessary\nlet vec_units = Vec::<()>::with_capacity(10);\nassert_eq!(vec_units.capacity(), usize::MAX);
\n
source

pub fn try_with_capacity(capacity: usize) -> Result<Vec<T>, TryReserveError>

🔬This is a nightly-only experimental API. (try_with_capacity)

Constructs a new, empty Vec<T> with at least the specified capacity.

\n

The vector will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the vector will not allocate.

\n
§Errors
\n

Returns an error if the capacity exceeds isize::MAX bytes,\nor if the allocator reports allocation failure.

\n
1.0.0 · source

pub unsafe fn from_raw_parts(\n ptr: *mut T,\n length: usize,\n capacity: usize,\n) -> Vec<T>

Creates a Vec<T> directly from a pointer, a length, and a capacity.

\n
§Safety
\n

This is highly unsafe, due to the number of invariants that aren’t\nchecked:

\n
    \n
  • ptr must have been allocated using the global allocator, such as via\nthe alloc::alloc function.
  • \n
  • T needs to have the same alignment as what ptr was allocated with.\n(T having a less strict alignment is not sufficient, the alignment really\nneeds to be equal to satisfy the dealloc requirement that memory must be\nallocated and deallocated with the same layout.)
  • \n
  • The size of T times the capacity (ie. the allocated size in bytes) needs\nto be the same size as the pointer was allocated with. (Because similar to\nalignment, dealloc must be called with the same layout size.)
  • \n
  • length needs to be less than or equal to capacity.
  • \n
  • The first length values must be properly initialized values of type T.
  • \n
  • capacity needs to be the capacity that the pointer was allocated with.
  • \n
  • The allocated size in bytes must be no larger than isize::MAX.\nSee the safety documentation of pointer::offset.
  • \n
\n

These requirements are always upheld by any ptr that has been allocated\nvia Vec<T>. Other allocation sources are allowed if the invariants are\nupheld.

\n

Violating these may cause problems like corrupting the allocator’s\ninternal data structures. For example it is normally not safe\nto build a Vec<u8> from a pointer to a C char array with length\nsize_t, doing so is only safe if the array was initially allocated by\na Vec or String.\nIt’s also not safe to build one from a Vec<u16> and its length, because\nthe allocator cares about the alignment, and these two types have different\nalignments. The buffer was allocated with alignment 2 (for u16), but after\nturning it into a Vec<u8> it’ll be deallocated with alignment 1. To avoid\nthese issues, it is often preferable to do casting/transmuting using\nslice::from_raw_parts instead.

\n

The ownership of ptr is effectively transferred to the\nVec<T> which may then deallocate, reallocate or change the\ncontents of memory pointed to by the pointer at will. Ensure\nthat nothing else uses the pointer after calling this\nfunction.

\n
§Examples
\n
use std::ptr;\nuse std::mem;\n\nlet v = vec![1, 2, 3];\n\n// Prevent running `v`'s destructor so we are in complete control\n// of the allocation.\nlet mut v = mem::ManuallyDrop::new(v);\n\n// Pull out the various important pieces of information about `v`\nlet p = v.as_mut_ptr();\nlet len = v.len();\nlet cap = v.capacity();\n\nunsafe {\n    // Overwrite memory with 4, 5, 6\n    for i in 0..len {\n        ptr::write(p.add(i), 4 + i);\n    }\n\n    // Put everything back together into a Vec\n    let rebuilt = Vec::from_raw_parts(p, len, cap);\n    assert_eq!(rebuilt, [4, 5, 6]);\n}
\n

Using memory that was allocated elsewhere:

\n\n
use std::alloc::{alloc, Layout};\n\nfn main() {\n    let layout = Layout::array::<u32>(16).expect(\"overflow cannot happen\");\n\n    let vec = unsafe {\n        let mem = alloc(layout).cast::<u32>();\n        if mem.is_null() {\n            return;\n        }\n\n        mem.write(1_000_000);\n\n        Vec::from_raw_parts(mem, 1, 16)\n    };\n\n    assert_eq!(vec, &[1_000_000]);\n    assert_eq!(vec.capacity(), 16);\n}
\n
",0,"oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<T, A> Vec<T, A>
where\n T: Clone,\n A: Allocator,

1.5.0 · source

pub fn resize(&mut self, new_len: usize, value: T)

Resizes the Vec in-place so that len is equal to new_len.

\n

If new_len is greater than len, the Vec is extended by the\ndifference, with each additional slot filled with value.\nIf new_len is less than len, the Vec is simply truncated.

\n

This method requires T to implement Clone,\nin order to be able to clone the passed value.\nIf you need more flexibility (or want to rely on Default instead of\nClone), use Vec::resize_with.\nIf you only need to resize to a smaller size, use Vec::truncate.

\n
§Examples
\n
let mut vec = vec![\"hello\"];\nvec.resize(3, \"world\");\nassert_eq!(vec, [\"hello\", \"world\", \"world\"]);\n\nlet mut vec = vec![1, 2, 3, 4];\nvec.resize(2, 0);\nassert_eq!(vec, [1, 2]);
\n
1.6.0 · source

pub fn extend_from_slice(&mut self, other: &[T])

Clones and appends all elements in a slice to the Vec.

\n

Iterates over the slice other, clones each element, and then appends\nit to this Vec. The other slice is traversed in-order.

\n

Note that this function is same as extend except that it is\nspecialized to work with slices instead. If and when Rust gets\nspecialization this function will likely be deprecated (but still\navailable).

\n
§Examples
\n
let mut vec = vec![1];\nvec.extend_from_slice(&[2, 3, 4]);\nassert_eq!(vec, [1, 2, 3, 4]);
\n
1.53.0 · source

pub fn extend_from_within<R>(&mut self, src: R)
where\n R: RangeBounds<usize>,

Copies elements from src range to the end of the vector.

\n
§Panics
\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the vector.

\n
§Examples
\n
let mut vec = vec![0, 1, 2, 3, 4];\n\nvec.extend_from_within(2..);\nassert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);\n\nvec.extend_from_within(..2);\nassert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);\n\nvec.extend_from_within(4..8);\nassert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
\n
",0,"oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<T, A> Vec<T, A>
where\n T: PartialEq,\n A: Allocator,

1.0.0 · source

pub fn dedup(&mut self)

Removes consecutive repeated elements in the vector according to the\nPartialEq trait implementation.

\n

If the vector is sorted, this removes all duplicates.

\n
§Examples
\n
let mut vec = vec![1, 2, 2, 3, 2];\n\nvec.dedup();\n\nassert_eq!(vec, [1, 2, 3, 2]);
\n
",0,"oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<T, A> Vec<T, A>
where\n A: Allocator,

1.21.0 · source

pub fn splice<R, I>(\n &mut self,\n range: R,\n replace_with: I,\n) -> Splice<'_, <I as IntoIterator>::IntoIter, A>
where\n R: RangeBounds<usize>,\n I: IntoIterator<Item = T>,

Creates a splicing iterator that replaces the specified range in the vector\nwith the given replace_with iterator and yields the removed items.\nreplace_with does not need to be the same length as range.

\n

range is removed even if the iterator is not consumed until the end.

\n

It is unspecified how many elements are removed from the vector\nif the Splice value is leaked.

\n

The input iterator replace_with is only consumed when the Splice value is dropped.

\n

This is optimal if:

\n
    \n
  • The tail (elements in the vector after range) is empty,
  • \n
  • or replace_with yields fewer or equal elements than range’s length
  • \n
  • or the lower bound of its size_hint() is exact.
  • \n
\n

Otherwise, a temporary vector is allocated and the tail is moved twice.

\n
§Panics
\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the vector.

\n
§Examples
\n
let mut v = vec![1, 2, 3, 4];\nlet new = [7, 8, 9];\nlet u: Vec<_> = v.splice(1..3, new).collect();\nassert_eq!(v, &[1, 7, 8, 9, 4]);\nassert_eq!(u, &[2, 3]);
\n
source

pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
where\n F: FnMut(&mut T) -> bool,

🔬This is a nightly-only experimental API. (extract_if)

Creates an iterator which uses a closure to determine if an element should be removed.

\n

If the closure returns true, then the element is removed and yielded.\nIf the closure returns false, the element will remain in the vector and will not be yielded\nby the iterator.

\n

If the returned ExtractIf is not exhausted, e.g. because it is dropped without iterating\nor the iteration short-circuits, then the remaining elements will be retained.\nUse retain with a negated predicate if you do not need the returned iterator.

\n

Using this method is equivalent to the following code:

\n\n
let mut i = 0;\nwhile i < vec.len() {\n    if some_predicate(&mut vec[i]) {\n        let val = vec.remove(i);\n        // your code here\n    } else {\n        i += 1;\n    }\n}\n
\n

But extract_if is easier to use. extract_if is also more efficient,\nbecause it can backshift the elements of the array in bulk.

\n

Note that extract_if also lets you mutate every element in the filter closure,\nregardless of whether you choose to keep or remove it.

\n
§Examples
\n

Splitting an array into evens and odds, reusing the original allocation:

\n\n
#![feature(extract_if)]\nlet mut numbers = vec![1, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 15];\n\nlet evens = numbers.extract_if(|x| *x % 2 == 0).collect::<Vec<_>>();\nlet odds = numbers;\n\nassert_eq!(evens, vec![2, 4, 6, 8, 14]);\nassert_eq!(odds, vec![1, 3, 5, 9, 11, 13, 15]);
\n
",0,"oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<T, A> Vec<T, A>
where\n A: Allocator,

source

pub const fn new_in(alloc: A) -> Vec<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new, empty Vec<T, A>.

\n

The vector will not allocate until elements are pushed onto it.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet mut vec: Vec<i32, _> = Vec::new_in(System);
\n
source

pub fn with_capacity_in(capacity: usize, alloc: A) -> Vec<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new, empty Vec<T, A> with at least the specified capacity\nwith the provided allocator.

\n

The vector will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the vector will not allocate.

\n

It is important to note that although the returned vector has the\nminimum capacity specified, the vector will have a zero length. For\nan explanation of the difference between length and capacity, see\nCapacity and reallocation.

\n

If it is important to know the exact allocated capacity of a Vec,\nalways use the capacity method after construction.

\n

For Vec<T, A> where T is a zero-sized type, there will be no allocation\nand the capacity will always be usize::MAX.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet mut vec = Vec::with_capacity_in(10, System);\n\n// The vector contains no items, even though it has capacity for more\nassert_eq!(vec.len(), 0);\nassert!(vec.capacity() >= 10);\n\n// These are all done without reallocating...\nfor i in 0..10 {\n    vec.push(i);\n}\nassert_eq!(vec.len(), 10);\nassert!(vec.capacity() >= 10);\n\n// ...but this may make the vector reallocate\nvec.push(11);\nassert_eq!(vec.len(), 11);\nassert!(vec.capacity() >= 11);\n\n// A vector of a zero-sized type will always over-allocate, since no\n// allocation is necessary\nlet vec_units = Vec::<(), System>::with_capacity_in(10, System);\nassert_eq!(vec_units.capacity(), usize::MAX);
\n
source

pub fn try_with_capacity_in(\n capacity: usize,\n alloc: A,\n) -> Result<Vec<T, A>, TryReserveError>

🔬This is a nightly-only experimental API. (allocator_api)

Constructs a new, empty Vec<T, A> with at least the specified capacity\nwith the provided allocator.

\n

The vector will be able to hold at least capacity elements without\nreallocating. This method is allowed to allocate for more elements than\ncapacity. If capacity is 0, the vector will not allocate.

\n
§Errors
\n

Returns an error if the capacity exceeds isize::MAX bytes,\nor if the allocator reports allocation failure.

\n
source

pub unsafe fn from_raw_parts_in(\n ptr: *mut T,\n length: usize,\n capacity: usize,\n alloc: A,\n) -> Vec<T, A>

🔬This is a nightly-only experimental API. (allocator_api)

Creates a Vec<T, A> directly from a pointer, a length, a capacity,\nand an allocator.

\n
§Safety
\n

This is highly unsafe, due to the number of invariants that aren’t\nchecked:

\n
    \n
  • ptr must be currently allocated via the given allocator alloc.
  • \n
  • T needs to have the same alignment as what ptr was allocated with.\n(T having a less strict alignment is not sufficient, the alignment really\nneeds to be equal to satisfy the dealloc requirement that memory must be\nallocated and deallocated with the same layout.)
  • \n
  • The size of T times the capacity (ie. the allocated size in bytes) needs\nto be the same size as the pointer was allocated with. (Because similar to\nalignment, dealloc must be called with the same layout size.)
  • \n
  • length needs to be less than or equal to capacity.
  • \n
  • The first length values must be properly initialized values of type T.
  • \n
  • capacity needs to fit the layout size that the pointer was allocated with.
  • \n
  • The allocated size in bytes must be no larger than isize::MAX.\nSee the safety documentation of pointer::offset.
  • \n
\n

These requirements are always upheld by any ptr that has been allocated\nvia Vec<T, A>. Other allocation sources are allowed if the invariants are\nupheld.

\n

Violating these may cause problems like corrupting the allocator’s\ninternal data structures. For example it is not safe\nto build a Vec<u8> from a pointer to a C char array with length size_t.\nIt’s also not safe to build one from a Vec<u16> and its length, because\nthe allocator cares about the alignment, and these two types have different\nalignments. The buffer was allocated with alignment 2 (for u16), but after\nturning it into a Vec<u8> it’ll be deallocated with alignment 1.

\n

The ownership of ptr is effectively transferred to the\nVec<T> which may then deallocate, reallocate or change the\ncontents of memory pointed to by the pointer at will. Ensure\nthat nothing else uses the pointer after calling this\nfunction.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nuse std::ptr;\nuse std::mem;\n\nlet mut v = Vec::with_capacity_in(3, System);\nv.push(1);\nv.push(2);\nv.push(3);\n\n// Prevent running `v`'s destructor so we are in complete control\n// of the allocation.\nlet mut v = mem::ManuallyDrop::new(v);\n\n// Pull out the various important pieces of information about `v`\nlet p = v.as_mut_ptr();\nlet len = v.len();\nlet cap = v.capacity();\nlet alloc = v.allocator();\n\nunsafe {\n    // Overwrite memory with 4, 5, 6\n    for i in 0..len {\n        ptr::write(p.add(i), 4 + i);\n    }\n\n    // Put everything back together into a Vec\n    let rebuilt = Vec::from_raw_parts_in(p, len, cap, alloc.clone());\n    assert_eq!(rebuilt, [4, 5, 6]);\n}
\n

Using memory that was allocated elsewhere:

\n\n
#![feature(allocator_api)]\n\nuse std::alloc::{AllocError, Allocator, Global, Layout};\n\nfn main() {\n    let layout = Layout::array::<u32>(16).expect(\"overflow cannot happen\");\n\n    let vec = unsafe {\n        let mem = match Global.allocate(layout) {\n            Ok(mem) => mem.cast::<u32>().as_ptr(),\n            Err(AllocError) => return,\n        };\n\n        mem.write(1_000_000);\n\n        Vec::from_raw_parts_in(mem, 1, 16, Global)\n    };\n\n    assert_eq!(vec, &[1_000_000]);\n    assert_eq!(vec.capacity(), 16);\n}
\n
source

pub fn into_raw_parts(self) -> (*mut T, usize, usize)

🔬This is a nightly-only experimental API. (vec_into_raw_parts)

Decomposes a Vec<T> into its raw components: (pointer, length, capacity).

\n

Returns the raw pointer to the underlying data, the length of\nthe vector (in elements), and the allocated capacity of the\ndata (in elements). These are the same arguments in the same\norder as the arguments to from_raw_parts.

\n

After calling this function, the caller is responsible for the\nmemory previously managed by the Vec. The only way to do\nthis is to convert the raw pointer, length, and capacity back\ninto a Vec with the from_raw_parts function, allowing\nthe destructor to perform the cleanup.

\n
§Examples
\n
#![feature(vec_into_raw_parts)]\nlet v: Vec<i32> = vec![-1, 0, 1];\n\nlet (ptr, len, cap) = v.into_raw_parts();\n\nlet rebuilt = unsafe {\n    // We can now make changes to the components, such as\n    // transmuting the raw pointer to a compatible type.\n    let ptr = ptr as *mut u32;\n\n    Vec::from_raw_parts(ptr, len, cap)\n};\nassert_eq!(rebuilt, [4294967295, 0, 1]);
\n
source

pub fn into_raw_parts_with_alloc(self) -> (*mut T, usize, usize, A)

🔬This is a nightly-only experimental API. (allocator_api)

Decomposes a Vec<T> into its raw components: (pointer, length, capacity, allocator).

\n

Returns the raw pointer to the underlying data, the length of the vector (in elements),\nthe allocated capacity of the data (in elements), and the allocator. These are the same\narguments in the same order as the arguments to from_raw_parts_in.

\n

After calling this function, the caller is responsible for the\nmemory previously managed by the Vec. The only way to do\nthis is to convert the raw pointer, length, and capacity back\ninto a Vec with the from_raw_parts_in function, allowing\nthe destructor to perform the cleanup.

\n
§Examples
\n
#![feature(allocator_api, vec_into_raw_parts)]\n\nuse std::alloc::System;\n\nlet mut v: Vec<i32, System> = Vec::new_in(System);\nv.push(-1);\nv.push(0);\nv.push(1);\n\nlet (ptr, len, cap, alloc) = v.into_raw_parts_with_alloc();\n\nlet rebuilt = unsafe {\n    // We can now make changes to the components, such as\n    // transmuting the raw pointer to a compatible type.\n    let ptr = ptr as *mut u32;\n\n    Vec::from_raw_parts_in(ptr, len, cap, alloc)\n};\nassert_eq!(rebuilt, [4294967295, 0, 1]);
\n
1.0.0 · source

pub fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without\nreallocating.

\n
§Examples
\n
let mut vec: Vec<i32> = Vec::with_capacity(10);\nvec.push(42);\nassert!(vec.capacity() >= 10);
\n
1.0.0 · source

pub fn reserve(&mut self, additional: usize)

Reserves capacity for at least additional more elements to be inserted\nin the given Vec<T>. The collection may reserve more space to\nspeculatively avoid frequent reallocations. After calling reserve,\ncapacity will be greater than or equal to self.len() + additional.\nDoes nothing if capacity is already sufficient.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = vec![1];\nvec.reserve(10);\nassert!(vec.capacity() >= 11);
\n
1.0.0 · source

pub fn reserve_exact(&mut self, additional: usize)

Reserves the minimum capacity for at least additional more elements to\nbe inserted in the given Vec<T>. Unlike reserve, this will not\ndeliberately over-allocate to speculatively avoid frequent allocations.\nAfter calling reserve_exact, capacity will be greater than or equal to\nself.len() + additional. Does nothing if the capacity is already\nsufficient.

\n

Note that the allocator may give the collection more space than it\nrequests. Therefore, capacity can not be relied upon to be precisely\nminimal. Prefer reserve if future insertions are expected.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = vec![1];\nvec.reserve_exact(10);\nassert!(vec.capacity() >= 11);
\n
1.57.0 · source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Tries to reserve capacity for at least additional more elements to be inserted\nin the given Vec<T>. The collection may reserve more space to speculatively avoid\nfrequent reallocations. After calling try_reserve, capacity will be\ngreater than or equal to self.len() + additional if it returns\nOk(()). Does nothing if capacity is already sufficient. This method\npreserves the contents even if an error occurs.

\n
§Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
§Examples
\n
use std::collections::TryReserveError;\n\nfn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {\n    let mut output = Vec::new();\n\n    // Pre-reserve the memory, exiting if we can't\n    output.try_reserve(data.len())?;\n\n    // Now we know this can't OOM in the middle of our complex work\n    output.extend(data.iter().map(|&val| {\n        val * 2 + 5 // very complicated\n    }));\n\n    Ok(output)\n}
\n
1.57.0 · source

pub fn try_reserve_exact(\n &mut self,\n additional: usize,\n) -> Result<(), TryReserveError>

Tries to reserve the minimum capacity for at least additional\nelements to be inserted in the given Vec<T>. Unlike try_reserve,\nthis will not deliberately over-allocate to speculatively avoid frequent\nallocations. After calling try_reserve_exact, capacity will be greater\nthan or equal to self.len() + additional if it returns Ok(()).\nDoes nothing if the capacity is already sufficient.

\n

Note that the allocator may give the collection more space than it\nrequests. Therefore, capacity can not be relied upon to be precisely\nminimal. Prefer try_reserve if future insertions are expected.

\n
§Errors
\n

If the capacity overflows, or the allocator reports a failure, then an error\nis returned.

\n
§Examples
\n
use std::collections::TryReserveError;\n\nfn process_data(data: &[u32]) -> Result<Vec<u32>, TryReserveError> {\n    let mut output = Vec::new();\n\n    // Pre-reserve the memory, exiting if we can't\n    output.try_reserve_exact(data.len())?;\n\n    // Now we know this can't OOM in the middle of our complex work\n    output.extend(data.iter().map(|&val| {\n        val * 2 + 5 // very complicated\n    }));\n\n    Ok(output)\n}
\n
1.0.0 · source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the vector as much as possible.

\n

The behavior of this method depends on the allocator, which may either shrink the vector\nin-place or reallocate. The resulting vector might still have some excess capacity, just as\nis the case for with_capacity. See Allocator::shrink for more details.

\n
§Examples
\n
let mut vec = Vec::with_capacity(10);\nvec.extend([1, 2, 3]);\nassert!(vec.capacity() >= 10);\nvec.shrink_to_fit();\nassert!(vec.capacity() >= 3);
\n
1.56.0 · source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrinks the capacity of the vector with a lower bound.

\n

The capacity will remain at least as large as both the length\nand the supplied value.

\n

If the current capacity is less than the lower limit, this is a no-op.

\n
§Examples
\n
let mut vec = Vec::with_capacity(10);\nvec.extend([1, 2, 3]);\nassert!(vec.capacity() >= 10);\nvec.shrink_to(4);\nassert!(vec.capacity() >= 4);\nvec.shrink_to(0);\nassert!(vec.capacity() >= 3);
\n
1.0.0 · source

pub fn into_boxed_slice(self) -> Box<[T], A>

Converts the vector into Box<[T]>.

\n

Before doing the conversion, this method discards excess capacity like shrink_to_fit.

\n
§Examples
\n
let v = vec![1, 2, 3];\n\nlet slice = v.into_boxed_slice();
\n

Any excess capacity is removed:

\n\n
let mut vec = Vec::with_capacity(10);\nvec.extend([1, 2, 3]);\n\nassert!(vec.capacity() >= 10);\nlet slice = vec.into_boxed_slice();\nassert_eq!(slice.into_vec().capacity(), 3);
\n
1.0.0 · source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping\nthe rest.

\n

If len is greater or equal to the vector’s current length, this has\nno effect.

\n

The drain method can emulate truncate, but causes the excess\nelements to be returned instead of dropped.

\n

Note that this method has no effect on the allocated capacity\nof the vector.

\n
§Examples
\n

Truncating a five element vector to two elements:

\n\n
let mut vec = vec![1, 2, 3, 4, 5];\nvec.truncate(2);\nassert_eq!(vec, [1, 2]);
\n

No truncation occurs when len is greater than the vector’s current\nlength:

\n\n
let mut vec = vec![1, 2, 3];\nvec.truncate(8);\nassert_eq!(vec, [1, 2, 3]);
\n

Truncating when len == 0 is equivalent to calling the clear\nmethod.

\n\n
let mut vec = vec![1, 2, 3];\nvec.truncate(0);\nassert_eq!(vec, []);
\n
1.7.0 · source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

\n

Equivalent to &s[..].

\n
§Examples
\n
use std::io::{self, Write};\nlet buffer = vec![1, 2, 3, 5, 8];\nio::sink().write(buffer.as_slice()).unwrap();
\n
1.7.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Extracts a mutable slice of the entire vector.

\n

Equivalent to &mut s[..].

\n
§Examples
\n
use std::io::{self, Read};\nlet mut buffer = vec![0; 3];\nio::repeat(0b101).read_exact(buffer.as_mut_slice()).unwrap();
\n
1.37.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer\nvalid for zero sized reads if the vector didn’t allocate.

\n

The caller must ensure that the vector outlives the pointer this\nfunction returns, or else it will end up pointing to garbage.\nModifying the vector may cause its buffer to be reallocated,\nwhich would also make any pointers to it invalid.

\n

The caller must also ensure that the memory the pointer (non-transitively) points to\nis never written to (except inside an UnsafeCell) using this pointer or any pointer\nderived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

\n

This method guarantees that for the purpose of the aliasing model, this method\ndoes not materialize a reference to the underlying slice, and thus the returned pointer\nwill remain valid when mixed with other calls to as_ptr and as_mut_ptr.\nNote that calling other methods that materialize mutable references to the slice,\nor mutable references to specific elements you are planning on accessing through this pointer,\nas well as writing to those elements, may still invalidate this pointer.\nSee the second example below for how this guarantee can be used.

\n
§Examples
\n
let x = vec![1, 2, 4];\nlet x_ptr = x.as_ptr();\n\nunsafe {\n    for i in 0..x.len() {\n        assert_eq!(*x_ptr.add(i), 1 << i);\n    }\n}
\n

Due to the aliasing guarantee, the following code is legal:

\n\n
unsafe {\n    let mut v = vec![0, 1, 2];\n    let ptr1 = v.as_ptr();\n    let _ = ptr1.read();\n    let ptr2 = v.as_mut_ptr().offset(2);\n    ptr2.write(2);\n    // Notably, the write to `ptr2` did *not* invalidate `ptr1`\n    // because it mutated a different element:\n    let _ = ptr1.read();\n}
\n
1.37.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the vector’s buffer, or a dangling\nraw pointer valid for zero sized reads if the vector didn’t allocate.

\n

The caller must ensure that the vector outlives the pointer this\nfunction returns, or else it will end up pointing to garbage.\nModifying the vector may cause its buffer to be reallocated,\nwhich would also make any pointers to it invalid.

\n

This method guarantees that for the purpose of the aliasing model, this method\ndoes not materialize a reference to the underlying slice, and thus the returned pointer\nwill remain valid when mixed with other calls to as_ptr and as_mut_ptr.\nNote that calling other methods that materialize references to the slice,\nor references to specific elements you are planning on accessing through this pointer,\nmay still invalidate this pointer.\nSee the second example below for how this guarantee can be used.

\n
§Examples
\n
// Allocate vector big enough for 4 elements.\nlet size = 4;\nlet mut x: Vec<i32> = Vec::with_capacity(size);\nlet x_ptr = x.as_mut_ptr();\n\n// Initialize elements via raw pointer writes, then set length.\nunsafe {\n    for i in 0..size {\n        *x_ptr.add(i) = i as i32;\n    }\n    x.set_len(size);\n}\nassert_eq!(&*x, &[0, 1, 2, 3]);
\n

Due to the aliasing guarantee, the following code is legal:

\n\n
unsafe {\n    let mut v = vec![0];\n    let ptr1 = v.as_mut_ptr();\n    ptr1.write(1);\n    let ptr2 = v.as_mut_ptr();\n    ptr2.write(2);\n    // Notably, the write to `ptr2` did *not* invalidate `ptr1`:\n    ptr1.write(3);\n}
\n
source

pub fn allocator(&self) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

\n
1.0.0 · source

pub unsafe fn set_len(&mut self, new_len: usize)

Forces the length of the vector to new_len.

\n

This is a low-level operation that maintains none of the normal\ninvariants of the type. Normally changing the length of a vector\nis done using one of the safe operations instead, such as\ntruncate, resize, extend, or clear.

\n
§Safety
\n
    \n
  • new_len must be less than or equal to capacity().
  • \n
  • The elements at old_len..new_len must be initialized.
  • \n
\n
§Examples
\n

This method can be useful for situations in which the vector\nis serving as a buffer for other code, particularly over FFI:

\n\n
pub fn get_dictionary(&self) -> Option<Vec<u8>> {\n    // Per the FFI method's docs, \"32768 bytes is always enough\".\n    let mut dict = Vec::with_capacity(32_768);\n    let mut dict_length = 0;\n    // SAFETY: When `deflateGetDictionary` returns `Z_OK`, it holds that:\n    // 1. `dict_length` elements were initialized.\n    // 2. `dict_length` <= the capacity (32_768)\n    // which makes `set_len` safe to call.\n    unsafe {\n        // Make the FFI call...\n        let r = deflateGetDictionary(self.strm, dict.as_mut_ptr(), &mut dict_length);\n        if r == Z_OK {\n            // ...and update the length to what was initialized.\n            dict.set_len(dict_length);\n            Some(dict)\n        } else {\n            None\n        }\n    }\n}
\n

While the following example is sound, there is a memory leak since\nthe inner vectors were not freed prior to the set_len call:

\n\n
let mut vec = vec![vec![1, 0, 0],\n                   vec![0, 1, 0],\n                   vec![0, 0, 1]];\n// SAFETY:\n// 1. `old_len..0` is empty so no elements need to be initialized.\n// 2. `0 <= capacity` always holds whatever `capacity` is.\nunsafe {\n    vec.set_len(0);\n}
\n

Normally, here, one would use clear instead to correctly drop\nthe contents and thus not leak memory.

\n
1.0.0 · source

pub fn swap_remove(&mut self, index: usize) -> T

Removes an element from the vector and returns it.

\n

The removed element is replaced by the last element of the vector.

\n

This does not preserve ordering of the remaining elements, but is O(1).\nIf you need to preserve the element order, use remove instead.

\n
§Panics
\n

Panics if index is out of bounds.

\n
§Examples
\n
let mut v = vec![\"foo\", \"bar\", \"baz\", \"qux\"];\n\nassert_eq!(v.swap_remove(1), \"bar\");\nassert_eq!(v, [\"foo\", \"qux\", \"baz\"]);\n\nassert_eq!(v.swap_remove(0), \"foo\");\nassert_eq!(v, [\"baz\", \"qux\"]);
\n
1.0.0 · source

pub fn insert(&mut self, index: usize, element: T)

Inserts an element at position index within the vector, shifting all\nelements after it to the right.

\n
§Panics
\n

Panics if index > len.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nvec.insert(1, 4);\nassert_eq!(vec, [1, 4, 2, 3]);\nvec.insert(4, 5);\nassert_eq!(vec, [1, 4, 2, 3, 5]);
\n
§Time complexity
\n

Takes O(Vec::len) time. All items after the insertion index must be\nshifted to the right. In the worst case, all elements are shifted when\nthe insertion index is 0.

\n
1.0.0 · source

pub fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector,\nshifting all elements after it to the left.

\n

Note: Because this shifts over the remaining elements, it has a\nworst-case performance of O(n). If you don’t need the order of elements\nto be preserved, use swap_remove instead. If you’d like to remove\nelements from the beginning of the Vec, consider using\nVecDeque::pop_front instead.

\n
§Panics
\n

Panics if index is out of bounds.

\n
§Examples
\n
let mut v = vec![1, 2, 3];\nassert_eq!(v.remove(1), 2);\nassert_eq!(v, [1, 3]);
\n
1.0.0 · source

pub fn retain<F>(&mut self, f: F)
where\n F: FnMut(&T) -> bool,

Retains only the elements specified by the predicate.

\n

In other words, remove all elements e for which f(&e) returns false.\nThis method operates in place, visiting each element exactly once in the\noriginal order, and preserves the order of the retained elements.

\n
§Examples
\n
let mut vec = vec![1, 2, 3, 4];\nvec.retain(|&x| x % 2 == 0);\nassert_eq!(vec, [2, 4]);
\n

Because the elements are visited exactly once in the original order,\nexternal state may be used to decide which elements to keep.

\n\n
let mut vec = vec![1, 2, 3, 4, 5];\nlet keep = [false, true, true, false, true];\nlet mut iter = keep.iter();\nvec.retain(|_| *iter.next().unwrap());\nassert_eq!(vec, [2, 3, 5]);
\n
1.61.0 · source

pub fn retain_mut<F>(&mut self, f: F)
where\n F: FnMut(&mut T) -> bool,

Retains only the elements specified by the predicate, passing a mutable reference to it.

\n

In other words, remove all elements e such that f(&mut e) returns false.\nThis method operates in place, visiting each element exactly once in the\noriginal order, and preserves the order of the retained elements.

\n
§Examples
\n
let mut vec = vec![1, 2, 3, 4];\nvec.retain_mut(|x| if *x <= 3 {\n    *x += 1;\n    true\n} else {\n    false\n});\nassert_eq!(vec, [2, 3, 4]);
\n
1.16.0 · source

pub fn dedup_by_key<F, K>(&mut self, key: F)
where\n F: FnMut(&mut T) -> K,\n K: PartialEq,

Removes all but the first of consecutive elements in the vector that resolve to the same\nkey.

\n

If the vector is sorted, this removes all duplicates.

\n
§Examples
\n
let mut vec = vec![10, 20, 21, 30, 20];\n\nvec.dedup_by_key(|i| *i / 10);\n\nassert_eq!(vec, [10, 20, 30, 20]);
\n
1.16.0 · source

pub fn dedup_by<F>(&mut self, same_bucket: F)
where\n F: FnMut(&mut T, &mut T) -> bool,

Removes all but the first of consecutive elements in the vector satisfying a given equality\nrelation.

\n

The same_bucket function is passed references to two elements from the vector and\nmust determine if the elements compare equal. The elements are passed in opposite order\nfrom their order in the slice, so if same_bucket(a, b) returns true, a is removed.

\n

If the vector is sorted, this removes all duplicates.

\n
§Examples
\n
let mut vec = vec![\"foo\", \"bar\", \"Bar\", \"baz\", \"bar\"];\n\nvec.dedup_by(|a, b| a.eq_ignore_ascii_case(b));\n\nassert_eq!(vec, [\"foo\", \"bar\", \"baz\", \"bar\"]);
\n
1.0.0 · source

pub fn push(&mut self, value: T)

Appends an element to the back of a collection.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = vec![1, 2];\nvec.push(3);\nassert_eq!(vec, [1, 2, 3]);
\n
§Time complexity
\n

Takes amortized O(1) time. If the vector’s length would exceed its\ncapacity after the push, O(capacity) time is taken to copy the\nvector’s elements to a larger allocation. This expensive operation is\noffset by the capacity O(1) insertions it allows.

\n
source

pub fn push_within_capacity(&mut self, value: T) -> Result<(), T>

🔬This is a nightly-only experimental API. (vec_push_within_capacity)

Appends an element if there is sufficient spare capacity, otherwise an error is returned\nwith the element.

\n

Unlike push this method will not reallocate when there’s insufficient capacity.\nThe caller should use reserve or try_reserve to ensure that there is enough capacity.

\n
§Examples
\n

A manual, panic-free alternative to FromIterator:

\n\n
#![feature(vec_push_within_capacity)]\n\nuse std::collections::TryReserveError;\nfn from_iter_fallible<T>(iter: impl Iterator<Item=T>) -> Result<Vec<T>, TryReserveError> {\n    let mut vec = Vec::new();\n    for value in iter {\n        if let Err(value) = vec.push_within_capacity(value) {\n            vec.try_reserve(1)?;\n            // this cannot fail, the previous line either returned or added at least 1 free slot\n            let _ = vec.push_within_capacity(value);\n        }\n    }\n    Ok(vec)\n}\nassert_eq!(from_iter_fallible(0..100), Ok(Vec::from_iter(0..100)));
\n
§Time complexity
\n

Takes O(1) time.

\n
1.0.0 · source

pub fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it\nis empty.

\n

If you’d like to pop the first element, consider using\nVecDeque::pop_front instead.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nassert_eq!(vec.pop(), Some(3));\nassert_eq!(vec, [1, 2]);
\n
§Time complexity
\n

Takes O(1) time.

\n
source

pub fn pop_if<F>(&mut self, f: F) -> Option<T>
where\n F: FnOnce(&mut T) -> bool,

🔬This is a nightly-only experimental API. (vec_pop_if)

Removes and returns the last element in a vector if the predicate\nreturns true, or None if the predicate returns false or the vector\nis empty.

\n
§Examples
\n
#![feature(vec_pop_if)]\n\nlet mut vec = vec![1, 2, 3, 4];\nlet pred = |x: &mut i32| *x % 2 == 0;\n\nassert_eq!(vec.pop_if(pred), Some(4));\nassert_eq!(vec, [1, 2, 3]);\nassert_eq!(vec.pop_if(pred), None);
\n
1.4.0 · source

pub fn append(&mut self, other: &mut Vec<T, A>)

Moves all the elements of other into self, leaving other empty.

\n
§Panics
\n

Panics if the new capacity exceeds isize::MAX bytes.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nlet mut vec2 = vec![4, 5, 6];\nvec.append(&mut vec2);\nassert_eq!(vec, [1, 2, 3, 4, 5, 6]);\nassert_eq!(vec2, []);
\n
1.6.0 · source

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
where\n R: RangeBounds<usize>,

Removes the specified range from the vector in bulk, returning all\nremoved elements as an iterator. If the iterator is dropped before\nbeing fully consumed, it drops the remaining removed elements.

\n

The returned iterator keeps a mutable borrow on the vector to optimize\nits implementation.

\n
§Panics
\n

Panics if the starting point is greater than the end point or if\nthe end point is greater than the length of the vector.

\n
§Leaking
\n

If the returned iterator goes out of scope without being dropped (due to\nmem::forget, for example), the vector may have lost and leaked\nelements arbitrarily, including elements outside the range.

\n
§Examples
\n
let mut v = vec![1, 2, 3];\nlet u: Vec<_> = v.drain(1..).collect();\nassert_eq!(v, &[1]);\nassert_eq!(u, &[2, 3]);\n\n// A full range clears the vector, like `clear()` does\nv.drain(..);\nassert_eq!(v, &[]);
\n
1.0.0 · source

pub fn clear(&mut self)

Clears the vector, removing all values.

\n

Note that this method has no effect on the allocated capacity\nof the vector.

\n
§Examples
\n
let mut v = vec![1, 2, 3];\n\nv.clear();\n\nassert!(v.is_empty());
\n
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to\nas its ‘length’.

\n
§Examples
\n
let a = vec![1, 2, 3];\nassert_eq!(a.len(), 3);
\n
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

\n
§Examples
\n
let mut v = Vec::new();\nassert!(v.is_empty());\n\nv.push(1);\nassert!(!v.is_empty());
\n
1.4.0 · source

pub fn split_off(&mut self, at: usize) -> Vec<T, A>
where\n A: Clone,

Splits the collection into two at the given index.

\n

Returns a newly allocated vector containing the elements in the range\n[at, len). After the call, the original vector will be left containing\nthe elements [0, at) with its previous capacity unchanged.

\n
    \n
  • If you want to take ownership of the entire contents and capacity of\nthe vector, see mem::take or mem::replace.
  • \n
  • If you don’t need the returned vector at all, see Vec::truncate.
  • \n
  • If you want to take ownership of an arbitrary subslice, or you don’t\nnecessarily want to store the removed items in a vector, see Vec::drain.
  • \n
\n
§Panics
\n

Panics if at > len.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nlet vec2 = vec.split_off(1);\nassert_eq!(vec, [1]);\nassert_eq!(vec2, [2, 3]);
\n
1.33.0 · source

pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where\n F: FnMut() -> T,

Resizes the Vec in-place so that len is equal to new_len.

\n

If new_len is greater than len, the Vec is extended by the\ndifference, with each additional slot filled with the result of\ncalling the closure f. The return values from f will end up\nin the Vec in the order they have been generated.

\n

If new_len is less than len, the Vec is simply truncated.

\n

This method uses a closure to create new values on every push. If\nyou’d rather Clone a given value, use Vec::resize. If you\nwant to use the Default trait to generate values, you can\npass Default::default as the second argument.

\n
§Examples
\n
let mut vec = vec![1, 2, 3];\nvec.resize_with(5, Default::default);\nassert_eq!(vec, [1, 2, 3, 0, 0]);\n\nlet mut vec = vec![];\nlet mut p = 1;\nvec.resize_with(4, || { p *= 2; p });\nassert_eq!(vec, [2, 4, 8, 16]);
\n
1.47.0 · source

pub fn leak<'a>(self) -> &'a mut [T]
where\n A: 'a,

Consumes and leaks the Vec, returning a mutable reference to the contents,\n&'a mut [T]. Note that the type T must outlive the chosen lifetime\n'a. If the type has only static references, or none at all, then this\nmay be chosen to be 'static.

\n

As of Rust 1.57, this method does not reallocate or shrink the Vec,\nso the leaked allocation may include unused capacity that is not part\nof the returned slice.

\n

This function is mainly useful for data that lives for the remainder of\nthe program’s life. Dropping the returned reference will cause a memory\nleak.

\n
§Examples
\n

Simple usage:

\n\n
let x = vec![1, 2, 3];\nlet static_ref: &'static mut [usize] = x.leak();\nstatic_ref[0] += 1;\nassert_eq!(static_ref, &[2, 2, 3]);
\n
1.60.0 · source

pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>]

Returns the remaining spare capacity of the vector as a slice of\nMaybeUninit<T>.

\n

The returned slice can be used to fill the vector with data (e.g. by\nreading from a file) before marking the data as initialized using the\nset_len method.

\n
§Examples
\n
// Allocate vector big enough for 10 elements.\nlet mut v = Vec::with_capacity(10);\n\n// Fill in the first 3 elements.\nlet uninit = v.spare_capacity_mut();\nuninit[0].write(0);\nuninit[1].write(1);\nuninit[2].write(2);\n\n// Mark the first 3 elements of the vector as being initialized.\nunsafe {\n    v.set_len(3);\n}\n\nassert_eq!(&v, &[0, 1, 2]);
\n
source

pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>])

🔬This is a nightly-only experimental API. (vec_split_at_spare)

Returns vector content as a slice of T, along with the remaining spare\ncapacity of the vector as a slice of MaybeUninit<T>.

\n

The returned spare capacity slice can be used to fill the vector with data\n(e.g. by reading from a file) before marking the data as initialized using\nthe set_len method.

\n

Note that this is a low-level API, which should be used with care for\noptimization purposes. If you need to append data to a Vec\nyou can use push, extend, extend_from_slice,\nextend_from_within, insert, append, resize or\nresize_with, depending on your exact needs.

\n
§Examples
\n
#![feature(vec_split_at_spare)]\n\nlet mut v = vec![1, 1, 2];\n\n// Reserve additional space big enough for 10 elements.\nv.reserve(10);\n\nlet (init, uninit) = v.split_at_spare_mut();\nlet sum = init.iter().copied().sum::<u32>();\n\n// Fill in the next 4 elements.\nuninit[0].write(sum);\nuninit[1].write(sum * 2);\nuninit[2].write(sum * 3);\nuninit[3].write(sum * 4);\n\n// Mark the 4 elements of the vector as being initialized.\nunsafe {\n    let len = v.len();\n    v.set_len(len + 4);\n}\n\nassert_eq!(&v, &[1, 1, 2, 4, 8, 12, 16]);
\n
",0,"oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<Z> Zeroize for Vec<Z>
where\n Z: Zeroize,

§

fn zeroize(&mut self)

“Best effort” zeroization for Vec.

\n

Ensures the entire capacity of the Vec is zeroed. Cannot ensure that\nprevious reallocations did not leave values on the heap.

\n
","Zeroize","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
source§

impl<T, A> DerefPure for Vec<T, A>
where\n A: Allocator,

","DerefPure","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
1.0.0 · source§

impl<T, A> Eq for Vec<T, A>
where\n T: Eq,\n A: Allocator,

","Eq","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"],["
§

impl<Z> ZeroizeOnDrop for Vec<Z>
where\n Z: ZeroizeOnDrop,

","ZeroizeOnDrop","oasis_runtime_sdk::crypto::multisig::SignatureSetOwned"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/core/ops/function/trait.Fn.js b/rust/type.impl/core/ops/function/trait.Fn.js new file mode 100644 index 0000000000..7b1a2e1b1e --- /dev/null +++ b/rust/type.impl/core/ops/function/trait.Fn.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/core/result/enum.Result.js b/rust/type.impl/core/result/enum.Result.js new file mode 100644 index 0000000000..387822bb78 --- /dev/null +++ b/rust/type.impl/core/result/enum.Result.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_runtime_sdk":[["
§

impl Add<Length> for Result<Length, Error>

§

type Output = Result<Length, Error>

The resulting type after applying the + operator.
§

fn add(self, other: Length) -> Result<Length, Error>

Performs the + operation. Read more
","Add","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
§

impl<'a, A, B> Arbitrary<'a> for Result<A, B>
where\n A: Arbitrary<'a>,\n B: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Result<A, B>, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
","Arbitrary<'a>","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> Clone for Result<T, E>
where\n T: Clone,\n E: Clone,

source§

fn clone(&self) -> Result<T, E>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Result<T, E>)

Performs copy-assignment from source. Read more
","Clone","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Context<T, E> for Result<T, E>
where\n E: StdError + Send + Sync + 'static,

source§

fn context<C>(self, context: C) -> Result<T, Error>
where\n C: Display + Send + Sync + 'static,

Wrap the error value with additional context.
source§

fn with_context<C, F>(self, context: F) -> Result<T, Error>
where\n C: Display + Send + Sync + 'static,\n F: FnOnce() -> C,

Wrap the error value with additional context that is evaluated lazily\nonly once an error does occur.
","Context","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> Debug for Result<T, E>
where\n T: Debug,\n E: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<'de, T, E> Deserialize<'de> for Result<T, E>
where\n T: Deserialize<'de>,\n E: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<Result<T, E>, <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
§

impl<I, O, E> Finish<I, O, E> for Result<(I, O), Err<E>>

§

fn finish(self) -> Result<(I, O), E>

converts the parser’s result to a type that is more consumable by error\nmanagement libraries. It keeps the same Ok branch, and merges Err::Error\nand Err::Failure into the Err side. Read more
","Finish","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl From<&StreamResult> for Result<MZStatus, MZError>

source§

fn from(res: &StreamResult) -> Result<MZStatus, MZError>

Converts to this type from the input type.
","From<&StreamResult>","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
§

impl From<Errors> for Result<(), Errors>

§

fn from(e: Errors) -> Result<(), Errors>

Converts to this type from the input type.
","From","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl From<StreamResult> for Result<MZStatus, MZError>

source§

fn from(res: StreamResult) -> Result<MZStatus, MZError>

Converts to this type from the input type.
","From","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>
where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Result<V, E>
where\n I: IntoIterator<Item = Result<A, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

\n

Here is an example which increments every integer in a vector,\nchecking for overflow:

\n\n
let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or(\"Overflow!\")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or(\"Underflow!\")\n).collect();\nassert_eq!(res, Err(\"Underflow!\"));
\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

\n\n
let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or(\"Underflow!\")\n}).collect();\nassert_eq!(res, Err(\"Underflow!\"));\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(_: Yeet<E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> Hash for Result<T, E>
where\n T: Hash,\n E: Hash,

source§

fn hash<__H>(&self, state: &mut __H)
where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> IntoIterator for Result<T, E>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> Ord for Result<T, E>
where\n T: Ord,\n E: Ord,

source§

fn cmp(&self, other: &Result<T, E>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> PartialEq for Result<T, E>
where\n T: PartialEq,\n E: PartialEq,

source§

fn eq(&self, other: &Result<T, E>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> PartialOrd for Result<T, E>
where\n T: PartialOrd,\n E: PartialOrd,

source§

fn partial_cmp(&self, other: &Result<T, E>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.16.0 · source§

impl<T, U, E> Product<Result<U, E>> for Result<T, E>
where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

\n
§Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

\n\n
let nums = vec![\"5\", \"10\", \"1\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec![\"5\", \"10\", \"one\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
\n
","Product>","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Residual<T> for Result<Infallible, E>

§

type TryType = Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2_residual)
The “return” type of this meta-function.
","Residual","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Result<&T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Result<&mut T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Result<Option<T>, E>

1.33.0 (const: unstable) · source

pub fn transpose(self) -> Option<Result<T, E>>

Transposes a Result of an Option into an Option of a Result.

\n

Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

\n
§Examples
\n
#[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
\n
",0,"oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Result<Result<T, E>, E>

source

pub fn flatten(self) -> Result<T, E>

🔬This is a nightly-only experimental API. (result_flattening)

Converts from Result<Result<T, E>, E> to Result<T, E>

\n
§Examples
\n
#![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok(\"hello\"));\nassert_eq!(Ok(\"hello\"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
\n

Flattening only removes one level of nesting at a time:

\n\n
#![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok(\"hello\")));\nassert_eq!(Ok(Ok(\"hello\")), x.flatten());\nassert_eq!(Ok(\"hello\"), x.flatten().flatten());
\n
",0,"oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Result<T, E>

1.0.0 (const: 1.48.0) · source

pub const fn is_ok(&self) -> bool

Returns true if the result is Ok.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_ok(), false);
\n
1.70.0 · source

pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the result is Ok and the value inside of it matches a predicate.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err(\"hey\");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_err(&self) -> bool

Returns true if the result is Err.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_err(), true);
\n
1.70.0 · source

pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

Returns true if the result is Err and the value inside of it matches a predicate.

\n
§Examples
\n
use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
\n
1.0.0 · source

pub fn ok(self) -> Option<T>

Converts from Result<T, E> to Option<T>.

\n

Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.ok(), None);
\n
1.0.0 · source

pub fn err(self) -> Option<E>

Converts from Result<T, E> to Option<E>.

\n

Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.err(), Some(\"Nothing here\"));
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Result<&T, &E>

Converts from &Result<T, E> to Result<&T, &E>.

\n

Produces a new Result, containing a reference\ninto the original, leaving the original in place.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err(\"Error\");\nassert_eq!(x.as_ref(), Err(&\"Error\"));
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

\n
§Examples
\n
fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
\n
1.0.0 · source

pub fn map<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> U,

Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

\n

This function can be used to compose the results of two functions.

\n
§Examples
\n

Print the numbers on each line of a string multiplied by two.

\n\n
let line = \"1\\n2\\n3\\n4\\n\";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!(\"{n}\"),\n        Err(..) => {}\n    }\n}
\n
1.41.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> U
where\n F: FnOnce(T) -> U,

Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let x: Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.41.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> U
where\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

\n

This function can be used to unpack a successful result\nwhile handling an error.

\n
§Examples
\n
let k = 21;\n\nlet x : Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_err<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> F,

Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

\n

This function can be used to pass through a successful result while handling\nan error.

\n
§Examples
\n
fn stringify(x: u32) -> String { format!(\"error code: {x}\") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err(\"error code: 13\".to_string()));
\n
1.76.0 · source

pub fn inspect<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&T),

Calls a function with a reference to the contained value if Ok.

\n

Returns the original result.

\n
§Examples
\n
let x: u8 = \"4\"\n    .parse::<u8>()\n    .inspect(|x| println!(\"original: {x}\"))\n    .map(|x| x.pow(3))\n    .expect(\"failed to parse number\");
\n
1.76.0 · source

pub fn inspect_err<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&E),

Calls a function with a reference to the contained value if Err.

\n

Returns the original result.

\n
§Examples
\n
use std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string(\"address.txt\")\n        .inspect_err(|e| eprintln!(\"failed to read file: {e}\"))\n}
\n
1.47.0 · source

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>
where\n T: Deref,

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

\n

Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

\n
§Examples
\n
let x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&str, &u32> = Ok(\"hello\");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
\n
1.47.0 · source

pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>
where\n T: DerefMut,

Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

\n

Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

\n
§Examples
\n
let mut s = \"HELLO\".to_string();\nlet mut x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter_mut().next(), None);
\n
1.4.0 · source

pub fn expect(self, msg: &str) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

\n
§Examples
\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.expect(\"Testing expect\"); // panics with `Testing expect: emergency failure`
\n
§Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

\n\n
let path = std::env::var(\"IMPORTANT_PATH\")\n    .expect(\"env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`\");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

\n
1.0.0 · source

pub fn unwrap(self) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message provided by the\nErr’s value.

\n
§Examples
\n

Basic usage:

\n\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.unwrap(); // panics with `emergency failure`
\n
1.16.0 · source

pub fn unwrap_or_default(self) -> T
where\n T: Default,

Returns the contained Ok value or a default

\n

Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

\n
§Examples
\n

Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

\n\n
let good_year_from_input = \"1909\";\nlet bad_year_from_input = \"190blarg\";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
\n
1.17.0 · source

pub fn expect_err(self, msg: &str) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(10);\nx.expect_err(\"Testing expect_err\"); // panics with `Testing expect_err: 10`
\n
1.0.0 · source

pub fn unwrap_err(self) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(x.unwrap_err(), \"emergency failure\");
\n
source

pub fn into_ok(self) -> T
where\n E: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Ok value, but never panics.

\n

Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

\n
§Examples
\n
\nfn only_good_news() -> Result<String, !> {\n    Ok(\"this is fine\".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!(\"{s}\");
\n
source

pub fn into_err(self) -> E
where\n T: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Err value, but never panics.

\n

Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

\n
§Examples
\n
\nfn only_bad_news() -> Result<!, String> {\n    Err(\"Oops, it failed\".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!(\"{error}\");
\n
1.0.0 · source

pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

Returns res if the result is Ok, otherwise returns the Err value of self.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<&str, &str> = Ok(\"foo\");\nassert_eq!(x.and(y), Err(\"early error\"));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"not a 2\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok(\"different result type\");\nassert_eq!(x.and(y), Ok(\"different result type\"));
\n
1.0.0 · source

pub fn and_then<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> Result<U, E>,

Calls op if the result is Ok, otherwise returns the Err value of self.

\n

This function can be used for control flow based on Result values.

\n
§Examples
\n
fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or(\"overflowed\")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err(\"overflowed\"));\nassert_eq!(Err(\"not a number\").and_then(sq_then_to_string), Err(\"not a number\"));
\n

Often used to chain fallible operations that may return Err.

\n\n
use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows \"/\" maps to \"C:\\\"\nlet root_modified_time = Path::new(\"/\").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new(\"/bad/path\").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
\n
1.0.0 · source

pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

Returns res if the result is Err, otherwise returns the Ok value of self.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
\n
1.0.0 · source

pub fn or_else<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> Result<T, F>,

Calls op if the result is Err, otherwise returns the Ok value of self.

\n

This function can be used for control flow based on result values.

\n
§Examples
\n
fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Ok value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err(\"error\");\nassert_eq!(x.unwrap_or(default), default);
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, op: F) -> T
where\n F: FnOnce(E) -> T,

Returns the contained Ok value or computes it from a closure.

\n
§Examples
\n
fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err(\"foo\").unwrap_or_else(count), 3);
\n
1.58.0 · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

\n
§Safety
\n

Calling this method on an Err is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
\n
1.58.0 · source

pub unsafe fn unwrap_err_unchecked(self) -> E

Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

\n
§Safety
\n

Calling this method on an Ok is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, \"emergency failure\");
\n
",0,"oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Serialize for Result<T, E>
where\n T: Serialize,\n E: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
§

impl Sub<Length> for Result<Length, Error>

§

type Output = Result<Length, Error>

The resulting type after applying the - operator.
§

fn sub(self, other: Length) -> Result<Length, Error>

Performs the - operation. Read more
","Sub","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.16.0 · source§

impl<T, U, E> Sum<Result<U, E>> for Result<T, E>
where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

\n
§Examples
\n

This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

\n\n
let f = |&x: &i32| if x < 0 { Err(\"Negative element found\") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err(\"Negative element found\"));
\n
","Sum>","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.61.0 · source§

impl<T, E> Termination for Result<T, E>
where\n T: Termination,\n E: Debug,

source§

fn report(self) -> ExitCode

Is called to get the representation of the value as status code.\nThis status code is returned to the operating system.
","Termination","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
source§

impl<T, E> Try for Result<T, E>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Result<Infallible, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self,\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> Copy for Result<T, E>
where\n T: Copy,\n E: Copy,

","Copy","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> Eq for Result<T, E>
where\n T: Eq,\n E: Eq,

","Eq","oasis_runtime_sdk::modules::rofl::app::prelude::Result"],["
1.0.0 · source§

impl<T, E> StructuralPartialEq for Result<T, E>

","StructuralPartialEq","oasis_runtime_sdk::modules::rofl::app::prelude::Result"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/oasis_core_runtime/common/crypto/signature/struct.Signed.js b/rust/type.impl/oasis_core_runtime/common/crypto/signature/struct.Signed.js new file mode 100644 index 0000000000..9479662837 --- /dev/null +++ b/rust/type.impl/oasis_core_runtime/common/crypto/signature/struct.Signed.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
source§

impl Clone for Signed

source§

fn clone(&self) -> Signed

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl Debug for Signed

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
","Debug","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl Decode for Signed

source§

fn try_default() -> Result<Self, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl Default for Signed

source§

fn default() -> Signed

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl Encode for Signed

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
","Encode","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl EncodeAsMap for Signed

§

fn into_cbor_value_map(self) -> Value
where\n Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where\n Self: Sized,

Encode the type into a CBOR Map, returning the map items.
","EncodeAsMap","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl Hash for Signed

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl PartialEq for Signed

source§

fn eq(&self, other: &Signed) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl Eq for Signed

","Eq","oasis_core_runtime::consensus::transaction::SignedTransaction"],["
source§

impl StructuralPartialEq for Signed

","StructuralPartialEq","oasis_core_runtime::consensus::transaction::SignedTransaction"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/oasis_core_runtime/consensus/roothash/struct.MessageEvent.js b/rust/type.impl/oasis_core_runtime/consensus/roothash/struct.MessageEvent.js new file mode 100644 index 0000000000..0f0307a9c5 --- /dev/null +++ b/rust/type.impl/oasis_core_runtime/consensus/roothash/struct.MessageEvent.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_runtime_sdk":[["
source§

impl Clone for MessageEvent

source§

fn clone(&self) -> MessageEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl Debug for MessageEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl Decode for MessageEvent

source§

fn try_default() -> Result<MessageEvent, DecodeError>

Try to decode from a missing/null/undefined value.
source§

fn try_from_cbor_value(value: Value) -> Result<MessageEvent, DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl Default for MessageEvent

source§

fn default() -> MessageEvent

Returns the “default value” for a type. Read more
","Default","oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl Encode for MessageEvent

source§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
","Encode","oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl EncodeAsMap for MessageEvent

§

fn into_cbor_value_map(self) -> Value
where\n Self: Sized,

Encode the type into a CBOR Map.
§

fn into_cbor_map(self) -> Vec<(Value, Value)>
where\n Self: Sized,

Encode the type into a CBOR Map, returning the map items.
","EncodeAsMap","oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl MessageEvent

source

pub fn is_success(&self) -> bool

Returns true if the event indicates that the message was successfully processed.

\n
",0,"oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl PartialEq for MessageEvent

source§

fn eq(&self, other: &MessageEvent) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl Eq for MessageEvent

","Eq","oasis_runtime_sdk::types::message::MessageEvent"],["
source§

impl StructuralPartialEq for MessageEvent

","StructuralPartialEq","oasis_runtime_sdk::types::message::MessageEvent"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/std/primitive.array.js b/rust/type.impl/std/primitive.array.js new file mode 100644 index 0000000000..098e2c762c --- /dev/null +++ b/rust/type.impl/std/primitive.array.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
source§

impl<T, const N: usize> [T; N]

1.55.0 · source

pub fn map<F, U>(self, f: F) -> [U; N]
where\n F: FnMut(T) -> U,

Returns an array of the same size as self, with function f applied to each element\nin order.

\n

If you don’t necessarily need a new fixed-size array, consider using\nIterator::map instead.

\n
§Note on performance and stack usage
\n

Unfortunately, usages of this method are currently not always optimized\nas well as they could be. This mainly concerns large arrays, as mapping\nover small arrays seem to be optimized just fine. Also note that in\ndebug mode (i.e. without any optimizations), this method can use a lot\nof stack space (a few times the size of the array or more).

\n

Therefore, in performance-critical code, try to avoid using this method\non large arrays or check the emitted code. Also try to avoid chained\nmaps (e.g. arr.map(...).map(...)).

\n

In many cases, you can instead use Iterator::map by calling .iter()\nor .into_iter() on your array. [T; N]::map is only necessary if you\nreally need a new array of the same size as the result. Rust’s lazy\niterators tend to get optimized very well.

\n
§Examples
\n
let x = [1, 2, 3];\nlet y = x.map(|v| v + 1);\nassert_eq!(y, [2, 3, 4]);\n\nlet x = [1, 2, 3];\nlet mut temp = 0;\nlet y = x.map(|v| { temp += 1; v * temp });\nassert_eq!(y, [1, 4, 9]);\n\nlet x = [\"Ferris\", \"Bueller's\", \"Day\", \"Off\"];\nlet y = x.map(|v| v.len());\nassert_eq!(y, [6, 9, 3, 3]);
\n
source

pub fn try_map<R>(\n self,\n f: impl FnMut(T) -> R,\n) -> <<R as Try>::Residual as Residual<[<R as Try>::Output; N]>>::TryType
where\n R: Try,\n <R as Try>::Residual: Residual<[<R as Try>::Output; N]>,

🔬This is a nightly-only experimental API. (array_try_map)

A fallible function f applied to each element on array self in order to\nreturn an array the same size as self or the first error encountered.

\n

The return type of this function depends on the return type of the closure.\nIf you return Result<T, E> from the closure, you’ll get a Result<[T; N], E>.\nIf you return Option<T> from the closure, you’ll get an Option<[T; N]>.

\n
§Examples
\n
#![feature(array_try_map)]\n\nlet a = [\"1\", \"2\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>()).unwrap().map(|v| v + 1);\nassert_eq!(b, [2, 3, 4]);\n\nlet a = [\"1\", \"2a\", \"3\"];\nlet b = a.try_map(|v| v.parse::<u32>());\nassert!(b.is_err());\n\nuse std::num::NonZero;\n\nlet z = [1, 2, 0, 3, 4];\nassert_eq!(z.try_map(NonZero::new), None);\n\nlet a = [1, 2, 3];\nlet b = a.try_map(NonZero::new);\nlet c = b.map(|x| x.map(NonZero::get));\nassert_eq!(c, Some(a));
\n
1.57.0 (const: 1.57.0) · source

pub const fn as_slice(&self) -> &[T]

Returns a slice containing the entire array. Equivalent to &s[..].

\n
1.57.0 · source

pub fn as_mut_slice(&mut self) -> &mut [T]

Returns a mutable slice containing the entire array. Equivalent to\n&mut s[..].

\n
1.77.0 · source

pub fn each_ref(&self) -> [&T; N]

Borrows each element and returns an array of references with the same\nsize as self.

\n
§Example
\n
let floats = [3.1, 2.7, -1.0];\nlet float_refs: [&f64; 3] = floats.each_ref();\nassert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
\n

This method is particularly useful if combined with other methods, like\nmap. This way, you can avoid moving the original\narray if its elements are not Copy.

\n\n
let strings = [\"Ferris\".to_string(), \"♥\".to_string(), \"Rust\".to_string()];\nlet is_ascii = strings.each_ref().map(|s| s.is_ascii());\nassert_eq!(is_ascii, [true, false, true]);\n\n// We can still access the original array: it has not been moved.\nassert_eq!(strings.len(), 3);
\n
1.77.0 · source

pub fn each_mut(&mut self) -> [&mut T; N]

Borrows each element mutably and returns an array of mutable references\nwith the same size as self.

\n
§Example
\n
\nlet mut floats = [3.1, 2.7, -1.0];\nlet float_refs: [&mut f64; 3] = floats.each_mut();\n*float_refs[0] = 0.0;\nassert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);\nassert_eq!(floats, [0.0, 2.7, -1.0]);
\n
source

pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one array reference into two at an index.

\n

The first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).

\n
§Panics
\n

Panics if M > N.

\n
§Examples
\n
#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n   let (left, right) = v.split_array_ref::<0>();\n   assert_eq!(left, &[]);\n   assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}\n\n{\n    let (left, right) = v.split_array_ref::<2>();\n    assert_eq!(left, &[1, 2]);\n    assert_eq!(right, &[3, 4, 5, 6]);\n}\n\n{\n    let (left, right) = v.split_array_ref::<6>();\n    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n    assert_eq!(right, &[]);\n}
\n
source

pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable array reference into two at an index.

\n

The first will contain all indices from [0, M) (excluding\nthe index M itself) and the second will contain all\nindices from [M, N) (excluding the index N itself).

\n
§Panics
\n

Panics if M > N.

\n
§Examples
\n
#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_array_mut::<2>();\nassert_eq!(left, &mut [1, 0][..]);\nassert_eq!(right, &mut [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n
source

pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M])

🔬This is a nightly-only experimental API. (split_array)

Divides one array reference into two at an index from the end.

\n

The first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).

\n
§Panics
\n

Panics if M > N.

\n
§Examples
\n
#![feature(split_array)]\n\nlet v = [1, 2, 3, 4, 5, 6];\n\n{\n   let (left, right) = v.rsplit_array_ref::<0>();\n   assert_eq!(left, &[1, 2, 3, 4, 5, 6]);\n   assert_eq!(right, &[]);\n}\n\n{\n    let (left, right) = v.rsplit_array_ref::<2>();\n    assert_eq!(left, &[1, 2, 3, 4]);\n    assert_eq!(right, &[5, 6]);\n}\n\n{\n    let (left, right) = v.rsplit_array_ref::<6>();\n    assert_eq!(left, &[]);\n    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);\n}
\n
source

pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable array reference into two at an index from the end.

\n

The first will contain all indices from [0, N - M) (excluding\nthe index N - M itself) and the second will contain all\nindices from [N - M, N) (excluding the index N itself).

\n
§Panics
\n

Panics if M > N.

\n
§Examples
\n
#![feature(split_array)]\n\nlet mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.rsplit_array_mut::<4>();\nassert_eq!(left, &mut [1, 0]);\nassert_eq!(right, &mut [3, 0, 5, 6][..]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n
",0,"oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<const N: usize> [u8; N]

source

pub const fn as_ascii(&self) -> Option<&[AsciiChar; N]>

🔬This is a nightly-only experimental API. (ascii_char)

Converts this array of bytes into a array of ASCII characters,\nor returns None if any of the characters is non-ASCII.

\n
§Examples
\n
#![feature(ascii_char)]\n#![feature(const_option)]\n\nconst HEX_DIGITS: [std::ascii::Char; 16] =\n    *b\"0123456789abcdef\".as_ascii().unwrap();\n\nassert_eq!(HEX_DIGITS[1].as_str(), \"1\");\nassert_eq!(HEX_DIGITS[10].as_str(), \"a\");
\n
source

pub const unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar; N]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this array of bytes into a array of ASCII characters,\nwithout checking whether they’re valid.

\n
§Safety
\n

Every byte in the array must be in 0..=127, or else this is UB.

\n
",0,"oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a, T, const N: usize> Arbitrary<'a> for [T; N]
where\n T: Arbitrary<'a>,

§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<[T; N], Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<[T; N], Error>

Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
§

fn size_hint(d: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
","Arbitrary<'a>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 0]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 0]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 0usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 0]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 1]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 1]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 1usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 1]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 10]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 10]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 10usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 10]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 1024]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 1024]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 1_024usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 1024]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 1048576]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 11]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 11]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 11usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 11]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 12]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 12]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 12usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 12]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 128]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 128]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 128usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 128]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 13]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 13]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 13usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 13]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 131072]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 14]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 14]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 14usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 14]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 15]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 15]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 15usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 15]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 1536]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 16]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 16]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 16usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 16]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 16384]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 17]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 17]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 17usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 17]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 18]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 18]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 18usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 18]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 19]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 19]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 19usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 19]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 2]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 2]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 2usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 2]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 20]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 20]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 20usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 20]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 2048]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 2048]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 2_048usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 2048]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 21]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 21]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 21usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 21]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 22]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 22]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 22usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 22]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 23]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 23]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 23usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 23]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 24]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 24]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 24usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 24]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 24576]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 25]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 25]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 25usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 25]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 256]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 256]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 256usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 256]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 26]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 26]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 26usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 26]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 262144]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 27]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 27]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 27usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 27]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 28]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 28]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 28usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 28]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 29]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 29]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 29usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 29]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 3]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 3]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 3usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 3]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 30]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 30]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 30usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 30]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 31]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 31]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 31usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 31]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 32]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 32]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 32usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 32]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 32768]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 33]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 33usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 33]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 36]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 393216]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 4]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 4]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 4usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 4]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 4096]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 4096]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 4_096usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 4096]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 5]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 5]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 5usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 5]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 512]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 512]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 512usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 512]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 524288]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 6]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 6]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 6usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 6]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 64]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 64]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 64usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 64]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 65536]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 7]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 7]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 7usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 7]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 8]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 8]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 8usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 8]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 8192]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 9]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 9]
where\n T: Default,

§

type Item = T

The type of the items in the thing.
§

const CAPACITY: usize = 9usize

The number of slots in the thing.
§

fn as_slice(&self) -> &[T]

Gives a shared slice over the whole thing. Read more
§

fn as_slice_mut(&mut self) -> &mut [T]

Gives a unique slice over the whole thing. Read more
§

fn default() -> [T; 9]

Create a default-initialized instance of ourself, similar to the\nDefault trait, but implemented for the same range of sizes as\n[Array].
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> Array for [T; 96]

§

type Item = T

The type of the array’s elements.
§

fn size() -> usize

Returns the number of items the array can hold.
","Array","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<const N: usize, T> AsBytes for [T; N]
where\n T: AsBytes,

§

fn as_bytes(&self) -> &[u8]

Gets the bytes of this value. Read more
§

fn write_to(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to bytes. Read more
§

fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to the prefix of bytes. Read more
§

fn write_to_suffix(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to the suffix of bytes. Read more
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 0]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 1]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 10]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 11]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 12]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 13]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 14]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 15]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 16]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 17]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 18]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 19]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 2]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 20]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 21]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 22]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 23]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 24]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 25]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 26]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 27]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 28]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 29]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 3]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 30]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 31]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 32]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 4]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 5]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 6]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 7]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 8]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl AsBytes for [u8; 9]

§

fn as_bytes(&self) -> &[u8]

Casts the input type to a byte slice
","AsBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, const N: usize> AsMut<[T]> for [T; N]

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut<[T]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, const N: usize> AsRef<[T]> for [T; N]

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[T]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T, const N: usize> Borrow<[T]> for [T; N]

source§

fn borrow(&self) -> &[T]

Immutably borrows from an owned value. Read more
","Borrow<[T]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T, const N: usize> BorrowMut<[T]> for [T; N]

source§

fn borrow_mut(&mut self) -> &mut [T]

Mutably borrows from an owned value. Read more
","BorrowMut<[T]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.58.0 · source§

impl<T, const N: usize> Clone for [T; N]
where\n T: Clone,

source§

fn clone(&self) -> [T; N]

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, other: &[T; N])

Performs copy-assignment from source. Read more
","Clone","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, const N: usize> Debug for [T; N]
where\n T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T, const N: usize> Decode for [T; N]
where\n T: Decode,

§

default fn try_default() -> Result<[T; N], DecodeError>

Try to decode from a missing/null/undefined value.
§

default fn try_from_cbor_value(value: Value) -> Result<[T; N], DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<const N: usize> Decode for [u8; N]

§

fn try_default() -> Result<[u8; N], DecodeError>

Try to decode from a missing/null/undefined value.
§

fn try_from_cbor_value(value: Value) -> Result<[u8; N], DecodeError>

Try to decode from a given CBOR value.
§

fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>
where\n Self: Sized,

Try to decode from a given CBOR value, calling try_default in case the value is null or\nundefined.
","Decode","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a, T, const N: usize> DecodeValue<'a> for [T; N]
where\n T: Decode<'a>,

§

fn decode_value<R>(reader: &mut R, header: Header) -> Result<[T; N], Error>
where\n R: Reader<'a>,

Attempt to decode this message using the provided [Reader].
","DecodeValue<'a>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 32]
where\n T: Default,

source§

fn default() -> [T; 32]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 31]
where\n T: Default,

source§

fn default() -> [T; 31]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 30]
where\n T: Default,

source§

fn default() -> [T; 30]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 29]
where\n T: Default,

source§

fn default() -> [T; 29]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 28]
where\n T: Default,

source§

fn default() -> [T; 28]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 27]
where\n T: Default,

source§

fn default() -> [T; 27]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 26]
where\n T: Default,

source§

fn default() -> [T; 26]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 25]
where\n T: Default,

source§

fn default() -> [T; 25]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 24]
where\n T: Default,

source§

fn default() -> [T; 24]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 23]
where\n T: Default,

source§

fn default() -> [T; 23]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 22]
where\n T: Default,

source§

fn default() -> [T; 22]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 21]
where\n T: Default,

source§

fn default() -> [T; 21]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 20]
where\n T: Default,

source§

fn default() -> [T; 20]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 19]
where\n T: Default,

source§

fn default() -> [T; 19]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 18]
where\n T: Default,

source§

fn default() -> [T; 18]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 17]
where\n T: Default,

source§

fn default() -> [T; 17]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 16]
where\n T: Default,

source§

fn default() -> [T; 16]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 15]
where\n T: Default,

source§

fn default() -> [T; 15]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 14]
where\n T: Default,

source§

fn default() -> [T; 14]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 13]
where\n T: Default,

source§

fn default() -> [T; 13]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 12]
where\n T: Default,

source§

fn default() -> [T; 12]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 11]
where\n T: Default,

source§

fn default() -> [T; 11]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 10]
where\n T: Default,

source§

fn default() -> [T; 10]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 9]
where\n T: Default,

source§

fn default() -> [T; 9]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 8]
where\n T: Default,

source§

fn default() -> [T; 8]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 7]
where\n T: Default,

source§

fn default() -> [T; 7]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 6]
where\n T: Default,

source§

fn default() -> [T; 6]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 5]
where\n T: Default,

source§

fn default() -> [T; 5]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 4]
where\n T: Default,

source§

fn default() -> [T; 4]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 3]
where\n T: Default,

source§

fn default() -> [T; 3]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 2]
where\n T: Default,

source§

fn default() -> [T; 2]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 1]
where\n T: Default,

source§

fn default() -> [T; 1]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.4.0 · source§

impl<T> Default for [T; 0]

source§

fn default() -> [T; 0]

Returns the “default value” for a type. Read more
","Default","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 0]

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 0], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 1]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 1], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 10]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 10], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 11]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 11], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 12]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 12], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 13]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 13], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 14]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 14], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 15]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 15], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 16]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 16], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 17]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 17], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 18]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 18], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 19]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 19], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 2]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 2], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 20]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 20], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 21]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 21], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 22]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 22], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 23]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 23], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 24]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 24], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 25]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 25], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 26]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 26], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 27]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 27], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 28]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 28], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 29]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 29], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 3]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 3], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 30]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 30], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 31]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 31], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 32]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 32], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 4]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 4], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 5]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 5], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 6]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 6], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 7]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 7], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 8]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 8], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<'de, T> Deserialize<'de> for [T; 9]
where\n T: Deserialize<'de>,

source§

fn deserialize<D>(\n deserializer: D,\n) -> Result<[T; 9], <D as Deserializer<'de>>::Error>
where\n D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
","Deserialize<'de>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T, const N: usize> Encode for [T; N]
where\n T: Encode,

§

default fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
","Encode","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<const N: usize> Encode for [u8; N]

§

fn into_cbor_value(self) -> Value

Encode the type into a CBOR Value.
§

fn is_empty(&self) -> bool

Whether the value is equal to the empty value for the type.
","Encode","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T, const N: usize> EncodeValue for [T; N]
where\n T: Encode,

§

fn value_len(&self) -> Result<Length, Error>

Compute the length of this value (sans [Tag]+[Length] header) when\nencoded as ASN.1 DER.
§

fn encode_value(&self, writer: &mut impl Writer) -> Result<(), Error>

Encode value (sans [Tag]+[Length] header) as ASN.1 DER using the\nprovided [Writer].
§

fn header(&self) -> Result<Header, Error>
where\n Self: Tagged,

Get the [Header] used to encode this value.
","EncodeValue","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 32]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 4096]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 31]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 30]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 29]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 28]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 27]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 26]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 25]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 24]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 23]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 22]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 21]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 20]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 19]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 18]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 17]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 16]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 15]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 14]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 13]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 12]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 11]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 10]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 9]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 8]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 7]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 6]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 5]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 4]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 3]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 2]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 1]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 0]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 2048]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 1024]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 512]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 256]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 128]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Fill for [T; 64]
where\n [T]: Fill,

source§

fn try_fill<R>(&mut self, rng: &mut R) -> Result<(), Error>
where\n R: Rng + ?Sized,

Fill self with random data
","Fill","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 0]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 1]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 10]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 11]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 12]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 13]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 14]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 15]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 16]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 17]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 18]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 19]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 2]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 20]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 21]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 22]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 23]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 24]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 25]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 26]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 27]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 28]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 29]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 3]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 30]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 31]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 32]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 4]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 5]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 6]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 7]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 8]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<'a> FindToken<&'a u8> for [u8; 9]

§

fn find_token(&self, token: &u8) -> bool

Returns true if self contains the token
","FindToken<&'a u8>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 0]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 1]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 10]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 11]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 12]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 13]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 14]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 15]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 16]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 17]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 18]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 19]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 2]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 20]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 21]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 22]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 23]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 24]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 25]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 26]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 27]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 28]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 29]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 3]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 30]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 31]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 32]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 4]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 5]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 6]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 7]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 8]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl FindToken<u8> for [u8; 9]

§

fn find_token(&self, token: u8) -> bool

Returns true if self contains the token
","FindToken","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T, const N: usize> FixedTag for [T; N]

§

const TAG: Tag = Tag::Sequence

ASN.1 tag
","FixedTag","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl From<&Signature> for [u8; 64]

§

fn from(sig: &Signature) -> [u8; 64]

Converts to this type from the input type.
","From<&Signature>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T,)> for [T; 1]

source§

fn from(tuple: (T,)) -> [T; 1]

Converts to this type from the input type.
","From<(T,)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T)> for [T; 2]

source§

fn from(tuple: (T, T)) -> [T; 2]

Converts to this type from the input type.
","From<(T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T)> for [T; 3]

source§

fn from(tuple: (T, T, T)) -> [T; 3]

Converts to this type from the input type.
","From<(T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T)> for [T; 4]

source§

fn from(tuple: (T, T, T, T)) -> [T; 4]

Converts to this type from the input type.
","From<(T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T, T)> for [T; 5]

source§

fn from(tuple: (T, T, T, T, T)) -> [T; 5]

Converts to this type from the input type.
","From<(T, T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T, T, T)> for [T; 6]

source§

fn from(tuple: (T, T, T, T, T, T)) -> [T; 6]

Converts to this type from the input type.
","From<(T, T, T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T, T, T, T)> for [T; 7]

source§

fn from(tuple: (T, T, T, T, T, T, T)) -> [T; 7]

Converts to this type from the input type.
","From<(T, T, T, T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T, T, T, T, T)> for [T; 8]

source§

fn from(tuple: (T, T, T, T, T, T, T, T)) -> [T; 8]

Converts to this type from the input type.
","From<(T, T, T, T, T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T, T, T, T, T, T)> for [T; 9]

source§

fn from(tuple: (T, T, T, T, T, T, T, T, T)) -> [T; 9]

Converts to this type from the input type.
","From<(T, T, T, T, T, T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T, T, T, T, T, T, T)> for [T; 10]

source§

fn from(tuple: (T, T, T, T, T, T, T, T, T, T)) -> [T; 10]

Converts to this type from the input type.
","From<(T, T, T, T, T, T, T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T, T, T, T, T, T, T, T)> for [T; 11]

source§

fn from(tuple: (T, T, T, T, T, T, T, T, T, T, T)) -> [T; 11]

Converts to this type from the input type.
","From<(T, T, T, T, T, T, T, T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.71.0 · source§

impl<T> From<(T, T, T, T, T, T, T, T, T, T, T, T)> for [T; 12]

source§

fn from(tuple: (T, T, T, T, T, T, T, T, T, T, T, T)) -> [T; 12]

Converts to this type from the input type.
","From<(T, T, T, T, T, T, T, T, T, T, T, T)>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<Address> for [u8; 21]

source§

fn from(val: Address) -> Self

Converts to this type from the input type.
","From
","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<F32<O>> for [u8; 4]
where\n O: ByteOrder,

§

fn from(x: F32<O>) -> [u8; 4]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<F64<O>> for [u8; 8]
where\n O: ByteOrder,

§

fn from(x: F64<O>) -> [u8; 8]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>> for [T; 1024]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,\n) -> [T; 1024]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>> for [T; 512]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,\n) -> [T; 512]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>, B1>, B0>, B0>, B0>>> for [T; 1000]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>, B1>, B0>, B0>, B0>>,\n) -> [T; 1000]

Converts to this type from the input type.
","From, B1>, B1>, B1>, B1>, B0>, B1>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>> for [T; 256]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,\n) -> [T; 256]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B1>, B1>, B0>, B0>>> for [T; 300]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B1>, B1>, B0>, B0>>,\n) -> [T; 300]

Converts to this type from the input type.
","From, B0>, B0>, B1>, B0>, B1>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>, B0>, B0>>> for [T; 400]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>, B0>, B0>>,\n) -> [T; 400]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B1>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>, B1>, B0>, B0>>> for [T; 500]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>, B1>, B0>, B0>>,\n) -> [T; 500]

Converts to this type from the input type.
","From, B1>, B1>, B1>, B1>, B0>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>> for [T; 128]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,\n) -> [T; 128]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>, B0>>> for [T; 200]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>, B0>>,\n) -> [T; 200]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B1>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>> for [T; 64]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>,\n) -> [T; 64]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B1>, B0>>> for [T; 70]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B1>, B0>>,\n) -> [T; 70]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B1>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B0>, B0>>> for [T; 80]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B0>, B0>>,\n) -> [T; 80]

Converts to this type from the input type.
","From, B0>, B1>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B1>, B0>>> for [T; 90]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B1>, B0>>,\n) -> [T; 90]

Converts to this type from the input type.
","From, B0>, B1>, B1>, B0>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>>> for [T; 100]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>, B0>>,\n) -> [T; 100]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>,\n) -> [T; 32]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>>> for [T; 33]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B1>>,\n) -> [T; 33]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B0>>> for [T; 34]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B0>>,\n) -> [T; 34]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B1>>> for [T; 35]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>, B1>>,\n) -> [T; 35]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B0>>> for [T; 36]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B0>>,\n) -> [T; 36]

Converts to this type from the input type.
","From, B0>, B0>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B1>>> for [T; 37]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>, B1>>,\n) -> [T; 37]

Converts to this type from the input type.
","From, B0>, B0>, B1>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>, B0>>> for [T; 38]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>, B0>>,\n) -> [T; 38]

Converts to this type from the input type.
","From, B0>, B0>, B1>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>, B1>>> for [T; 39]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>, B1>>,\n) -> [T; 39]

Converts to this type from the input type.
","From, B0>, B0>, B1>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B0>>> for [T; 40]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B0>>,\n) -> [T; 40]

Converts to this type from the input type.
","From, B0>, B1>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B1>>> for [T; 41]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>, B1>>,\n) -> [T; 41]

Converts to this type from the input type.
","From, B0>, B1>, B0>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>, B0>>> for [T; 42]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>, B0>>,\n) -> [T; 42]

Converts to this type from the input type.
","From, B0>, B1>, B0>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>, B1>>> for [T; 43]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>, B1>>,\n) -> [T; 43]

Converts to this type from the input type.
","From, B0>, B1>, B0>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B0>>> for [T; 44]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B0>>,\n) -> [T; 44]

Converts to this type from the input type.
","From, B0>, B1>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B1>>> for [T; 45]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>, B1>>,\n) -> [T; 45]

Converts to this type from the input type.
","From, B0>, B1>, B1>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>, B0>>> for [T; 46]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>, B0>>,\n) -> [T; 46]

Converts to this type from the input type.
","From, B0>, B1>, B1>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>, B1>>> for [T; 47]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>, B1>>,\n) -> [T; 47]

Converts to this type from the input type.
","From, B0>, B1>, B1>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>> for [T; 48]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>>,\n) -> [T; 48]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B1>>> for [T; 49]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B1>>,\n) -> [T; 49]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>>> for [T; 50]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B0>>,\n) -> [T; 50]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B1>>> for [T; 51]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>, B1>>,\n) -> [T; 51]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>, B0>>> for [T; 52]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>, B0>>,\n) -> [T; 52]

Converts to this type from the input type.
","From, B1>, B0>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>, B1>>> for [T; 53]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>, B1>>,\n) -> [T; 53]

Converts to this type from the input type.
","From, B1>, B0>, B1>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>, B0>>> for [T; 54]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>, B0>>,\n) -> [T; 54]

Converts to this type from the input type.
","From, B1>, B0>, B1>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>, B1>>> for [T; 55]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>, B1>>,\n) -> [T; 55]

Converts to this type from the input type.
","From, B1>, B0>, B1>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>>> for [T; 56]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B0>>,\n) -> [T; 56]

Converts to this type from the input type.
","From, B1>, B1>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B1>>> for [T; 57]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>, B1>>,\n) -> [T; 57]

Converts to this type from the input type.
","From, B1>, B1>, B0>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>, B0>>> for [T; 58]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>, B0>>,\n) -> [T; 58]

Converts to this type from the input type.
","From, B1>, B1>, B0>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>, B1>>> for [T; 59]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>, B1>>,\n) -> [T; 59]

Converts to this type from the input type.
","From, B1>, B1>, B0>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B0>>> for [T; 60]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B0>>,\n) -> [T; 60]

Converts to this type from the input type.
","From, B1>, B1>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B1>>> for [T; 61]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>, B1>>,\n) -> [T; 61]

Converts to this type from the input type.
","From, B1>, B1>, B1>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>>> for [T; 62]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B0>>,\n) -> [T; 62]

Converts to this type from the input type.
","From, B1>, B1>, B1>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>>> for [T; 63]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>, B1>>,\n) -> [T; 63]

Converts to this type from the input type.
","From, B1>, B1>, B1>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>> for [T; 16]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>,\n) -> [T; 16]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>>> for [T; 17]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>>,\n) -> [T; 17]

Converts to this type from the input type.
","From, B0>, B0>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>>> for [T; 18]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>>,\n) -> [T; 18]

Converts to this type from the input type.
","From, B0>, B0>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>>> for [T; 19]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>>,\n) -> [T; 19]

Converts to this type from the input type.
","From, B0>, B0>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>>> for [T; 20]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>>,\n) -> [T; 20]

Converts to this type from the input type.
","From, B0>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>>> for [T; 21]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>>,\n) -> [T; 21]

Converts to this type from the input type.
","From, B0>, B1>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>>> for [T; 22]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>>,\n) -> [T; 22]

Converts to this type from the input type.
","From, B0>, B1>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>>> for [T; 23]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>>,\n) -> [T; 23]

Converts to this type from the input type.
","From, B0>, B1>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for [T; 24]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>,\n) -> [T; 24]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>>> for [T; 25]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>>,\n) -> [T; 25]

Converts to this type from the input type.
","From, B1>, B0>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>>> for [T; 26]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>>,\n) -> [T; 26]

Converts to this type from the input type.
","From, B1>, B0>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>>> for [T; 27]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>>,\n) -> [T; 27]

Converts to this type from the input type.
","From, B1>, B0>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>>> for [T; 28]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>>,\n) -> [T; 28]

Converts to this type from the input type.
","From, B1>, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>>> for [T; 29]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>>,\n) -> [T; 29]

Converts to this type from the input type.
","From, B1>, B1>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>>> for [T; 30]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>>,\n) -> [T; 30]

Converts to this type from the input type.
","From, B1>, B1>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>>> for [T; 31]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>>,\n) -> [T; 31]

Converts to this type from the input type.
","From, B1>, B1>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>> for [T; 8]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>>,\n) -> [T; 8]

Converts to this type from the input type.
","From, B0>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>> for [T; 9]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>>,\n) -> [T; 9]

Converts to this type from the input type.
","From, B0>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>> for [T; 10]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>,\n) -> [T; 10]

Converts to this type from the input type.
","From, B0>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>>> for [T; 11]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>>,\n) -> [T; 11]

Converts to this type from the input type.
","From, B0>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>> for [T; 12]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>,\n) -> [T; 12]

Converts to this type from the input type.
","From, B1>, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>>> for [T; 13]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>>,\n) -> [T; 13]

Converts to this type from the input type.
","From, B1>, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>>> for [T; 14]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>>,\n) -> [T; 14]

Converts to this type from the input type.
","From, B1>, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>>> for [T; 15]

§

fn from(\n sel: GenericArray<T, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>>,\n) -> [T; 15]

Converts to this type from the input type.
","From, B1>, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B0>, B0>>> for [T; 4]

§

fn from(sel: GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B0>, B0>>) -> [T; 4]

Converts to this type from the input type.
","From, B0>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B0>, B1>>> for [T; 5]

§

fn from(sel: GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B0>, B1>>) -> [T; 5]

Converts to this type from the input type.
","From, B0>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B1>, B0>>> for [T; 6]

§

fn from(sel: GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B1>, B0>>) -> [T; 6]

Converts to this type from the input type.
","From, B1>, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B1>, B1>>> for [T; 7]

§

fn from(sel: GenericArray<T, UInt<UInt<UInt<UTerm, B1>, B1>, B1>>) -> [T; 7]

Converts to this type from the input type.
","From, B1>, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UTerm, B1>, B0>>> for [T; 2]

§

fn from(sel: GenericArray<T, UInt<UInt<UTerm, B1>, B0>>) -> [T; 2]

Converts to this type from the input type.
","From, B0>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UInt<UTerm, B1>, B1>>> for [T; 3]

§

fn from(sel: GenericArray<T, UInt<UInt<UTerm, B1>, B1>>) -> [T; 3]

Converts to this type from the input type.
","From, B1>>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T> From<GenericArray<T, UInt<UTerm, B1>>> for [T; 1]

§

fn from(sel: GenericArray<T, UInt<UTerm, B1>>) -> [T; 1]

Converts to this type from the input type.
","From>>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<Hash> for [u8; 32]

source§

fn from(b: Hash) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<I128<O>> for [u8; 16]
where\n O: ByteOrder,

§

fn from(x: I128<O>) -> [u8; 16]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<I16<O>> for [u8; 2]
where\n O: ByteOrder,

§

fn from(x: I16<O>) -> [u8; 2]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<I32<O>> for [u8; 4]
where\n O: ByteOrder,

§

fn from(x: I32<O>) -> [u8; 4]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<I64<O>> for [u8; 8]
where\n O: ByteOrder,

§

fn from(x: I64<O>) -> [u8; 8]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<MrEnclave> for [u8; 32]

source§

fn from(b: MrEnclave) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<MrSigner> for [u8; 32]

source§

fn from(b: MrSigner) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<Namespace> for [u8; 32]

source§

fn from(b: Namespace) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<PublicKey> for [u8; 32]

source§

fn from(b: PublicKey) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<SessionID> for [u8; 32]

source§

fn from(b: SessionID) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<Signature> for [u8; 64]

source§

fn from(sig: Signature) -> [u8; 64]

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<Signature> for [u8; 64]

source§

fn from(b: Signature) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl From<Signature> for [u8; 64]

§

fn from(sig: Signature) -> [u8; 64]

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<SigningKey> for [u8; 32]

source§

fn from(sk: SigningKey) -> [u8; 32]

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T, const N: usize> From<Simd<T, N>> for [T; N]

source§

fn from(vector: Simd<T, N>) -> [T; N]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<U128<O>> for [u8; 16]
where\n O: ByteOrder,

§

fn from(x: U128<O>) -> [u8; 16]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<U16<O>> for [u8; 2]
where\n O: ByteOrder,

§

fn from(x: U16<O>) -> [u8; 2]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<U32<O>> for [u8; 4]
where\n O: ByteOrder,

§

fn from(x: U32<O>) -> [u8; 4]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> From<U64<O>> for [u8; 8]
where\n O: ByteOrder,

§

fn from(x: U64<O>) -> [u8; 8]

Converts to this type from the input type.
","From>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<VerificationKey> for [u8; 32]

source§

fn from(vk: VerificationKey) -> [u8; 32]

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl From<VerificationKeyBytes> for [u8; 32]

source§

fn from(refined: VerificationKeyBytes) -> [u8; 32]

Converts to this type from the input type.
","From","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<const N: usize, T> FromBytes for [T; N]
where\n T: FromBytes,

§

fn ref_from(bytes: &[u8]) -> Option<&Self>
where\n Self: Sized,

Interprets the given bytes as a &Self without copying. Read more
§

fn ref_from_prefix(bytes: &[u8]) -> Option<&Self>
where\n Self: Sized,

Interprets the prefix of the given bytes as a &Self without copying. Read more
§

fn ref_from_suffix(bytes: &[u8]) -> Option<&Self>
where\n Self: Sized,

Interprets the suffix of the given bytes as a &Self without copying. Read more
§

fn slice_from(bytes: &[u8]) -> Option<&[Self]>
where\n Self: Sized,

Interprets the given bytes as a &[Self] without copying. Read more
§

fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>
where\n Self: Sized,

Interprets the prefix of the given bytes as a &[Self] with length\nequal to count without copying. Read more
§

fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>
where\n Self: Sized,

Interprets the suffix of the given bytes as a &[Self] with length\nequal to count without copying. Read more
§

fn read_from(bytes: &[u8]) -> Option<Self>
where\n Self: Sized,

Reads a copy of Self from bytes. Read more
§

fn read_from_prefix(bytes: &[u8]) -> Option<Self>
where\n Self: Sized,

Reads a copy of Self from the prefix of bytes. Read more
§

fn read_from_suffix(bytes: &[u8]) -> Option<Self>
where\n Self: Sized,

Reads a copy of Self from the suffix of bytes. Read more
","FromBytes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 1]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 1], <[u8; 1] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 10]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 10], <[u8; 10] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 100]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 100], <[u8; 100] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 101]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 101], <[u8; 101] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 102]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 102], <[u8; 102] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 1024]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 1024], <[u8; 1024] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 103]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 103], <[u8; 103] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 104]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 104], <[u8; 104] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 1048576]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 1048576], <[u8; 1048576] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 105]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 105], <[u8; 105] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 106]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 106], <[u8; 106] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 107]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 107], <[u8; 107] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 1073741824]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 1073741824], <[u8; 1073741824] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 108]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 108], <[u8; 108] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 109]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 109], <[u8; 109] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 11]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 11], <[u8; 11] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 110]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 110], <[u8; 110] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 111]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 111], <[u8; 111] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 112]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 112], <[u8; 112] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 113]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 113], <[u8; 113] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 114]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 114], <[u8; 114] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 115]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 115], <[u8; 115] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 116]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 116], <[u8; 116] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 117]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 117], <[u8; 117] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 118]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 118], <[u8; 118] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 119]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 119], <[u8; 119] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 12]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 12], <[u8; 12] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 120]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 120], <[u8; 120] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 121]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 121], <[u8; 121] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 122]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 122], <[u8; 122] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 123]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 123], <[u8; 123] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 124]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 124], <[u8; 124] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 125]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 125], <[u8; 125] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 126]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 126], <[u8; 126] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 127]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 127], <[u8; 127] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 128]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 128], <[u8; 128] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 13]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 13], <[u8; 13] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 131072]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 131072], <[u8; 131072] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 134217728]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 134217728], <[u8; 134217728] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 14]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 14], <[u8; 14] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 15]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 15], <[u8; 15] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 16]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 16], <[u8; 16] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 160]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 160], <[u8; 160] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 16384]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 16384], <[u8; 16384] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 16777216]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 16777216], <[u8; 16777216] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 17]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 17], <[u8; 17] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 18]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 18], <[u8; 18] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 19]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 19], <[u8; 19] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 192]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 192], <[u8; 192] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 2]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 2], <[u8; 2] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 20]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 20], <[u8; 20] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 200]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 200], <[u8; 200] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 2048]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 2048], <[u8; 2048] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 2097152]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 2097152], <[u8; 2097152] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 21]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 21], <[u8; 21] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 2147483648]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 2147483648], <[u8; 2147483648] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 22]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 22], <[u8; 22] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 224]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 224], <[u8; 224] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 23]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 23], <[u8; 23] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 24]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 24], <[u8; 24] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 25]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 25], <[u8; 25] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 256]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 256], <[u8; 256] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 26]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 26], <[u8; 26] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 262144]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 262144], <[u8; 262144] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 268435456]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 268435456], <[u8; 268435456] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 27]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 27], <[u8; 27] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 28]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 28], <[u8; 28] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 29]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 29], <[u8; 29] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 3]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 3], <[u8; 3] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 30]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 30], <[u8; 30] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 31]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 31], <[u8; 31] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 32]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 32], <[u8; 32] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 32768]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 32768], <[u8; 32768] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 33]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 33], <[u8; 33] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 33554432]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 33554432], <[u8; 33554432] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 34]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 34], <[u8; 34] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 35]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 35], <[u8; 35] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 36]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 36], <[u8; 36] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 37]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 37], <[u8; 37] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 38]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 38], <[u8; 38] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 384]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 384], <[u8; 384] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 39]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 39], <[u8; 39] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 4]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 4], <[u8; 4] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 40]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 40], <[u8; 40] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 4096]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 4096], <[u8; 4096] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 41]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 41], <[u8; 41] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 4194304]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 4194304], <[u8; 4194304] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 42]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 42], <[u8; 42] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 4294967296]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 4294967296], <[u8; 4294967296] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 43]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 43], <[u8; 43] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 44]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 44], <[u8; 44] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 45]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 45], <[u8; 45] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 46]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 46], <[u8; 46] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 47]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 47], <[u8; 47] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 48]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 48], <[u8; 48] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 49]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 49], <[u8; 49] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 5]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 5], <[u8; 5] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 50]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 50], <[u8; 50] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 51]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 51], <[u8; 51] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 512]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 512], <[u8; 512] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 52]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 52], <[u8; 52] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 524288]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 524288], <[u8; 524288] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 53]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 53], <[u8; 53] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 536870912]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 536870912], <[u8; 536870912] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 54]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 54], <[u8; 54] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 55]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 55], <[u8; 55] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 56]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 56], <[u8; 56] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 57]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 57], <[u8; 57] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 58]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 58], <[u8; 58] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 59]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 59], <[u8; 59] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 6]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 6], <[u8; 6] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 60]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 60], <[u8; 60] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 61]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 61], <[u8; 61] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 62]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 62], <[u8; 62] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 63]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 63], <[u8; 63] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 64]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 64], <[u8; 64] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 65]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 65], <[u8; 65] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 65536]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 65536], <[u8; 65536] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 66]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 66], <[u8; 66] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 67]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 67], <[u8; 67] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 67108864]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 67108864], <[u8; 67108864] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 68]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 68], <[u8; 68] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 69]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 69], <[u8; 69] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 7]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 7], <[u8; 7] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 70]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 70], <[u8; 70] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 71]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 71], <[u8; 71] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 72]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 72], <[u8; 72] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 73]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 73], <[u8; 73] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 74]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 74], <[u8; 74] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 75]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 75], <[u8; 75] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 76]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 76], <[u8; 76] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 768]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 768], <[u8; 768] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 77]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 77], <[u8; 77] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 78]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 78], <[u8; 78] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 79]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 79], <[u8; 79] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 8]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 8], <[u8; 8] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 80]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 80], <[u8; 80] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 81]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 81], <[u8; 81] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 8192]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 8192], <[u8; 8192] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 82]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 82], <[u8; 82] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 83]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 83], <[u8; 83] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 8388608]

§

type Error = FromHexError

source§

fn from_hex<T>(\n hex: T,\n) -> Result<[u8; 8388608], <[u8; 8388608] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 84]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 84], <[u8; 84] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 85]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 85], <[u8; 85] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 86]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 86], <[u8; 86] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 87]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 87], <[u8; 87] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 88]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 88], <[u8; 88] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 89]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 89], <[u8; 89] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 9]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 9], <[u8; 9] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 90]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 90], <[u8; 90] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 91]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 91], <[u8; 91] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 92]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 92], <[u8; 92] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 93]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 93], <[u8; 93] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 94]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 94], <[u8; 94] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 95]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 95], <[u8; 95] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 96]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 96], <[u8; 96] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 97]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 97], <[u8; 97] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 98]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 98], <[u8; 98] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl FromHex for [u8; 99]

§

type Error = FromHexError

source§

fn from_hex<T>(hex: T) -> Result<[u8; 99], <[u8; 99] as FromHex>::Error>
where\n T: AsRef<[u8]>,

Creates an instance of type Self from the given hex string, or fails\nwith a custom error type. Read more
","FromHex","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<const N: usize, T> FromZeroes for [T; N]
where\n T: FromZeroes,

§

fn zero(&mut self)

Overwrites self with zeroes. Read more
§

fn new_zeroed() -> Self
where\n Self: Sized,

Creates an instance of Self from zeroed bytes. Read more
","FromZeroes","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, const N: usize> Hash for [T; N]
where\n T: Hash,

The hash of an array is the same as that of the corresponding slice,\nas required by the Borrow implementation.

\n\n
use std::hash::BuildHasher;\n\nlet b = std::hash::RandomState::new();\nlet a: [u8; 3] = [0xa8, 0x3c, 0x09];\nlet s: &[u8] = &[0xa8, 0x3c, 0x09];\nassert_eq!(b.hash_one(a), b.hash_one(s));
\n
source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.50.0 · source§

impl<T, I, const N: usize> Index<I> for [T; N]
where\n [T]: Index<I>,

§

type Output = <[T] as Index<I>>::Output

The returned type after indexing.
source§

fn index(&self, index: I) -> &<[T; N] as Index<I>>::Output

Performs the indexing (container[index]) operation. Read more
","Index","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.50.0 · source§

impl<T, I, const N: usize> IndexMut<I> for [T; N]
where\n [T]: IndexMut<I>,

source§

fn index_mut(&mut self, index: I) -> &mut <[T; N] as Index<I>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 0]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 1]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 10]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 11]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 12]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 13]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 14]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 15]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 16]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 17]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 18]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 19]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 2]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 20]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 21]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 22]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 23]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 24]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 25]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 26]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 27]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 28]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 29]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 3]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 30]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 31]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 32]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 4]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 5]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 6]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 7]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 8]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl InputLength for [u8; 9]

§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name,\nand the name of the trait itself
","InputLength","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.53.0 · source§

impl<T, const N: usize> IntoIterator for [T; N]

source§

fn into_iter(self) -> <[T; N] as IntoIterator>::IntoIter

Creates a consuming iterator, that is, one that moves each value out of\nthe array (from start to end). The array cannot be used after calling\nthis unless T implements Copy, so the whole array is copied.

\n

Arrays have special behavior when calling .into_iter() prior to the\n2021 edition – see the array Editions section for more information.

\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, N>

Which kind of iterator are we turning this into?
","IntoIterator","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, const N: usize> Ord for [T; N]
where\n T: Ord,

Implements comparison of arrays lexicographically.

\n
source§

fn cmp(&self, other: &[T; N]) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, U, const N: usize> PartialEq<&[U]> for [T; N]
where\n T: PartialEq<U>,

source§

fn eq(&self, other: &&[U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&[U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&[U]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, U, const N: usize> PartialEq<&mut [U]> for [T; N]
where\n T: PartialEq<U>,

source§

fn eq(&self, other: &&mut [U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &&mut [U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<&mut [U]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, U, const N: usize> PartialEq<[U]> for [T; N]
where\n T: PartialEq<U>,

source§

fn eq(&self, other: &[U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &[U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<[U]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, U, const N: usize> PartialEq<[U; N]> for [T; N]
where\n T: PartialEq<U>,

source§

fn eq(&self, other: &[U; N]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &[U; N]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<[U; N]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<F32<O>> for [u8; 4]
where\n O: ByteOrder,

§

fn eq(&self, other: &F32<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<F64<O>> for [u8; 8]
where\n O: ByteOrder,

§

fn eq(&self, other: &F64<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<I128<O>> for [u8; 16]
where\n O: ByteOrder,

§

fn eq(&self, other: &I128<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<I16<O>> for [u8; 2]
where\n O: ByteOrder,

§

fn eq(&self, other: &I16<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<I32<O>> for [u8; 4]
where\n O: ByteOrder,

§

fn eq(&self, other: &I32<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<I64<O>> for [u8; 8]
where\n O: ByteOrder,

§

fn eq(&self, other: &I64<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<U128<O>> for [u8; 16]
where\n O: ByteOrder,

§

fn eq(&self, other: &U128<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<U16<O>> for [u8; 2]
where\n O: ByteOrder,

§

fn eq(&self, other: &U16<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<U32<O>> for [u8; 4]
where\n O: ByteOrder,

§

fn eq(&self, other: &U32<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<O> PartialEq<U64<O>> for [u8; 8]
where\n O: ByteOrder,

§

fn eq(&self, other: &U64<O>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, const N: usize> PartialOrd for [T; N]
where\n T: PartialOrd,

Implements comparison of arrays lexicographically.

\n
source§

fn partial_cmp(&self, other: &[T; N]) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, other: &[T; N]) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, other: &[T; N]) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
source§

fn ge(&self, other: &[T; N]) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
source§

fn gt(&self, other: &[T; N]) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
","PartialOrd","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<const N: usize> Replacer for [u8; N]

§

fn replace_append(&mut self, caps: &Captures<'_>, dst: &mut Vec<u8>)

Appends possibly empty data to dst to replace the current match. Read more
§

fn no_expansion(&mut self) -> Option<Cow<'_, [u8]>>

Return a fixed unchanging replacement byte string. Read more
§

fn by_ref<'r>(&'r mut self) -> ReplacerRef<'r, Self>

Returns a type that implements Replacer, but that borrows and wraps\nthis Replacer. Read more
","Replacer","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 0]

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 1]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 10]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 11]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 12]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 13]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 14]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 15]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 16]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 17]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 18]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 19]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 2]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 20]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 21]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 22]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 23]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 24]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 25]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 26]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 27]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 28]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 29]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 3]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 30]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 31]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 32]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 4]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 5]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 6]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 7]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 8]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T> Serialize for [T; 9]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.51.0 · source§

impl<T, const N: usize> SlicePattern for [T; N]

§

type Item = T

🔬This is a nightly-only experimental API. (slice_pattern)
The element type of the slice being matched on.
source§

fn as_slice(&self) -> &[<[T; N] as SlicePattern>::Item]

🔬This is a nightly-only experimental API. (slice_pattern)
Currently, the consumers of SlicePattern need a slice.
","SlicePattern","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.34.0 · source§

impl<T, const N: usize> TryFrom<&[T]> for [T; N]
where\n T: Copy,

Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if\nslice.len() == N.

\n\n
let bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n
§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(slice: &[T]) -> Result<[T; N], TryFromSliceError>

Performs the conversion.
","TryFrom<&[T]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.59.0 · source§

impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]
where\n T: Copy,

Tries to create an array [T; N] by copying from a mutable slice &mut [T].\nSucceeds if slice.len() == N.

\n\n
let mut bytes: [u8; 3] = [1, 0, 2];\n\nlet bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();\nassert_eq!(1, u16::from_le_bytes(bytes_head));\n\nlet bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();\nassert_eq!(512, u16::from_le_bytes(bytes_tail));
\n
§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(slice: &mut [T]) -> Result<[T; N], TryFromSliceError>

Performs the conversion.
","TryFrom<&mut [T]>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]
where\n A: Allocator,

§

fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>

Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.

\n
§Examples
\n
assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\n

If the length doesn’t match, the input comes back in Err:

\n\n
let r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\n

If you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.

\n\n
let mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n
§

type Error = Vec<T, A>

The type returned in the event of a conversion error.
","TryFrom>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.48.0 · source§

impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]
where\n A: Allocator,

source§

fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>

Gets the entire contents of the Vec<T> as an array,\nif its size exactly matches that of the requested array.

\n
§Examples
\n
assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));\nassert_eq!(<Vec<i32>>::new().try_into(), Ok([]));
\n

If the length doesn’t match, the input comes back in Err:

\n\n
let r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();\nassert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));
\n

If you’re fine with just getting a prefix of the Vec<T>,\nyou can call .truncate(N) first.

\n\n
let mut v = String::from(\"hello world\").into_bytes();\nv.sort();\nv.truncate(2);\nlet [a, b]: [_; 2] = v.try_into().unwrap();\nassert_eq!(a, b' ');\nassert_eq!(b, b'd');
\n
§

type Error = Vec<T, A>

The type returned in the event of a conversion error.
","TryFrom>","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<T, const N: usize> ValueOrd for [T; N]
where\n T: DerOrd,

§

fn value_cmp(&self, other: &[T; N]) -> Result<Ordering, Error>

Return an Ordering between value portion of TLV-encoded self and\nother when serialized as ASN.1 DER.
","ValueOrd","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<Z, const N: usize> Zeroize for [Z; N]
where\n Z: Zeroize,

Impl [Zeroize] on arrays of types that impl [Zeroize].

\n
§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the\nzeroization operation is not “optimized away” by the compiler.
","Zeroize","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T, const N: usize> ConstParamTy for [T; N]
where\n T: ConstParamTy,

","ConstParamTy","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.58.0 · source§

impl<T, const N: usize> Copy for [T; N]
where\n T: Copy,

","Copy","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
1.0.0 · source§

impl<T, const N: usize> Eq for [T; N]
where\n T: Eq,

","Eq","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
source§

impl<T, const N: usize> StructuralPartialEq for [T; N]

","StructuralPartialEq","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<const N: usize, T> Unaligned for [T; N]
where\n T: Unaligned,

","Unaligned","oasis_core_runtime::common::sgx::ias::QuoteContext"],["
§

impl<Z, const N: usize> ZeroizeOnDrop for [Z; N]
where\n Z: ZeroizeOnDrop,

Impl [ZeroizeOnDrop] on arrays of types that impl [ZeroizeOnDrop].

\n
","ZeroizeOnDrop","oasis_core_runtime::common::sgx::ias::QuoteContext"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/std/primitive.slice.js b/rust/type.impl/std/primitive.slice.js new file mode 100644 index 0000000000..cd130b9043 --- /dev/null +++ b/rust/type.impl/std/primitive.slice.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_runtime_sdk":[["
source§

impl<T> [T]

1.0.0 · source

pub fn sort(&mut self)
where\n T: Ord,

Sorts the slice, preserving initial order of equal elements.

\n

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n))\nworst-case.

\n

If T: Ord does not implement a total order the resulting order is unspecified. All\noriginal elements will remain in the slice and any possible modifications via interior\nmutability are observed in the input. Same is true if T: Ord panics.

\n

When applicable, unstable sorting is preferred because it is generally faster than stable\nsorting and it doesn’t allocate auxiliary memory. See\nsort_unstable. The exception are partially sorted slices, which\nmay be better served with slice::sort.

\n
§Current implementation
\n

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which\ncombines the fast average case of quicksort with the fast worst case and partial run\ndetection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs\nwith k distinct elements, the expected time to sort the data is O(n * log(k)).

\n

The auxiliary memory allocation behavior depends on the input length. Short slices are\nhandled without allocation, medium sized slices allocate self.len() and beyond that it\nclamps at self.len() / 2.

\n

If T: Ord does not implement a total order, the implementation may panic.

\n
§Examples
\n
let mut v = [-5, 4, 1, -3, 2];\n\nv.sort();\nassert!(v == [-5, -3, 1, 2, 4]);
\n
1.0.0 · source

pub fn sort_by<F>(&mut self, compare: F)
where\n F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, preserving initial order of equal elements.

\n

This sort is stable (i.e., does not reorder equal elements) and O(n * log(n))\nworst-case.

\n

The comparator function should define a total ordering for the elements in the slice. If the\nordering is not total, the order of the elements is unspecified.

\n

If the comparator function does not implement a total order the resulting order is\nunspecified. All original elements will remain in the slice and any possible modifications\nvia interior mutability are observed in the input. Same is true if the comparator function\npanics. A total order (for all a, b and c):

\n
    \n
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • \n
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • \n
\n

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use\npartial_cmp as our sort function when we know the slice doesn’t contain a NaN.

\n\n
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];\nfloats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());\nassert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
\n
§Current implementation
\n

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which\ncombines the fast average case of quicksort with the fast worst case and partial run\ndetection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs\nwith k distinct elements, the expected time to sort the data is O(n * log(k)).

\n

The auxiliary memory allocation behavior depends on the input length. Short slices are\nhandled without allocation, medium sized slices allocate self.len() and beyond that it\nclamps at self.len() / 2.

\n

If T: Ord does not implement a total order, the implementation may panic.

\n
§Examples
\n
let mut v = [5, 4, 1, 3, 2];\nv.sort_by(|a, b| a.cmp(b));\nassert!(v == [1, 2, 3, 4, 5]);\n\n// reverse sorting\nv.sort_by(|a, b| b.cmp(a));\nassert!(v == [5, 4, 3, 2, 1]);
\n
1.7.0 · source

pub fn sort_by_key<K, F>(&mut self, f: F)
where\n F: FnMut(&T) -> K,\n K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

\n

This sort is stable (i.e., does not reorder equal elements) and O(m * n * log(n))\nworst-case, where the key function is O(m).

\n

If K: Ord does not implement a total order the resulting order is unspecified.\nAll original elements will remain in the slice and any possible modifications via interior\nmutability are observed in the input. Same is true if K: Ord panics.

\n
§Current implementation
\n

The current implementation is based on driftsort by Orson Peters and Lukas Bergdoll, which\ncombines the fast average case of quicksort with the fast worst case and partial run\ndetection of mergesort, achieving linear time on fully sorted and reversed inputs. On inputs\nwith k distinct elements, the expected time to sort the data is O(n * log(k)).

\n

The auxiliary memory allocation behavior depends on the input length. Short slices are\nhandled without allocation, medium sized slices allocate self.len() and beyond that it\nclamps at self.len() / 2.

\n

If K: Ord does not implement a total order, the implementation may panic.

\n
§Examples
\n
let mut v = [-5i32, 4, 1, -3, 2];\n\nv.sort_by_key(|k| k.abs());\nassert!(v == [1, 2, -3, 4, -5]);
\n
1.34.0 · source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where\n F: FnMut(&T) -> K,\n K: Ord,

Sorts the slice with a key extraction function, preserving initial order of equal elements.

\n

This sort is stable (i.e., does not reorder equal elements) and O(m * n + n *\nlog(n)) worst-case, where the key function is O(m).

\n

During sorting, the key function is called at most once per element, by using temporary\nstorage to remember the results of key evaluation. The order of calls to the key function is\nunspecified and may change in future versions of the standard library.

\n

If K: Ord does not implement a total order the resulting order is unspecified.\nAll original elements will remain in the slice and any possible modifications via interior\nmutability are observed in the input. Same is true if K: Ord panics.

\n

For simple key functions (e.g., functions that are property accesses or basic operations),\nsort_by_key is likely to be faster.

\n
§Current implementation
\n

The current implementation is based on instruction-parallel-network sort by Lukas\nBergdoll, which combines the fast average case of randomized quicksort with the fast worst\ncase of heapsort, while achieving linear time on fully sorted and reversed inputs. And\nO(k * log(n)) where k is the number of distinct elements in the input. It leverages\nsuperscalar out-of-order execution capabilities commonly found in CPUs, to efficiently\nperform the operation.

\n

In the worst case, the algorithm allocates temporary storage in a Vec<(K, usize)> the\nlength of the slice.

\n
§Examples
\n
let mut v = [-5i32, 4, 32, -3, 2];\n\nv.sort_by_cached_key(|k| k.to_string());\nassert!(v == [-3, -5, 2, 32, 4]);
\n
1.0.0 · source

pub fn to_vec(&self) -> Vec<T>
where\n T: Clone,

Copies self into a new Vec.

\n
§Examples
\n
let s = [10, 40, 30];\nlet x = s.to_vec();\n// Here, `s` and `x` can be modified independently.
\n
source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where\n A: Allocator,\n T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

\n
§Examples
\n
#![feature(allocator_api)]\n\nuse std::alloc::System;\n\nlet s = [10, 40, 30];\nlet x = s.to_vec_in(System);\n// Here, `s` and `x` can be modified independently.
\n
1.0.0 · source

pub fn into_vec<A>(self: Box<[T], A>) -> Vec<T, A>
where\n A: Allocator,

Converts self into a vector without clones or allocation.

\n

The resulting vector can be converted back into a box via\nVec<T>’s into_boxed_slice method.

\n
§Examples
\n
let s: Box<[i32]> = Box::new([10, 40, 30]);\nlet x = s.into_vec();\n// `s` cannot be used anymore because it has been converted into `x`.\n\nassert_eq!(x, vec![10, 40, 30]);
\n
1.40.0 · source

pub fn repeat(&self, n: usize) -> Vec<T>
where\n T: Copy,

Creates a vector by copying a slice n times.

\n
§Panics
\n

This function will panic if the capacity would overflow.

\n
§Examples
\n

Basic usage:

\n\n
assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
\n

A panic upon overflow:

\n\n
// this will panic at runtime\nb\"0123456789abcdef\".repeat(usize::MAX);
\n
1.0.0 · source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where\n [T]: Concat<Item>,\n Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

\n
§Examples
\n
assert_eq!([\"hello\", \"world\"].concat(), \"helloworld\");\nassert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
\n
1.3.0 · source

pub fn join<Separator>(\n &self,\n sep: Separator,\n) -> <[T] as Join<Separator>>::Output
where\n [T]: Join<Separator>,

Flattens a slice of T into a single value Self::Output, placing a\ngiven separator between each.

\n
§Examples
\n
assert_eq!([\"hello\", \"world\"].join(\" \"), \"hello world\");\nassert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);\nassert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
\n
1.0.0 · source

pub fn connect<Separator>(\n &self,\n sep: Separator,\n) -> <[T] as Join<Separator>>::Output
where\n [T]: Join<Separator>,

👎Deprecated since 1.3.0: renamed to join

Flattens a slice of T into a single value Self::Output, placing a\ngiven separator between each.

\n
§Examples
\n
assert_eq!([\"hello\", \"world\"].connect(\" \"), \"hello world\");\nassert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
\n
",0,"oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> [T]

1.0.0 (const: 1.39.0) · source

pub const fn len(&self) -> usize

Returns the number of elements in the slice.

\n
§Examples
\n
let a = [1, 2, 3];\nassert_eq!(a.len(), 3);
\n
1.0.0 (const: 1.39.0) · source

pub const fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

\n
§Examples
\n
let a = [1, 2, 3];\nassert!(!a.is_empty());\n\nlet b: &[i32] = &[];\nassert!(b.is_empty());
\n
1.0.0 (const: 1.56.0) · source

pub const fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

\n
§Examples
\n
let v = [10, 40, 30];\nassert_eq!(Some(&10), v.first());\n\nlet w: &[i32] = &[];\nassert_eq!(None, w.first());
\n
1.0.0 (const: unstable) · source

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some(first) = x.first_mut() {\n    *first = 5;\n}\nassert_eq!(x, &[5, 1, 2]);\n\nlet y: &mut [i32] = &mut [];\nassert_eq!(None, y.first_mut());
\n
1.5.0 (const: 1.56.0) · source

pub const fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

\n
§Examples
\n
let x = &[0, 1, 2];\n\nif let Some((first, elements)) = x.split_first() {\n    assert_eq!(first, &0);\n    assert_eq!(elements, &[1, 2]);\n}
\n
1.5.0 (const: unstable) · source

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some((first, elements)) = x.split_first_mut() {\n    *first = 3;\n    elements[0] = 4;\n    elements[1] = 5;\n}\nassert_eq!(x, &[3, 4, 5]);
\n
1.5.0 (const: 1.56.0) · source

pub const fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

\n
§Examples
\n
let x = &[0, 1, 2];\n\nif let Some((last, elements)) = x.split_last() {\n    assert_eq!(last, &2);\n    assert_eq!(elements, &[0, 1]);\n}
\n
1.5.0 (const: unstable) · source

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some((last, elements)) = x.split_last_mut() {\n    *last = 3;\n    elements[0] = 4;\n    elements[1] = 5;\n}\nassert_eq!(x, &[4, 5, 3]);
\n
1.0.0 (const: 1.56.0) · source

pub const fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

\n
§Examples
\n
let v = [10, 40, 30];\nassert_eq!(Some(&30), v.last());\n\nlet w: &[i32] = &[];\nassert_eq!(None, w.last());
\n
1.0.0 (const: unstable) · source

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable reference to the last item in the slice, or None if it is empty.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some(last) = x.last_mut() {\n    *last = 10;\n}\nassert_eq!(x, &[0, 1, 10]);\n\nlet y: &mut [i32] = &mut [];\nassert_eq!(None, y.last_mut());
\n
1.77.0 (const: 1.77.0) · source

pub const fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the first N items in the slice.

\n

If the slice is not at least N in length, this will return None.

\n
§Examples
\n
let u = [10, 40, 30];\nassert_eq!(Some(&[10, 40]), u.first_chunk::<2>());\n\nlet v: &[i32] = &[10];\nassert_eq!(None, v.first_chunk::<2>());\n\nlet w: &[i32] = &[];\nassert_eq!(Some(&[]), w.first_chunk::<0>());
\n
1.77.0 (const: unstable) · source

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the first N items in the slice.

\n

If the slice is not at least N in length, this will return None.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some(first) = x.first_chunk_mut::<2>() {\n    first[0] = 5;\n    first[1] = 4;\n}\nassert_eq!(x, &[5, 4, 2]);\n\nassert_eq!(None, x.first_chunk_mut::<4>());
\n
1.77.0 (const: 1.77.0) · source

pub const fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

Return an array reference to the first N items in the slice and the remaining slice.

\n

If the slice is not at least N in length, this will return None.

\n
§Examples
\n
let x = &[0, 1, 2];\n\nif let Some((first, elements)) = x.split_first_chunk::<2>() {\n    assert_eq!(first, &[0, 1]);\n    assert_eq!(elements, &[2]);\n}\n\nassert_eq!(None, x.split_first_chunk::<4>());
\n
1.77.0 (const: unstable) · source

pub fn split_first_chunk_mut<const N: usize>(\n &mut self,\n) -> Option<(&mut [T; N], &mut [T])>

Return a mutable array reference to the first N items in the slice and the remaining\nslice.

\n

If the slice is not at least N in length, this will return None.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some((first, elements)) = x.split_first_chunk_mut::<2>() {\n    first[0] = 3;\n    first[1] = 4;\n    elements[0] = 5;\n}\nassert_eq!(x, &[3, 4, 5]);\n\nassert_eq!(None, x.split_first_chunk_mut::<4>());
\n
1.77.0 (const: 1.77.0) · source

pub const fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

Return an array reference to the last N items in the slice and the remaining slice.

\n

If the slice is not at least N in length, this will return None.

\n
§Examples
\n
let x = &[0, 1, 2];\n\nif let Some((elements, last)) = x.split_last_chunk::<2>() {\n    assert_eq!(elements, &[0]);\n    assert_eq!(last, &[1, 2]);\n}\n\nassert_eq!(None, x.split_last_chunk::<4>());
\n
1.77.0 (const: unstable) · source

pub fn split_last_chunk_mut<const N: usize>(\n &mut self,\n) -> Option<(&mut [T], &mut [T; N])>

Return a mutable array reference to the last N items in the slice and the remaining\nslice.

\n

If the slice is not at least N in length, this will return None.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some((elements, last)) = x.split_last_chunk_mut::<2>() {\n    last[0] = 3;\n    last[1] = 4;\n    elements[0] = 5;\n}\nassert_eq!(x, &[5, 3, 4]);\n\nassert_eq!(None, x.split_last_chunk_mut::<4>());
\n
1.77.0 (const: 1.77.0) · source

pub const fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the last N items in the slice.

\n

If the slice is not at least N in length, this will return None.

\n
§Examples
\n
let u = [10, 40, 30];\nassert_eq!(Some(&[40, 30]), u.last_chunk::<2>());\n\nlet v: &[i32] = &[10];\nassert_eq!(None, v.last_chunk::<2>());\n\nlet w: &[i32] = &[];\nassert_eq!(Some(&[]), w.last_chunk::<0>());
\n
1.77.0 (const: unstable) · source

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the last N items in the slice.

\n

If the slice is not at least N in length, this will return None.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some(last) = x.last_chunk_mut::<2>() {\n    last[0] = 10;\n    last[1] = 20;\n}\nassert_eq!(x, &[0, 10, 20]);\n\nassert_eq!(None, x.last_chunk_mut::<4>());
\n
1.0.0 · source

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
where\n I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of\nindex.

\n
    \n
  • If given a position, returns a reference to the element at that\nposition or None if out of bounds.
  • \n
  • If given a range, returns the subslice corresponding to that range,\nor None if out of bounds.
  • \n
\n
§Examples
\n
let v = [10, 40, 30];\nassert_eq!(Some(&40), v.get(1));\nassert_eq!(Some(&[10, 40][..]), v.get(0..2));\nassert_eq!(None, v.get(3));\nassert_eq!(None, v.get(0..4));
\n
1.0.0 · source

pub fn get_mut<I>(\n &mut self,\n index: I,\n) -> Option<&mut <I as SliceIndex<[T]>>::Output>
where\n I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the\ntype of index (see get) or None if the index is out of bounds.

\n
§Examples
\n
let x = &mut [0, 1, 2];\n\nif let Some(elem) = x.get_mut(1) {\n    *elem = 42;\n}\nassert_eq!(x, &[0, 42, 2]);
\n
1.0.0 · source

pub unsafe fn get_unchecked<I>(\n &self,\n index: I,\n) -> &<I as SliceIndex<[T]>>::Output
where\n I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds\nchecking.

\n

For a safe alternative see get.

\n
§Safety
\n

Calling this method with an out-of-bounds index is undefined behavior\neven if the resulting reference is not used.

\n

You can think of this like .get(index).unwrap_unchecked(). It’s UB\nto call .get_unchecked(len), even if you immediately convert to a\npointer. And it’s UB to call .get_unchecked(..len + 1),\n.get_unchecked(..=len), or similar.

\n
§Examples
\n
let x = &[1, 2, 4];\n\nunsafe {\n    assert_eq!(x.get_unchecked(1), &2);\n}
\n
1.0.0 · source

pub unsafe fn get_unchecked_mut<I>(\n &mut self,\n index: I,\n) -> &mut <I as SliceIndex<[T]>>::Output
where\n I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing\nbounds checking.

\n

For a safe alternative see get_mut.

\n
§Safety
\n

Calling this method with an out-of-bounds index is undefined behavior\neven if the resulting reference is not used.

\n

You can think of this like .get_mut(index).unwrap_unchecked(). It’s\nUB to call .get_unchecked_mut(len), even if you immediately convert\nto a pointer. And it’s UB to call .get_unchecked_mut(..len + 1),\n.get_unchecked_mut(..=len), or similar.

\n
§Examples
\n
let x = &mut [1, 2, 4];\n\nunsafe {\n    let elem = x.get_unchecked_mut(1);\n    *elem = 13;\n}\nassert_eq!(x, &[1, 13, 4]);
\n
1.0.0 (const: 1.32.0) · source

pub const fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

\n

The caller must ensure that the slice outlives the pointer this\nfunction returns, or else it will end up pointing to garbage.

\n

The caller must also ensure that the memory the pointer (non-transitively) points to\nis never written to (except inside an UnsafeCell) using this pointer or any pointer\nderived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

\n

Modifying the container referenced by this slice may cause its buffer\nto be reallocated, which would also make any pointers to it invalid.

\n
§Examples
\n
let x = &[1, 2, 4];\nlet x_ptr = x.as_ptr();\n\nunsafe {\n    for i in 0..x.len() {\n        assert_eq!(x.get_unchecked(i), &*x_ptr.add(i));\n    }\n}
\n
1.0.0 (const: 1.61.0) · source

pub const fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

\n

The caller must ensure that the slice outlives the pointer this\nfunction returns, or else it will end up pointing to garbage.

\n

Modifying the container referenced by this slice may cause its buffer\nto be reallocated, which would also make any pointers to it invalid.

\n
§Examples
\n
let x = &mut [1, 2, 4];\nlet x_ptr = x.as_mut_ptr();\n\nunsafe {\n    for i in 0..x.len() {\n        *x_ptr.add(i) += 2;\n    }\n}\nassert_eq!(x, &[3, 4, 6]);
\n
1.48.0 (const: 1.61.0) · source

pub const fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

\n

The returned range is half-open, which means that the end pointer\npoints one past the last element of the slice. This way, an empty\nslice is represented by two equal pointers, and the difference between\nthe two pointers represents the size of the slice.

\n

See as_ptr for warnings on using these pointers. The end pointer\nrequires extra caution, as it does not point to a valid element in the\nslice.

\n

This function is useful for interacting with foreign interfaces which\nuse two pointers to refer to a range of elements in memory, as is\ncommon in C++.

\n

It can also be useful to check if a pointer to an element refers to an\nelement of this slice:

\n\n
let a = [1, 2, 3];\nlet x = &a[1] as *const _;\nlet y = &5 as *const _;\n\nassert!(a.as_ptr_range().contains(&x));\nassert!(!a.as_ptr_range().contains(&y));
\n
1.48.0 (const: 1.61.0) · source

pub const fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

\n

The returned range is half-open, which means that the end pointer\npoints one past the last element of the slice. This way, an empty\nslice is represented by two equal pointers, and the difference between\nthe two pointers represents the size of the slice.

\n

See as_mut_ptr for warnings on using these pointers. The end\npointer requires extra caution, as it does not point to a valid element\nin the slice.

\n

This function is useful for interacting with foreign interfaces which\nuse two pointers to refer to a range of elements in memory, as is\ncommon in C++.

\n
1.0.0 (const: unstable) · source

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

\n

If a equals to b, it’s guaranteed that elements won’t change value.

\n
§Arguments
\n
    \n
  • a - The index of the first element
  • \n
  • b - The index of the second element
  • \n
\n
§Panics
\n

Panics if a or b are out of bounds.

\n
§Examples
\n
let mut v = [\"a\", \"b\", \"c\", \"d\", \"e\"];\nv.swap(2, 4);\nassert!(v == [\"a\", \"b\", \"e\", \"d\", \"c\"]);
\n
source

pub const unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

\n

For a safe alternative see swap.

\n
§Arguments
\n
    \n
  • a - The index of the first element
  • \n
  • b - The index of the second element
  • \n
\n
§Safety
\n

Calling this method with an out-of-bounds index is undefined behavior.\nThe caller has to ensure that a < self.len() and b < self.len().

\n
§Examples
\n
#![feature(slice_swap_unchecked)]\n\nlet mut v = [\"a\", \"b\", \"c\", \"d\"];\n// SAFETY: we know that 1 and 3 are both indices of the slice\nunsafe { v.swap_unchecked(1, 3) };\nassert!(v == [\"a\", \"d\", \"c\", \"b\"]);
\n
1.0.0 · source

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

\n
§Examples
\n
let mut v = [1, 2, 3];\nv.reverse();\nassert!(v == [3, 2, 1]);
\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

\n

The iterator yields all items from start to end.

\n
§Examples
\n
let x = &[1, 2, 4];\nlet mut iterator = x.iter();\n\nassert_eq!(iterator.next(), Some(&1));\nassert_eq!(iterator.next(), Some(&2));\nassert_eq!(iterator.next(), Some(&4));\nassert_eq!(iterator.next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

\n

The iterator yields all items from start to end.

\n
§Examples
\n
let x = &mut [1, 2, 4];\nfor elem in x.iter_mut() {\n    *elem += 2;\n}\nassert_eq!(x, &[3, 4, 6]);
\n
1.0.0 · source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length\nsize. The windows overlap. If the slice is shorter than\nsize, the iterator returns no values.

\n
§Panics
\n

Panics if size is 0.

\n
§Examples
\n
let slice = ['l', 'o', 'r', 'e', 'm'];\nlet mut iter = slice.windows(3);\nassert_eq!(iter.next().unwrap(), &['l', 'o', 'r']);\nassert_eq!(iter.next().unwrap(), &['o', 'r', 'e']);\nassert_eq!(iter.next().unwrap(), &['r', 'e', 'm']);\nassert!(iter.next().is_none());
\n

If the slice is shorter than size:

\n\n
let slice = ['f', 'o', 'o'];\nlet mut iter = slice.windows(4);\nassert!(iter.next().is_none());
\n

There’s no windows_mut, as that existing would let safe code violate the\n“only one &mut at a time to the same thing” rule. However, you can sometimes\nuse Cell::as_slice_of_cells in\nconjunction with windows to accomplish something similar:

\n\n
use std::cell::Cell;\n\nlet mut array = ['R', 'u', 's', 't', ' ', '2', '0', '1', '5'];\nlet slice = &mut array[..];\nlet slice_of_cells: &[Cell<char>] = Cell::from_mut(slice).as_slice_of_cells();\nfor w in slice_of_cells.windows(3) {\n    Cell::swap(&w[0], &w[2]);\n}\nassert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
\n
1.0.0 · source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the\nbeginning of the slice.

\n

The chunks are slices and do not overlap. If chunk_size does not divide the length of the\nslice, then the last chunk will not have length chunk_size.

\n

See chunks_exact for a variant of this iterator that returns chunks of always exactly\nchunk_size elements, and rchunks for the same iterator but starting at the end of the\nslice.

\n
§Panics
\n

Panics if chunk_size is 0.

\n
§Examples
\n
let slice = ['l', 'o', 'r', 'e', 'm'];\nlet mut iter = slice.chunks(2);\nassert_eq!(iter.next().unwrap(), &['l', 'o']);\nassert_eq!(iter.next().unwrap(), &['r', 'e']);\nassert_eq!(iter.next().unwrap(), &['m']);\nassert!(iter.next().is_none());
\n
1.0.0 · source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the\nbeginning of the slice.

\n

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the\nlength of the slice, then the last chunk will not have length chunk_size.

\n

See chunks_exact_mut for a variant of this iterator that returns chunks of always\nexactly chunk_size elements, and rchunks_mut for the same iterator but starting at\nthe end of the slice.

\n
§Panics
\n

Panics if chunk_size is 0.

\n
§Examples
\n
let v = &mut [0, 0, 0, 0, 0];\nlet mut count = 1;\n\nfor chunk in v.chunks_mut(2) {\n    for elem in chunk.iter_mut() {\n        *elem += count;\n    }\n    count += 1;\n}\nassert_eq!(v, &[1, 1, 2, 2, 3]);
\n
1.31.0 · source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the\nbeginning of the slice.

\n

The chunks are slices and do not overlap. If chunk_size does not divide the length of the\nslice, then the last up to chunk_size-1 elements will be omitted and can be retrieved\nfrom the remainder function of the iterator.

\n

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the\nresulting code better than in the case of chunks.

\n

See chunks for a variant of this iterator that also returns the remainder as a smaller\nchunk, and rchunks_exact for the same iterator but starting at the end of the slice.

\n
§Panics
\n

Panics if chunk_size is 0.

\n
§Examples
\n
let slice = ['l', 'o', 'r', 'e', 'm'];\nlet mut iter = slice.chunks_exact(2);\nassert_eq!(iter.next().unwrap(), &['l', 'o']);\nassert_eq!(iter.next().unwrap(), &['r', 'e']);\nassert!(iter.next().is_none());\nassert_eq!(iter.remainder(), &['m']);
\n
1.31.0 · source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the\nbeginning of the slice.

\n

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the\nlength of the slice, then the last up to chunk_size-1 elements will be omitted and can be\nretrieved from the into_remainder function of the iterator.

\n

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the\nresulting code better than in the case of chunks_mut.

\n

See chunks_mut for a variant of this iterator that also returns the remainder as a\nsmaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of\nthe slice.

\n
§Panics
\n

Panics if chunk_size is 0.

\n
§Examples
\n
let v = &mut [0, 0, 0, 0, 0];\nlet mut count = 1;\n\nfor chunk in v.chunks_exact_mut(2) {\n    for elem in chunk.iter_mut() {\n        *elem += count;\n    }\n    count += 1;\n}\nassert_eq!(v, &[1, 1, 2, 2, 0]);
\n
source

pub const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays,\nassuming that there’s no remainder.

\n
§Safety
\n

This may only be called when

\n
    \n
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • \n
  • N != 0.
  • \n
\n
§Examples
\n
#![feature(slice_as_chunks)]\nlet slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];\nlet chunks: &[[char; 1]] =\n    // SAFETY: 1-element chunks never have remainder\n    unsafe { slice.as_chunks_unchecked() };\nassert_eq!(chunks, &[['l'], ['o'], ['r'], ['e'], ['m'], ['!']]);\nlet chunks: &[[char; 3]] =\n    // SAFETY: The slice length (6) is a multiple of 3\n    unsafe { slice.as_chunks_unchecked() };\nassert_eq!(chunks, &[['l', 'o', 'r'], ['e', 'm', '!']]);\n\n// These would be unsound:\n// let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5\n// let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
\n
source

pub const fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays,\nstarting at the beginning of the slice,\nand a remainder slice with length strictly less than N.

\n
§Panics
\n

Panics if N is 0. This check will most probably get changed to a compile time\nerror before this method gets stabilized.

\n
§Examples
\n
#![feature(slice_as_chunks)]\nlet slice = ['l', 'o', 'r', 'e', 'm'];\nlet (chunks, remainder) = slice.as_chunks();\nassert_eq!(chunks, &[['l', 'o'], ['r', 'e']]);\nassert_eq!(remainder, &['m']);
\n

If you expect the slice to be an exact multiple, you can combine\nlet-else with an empty slice pattern:

\n\n
#![feature(slice_as_chunks)]\nlet slice = ['R', 'u', 's', 't'];\nlet (chunks, []) = slice.as_chunks::<2>() else {\n    panic!(\"slice didn't have even length\")\n};\nassert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
\n
source

pub const fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays,\nstarting at the end of the slice,\nand a remainder slice with length strictly less than N.

\n
§Panics
\n

Panics if N is 0. This check will most probably get changed to a compile time\nerror before this method gets stabilized.

\n
§Examples
\n
#![feature(slice_as_chunks)]\nlet slice = ['l', 'o', 'r', 'e', 'm'];\nlet (remainder, chunks) = slice.as_rchunks();\nassert_eq!(remainder, &['l']);\nassert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
\n
source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the\nbeginning of the slice.

\n

The chunks are array references and do not overlap. If N does not divide the\nlength of the slice, then the last up to N-1 elements will be omitted and can be\nretrieved from the remainder function of the iterator.

\n

This method is the const generic equivalent of chunks_exact.

\n
§Panics
\n

Panics if N is 0. This check will most probably get changed to a compile time\nerror before this method gets stabilized.

\n
§Examples
\n
#![feature(array_chunks)]\nlet slice = ['l', 'o', 'r', 'e', 'm'];\nlet mut iter = slice.array_chunks();\nassert_eq!(iter.next().unwrap(), &['l', 'o']);\nassert_eq!(iter.next().unwrap(), &['r', 'e']);\nassert!(iter.next().is_none());\nassert_eq!(iter.remainder(), &['m']);
\n
source

pub const unsafe fn as_chunks_unchecked_mut<const N: usize>(\n &mut self,\n) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays,\nassuming that there’s no remainder.

\n
§Safety
\n

This may only be called when

\n
    \n
  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • \n
  • N != 0.
  • \n
\n
§Examples
\n
#![feature(slice_as_chunks)]\nlet slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];\nlet chunks: &mut [[char; 1]] =\n    // SAFETY: 1-element chunks never have remainder\n    unsafe { slice.as_chunks_unchecked_mut() };\nchunks[0] = ['L'];\nassert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);\nlet chunks: &mut [[char; 3]] =\n    // SAFETY: The slice length (6) is a multiple of 3\n    unsafe { slice.as_chunks_unchecked_mut() };\nchunks[1] = ['a', 'x', '?'];\nassert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);\n\n// These would be unsound:\n// let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5\n// let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
\n
source

pub const fn as_chunks_mut<const N: usize>(\n &mut self,\n) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays,\nstarting at the beginning of the slice,\nand a remainder slice with length strictly less than N.

\n
§Panics
\n

Panics if N is 0. This check will most probably get changed to a compile time\nerror before this method gets stabilized.

\n
§Examples
\n
#![feature(slice_as_chunks)]\nlet v = &mut [0, 0, 0, 0, 0];\nlet mut count = 1;\n\nlet (chunks, remainder) = v.as_chunks_mut();\nremainder[0] = 9;\nfor chunk in chunks {\n    *chunk = [count; 2];\n    count += 1;\n}\nassert_eq!(v, &[1, 1, 2, 2, 9]);
\n
source

pub const fn as_rchunks_mut<const N: usize>(\n &mut self,\n) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays,\nstarting at the end of the slice,\nand a remainder slice with length strictly less than N.

\n
§Panics
\n

Panics if N is 0. This check will most probably get changed to a compile time\nerror before this method gets stabilized.

\n
§Examples
\n
#![feature(slice_as_chunks)]\nlet v = &mut [0, 0, 0, 0, 0];\nlet mut count = 1;\n\nlet (remainder, chunks) = v.as_rchunks_mut();\nremainder[0] = 9;\nfor chunk in chunks {\n    *chunk = [count; 2];\n    count += 1;\n}\nassert_eq!(v, &[9, 1, 1, 2, 2]);
\n
source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the\nbeginning of the slice.

\n

The chunks are mutable array references and do not overlap. If N does not divide\nthe length of the slice, then the last up to N-1 elements will be omitted and\ncan be retrieved from the into_remainder function of the iterator.

\n

This method is the const generic equivalent of chunks_exact_mut.

\n
§Panics
\n

Panics if N is 0. This check will most probably get changed to a compile time\nerror before this method gets stabilized.

\n
§Examples
\n
#![feature(array_chunks)]\nlet v = &mut [0, 0, 0, 0, 0];\nlet mut count = 1;\n\nfor chunk in v.array_chunks_mut() {\n    *chunk = [count; 2];\n    count += 1;\n}\nassert_eq!(v, &[1, 1, 2, 2, 0]);
\n
source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice,\nstarting at the beginning of the slice.

\n

This is the const generic equivalent of windows.

\n

If N is greater than the size of the slice, it will return no windows.

\n
§Panics
\n

Panics if N is 0. This check will most probably get changed to a compile time\nerror before this method gets stabilized.

\n
§Examples
\n
#![feature(array_windows)]\nlet slice = [0, 1, 2, 3];\nlet mut iter = slice.array_windows();\nassert_eq!(iter.next().unwrap(), &[0, 1]);\nassert_eq!(iter.next().unwrap(), &[1, 2]);\nassert_eq!(iter.next().unwrap(), &[2, 3]);\nassert!(iter.next().is_none());
\n
1.31.0 · source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end\nof the slice.

\n

The chunks are slices and do not overlap. If chunk_size does not divide the length of the\nslice, then the last chunk will not have length chunk_size.

\n

See rchunks_exact for a variant of this iterator that returns chunks of always exactly\nchunk_size elements, and chunks for the same iterator but starting at the beginning\nof the slice.

\n
§Panics
\n

Panics if chunk_size is 0.

\n
§Examples
\n
let slice = ['l', 'o', 'r', 'e', 'm'];\nlet mut iter = slice.rchunks(2);\nassert_eq!(iter.next().unwrap(), &['e', 'm']);\nassert_eq!(iter.next().unwrap(), &['o', 'r']);\nassert_eq!(iter.next().unwrap(), &['l']);\nassert!(iter.next().is_none());
\n
1.31.0 · source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end\nof the slice.

\n

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the\nlength of the slice, then the last chunk will not have length chunk_size.

\n

See rchunks_exact_mut for a variant of this iterator that returns chunks of always\nexactly chunk_size elements, and chunks_mut for the same iterator but starting at the\nbeginning of the slice.

\n
§Panics
\n

Panics if chunk_size is 0.

\n
§Examples
\n
let v = &mut [0, 0, 0, 0, 0];\nlet mut count = 1;\n\nfor chunk in v.rchunks_mut(2) {\n    for elem in chunk.iter_mut() {\n        *elem += count;\n    }\n    count += 1;\n}\nassert_eq!(v, &[3, 2, 2, 1, 1]);
\n
1.31.0 · source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the\nend of the slice.

\n

The chunks are slices and do not overlap. If chunk_size does not divide the length of the\nslice, then the last up to chunk_size-1 elements will be omitted and can be retrieved\nfrom the remainder function of the iterator.

\n

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the\nresulting code better than in the case of rchunks.

\n

See rchunks for a variant of this iterator that also returns the remainder as a smaller\nchunk, and chunks_exact for the same iterator but starting at the beginning of the\nslice.

\n
§Panics
\n

Panics if chunk_size is 0.

\n
§Examples
\n
let slice = ['l', 'o', 'r', 'e', 'm'];\nlet mut iter = slice.rchunks_exact(2);\nassert_eq!(iter.next().unwrap(), &['e', 'm']);\nassert_eq!(iter.next().unwrap(), &['o', 'r']);\nassert!(iter.next().is_none());\nassert_eq!(iter.remainder(), &['l']);
\n
1.31.0 · source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end\nof the slice.

\n

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the\nlength of the slice, then the last up to chunk_size-1 elements will be omitted and can be\nretrieved from the into_remainder function of the iterator.

\n

Due to each chunk having exactly chunk_size elements, the compiler can often optimize the\nresulting code better than in the case of chunks_mut.

\n

See rchunks_mut for a variant of this iterator that also returns the remainder as a\nsmaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning\nof the slice.

\n
§Panics
\n

Panics if chunk_size is 0.

\n
§Examples
\n
let v = &mut [0, 0, 0, 0, 0];\nlet mut count = 1;\n\nfor chunk in v.rchunks_exact_mut(2) {\n    for elem in chunk.iter_mut() {\n        *elem += count;\n    }\n    count += 1;\n}\nassert_eq!(v, &[0, 2, 2, 1, 1]);
\n
1.77.0 · source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where\n F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs\nof elements using the predicate to separate them.

\n

The predicate is called for every pair of consecutive elements,\nmeaning that it is called on slice[0] and slice[1],\nfollowed by slice[1] and slice[2], and so on.

\n
§Examples
\n
let slice = &[1, 1, 1, 3, 3, 2, 2, 2];\n\nlet mut iter = slice.chunk_by(|a, b| a == b);\n\nassert_eq!(iter.next(), Some(&[1, 1, 1][..]));\nassert_eq!(iter.next(), Some(&[3, 3][..]));\nassert_eq!(iter.next(), Some(&[2, 2, 2][..]));\nassert_eq!(iter.next(), None);
\n

This method can be used to extract the sorted subslices:

\n\n
let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];\n\nlet mut iter = slice.chunk_by(|a, b| a <= b);\n\nassert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));\nassert_eq!(iter.next(), Some(&[2, 3][..]));\nassert_eq!(iter.next(), Some(&[2, 3, 4][..]));\nassert_eq!(iter.next(), None);
\n
1.77.0 · source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where\n F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable\nruns of elements using the predicate to separate them.

\n

The predicate is called for every pair of consecutive elements,\nmeaning that it is called on slice[0] and slice[1],\nfollowed by slice[1] and slice[2], and so on.

\n
§Examples
\n
let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];\n\nlet mut iter = slice.chunk_by_mut(|a, b| a == b);\n\nassert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));\nassert_eq!(iter.next(), Some(&mut [3, 3][..]));\nassert_eq!(iter.next(), Some(&mut [2, 2, 2][..]));\nassert_eq!(iter.next(), None);
\n

This method can be used to extract the sorted subslices:

\n\n
let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];\n\nlet mut iter = slice.chunk_by_mut(|a, b| a <= b);\n\nassert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));\nassert_eq!(iter.next(), Some(&mut [2, 3][..]));\nassert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));\nassert_eq!(iter.next(), None);
\n
1.0.0 (const: 1.71.0) · source

pub const fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

\n

The first will contain all indices from [0, mid) (excluding\nthe index mid itself) and the second will contain all\nindices from [mid, len) (excluding the index len itself).

\n
§Panics
\n

Panics if mid > len. For a non-panicking alternative see\nsplit_at_checked.

\n
§Examples
\n
let v = [1, 2, 3, 4, 5, 6];\n\n{\n   let (left, right) = v.split_at(0);\n   assert_eq!(left, []);\n   assert_eq!(right, [1, 2, 3, 4, 5, 6]);\n}\n\n{\n    let (left, right) = v.split_at(2);\n    assert_eq!(left, [1, 2]);\n    assert_eq!(right, [3, 4, 5, 6]);\n}\n\n{\n    let (left, right) = v.split_at(6);\n    assert_eq!(left, [1, 2, 3, 4, 5, 6]);\n    assert_eq!(right, []);\n}
\n
1.0.0 (const: unstable) · source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

\n

The first will contain all indices from [0, mid) (excluding\nthe index mid itself) and the second will contain all\nindices from [mid, len) (excluding the index len itself).

\n
§Panics
\n

Panics if mid > len. For a non-panicking alternative see\nsplit_at_mut_checked.

\n
§Examples
\n
let mut v = [1, 0, 3, 0, 5, 6];\nlet (left, right) = v.split_at_mut(2);\nassert_eq!(left, [1, 0]);\nassert_eq!(right, [3, 0, 5, 6]);\nleft[1] = 2;\nright[1] = 4;\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n
1.79.0 (const: 1.77.0) · source

pub const unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

\n

The first will contain all indices from [0, mid) (excluding\nthe index mid itself) and the second will contain all\nindices from [mid, len) (excluding the index len itself).

\n

For a safe alternative see split_at.

\n
§Safety
\n

Calling this method with an out-of-bounds index is undefined behavior\neven if the resulting reference is not used. The caller has to ensure that\n0 <= mid <= self.len().

\n
§Examples
\n
let v = [1, 2, 3, 4, 5, 6];\n\nunsafe {\n   let (left, right) = v.split_at_unchecked(0);\n   assert_eq!(left, []);\n   assert_eq!(right, [1, 2, 3, 4, 5, 6]);\n}\n\nunsafe {\n    let (left, right) = v.split_at_unchecked(2);\n    assert_eq!(left, [1, 2]);\n    assert_eq!(right, [3, 4, 5, 6]);\n}\n\nunsafe {\n    let (left, right) = v.split_at_unchecked(6);\n    assert_eq!(left, [1, 2, 3, 4, 5, 6]);\n    assert_eq!(right, []);\n}
\n
1.79.0 (const: unstable) · source

pub unsafe fn split_at_mut_unchecked(\n &mut self,\n mid: usize,\n) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

\n

The first will contain all indices from [0, mid) (excluding\nthe index mid itself) and the second will contain all\nindices from [mid, len) (excluding the index len itself).

\n

For a safe alternative see split_at_mut.

\n
§Safety
\n

Calling this method with an out-of-bounds index is undefined behavior\neven if the resulting reference is not used. The caller has to ensure that\n0 <= mid <= self.len().

\n
§Examples
\n
let mut v = [1, 0, 3, 0, 5, 6];\n// scoped to restrict the lifetime of the borrows\nunsafe {\n    let (left, right) = v.split_at_mut_unchecked(2);\n    assert_eq!(left, [1, 0]);\n    assert_eq!(right, [3, 0, 5, 6]);\n    left[1] = 2;\n    right[1] = 4;\n}\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);
\n
1.80.0 (const: 1.80.0) · source

pub const fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

Divides one slice into two at an index, returning None if the slice is\ntoo short.

\n

If mid ≤ len returns a pair of slices where the first will contain all\nindices from [0, mid) (excluding the index mid itself) and the\nsecond will contain all indices from [mid, len) (excluding the index\nlen itself).

\n

Otherwise, if mid > len, returns None.

\n
§Examples
\n
let v = [1, -2, 3, -4, 5, -6];\n\n{\n   let (left, right) = v.split_at_checked(0).unwrap();\n   assert_eq!(left, []);\n   assert_eq!(right, [1, -2, 3, -4, 5, -6]);\n}\n\n{\n    let (left, right) = v.split_at_checked(2).unwrap();\n    assert_eq!(left, [1, -2]);\n    assert_eq!(right, [3, -4, 5, -6]);\n}\n\n{\n    let (left, right) = v.split_at_checked(6).unwrap();\n    assert_eq!(left, [1, -2, 3, -4, 5, -6]);\n    assert_eq!(right, []);\n}\n\nassert_eq!(None, v.split_at_checked(7));
\n
1.80.0 (const: unstable) · source

pub fn split_at_mut_checked(\n &mut self,\n mid: usize,\n) -> Option<(&mut [T], &mut [T])>

Divides one mutable slice into two at an index, returning None if the\nslice is too short.

\n

If mid ≤ len returns a pair of slices where the first will contain all\nindices from [0, mid) (excluding the index mid itself) and the\nsecond will contain all indices from [mid, len) (excluding the index\nlen itself).

\n

Otherwise, if mid > len, returns None.

\n
§Examples
\n
let mut v = [1, 0, 3, 0, 5, 6];\n\nif let Some((left, right)) = v.split_at_mut_checked(2) {\n    assert_eq!(left, [1, 0]);\n    assert_eq!(right, [3, 0, 5, 6]);\n    left[1] = 2;\n    right[1] = 4;\n}\nassert_eq!(v, [1, 2, 3, 4, 5, 6]);\n\nassert_eq!(None, v.split_at_mut_checked(7));
\n
1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match\npred. The matched element is not contained in the subslices.

\n
§Examples
\n
let slice = [10, 40, 33, 20];\nlet mut iter = slice.split(|num| num % 3 == 0);\n\nassert_eq!(iter.next().unwrap(), &[10, 40]);\nassert_eq!(iter.next().unwrap(), &[20]);\nassert!(iter.next().is_none());
\n

If the first element is matched, an empty slice will be the first item\nreturned by the iterator. Similarly, if the last element in the slice\nis matched, an empty slice will be the last item returned by the\niterator:

\n\n
let slice = [10, 40, 33];\nlet mut iter = slice.split(|num| num % 3 == 0);\n\nassert_eq!(iter.next().unwrap(), &[10, 40]);\nassert_eq!(iter.next().unwrap(), &[]);\nassert!(iter.next().is_none());
\n

If two matched elements are directly adjacent, an empty slice will be\npresent between them:

\n\n
let slice = [10, 6, 33, 20];\nlet mut iter = slice.split(|num| num % 3 == 0);\n\nassert_eq!(iter.next().unwrap(), &[10]);\nassert_eq!(iter.next().unwrap(), &[]);\nassert_eq!(iter.next().unwrap(), &[20]);\nassert!(iter.next().is_none());
\n
1.0.0 · source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that\nmatch pred. The matched element is not contained in the subslices.

\n
§Examples
\n
let mut v = [10, 40, 30, 20, 60, 50];\n\nfor group in v.split_mut(|num| *num % 3 == 0) {\n    group[0] = 1;\n}\nassert_eq!(v, [1, 40, 30, 1, 60, 1]);
\n
1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match\npred. The matched element is contained in the end of the previous\nsubslice as a terminator.

\n
§Examples
\n
let slice = [10, 40, 33, 20];\nlet mut iter = slice.split_inclusive(|num| num % 3 == 0);\n\nassert_eq!(iter.next().unwrap(), &[10, 40, 33]);\nassert_eq!(iter.next().unwrap(), &[20]);\nassert!(iter.next().is_none());
\n

If the last element of the slice is matched,\nthat element will be considered the terminator of the preceding slice.\nThat slice will be the last item returned by the iterator.

\n\n
let slice = [3, 10, 40, 33];\nlet mut iter = slice.split_inclusive(|num| num % 3 == 0);\n\nassert_eq!(iter.next().unwrap(), &[3]);\nassert_eq!(iter.next().unwrap(), &[10, 40, 33]);\nassert!(iter.next().is_none());
\n
1.51.0 · source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that\nmatch pred. The matched element is contained in the previous\nsubslice as a terminator.

\n
§Examples
\n
let mut v = [10, 40, 30, 20, 60, 50];\n\nfor group in v.split_inclusive_mut(|num| *num % 3 == 0) {\n    let terminator_idx = group.len()-1;\n    group[terminator_idx] = 1;\n}\nassert_eq!(v, [10, 40, 1, 20, 1, 1]);
\n
1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match\npred, starting at the end of the slice and working backwards.\nThe matched element is not contained in the subslices.

\n
§Examples
\n
let slice = [11, 22, 33, 0, 44, 55];\nlet mut iter = slice.rsplit(|num| *num == 0);\n\nassert_eq!(iter.next().unwrap(), &[44, 55]);\nassert_eq!(iter.next().unwrap(), &[11, 22, 33]);\nassert_eq!(iter.next(), None);
\n

As with split(), if the first or last element is matched, an empty\nslice will be the first (or last) item returned by the iterator.

\n\n
let v = &[0, 1, 1, 2, 3, 5, 8];\nlet mut it = v.rsplit(|n| *n % 2 == 0);\nassert_eq!(it.next().unwrap(), &[]);\nassert_eq!(it.next().unwrap(), &[3, 5]);\nassert_eq!(it.next().unwrap(), &[1, 1]);\nassert_eq!(it.next().unwrap(), &[]);\nassert_eq!(it.next(), None);
\n
1.27.0 · source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that\nmatch pred, starting at the end of the slice and working\nbackwards. The matched element is not contained in the subslices.

\n
§Examples
\n
let mut v = [100, 400, 300, 200, 600, 500];\n\nlet mut count = 0;\nfor group in v.rsplit_mut(|num| *num % 3 == 0) {\n    count += 1;\n    group[0] = count;\n}\nassert_eq!(v, [3, 400, 300, 2, 600, 1]);
\n
1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match\npred, limited to returning at most n items. The matched element is\nnot contained in the subslices.

\n

The last element returned, if any, will contain the remainder of the\nslice.

\n
§Examples
\n

Print the slice split once by numbers divisible by 3 (i.e., [10, 40],\n[20, 60, 50]):

\n\n
let v = [10, 40, 30, 20, 60, 50];\n\nfor group in v.splitn(2, |num| *num % 3 == 0) {\n    println!(\"{group:?}\");\n}
\n
1.0.0 · source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match\npred, limited to returning at most n items. The matched element is\nnot contained in the subslices.

\n

The last element returned, if any, will contain the remainder of the\nslice.

\n
§Examples
\n
let mut v = [10, 40, 30, 20, 60, 50];\n\nfor group in v.splitn_mut(2, |num| *num % 3 == 0) {\n    group[0] = 1;\n}\nassert_eq!(v, [1, 40, 30, 1, 60, 50]);
\n
1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match\npred limited to returning at most n items. This starts at the end of\nthe slice and works backwards. The matched element is not contained in\nthe subslices.

\n

The last element returned, if any, will contain the remainder of the\nslice.

\n
§Examples
\n

Print the slice split once, starting from the end, by numbers divisible\nby 3 (i.e., [50], [10, 40, 30, 20]):

\n\n
let v = [10, 40, 30, 20, 60, 50];\n\nfor group in v.rsplitn(2, |num| *num % 3 == 0) {\n    println!(\"{group:?}\");\n}
\n
1.0.0 · source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where\n F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match\npred limited to returning at most n items. This starts at the end of\nthe slice and works backwards. The matched element is not contained in\nthe subslices.

\n

The last element returned, if any, will contain the remainder of the\nslice.

\n
§Examples
\n
let mut s = [10, 40, 30, 20, 60, 50];\n\nfor group in s.rsplitn_mut(2, |num| *num % 3 == 0) {\n    group[0] = 1;\n}\nassert_eq!(s, [1, 40, 30, 20, 60, 1]);
\n
source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where\n F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified\npredicate.

\n

If any matching elements are present in the slice, returns the prefix\nbefore the match and suffix after. The matching element itself is not\nincluded. If no elements match, returns None.

\n
§Examples
\n
#![feature(slice_split_once)]\nlet s = [1, 2, 3, 2, 4];\nassert_eq!(s.split_once(|&x| x == 2), Some((\n    &[1][..],\n    &[3, 2, 4][..]\n)));\nassert_eq!(s.split_once(|&x| x == 0), None);
\n
source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where\n F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified\npredicate.

\n

If any matching elements are present in the slice, returns the prefix\nbefore the match and suffix after. The matching element itself is not\nincluded. If no elements match, returns None.

\n
§Examples
\n
#![feature(slice_split_once)]\nlet s = [1, 2, 3, 2, 4];\nassert_eq!(s.rsplit_once(|&x| x == 2), Some((\n    &[1, 2, 3][..],\n    &[4][..]\n)));\nassert_eq!(s.rsplit_once(|&x| x == 0), None);
\n
1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where\n T: PartialEq,

Returns true if the slice contains an element with the given value.

\n

This operation is O(n).

\n

Note that if you have a sorted slice, binary_search may be faster.

\n
§Examples
\n
let v = [10, 40, 30];\nassert!(v.contains(&30));\nassert!(!v.contains(&50));
\n

If you do not have a &T, but some other value that you can compare\nwith one (for example, String implements PartialEq<str>), you can\nuse iter().any:

\n\n
let v = [String::from(\"hello\"), String::from(\"world\")]; // slice of `String`\nassert!(v.iter().any(|e| e == \"hello\")); // search with `&str`\nassert!(!v.iter().any(|e| e == \"hi\"));
\n
1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where\n T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

\n
§Examples
\n
let v = [10, 40, 30];\nassert!(v.starts_with(&[10]));\nassert!(v.starts_with(&[10, 40]));\nassert!(v.starts_with(&v));\nassert!(!v.starts_with(&[50]));\nassert!(!v.starts_with(&[10, 50]));
\n

Always returns true if needle is an empty slice:

\n\n
let v = &[10, 40, 30];\nassert!(v.starts_with(&[]));\nlet v: &[u8] = &[];\nassert!(v.starts_with(&[]));
\n
1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where\n T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

\n
§Examples
\n
let v = [10, 40, 30];\nassert!(v.ends_with(&[30]));\nassert!(v.ends_with(&[40, 30]));\nassert!(v.ends_with(&v));\nassert!(!v.ends_with(&[50]));\nassert!(!v.ends_with(&[50, 30]));
\n

Always returns true if needle is an empty slice:

\n\n
let v = &[10, 40, 30];\nassert!(v.ends_with(&[]));\nlet v: &[u8] = &[];\nassert!(v.ends_with(&[]));
\n
1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where\n P: SlicePattern<Item = T> + ?Sized,\n T: PartialEq,

Returns a subslice with the prefix removed.

\n

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some.\nIf prefix is empty, simply returns the original slice. If prefix is equal to the\noriginal slice, returns an empty slice.

\n

If the slice does not start with prefix, returns None.

\n
§Examples
\n
let v = &[10, 40, 30];\nassert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));\nassert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));\nassert_eq!(v.strip_prefix(&[10, 40, 30]), Some(&[][..]));\nassert_eq!(v.strip_prefix(&[50]), None);\nassert_eq!(v.strip_prefix(&[10, 50]), None);\n\nlet prefix : &str = \"he\";\nassert_eq!(b\"hello\".strip_prefix(prefix.as_bytes()),\n           Some(b\"llo\".as_ref()));
\n
1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where\n P: SlicePattern<Item = T> + ?Sized,\n T: PartialEq,

Returns a subslice with the suffix removed.

\n

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some.\nIf suffix is empty, simply returns the original slice. If suffix is equal to the\noriginal slice, returns an empty slice.

\n

If the slice does not end with suffix, returns None.

\n
§Examples
\n
let v = &[10, 40, 30];\nassert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));\nassert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));\nassert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..]));\nassert_eq!(v.strip_suffix(&[50]), None);\nassert_eq!(v.strip_suffix(&[50, 30]), None);
\n
1.0.0 · source

pub fn binary_search(&self, x: &T) -> Result<usize, usize>
where\n T: Ord,

Binary searches this slice for a given element.\nIf the slice is not sorted, the returned result is unspecified and\nmeaningless.

\n

If the value is found then Result::Ok is returned, containing the\nindex of the matching element. If there are multiple matches, then any\none of the matches could be returned. The index is chosen\ndeterministically, but is subject to change in future versions of Rust.\nIf the value is not found then Result::Err is returned, containing\nthe index where a matching element could be inserted while maintaining\nsorted order.

\n

See also binary_search_by, binary_search_by_key, and partition_point.

\n
§Examples
\n

Looks up a series of four elements. The first is found, with a\nuniquely determined position; the second and third are not\nfound; the fourth could match any position in [1, 4].

\n\n
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];\n\nassert_eq!(s.binary_search(&13),  Ok(9));\nassert_eq!(s.binary_search(&4),   Err(7));\nassert_eq!(s.binary_search(&100), Err(13));\nlet r = s.binary_search(&1);\nassert!(match r { Ok(1..=4) => true, _ => false, });
\n

If you want to find that whole range of matching items, rather than\nan arbitrary matching one, that can be done using partition_point:

\n\n
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];\n\nlet low = s.partition_point(|x| x < &1);\nassert_eq!(low, 1);\nlet high = s.partition_point(|x| x <= &1);\nassert_eq!(high, 5);\nlet r = s.binary_search(&1);\nassert!((low..high).contains(&r.unwrap()));\n\nassert!(s[..low].iter().all(|&x| x < 1));\nassert!(s[low..high].iter().all(|&x| x == 1));\nassert!(s[high..].iter().all(|&x| x > 1));\n\n// For something not found, the \"range\" of equal items is empty\nassert_eq!(s.partition_point(|x| x < &11), 9);\nassert_eq!(s.partition_point(|x| x <= &11), 9);\nassert_eq!(s.binary_search(&11), Err(9));
\n

If you want to insert an item to a sorted vector, while maintaining\nsort order, consider using partition_point:

\n\n
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];\nlet num = 42;\nlet idx = s.partition_point(|&x| x <= num);\n// If `num` is unique, `s.partition_point(|&x| x < num)` (with `<`) is equivalent to\n// `s.binary_search(&num).unwrap_or_else(|x| x)`, but using `<=` will allow `insert`\n// to shift less elements.\ns.insert(idx, num);\nassert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
\n
1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where\n F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

\n

The comparator function should return an order code that indicates\nwhether its argument is Less, Equal or Greater the desired\ntarget.\nIf the slice is not sorted or if the comparator function does not\nimplement an order consistent with the sort order of the underlying\nslice, the returned result is unspecified and meaningless.

\n

If the value is found then Result::Ok is returned, containing the\nindex of the matching element. If there are multiple matches, then any\none of the matches could be returned. The index is chosen\ndeterministically, but is subject to change in future versions of Rust.\nIf the value is not found then Result::Err is returned, containing\nthe index where a matching element could be inserted while maintaining\nsorted order.

\n

See also binary_search, binary_search_by_key, and partition_point.

\n
§Examples
\n

Looks up a series of four elements. The first is found, with a\nuniquely determined position; the second and third are not\nfound; the fourth could match any position in [1, 4].

\n\n
let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];\n\nlet seek = 13;\nassert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Ok(9));\nlet seek = 4;\nassert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(7));\nlet seek = 100;\nassert_eq!(s.binary_search_by(|probe| probe.cmp(&seek)), Err(13));\nlet seek = 1;\nlet r = s.binary_search_by(|probe| probe.cmp(&seek));\nassert!(match r { Ok(1..=4) => true, _ => false, });
\n
1.10.0 · source

pub fn binary_search_by_key<'a, B, F>(\n &'a self,\n b: &B,\n f: F,\n) -> Result<usize, usize>
where\n F: FnMut(&'a T) -> B,\n B: Ord,

Binary searches this slice with a key extraction function.

\n

Assumes that the slice is sorted by the key, for instance with\nsort_by_key using the same key extraction function.\nIf the slice is not sorted by the key, the returned result is\nunspecified and meaningless.

\n

If the value is found then Result::Ok is returned, containing the\nindex of the matching element. If there are multiple matches, then any\none of the matches could be returned. The index is chosen\ndeterministically, but is subject to change in future versions of Rust.\nIf the value is not found then Result::Err is returned, containing\nthe index where a matching element could be inserted while maintaining\nsorted order.

\n

See also binary_search, binary_search_by, and partition_point.

\n
§Examples
\n

Looks up a series of four elements in a slice of pairs sorted by\ntheir second elements. The first is found, with a uniquely\ndetermined position; the second and third are not found; the\nfourth could match any position in [1, 4].

\n\n
let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),\n         (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),\n         (1, 21), (2, 34), (4, 55)];\n\nassert_eq!(s.binary_search_by_key(&13, |&(a, b)| b),  Ok(9));\nassert_eq!(s.binary_search_by_key(&4, |&(a, b)| b),   Err(7));\nassert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13));\nlet r = s.binary_search_by_key(&1, |&(a, b)| b);\nassert!(match r { Ok(1..=4) => true, _ => false, });
\n
1.20.0 · source

pub fn sort_unstable(&mut self)
where\n T: Ord,

Sorts the slice without preserving the initial order of equal elements.

\n

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not\nallocate), and O(n * log(n)) worst-case.

\n

If T: Ord does not implement a total order the resulting order is unspecified. All\noriginal elements will remain in the slice and any possible modifications via interior\nmutability are observed in the input. Same is true if T: Ord panics.

\n
§Current implementation
\n

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which\ncombines the fast average case of quicksort with the fast worst case of heapsort, achieving\nlinear time on fully sorted and reversed inputs. On inputs with k distinct elements, the\nexpected time to sort the data is O(n * log(k)).

\n

It is typically faster than stable sorting, except in a few special cases, e.g., when the\nslice is partially sorted.

\n

If T: Ord does not implement a total order, the implementation may panic.

\n
§Examples
\n
let mut v = [-5, 4, 1, -3, 2];\n\nv.sort_unstable();\nassert!(v == [-5, -3, 1, 2, 4]);
\n
1.20.0 · source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where\n F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, without preserving the initial order of\nequal elements.

\n

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not\nallocate), and O(n * log(n)) worst-case.

\n

The comparator function should define a total ordering for the elements in the slice. If the\nordering is not total, the order of the elements is unspecified.

\n

If the comparator function does not implement a total order the resulting order is\nunspecified. All original elements will remain in the slice and any possible modifications\nvia interior mutability are observed in the input. Same is true if the comparator function\npanics. A total order (for all a, b and c):

\n
    \n
  • total and antisymmetric: exactly one of a < b, a == b or a > b is true, and
  • \n
  • transitive, a < b and b < c implies a < c. The same must hold for both == and >.
  • \n
\n

For example, while f64 doesn’t implement Ord because NaN != NaN, we can use\npartial_cmp as our sort function when we know the slice doesn’t contain a NaN.

\n\n
let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];\nfloats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());\nassert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
\n
§Current implementation
\n

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which\ncombines the fast average case of quicksort with the fast worst case of heapsort, achieving\nlinear time on fully sorted and reversed inputs. On inputs with k distinct elements, the\nexpected time to sort the data is O(n * log(k)).

\n

It is typically faster than stable sorting, except in a few special cases, e.g., when the\nslice is partially sorted.

\n

If T: Ord does not implement a total order, the implementation may panic.

\n
§Examples
\n
let mut v = [5, 4, 1, 3, 2];\nv.sort_unstable_by(|a, b| a.cmp(b));\nassert!(v == [1, 2, 3, 4, 5]);\n\n// reverse sorting\nv.sort_unstable_by(|a, b| b.cmp(a));\nassert!(v == [5, 4, 3, 2, 1]);
\n
1.20.0 · source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where\n F: FnMut(&T) -> K,\n K: Ord,

Sorts the slice with a key extraction function, without preserving the initial order of\nequal elements.

\n

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not\nallocate), and O(n * log(n)) worst-case.

\n

If K: Ord does not implement a total order the resulting order is unspecified.\nAll original elements will remain in the slice and any possible modifications via interior\nmutability are observed in the input. Same is true if K: Ord panics.

\n
§Current implementation
\n

The current implementation is based on ipnsort by Lukas Bergdoll and Orson Peters, which\ncombines the fast average case of quicksort with the fast worst case of heapsort, achieving\nlinear time on fully sorted and reversed inputs. On inputs with k distinct elements, the\nexpected time to sort the data is O(n * log(k)).

\n

It is typically faster than stable sorting, except in a few special cases, e.g., when the\nslice is partially sorted.

\n

If K: Ord does not implement a total order, the implementation may panic.

\n
§Examples
\n
let mut v = [-5i32, 4, 1, -3, 2];\n\nv.sort_unstable_by_key(|k| k.abs());\nassert!(v == [1, 2, -3, 4, -5]);
\n
1.49.0 · source

pub fn select_nth_unstable(\n &mut self,\n index: usize,\n) -> (&mut [T], &mut T, &mut [T])
where\n T: Ord,

Reorder the slice such that the element at index after the reordering is at its final\nsorted position.

\n

This reordering has the additional property that any value at position i < index will be\nless than or equal to any value at a position j > index. Additionally, this reordering is\nunstable (i.e. any number of equal elements may end up at position index), in-place (i.e.\ndoes not allocate), and runs in O(n) time. This function is also known as “kth element”\nin other libraries.

\n

It returns a triplet of the following from the reordered slice: the subslice prior to\nindex, the element at index, and the subslice after index; accordingly, the values in\nthose two subslices will respectively all be less-than-or-equal-to and\ngreater-than-or-equal-to the value of the element at index.

\n
§Current implementation
\n

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll\nand Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is\nMedian of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime\nfor all inputs.

\n

It is typically faster than stable sorting, except in a few special cases, e.g., when the\nslice is nearly fully sorted, where slice::sort may be faster.

\n
§Panics
\n

Panics when index >= len(), meaning it always panics on empty slices.

\n
§Examples
\n
let mut v = [-5i32, 4, 2, -3, 1];\n\n// Find the items less than or equal to the median, the median, and greater than or equal to\n// the median.\nlet (lesser, median, greater) = v.select_nth_unstable(2);\n\nassert!(lesser == [-3, -5] || lesser == [-5, -3]);\nassert_eq!(median, &mut 1);\nassert!(greater == [4, 2] || greater == [2, 4]);\n\n// We are only guaranteed the slice will be one of the following, based on the way we sort\n// about the specified index.\nassert!(v == [-3, -5, 1, 2, 4] ||\n        v == [-5, -3, 1, 2, 4] ||\n        v == [-3, -5, 1, 4, 2] ||\n        v == [-5, -3, 1, 4, 2]);
\n
1.49.0 · source

pub fn select_nth_unstable_by<F>(\n &mut self,\n index: usize,\n compare: F,\n) -> (&mut [T], &mut T, &mut [T])
where\n F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index after the\nreordering is at its final sorted position.

\n

This reordering has the additional property that any value at position i < index will be\nless than or equal to any value at a position j > index using the comparator function.\nAdditionally, this reordering is unstable (i.e. any number of equal elements may end up at\nposition index), in-place (i.e. does not allocate), and runs in O(n) time. This\nfunction is also known as “kth element” in other libraries.

\n

It returns a triplet of the following from the slice reordered according to the provided\ncomparator function: the subslice prior to index, the element at index, and the subslice\nafter index; accordingly, the values in those two subslices will respectively all be\nless-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

\n
§Current implementation
\n

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll\nand Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is\nMedian of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime\nfor all inputs.

\n

It is typically faster than stable sorting, except in a few special cases, e.g., when the\nslice is nearly fully sorted, where slice::sort may be faster.

\n
§Panics
\n

Panics when index >= len(), meaning it always panics on empty slices.

\n
§Examples
\n
let mut v = [-5i32, 4, 2, -3, 1];\n\n// Find the items less than or equal to the median, the median, and greater than or equal to\n// the median as if the slice were sorted in descending order.\nlet (lesser, median, greater) = v.select_nth_unstable_by(2, |a, b| b.cmp(a));\n\nassert!(lesser == [4, 2] || lesser == [2, 4]);\nassert_eq!(median, &mut 1);\nassert!(greater == [-3, -5] || greater == [-5, -3]);\n\n// We are only guaranteed the slice will be one of the following, based on the way we sort\n// about the specified index.\nassert!(v == [2, 4, 1, -5, -3] ||\n        v == [2, 4, 1, -3, -5] ||\n        v == [4, 2, 1, -5, -3] ||\n        v == [4, 2, 1, -3, -5]);
\n
1.49.0 · source

pub fn select_nth_unstable_by_key<K, F>(\n &mut self,\n index: usize,\n f: F,\n) -> (&mut [T], &mut T, &mut [T])
where\n F: FnMut(&T) -> K,\n K: Ord,

Reorder the slice with a key extraction function such that the element at index after the\nreordering is at its final sorted position.

\n

This reordering has the additional property that any value at position i < index will be\nless than or equal to any value at a position j > index using the key extraction function.\nAdditionally, this reordering is unstable (i.e. any number of equal elements may end up at\nposition index), in-place (i.e. does not allocate), and runs in O(n) time. This\nfunction is also known as “kth element” in other libraries.

\n

It returns a triplet of the following from the slice reordered according to the provided key\nextraction function: the subslice prior to index, the element at index, and the subslice\nafter index; accordingly, the values in those two subslices will respectively all be\nless-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

\n
§Current implementation
\n

The current algorithm is an introselect implementation based on ipnsort by Lukas Bergdoll\nand Orson Peters, which is also the basis for sort_unstable. The fallback algorithm is\nMedian of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime\nfor all inputs.

\n

It is typically faster than stable sorting, except in a few special cases, e.g., when the\nslice is nearly fully sorted, where slice::sort may be faster.

\n
§Panics
\n

Panics when index >= len(), meaning it always panics on empty slices.

\n
§Examples
\n
let mut v = [-5i32, 4, 1, -3, 2];\n\n// Find the items less than or equal to the median, the median, and greater than or equal to\n// the median as if the slice were sorted according to absolute value.\nlet (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());\n\nassert!(lesser == [1, 2] || lesser == [2, 1]);\nassert_eq!(median, &mut -3);\nassert!(greater == [4, -5] || greater == [-5, 4]);\n\n// We are only guaranteed the slice will be one of the following, based on the way we sort\n// about the specified index.\nassert!(v == [1, 2, -3, 4, -5] ||\n        v == [1, 2, -3, -5, 4] ||\n        v == [2, 1, -3, 4, -5] ||\n        v == [2, 1, -3, -5, 4]);
\n
source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where\n T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the\nPartialEq trait implementation.

\n

Returns two slices. The first contains no consecutive repeated elements.\nThe second contains all the duplicates in no specified order.

\n

If the slice is sorted, the first returned slice contains no duplicates.

\n
§Examples
\n
#![feature(slice_partition_dedup)]\n\nlet mut slice = [1, 2, 2, 3, 3, 2, 1, 1];\n\nlet (dedup, duplicates) = slice.partition_dedup();\n\nassert_eq!(dedup, [1, 2, 3, 2, 1]);\nassert_eq!(duplicates, [2, 3, 1]);
\n
source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where\n F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying\na given equality relation.

\n

Returns two slices. The first contains no consecutive repeated elements.\nThe second contains all the duplicates in no specified order.

\n

The same_bucket function is passed references to two elements from the slice and\nmust determine if the elements compare equal. The elements are passed in opposite order\nfrom their order in the slice, so if same_bucket(a, b) returns true, a is moved\nat the end of the slice.

\n

If the slice is sorted, the first returned slice contains no duplicates.

\n
§Examples
\n
#![feature(slice_partition_dedup)]\n\nlet mut slice = [\"foo\", \"Foo\", \"BAZ\", \"Bar\", \"bar\", \"baz\", \"BAZ\"];\n\nlet (dedup, duplicates) = slice.partition_dedup_by(|a, b| a.eq_ignore_ascii_case(b));\n\nassert_eq!(dedup, [\"foo\", \"BAZ\", \"Bar\", \"baz\"]);\nassert_eq!(duplicates, [\"bar\", \"Foo\", \"BAZ\"]);
\n
source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where\n F: FnMut(&mut T) -> K,\n K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve\nto the same key.

\n

Returns two slices. The first contains no consecutive repeated elements.\nThe second contains all the duplicates in no specified order.

\n

If the slice is sorted, the first returned slice contains no duplicates.

\n
§Examples
\n
#![feature(slice_partition_dedup)]\n\nlet mut slice = [10, 20, 21, 30, 30, 20, 11, 13];\n\nlet (dedup, duplicates) = slice.partition_dedup_by_key(|i| *i / 10);\n\nassert_eq!(dedup, [10, 20, 30, 20, 11]);\nassert_eq!(duplicates, [21, 30, 13]);
\n
1.26.0 · source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the\nslice move to the end while the last self.len() - mid elements move to\nthe front. After calling rotate_left, the element previously at index\nmid will become the first element in the slice.

\n
§Panics
\n

This function will panic if mid is greater than the length of the\nslice. Note that mid == self.len() does not panic and is a no-op\nrotation.

\n
§Complexity
\n

Takes linear (in self.len()) time.

\n
§Examples
\n
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];\na.rotate_left(2);\nassert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
\n

Rotating a subslice:

\n\n
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];\na[1..5].rotate_left(1);\nassert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
\n
1.26.0 · source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k\nelements of the slice move to the end while the last k elements move\nto the front. After calling rotate_right, the element previously at\nindex self.len() - k will become the first element in the slice.

\n
§Panics
\n

This function will panic if k is greater than the length of the\nslice. Note that k == self.len() does not panic and is a no-op\nrotation.

\n
§Complexity
\n

Takes linear (in self.len()) time.

\n
§Examples
\n
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];\na.rotate_right(2);\nassert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
\n

Rotating a subslice:

\n\n
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];\na[1..5].rotate_right(1);\nassert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
\n
1.50.0 · source

pub fn fill(&mut self, value: T)
where\n T: Clone,

Fills self with elements by cloning value.

\n
§Examples
\n
let mut buf = vec![0; 10];\nbuf.fill(1);\nassert_eq!(buf, vec![1; 10]);
\n
1.51.0 · source

pub fn fill_with<F>(&mut self, f: F)
where\n F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

\n

This method uses a closure to create new values. If you’d rather\nClone a given value, use fill. If you want to use the Default\ntrait to generate values, you can pass Default::default as the\nargument.

\n
§Examples
\n
let mut buf = vec![1; 10];\nbuf.fill_with(Default::default);\nassert_eq!(buf, vec![0; 10]);
\n
1.7.0 · source

pub fn clone_from_slice(&mut self, src: &[T])
where\n T: Clone,

Copies the elements from src into self.

\n

The length of src must be the same as self.

\n
§Panics
\n

This function will panic if the two slices have different lengths.

\n
§Examples
\n

Cloning two elements from a slice into another:

\n\n
let src = [1, 2, 3, 4];\nlet mut dst = [0, 0];\n\n// Because the slices have to be the same length,\n// we slice the source slice from four elements\n// to two. It will panic if we don't do this.\ndst.clone_from_slice(&src[2..]);\n\nassert_eq!(src, [1, 2, 3, 4]);\nassert_eq!(dst, [3, 4]);
\n

Rust enforces that there can only be one mutable reference with no\nimmutable references to a particular piece of data in a particular\nscope. Because of this, attempting to use clone_from_slice on a\nsingle slice will result in a compile failure:

\n\n
let mut slice = [1, 2, 3, 4, 5];\n\nslice[..2].clone_from_slice(&slice[3..]); // compile fail!
\n

To work around this, we can use split_at_mut to create two distinct\nsub-slices from a slice:

\n\n
let mut slice = [1, 2, 3, 4, 5];\n\n{\n    let (left, right) = slice.split_at_mut(2);\n    left.clone_from_slice(&right[1..]);\n}\n\nassert_eq!(slice, [4, 5, 3, 4, 5]);
\n
1.9.0 · source

pub fn copy_from_slice(&mut self, src: &[T])
where\n T: Copy,

Copies all elements from src into self, using a memcpy.

\n

The length of src must be the same as self.

\n

If T does not implement Copy, use clone_from_slice.

\n
§Panics
\n

This function will panic if the two slices have different lengths.

\n
§Examples
\n

Copying two elements from a slice into another:

\n\n
let src = [1, 2, 3, 4];\nlet mut dst = [0, 0];\n\n// Because the slices have to be the same length,\n// we slice the source slice from four elements\n// to two. It will panic if we don't do this.\ndst.copy_from_slice(&src[2..]);\n\nassert_eq!(src, [1, 2, 3, 4]);\nassert_eq!(dst, [3, 4]);
\n

Rust enforces that there can only be one mutable reference with no\nimmutable references to a particular piece of data in a particular\nscope. Because of this, attempting to use copy_from_slice on a\nsingle slice will result in a compile failure:

\n\n
let mut slice = [1, 2, 3, 4, 5];\n\nslice[..2].copy_from_slice(&slice[3..]); // compile fail!
\n

To work around this, we can use split_at_mut to create two distinct\nsub-slices from a slice:

\n\n
let mut slice = [1, 2, 3, 4, 5];\n\n{\n    let (left, right) = slice.split_at_mut(2);\n    left.copy_from_slice(&right[1..]);\n}\n\nassert_eq!(slice, [4, 5, 3, 4, 5]);
\n
1.37.0 · source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where\n R: RangeBounds<usize>,\n T: Copy,

Copies elements from one part of the slice to another part of itself,\nusing a memmove.

\n

src is the range within self to copy from. dest is the starting\nindex of the range within self to copy to, which will have the same\nlength as src. The two ranges may overlap. The ends of the two ranges\nmust be less than or equal to self.len().

\n
§Panics
\n

This function will panic if either range exceeds the end of the slice,\nor if the end of src is before the start.

\n
§Examples
\n

Copying four bytes within a slice:

\n\n
let mut bytes = *b\"Hello, World!\";\n\nbytes.copy_within(1..5, 8);\n\nassert_eq!(&bytes, b\"Hello, Wello!\");
\n
1.27.0 · source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

\n

The length of other must be the same as self.

\n
§Panics
\n

This function will panic if the two slices have different lengths.

\n
§Example
\n

Swapping two elements across slices:

\n\n
let mut slice1 = [0, 0];\nlet mut slice2 = [1, 2, 3, 4];\n\nslice1.swap_with_slice(&mut slice2[2..]);\n\nassert_eq!(slice1, [3, 4]);\nassert_eq!(slice2, [1, 2, 0, 0]);
\n

Rust enforces that there can only be one mutable reference to a\nparticular piece of data in a particular scope. Because of this,\nattempting to use swap_with_slice on a single slice will result in\na compile failure:

\n\n
let mut slice = [1, 2, 3, 4, 5];\nslice[..2].swap_with_slice(&mut slice[3..]); // compile fail!
\n

To work around this, we can use split_at_mut to create two distinct\nmutable sub-slices from a slice:

\n\n
let mut slice = [1, 2, 3, 4, 5];\n\n{\n    let (left, right) = slice.split_at_mut(2);\n    left.swap_with_slice(&mut right[1..]);\n}\n\nassert_eq!(slice, [4, 5, 3, 1, 2]);
\n
1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is\nmaintained.

\n

This method splits the slice into three distinct slices: prefix, correctly aligned middle\nslice of a new type, and the suffix slice. The middle part will be as big as possible under\nthe given alignment constraint and element size.

\n

This method has no purpose when either input element T or output element U are\nzero-sized and will return the original slice without splitting anything.

\n
§Safety
\n

This method is essentially a transmute with respect to the elements in the returned\nmiddle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

\n
§Examples
\n

Basic usage:

\n\n
unsafe {\n    let bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];\n    let (prefix, shorts, suffix) = bytes.align_to::<u16>();\n    // less_efficient_algorithm_for_bytes(prefix);\n    // more_efficient_algorithm_for_aligned_shorts(shorts);\n    // less_efficient_algorithm_for_bytes(suffix);\n}
\n
1.30.0 · source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the\ntypes is maintained.

\n

This method splits the slice into three distinct slices: prefix, correctly aligned middle\nslice of a new type, and the suffix slice. The middle part will be as big as possible under\nthe given alignment constraint and element size.

\n

This method has no purpose when either input element T or output element U are\nzero-sized and will return the original slice without splitting anything.

\n
§Safety
\n

This method is essentially a transmute with respect to the elements in the returned\nmiddle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

\n
§Examples
\n

Basic usage:

\n\n
unsafe {\n    let mut bytes: [u8; 7] = [1, 2, 3, 4, 5, 6, 7];\n    let (prefix, shorts, suffix) = bytes.align_to_mut::<u16>();\n    // less_efficient_algorithm_for_bytes(prefix);\n    // more_efficient_algorithm_for_aligned_shorts(shorts);\n    // less_efficient_algorithm_for_bytes(suffix);\n}
\n
source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where\n Simd<T, LANES>: AsRef<[T; LANES]>,\n T: SimdElement,\n LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

\n

This is a safe wrapper around slice::align_to, so has the same weak\npostconditions as that method. You’re only assured that\nself.len() == prefix.len() + middle.len() * LANES + suffix.len().

\n

Notably, all of the following are possible:

\n
    \n
  • prefix.len() >= LANES.
  • \n
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • \n
  • suffix.len() >= LANES.
  • \n
\n

That said, this is a safe method, so if you’re only writing safe code,\nthen this can at most cause incorrect logic, not unsoundness.

\n
§Panics
\n

This will panic if the size of the SIMD type is different from\nLANES times that of the scalar.

\n

At the time of writing, the trait restrictions on Simd<T, LANES> keeps\nthat from ever happening, as only power-of-two numbers of lanes are\nsupported. It’s possible that, in the future, those restrictions might\nbe lifted in a way that would make it possible to see panics from this\nmethod for something like LANES == 3.

\n
§Examples
\n
#![feature(portable_simd)]\nuse core::simd::prelude::*;\n\nlet short = &[1, 2, 3];\nlet (prefix, middle, suffix) = short.as_simd::<4>();\nassert_eq!(middle, []); // Not enough elements for anything in the middle\n\n// They might be split in any possible way between prefix and suffix\nlet it = prefix.iter().chain(suffix).copied();\nassert_eq!(it.collect::<Vec<_>>(), vec![1, 2, 3]);\n\nfn basic_simd_sum(x: &[f32]) -> f32 {\n    use std::ops::Add;\n    let (prefix, middle, suffix) = x.as_simd();\n    let sums = f32x4::from_array([\n        prefix.iter().copied().sum(),\n        0.0,\n        0.0,\n        suffix.iter().copied().sum(),\n    ]);\n    let sums = middle.iter().copied().fold(sums, f32x4::add);\n    sums.reduce_sum()\n}\n\nlet numbers: Vec<f32> = (1..101).map(|x| x as _).collect();\nassert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
\n
source

pub fn as_simd_mut<const LANES: usize>(\n &mut self,\n) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where\n Simd<T, LANES>: AsMut<[T; LANES]>,\n T: SimdElement,\n LaneCount<LANES>: SupportedLaneCount,

🔬This is a nightly-only experimental API. (portable_simd)

Split a mutable slice into a mutable prefix, a middle of aligned SIMD types,\nand a mutable suffix.

\n

This is a safe wrapper around slice::align_to_mut, so has the same weak\npostconditions as that method. You’re only assured that\nself.len() == prefix.len() + middle.len() * LANES + suffix.len().

\n

Notably, all of the following are possible:

\n
    \n
  • prefix.len() >= LANES.
  • \n
  • middle.is_empty() despite self.len() >= 3 * LANES.
  • \n
  • suffix.len() >= LANES.
  • \n
\n

That said, this is a safe method, so if you’re only writing safe code,\nthen this can at most cause incorrect logic, not unsoundness.

\n

This is the mutable version of slice::as_simd; see that for examples.

\n
§Panics
\n

This will panic if the size of the SIMD type is different from\nLANES times that of the scalar.

\n

At the time of writing, the trait restrictions on Simd<T, LANES> keeps\nthat from ever happening, as only power-of-two numbers of lanes are\nsupported. It’s possible that, in the future, those restrictions might\nbe lifted in a way that would make it possible to see panics from this\nmethod for something like LANES == 3.

\n
source

pub fn is_sorted(&self) -> bool
where\n T: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

\n

That is, for each element a and its following element b, a <= b must hold. If the\nslice yields exactly zero or one element, true is returned.

\n

Note that if Self::Item is only PartialOrd, but not Ord, the above definition\nimplies that this function returns false if any two consecutive items are not\ncomparable.

\n
§Examples
\n
#![feature(is_sorted)]\nlet empty: [i32; 0] = [];\n\nassert!([1, 2, 2, 9].is_sorted());\nassert!(![1, 3, 2, 4].is_sorted());\nassert!([0].is_sorted());\nassert!(empty.is_sorted());\nassert!(![0.0, 1.0, f32::NAN].is_sorted());
\n
source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where\n F: FnMut(&'a T, &'a T) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

\n

Instead of using PartialOrd::partial_cmp, this function uses the given compare\nfunction to determine whether two elements are to be considered in sorted order.

\n
§Examples
\n
#![feature(is_sorted)]\n\nassert!([1, 2, 2, 9].is_sorted_by(|a, b| a <= b));\nassert!(![1, 2, 2, 9].is_sorted_by(|a, b| a < b));\n\nassert!([0].is_sorted_by(|a, b| true));\nassert!([0].is_sorted_by(|a, b| false));\n\nlet empty: [i32; 0] = [];\nassert!(empty.is_sorted_by(|a, b| false));\nassert!(empty.is_sorted_by(|a, b| true));
\n
source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where\n F: FnMut(&'a T) -> K,\n K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

\n

Instead of comparing the slice’s elements directly, this function compares the keys of the\nelements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its\ndocumentation for more information.

\n
§Examples
\n
#![feature(is_sorted)]\n\nassert!([\"c\", \"bb\", \"aaa\"].is_sorted_by_key(|s| s.len()));\nassert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
\n
1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where\n P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate\n(the index of the first element of the second partition).

\n

The slice is assumed to be partitioned according to the given predicate.\nThis means that all elements for which the predicate returns true are at the start of the slice\nand all elements for which the predicate returns false are at the end.\nFor example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predicate x % 2 != 0\n(all odd numbers are at the start, all even at the end).

\n

If this slice is not partitioned, the returned result is unspecified and meaningless,\nas this method performs a kind of binary search.

\n

See also binary_search, binary_search_by, and binary_search_by_key.

\n
§Examples
\n
let v = [1, 2, 3, 3, 5, 6, 7];\nlet i = v.partition_point(|&x| x < 5);\n\nassert_eq!(i, 4);\nassert!(v[..i].iter().all(|&x| x < 5));\nassert!(v[i..].iter().all(|&x| !(x < 5)));
\n

If all elements of the slice match the predicate, including if the slice\nis empty, then the length of the slice will be returned:

\n\n
let a = [2, 4, 8];\nassert_eq!(a.partition_point(|x| x < &100), a.len());\nlet a: [i32; 0] = [];\nassert_eq!(a.partition_point(|x| x < &100), 0);
\n

If you want to insert an item to a sorted vector, while maintaining\nsort order:

\n\n
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];\nlet num = 42;\nlet idx = s.partition_point(|&x| x <= num);\ns.insert(idx, num);\nassert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
\n
source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where\n R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range\nand returns a reference to it.

\n

Returns None and does not modify the slice if the given\nrange is out of bounds.

\n

Note that this method only accepts one-sided ranges such as\n2.. or ..6, but not 2..6.

\n
§Examples
\n

Taking the first three elements of a slice:

\n\n
#![feature(slice_take)]\n\nlet mut slice: &[_] = &['a', 'b', 'c', 'd'];\nlet mut first_three = slice.take(..3).unwrap();\n\nassert_eq!(slice, &['d']);\nassert_eq!(first_three, &['a', 'b', 'c']);
\n

Taking the last two elements of a slice:

\n\n
#![feature(slice_take)]\n\nlet mut slice: &[_] = &['a', 'b', 'c', 'd'];\nlet mut tail = slice.take(2..).unwrap();\n\nassert_eq!(slice, &['a', 'b']);\nassert_eq!(tail, &['c', 'd']);
\n

Getting None when range is out of bounds:

\n\n
#![feature(slice_take)]\n\nlet mut slice: &[_] = &['a', 'b', 'c', 'd'];\n\nassert_eq!(None, slice.take(5..));\nassert_eq!(None, slice.take(..5));\nassert_eq!(None, slice.take(..=4));\nlet expected: &[char] = &['a', 'b', 'c', 'd'];\nassert_eq!(Some(expected), slice.take(..4));
\n
source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where\n R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range\nand returns a mutable reference to it.

\n

Returns None and does not modify the slice if the given\nrange is out of bounds.

\n

Note that this method only accepts one-sided ranges such as\n2.. or ..6, but not 2..6.

\n
§Examples
\n

Taking the first three elements of a slice:

\n\n
#![feature(slice_take)]\n\nlet mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];\nlet mut first_three = slice.take_mut(..3).unwrap();\n\nassert_eq!(slice, &mut ['d']);\nassert_eq!(first_three, &mut ['a', 'b', 'c']);
\n

Taking the last two elements of a slice:

\n\n
#![feature(slice_take)]\n\nlet mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];\nlet mut tail = slice.take_mut(2..).unwrap();\n\nassert_eq!(slice, &mut ['a', 'b']);\nassert_eq!(tail, &mut ['c', 'd']);
\n

Getting None when range is out of bounds:

\n\n
#![feature(slice_take)]\n\nlet mut slice: &mut [_] = &mut ['a', 'b', 'c', 'd'];\n\nassert_eq!(None, slice.take_mut(5..));\nassert_eq!(None, slice.take_mut(..5));\nassert_eq!(None, slice.take_mut(..=4));\nlet expected: &mut [_] = &mut ['a', 'b', 'c', 'd'];\nassert_eq!(Some(expected), slice.take_mut(..4));
\n
source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference\nto it.

\n

Returns None if the slice is empty.

\n
§Examples
\n
#![feature(slice_take)]\n\nlet mut slice: &[_] = &['a', 'b', 'c'];\nlet first = slice.take_first().unwrap();\n\nassert_eq!(slice, &['b', 'c']);\nassert_eq!(first, &'a');
\n
source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable\nreference to it.

\n

Returns None if the slice is empty.

\n
§Examples
\n
#![feature(slice_take)]\n\nlet mut slice: &mut [_] = &mut ['a', 'b', 'c'];\nlet first = slice.take_first_mut().unwrap();\n*first = 'd';\n\nassert_eq!(slice, &['b', 'c']);\nassert_eq!(first, &'d');
\n
source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference\nto it.

\n

Returns None if the slice is empty.

\n
§Examples
\n
#![feature(slice_take)]\n\nlet mut slice: &[_] = &['a', 'b', 'c'];\nlet last = slice.take_last().unwrap();\n\nassert_eq!(slice, &['a', 'b']);\nassert_eq!(last, &'c');
\n
source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable\nreference to it.

\n

Returns None if the slice is empty.

\n
§Examples
\n
#![feature(slice_take)]\n\nlet mut slice: &mut [_] = &mut ['a', 'b', 'c'];\nlet last = slice.take_last_mut().unwrap();\n*last = 'd';\n\nassert_eq!(slice, &['a', 'b']);\nassert_eq!(last, &'d');
\n
source

pub unsafe fn get_many_unchecked_mut<const N: usize>(\n &mut self,\n indices: [usize; N],\n) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

\n

For a safe alternative see get_many_mut.

\n
§Safety
\n

Calling this method with overlapping or out-of-bounds indices is undefined behavior\neven if the resulting references are not used.

\n
§Examples
\n
#![feature(get_many_mut)]\n\nlet x = &mut [1, 2, 4];\n\nunsafe {\n    let [a, b] = x.get_many_unchecked_mut([0, 2]);\n    *a *= 10;\n    *b *= 100;\n}\nassert_eq!(x, &[10, 2, 400]);
\n
source

pub fn get_many_mut<const N: usize>(\n &mut self,\n indices: [usize; N],\n) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

\n

Returns an error if any index is out-of-bounds, or if the same index was\npassed more than once.

\n
§Examples
\n
#![feature(get_many_mut)]\n\nlet v = &mut [1, 2, 3];\nif let Ok([a, b]) = v.get_many_mut([0, 2]) {\n    *a = 413;\n    *b = 612;\n}\nassert_eq!(v, &[413, 2, 612]);
\n
",0,"oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> AsBytes for [T]
where\n T: AsBytes,

§

fn as_bytes(&self) -> &[u8]

Gets the bytes of this value. Read more
§

fn write_to(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to bytes. Read more
§

fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to the prefix of bytes. Read more
§

fn write_to_suffix(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to the suffix of bytes. Read more
","AsBytes","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T> AsMut<[T]> for [T]

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
","AsMut<[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T> AsRef<[T]> for [T]

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
","AsRef<[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> BatchInvert<[T]> for T
where\n T: Mul<Output = T> + Invert<Output = CtOption<T>> + Copy + Default + ConditionallySelectable,

§

type Output = Vec<T>

The output of batch inversion. A container of field elements.
§

fn batch_invert(field_elements: &[T]) -> CtOption<Vec<T>>

Invert a batch of field elements.
","BatchInvert<[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> CloneToUninit for [T]
where\n T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut [T])

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
","CloneToUninit","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> CloneToUninit for [T]
where\n T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut [T])

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
","CloneToUninit","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T, V> Concat<T> for [V]
where\n T: Clone,\n V: Borrow<[T]>,

§

type Output = Vec<T>

🔬This is a nightly-only experimental API. (slice_concat_trait)
The resulting type after concatenation
source§

fn concat(slice: &[V]) -> Vec<T>

🔬This is a nightly-only experimental API. (slice_concat_trait)
Implementation of [T]::concat
","Concat","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<S> Concat<str> for [S]
where\n S: Borrow<str>,

Note: str in Concat<str> is not meaningful here.\nThis type parameter of the trait only exists to enable another impl.

\n
§

type Output = String

🔬This is a nightly-only experimental API. (slice_concat_trait)
The resulting type after concatenation
source§

fn concat(slice: &[S]) -> String

🔬This is a nightly-only experimental API. (slice_concat_trait)
Implementation of [T]::concat
","Concat","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> ConstantTimeEq for [T]
where\n T: ConstantTimeEq,

source§

fn ct_eq(&self, _rhs: &[T]) -> Choice

Check whether two slices of ConstantTimeEq types are equal.

\n
§Note
\n

This function short-circuits if the lengths of the input slices\nare different. Otherwise, it should execute in time independent\nof the slice contents.

\n

Since arrays coerce to slices, this function works with fixed-size arrays:

\n\n
let a: [u8; 8] = [0,1,2,3,4,5,6,7];\nlet b: [u8; 8] = [0,1,2,3,0,1,2,3];\n\nlet a_eq_a = a.ct_eq(&a);\nlet a_eq_b = a.ct_eq(&b);\n\nassert_eq!(a_eq_a.unwrap_u8(), 1);\nassert_eq!(a_eq_b.unwrap_u8(), 0);
\n
","ConstantTimeEq","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> ConstantTimeEq for [T]
where\n T: ConstantTimeEq,

source§

fn ct_eq(&self, _rhs: &[T]) -> Choice

Check whether two slices of ConstantTimeEq types are equal.

\n
§Note
\n

This function short-circuits if the lengths of the input slices\nare different. Otherwise, it should execute in time independent\nof the slice contents.

\n

Since arrays coerce to slices, this function works with fixed-size arrays:

\n\n
let a: [u8; 8] = [0,1,2,3,4,5,6,7];\nlet b: [u8; 8] = [0,1,2,3,0,1,2,3];\n\nlet a_eq_a = a.ct_eq(&a);\nlet a_eq_b = a.ct_eq(&b);\n\nassert_eq!(a_eq_a.unwrap_u8(), 1);\nassert_eq!(a_eq_b.unwrap_u8(), 0);
\n
source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
","ConstantTimeEq","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> DEREncodable for [T]
where\n T: DEREncodable,

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> DEREncodable for [T]
where\n T: DEREncodable,

§

fn encode_der(&self, writer: DERWriter<'_>)

Writes the value as an DER-encoded ASN.1 value. Read more
","DEREncodable","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T> Debug for [T]
where\n T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> FromZeroes for [T]
where\n T: FromZeroes,

§

fn zero(&mut self)

Overwrites self with zeroes. Read more
","FromZeroes","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T> Hash for [T]
where\n T: Hash,

source§

fn hash<H>(&self, state: &mut H)
where\n H: Hasher,

Feeds this value into the given Hasher. Read more
","Hash","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T, I> Index<I> for [T]
where\n I: SliceIndex<[T]>,

§

type Output = <I as SliceIndex<[T]>>::Output

The returned type after indexing.
source§

fn index(&self, index: I) -> &<I as SliceIndex<[T]>>::Output

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> Index<PatternID> for [T]

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: PatternID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> Index<PatternID> for [T]

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: PatternID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> Index<SmallIndex> for [T]

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: SmallIndex) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> Index<SmallIndex> for [T]

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: SmallIndex) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> Index<StateID> for [T]

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: StateID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> Index<StateID> for [T]

§

type Output = T

The returned type after indexing.
§

fn index(&self, index: StateID) -> &T

Performs the indexing (container[index]) operation. Read more
","Index","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T, I> IndexMut<I> for [T]
where\n I: SliceIndex<[T]>,

source§

fn index_mut(&mut self, index: I) -> &mut <I as SliceIndex<[T]>>::Output

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> IndexMut<PatternID> for [T]

§

fn index_mut(&mut self, index: PatternID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> IndexMut<PatternID> for [T]

§

fn index_mut(&mut self, index: PatternID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> IndexMut<SmallIndex> for [T]

§

fn index_mut(&mut self, index: SmallIndex) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> IndexMut<SmallIndex> for [T]

§

fn index_mut(&mut self, index: SmallIndex) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> IndexMut<StateID> for [T]

§

fn index_mut(&mut self, index: StateID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> IndexMut<StateID> for [T]

§

fn index_mut(&mut self, index: StateID) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
","IndexMut","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.80.0 · source§

impl<T> !Iterator for [T]

§

type Item

The type of the elements being iterated over.
1.0.0 · source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
","Iterator","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T, V> Join<&[T]> for [V]
where\n T: Clone,\n V: Borrow<[T]>,

§

type Output = Vec<T>

🔬This is a nightly-only experimental API. (slice_concat_trait)
The resulting type after concatenation
source§

fn join(slice: &[V], sep: &[T]) -> Vec<T>

🔬This is a nightly-only experimental API. (slice_concat_trait)
Implementation of [T]::join
","Join<&[T]>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<S> Join<&OsStr> for [S]
where\n S: Borrow<OsStr>,

§

type Output = OsString

🔬This is a nightly-only experimental API. (slice_concat_trait)
The resulting type after concatenation
source§

fn join(slice: &[S], sep: &OsStr) -> OsString

🔬This is a nightly-only experimental API. (slice_concat_trait)
Implementation of [T]::join
","Join<&OsStr>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T, V> Join<&T> for [V]
where\n T: Clone,\n V: Borrow<[T]>,

§

type Output = Vec<T>

🔬This is a nightly-only experimental API. (slice_concat_trait)
The resulting type after concatenation
source§

fn join(slice: &[V], sep: &T) -> Vec<T>

🔬This is a nightly-only experimental API. (slice_concat_trait)
Implementation of [T]::join
","Join<&T>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<S> Join<&str> for [S]
where\n S: Borrow<str>,

§

type Output = String

🔬This is a nightly-only experimental API. (slice_concat_trait)
The resulting type after concatenation
source§

fn join(slice: &[S], sep: &str) -> String

🔬This is a nightly-only experimental API. (slice_concat_trait)
Implementation of [T]::join
","Join<&str>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T> Ord for [T]
where\n T: Ord,

Implements comparison of slices lexicographically.

\n
source§

fn cmp(&self, other: &[T]) -> Ordering

This method returns an Ordering between self and other. Read more
","Ord","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> Parse for [T]

§

type PositionRepr = usize

§

fn start(&self) -> usize

§

fn is_eof(&self, pos: usize) -> bool

§

fn position_repr(&self, pos: usize) -> usize

","Parse","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<'input, T> ParseElem<'input> for [T]
where\n T: 'input + Copy,

§

type Element = T

Type of a single atomic element of the input, for example a character or token
§

fn parse_elem(&'input self, pos: usize) -> RuleResult<T>

Get the element at pos, or Failed if past end of input.
","ParseElem<'input>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<'input, T> ParseSlice<'input> for [T]
where\n T: 'input,

§

type Slice = &'input [T]

Type of a slice of the input.
§

fn parse_slice(&'input self, p1: usize, p2: usize) -> &'input [T]

Get a slice of input.
","ParseSlice<'input>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T, U> PartialEq<[U]> for [T]
where\n T: PartialEq<U>,

source§

fn eq(&self, other: &[U]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &[U]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<[U]>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T, U, const N: usize> PartialEq<[U; N]> for [T]
where\n T: PartialEq<U>,

source§

fn eq(&self, other: &[U; N]) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &[U; N]) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq<[U; N]>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T, U, A> PartialEq<Vec<U, A>> for [T]
where\n A: Allocator,\n T: PartialEq<U>,

§

fn eq(&self, other: &Vec<U, A>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
§

fn ne(&self, other: &Vec<U, A>) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.48.0 · source§

impl<T, U, A> PartialEq<Vec<U, A>> for [T]
where\n A: Allocator,\n T: PartialEq<U>,

source§

fn eq(&self, other: &Vec<U, A>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
source§

fn ne(&self, other: &Vec<U, A>) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq>","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T> PartialOrd for [T]
where\n T: PartialOrd,

Implements comparison of slices lexicographically.

\n
source§

fn partial_cmp(&self, other: &[T]) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> Serialize for [T]
where\n T: Serialize,

source§

fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where\n S: Serializer,

Serialize this value into the given Serde serializer. Read more
","Serialize","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> SliceExt<T> for [T]

§

fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where\n A: Allocator,\n T: Clone,

Copies self into a new Vec with an allocator. Read more
§

fn repeat(&self, n: usize) -> Vec<T>
where\n T: Copy,

Creates a vector by copying a slice n times. Read more
","SliceExt","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.51.0 · source§

impl<T> SlicePattern for [T]

§

type Item = T

🔬This is a nightly-only experimental API. (slice_pattern)
The element type of the slice being matched on.
source§

fn as_slice(&self) -> &[<[T] as SlicePattern>::Item]

🔬This is a nightly-only experimental API. (slice_pattern)
Currently, the consumers of SlicePattern need a slice.
","SlicePattern","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> SliceRandom for [T]

§

type Item = T

The element type.
source§

fn choose<R>(&self, rng: &mut R) -> Option<&<[T] as SliceRandom>::Item>
where\n R: Rng + ?Sized,

Returns a reference to one random element of the slice, or None if the\nslice is empty. Read more
source§

fn choose_mut<R>(\n &mut self,\n rng: &mut R,\n) -> Option<&mut <[T] as SliceRandom>::Item>
where\n R: Rng + ?Sized,

Returns a mutable reference to one random element of the slice, or\nNone if the slice is empty. Read more
source§

fn choose_multiple<R>(\n &self,\n rng: &mut R,\n amount: usize,\n) -> SliceChooseIter<'_, [T], <[T] as SliceRandom>::Item>
where\n R: Rng + ?Sized,

Chooses amount elements from the slice at random, without repetition,\nand in random order. The returned iterator is appropriate both for\ncollection into a Vec and filling an existing buffer (see example). Read more
source§

fn choose_weighted<R, F, B, X>(\n &self,\n rng: &mut R,\n weight: F,\n) -> Result<&<[T] as SliceRandom>::Item, WeightedError>
where\n R: Rng + ?Sized,\n F: Fn(&<[T] as SliceRandom>::Item) -> B,\n B: SampleBorrow<X>,\n X: SampleUniform + for<'a> AddAssign<&'a X> + PartialOrd + Clone + Default,

Similar to choose, but where the likelihood of each outcome may be\nspecified. Read more
source§

fn choose_weighted_mut<R, F, B, X>(\n &mut self,\n rng: &mut R,\n weight: F,\n) -> Result<&mut <[T] as SliceRandom>::Item, WeightedError>
where\n R: Rng + ?Sized,\n F: Fn(&<[T] as SliceRandom>::Item) -> B,\n B: SampleBorrow<X>,\n X: SampleUniform + for<'a> AddAssign<&'a X> + PartialOrd + Clone + Default,

Similar to choose_mut, but where the likelihood of each outcome may\nbe specified. Read more
source§

fn choose_multiple_weighted<R, F, X>(\n &self,\n rng: &mut R,\n amount: usize,\n weight: F,\n) -> Result<SliceChooseIter<'_, [T], <[T] as SliceRandom>::Item>, WeightedError>
where\n R: Rng + ?Sized,\n F: Fn(&<[T] as SliceRandom>::Item) -> X,\n X: Into<f64>,

Similar to choose_multiple, but where the likelihood of each element’s\ninclusion in the output may be specified. The elements are returned in an\narbitrary, unspecified order. Read more
source§

fn shuffle<R>(&mut self, rng: &mut R)
where\n R: Rng + ?Sized,

Shuffle a mutable slice in place. Read more
source§

fn partial_shuffle<R>(\n &mut self,\n rng: &mut R,\n amount: usize,\n) -> (&mut [<[T] as SliceRandom>::Item], &mut [<[T] as SliceRandom>::Item])
where\n R: Rng + ?Sized,

Shuffle a slice in place, but exit early. Read more
","SliceRandom","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T> ToOwned for [T]
where\n T: Clone,

§

type Owned = Vec<T>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Vec<T>

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut Vec<T>)

Uses borrowed data to replace owned data, usually by cloning. Read more
","ToOwned","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<A> ToSmallVec<A> for [<A as Array>::Item]
where\n A: Array,\n <A as Array>::Item: Copy,

§

fn to_smallvec(&self) -> SmallVec<A>

Construct a new SmallVec from a slice.
","ToSmallVec","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<Z> Zeroize for [Z]
where\n Z: DefaultIsZeroes,

Impl [Zeroize] on slices of types that can be zeroized with Default.

\n

This impl can eventually be optimized using an memset intrinsic,\nsuch as core::intrinsics::volatile_set_memory. For that reason the\nblanket impl on slices is bounded by [DefaultIsZeroes].

\n

To zeroize a mut slice of Z: Zeroize which does not impl\n[DefaultIsZeroes], call iter_mut().zeroize().

\n
§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the\nzeroization operation is not “optimized away” by the compiler.
","Zeroize","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> ConstParamTy for [T]
where\n T: ConstParamTy,

","ConstParamTy","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
1.0.0 · source§

impl<T> Eq for [T]
where\n T: Eq,

","Eq","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> FromBytes for [T]
where\n T: FromBytes,

","FromBytes","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
source§

impl<T> StructuralPartialEq for [T]

","StructuralPartialEq","oasis_runtime_sdk::crypto::multisig::SignatureSet"],["
§

impl<T> Unaligned for [T]
where\n T: Unaligned,

","Unaligned","oasis_runtime_sdk::crypto::multisig::SignatureSet"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/std/primitive.tuple.js b/rust/type.impl/std/primitive.tuple.js new file mode 100644 index 0000000000..7e75804b6d --- /dev/null +++ b/rust/type.impl/std/primitive.tuple.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
source§

impl<TupleElement0: KeyFormatAtom, TupleElement1: KeyFormatAtom, TupleElement2: KeyFormatAtom> KeyFormatAtom for (TupleElement0, TupleElement1, TupleElement2)

","KeyFormatAtom","oasis_core_runtime::enclave_rpc::sessions::SessionByTimeKey"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/std/primitive.u16.js b/rust/type.impl/std/primitive.u16.js new file mode 100644 index 0000000000..75ab34525b --- /dev/null +++ b/rust/type.impl/std/primitive.u16.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
source§

impl Marshal for u16

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

Marshal the object into a binary form and return it as a new vector.
source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

Unmarshal from the given byte slice reference and modify self.
","Marshal","oasis_core_runtime::storage::mkvs::tree::node::Depth"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/rust/type.impl/std/primitive.u64.js b/rust/type.impl/std/primitive.u64.js new file mode 100644 index 0000000000..4fcaa1ec08 --- /dev/null +++ b/rust/type.impl/std/primitive.u64.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"oasis_core_runtime":[["
source§

impl From<Version> for u64

source§

fn from(val: Version) -> Self

Converts to this type from the input type.
","From","oasis_core_runtime::consensus::beacon::EpochTime","oasis_core_runtime::consensus::transaction::Gas"],["
source§

impl KeyFormatAtom for u64

source§

fn size() -> usize

source§

fn encode_atom(self) -> Vec<u8>

source§

fn decode_atom(data: &[u8]) -> Self
where\n Self: Sized,

","KeyFormatAtom","oasis_core_runtime::consensus::beacon::EpochTime","oasis_core_runtime::consensus::transaction::Gas"],["
source§

impl Marshal for u64

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

Marshal the object into a binary form and return it as a new vector.
source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

Unmarshal from the given byte slice reference and modify self.
","Marshal","oasis_core_runtime::consensus::beacon::EpochTime","oasis_core_runtime::consensus::transaction::Gas"],["
source§

impl TryFrom<&Quantity> for u64

§

type Error = IntErrorKind

The type returned in the event of a conversion error.
source§

fn try_from(value: &Quantity) -> Result<u64, Self::Error>

Performs the conversion.
","TryFrom<&Quantity>","oasis_core_runtime::consensus::beacon::EpochTime","oasis_core_runtime::consensus::transaction::Gas"],["
source§

impl TryFrom<Quantity> for u64

§

type Error = IntErrorKind

The type returned in the event of a conversion error.
source§

fn try_from(value: Quantity) -> Result<u64, Self::Error>

Performs the conversion.
","TryFrom","oasis_core_runtime::consensus::beacon::EpochTime","oasis_core_runtime::consensus::transaction::Gas"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file